]> Pileus Git - ~andy/gtk/blob - gtk/gtkclist.h
5375ea1c2eb2c78e620b32d2e6a1bc445f58515d
[~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
43 G_BEGIN_DECLS
44
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   gpointer reserved1;
155   gpointer reserved2;
156
157   guint freeze_count;
158   
159   /* allocation rectangle after the conatiner_border_width
160    * and the width of the shadow border */
161   GdkRectangle internal_allocation;
162   
163   /* rows */
164   gint rows;
165   gint row_height;
166   GList *row_list;
167   GList *row_list_end;
168   
169   /* columns */
170   gint columns;
171   GdkRectangle column_title_area;
172   GdkWindow *title_window;
173   
174   /* dynamicly allocated array of column structures */
175   GtkCListColumn *column;
176   
177   /* the scrolling window and its height and width to
178    * make things a little speedier */
179   GdkWindow *clist_window;
180   gint clist_window_width;
181   gint clist_window_height;
182   
183   /* offsets for scrolling */
184   gint hoffset;
185   gint voffset;
186   
187   /* border shadow style */
188   GtkShadowType shadow_type;
189   
190   /* the list's selection mode (gtkenums.h) */
191   GtkSelectionMode selection_mode;
192   
193   /* list of selected rows */
194   GList *selection;
195   GList *selection_end;
196   
197   GList *undo_selection;
198   GList *undo_unselection;
199   gint undo_anchor;
200   
201   /* mouse buttons */
202   guint8 button_actions[5];
203
204   guint8 drag_button;
205
206   /* dnd */
207   GtkCListCellInfo click_cell;
208
209   /* scroll adjustments */
210   GtkAdjustment *hadjustment;
211   GtkAdjustment *vadjustment;
212   
213   /* xor GC for the vertical drag line */
214   GdkGC *xor_gc;
215   
216   /* gc for drawing unselected cells */
217   GdkGC *fg_gc;
218   GdkGC *bg_gc;
219   
220   /* cursor used to indicate dragging */
221   GdkCursor *cursor_drag;
222   
223   /* the current x-pixel location of the xor-drag line */
224   gint x_drag;
225   
226   /* focus handling */
227   gint focus_row;
228
229   gint focus_header_column;
230   
231   /* dragging the selection */
232   gint anchor;
233   GtkStateType anchor_state;
234   gint drag_pos;
235   gint htimer;
236   gint vtimer;
237   
238   GtkSortType sort_type;
239   GtkCListCompareFunc compare;
240   gint sort_column;
241
242   gint drag_highlight_row;
243   GtkCListDragPos drag_highlight_pos;
244 };
245
246 struct _GtkCListClass
247 {
248   GtkContainerClass parent_class;
249   
250   void  (*set_scroll_adjustments) (GtkCList       *clist,
251                                    GtkAdjustment  *hadjustment,
252                                    GtkAdjustment  *vadjustment);
253   void   (*refresh)             (GtkCList       *clist);
254   void   (*select_row)          (GtkCList       *clist,
255                                  gint            row,
256                                  gint            column,
257                                  GdkEvent       *event);
258   void   (*unselect_row)        (GtkCList       *clist,
259                                  gint            row,
260                                  gint            column,
261                                  GdkEvent       *event);
262   void   (*row_move)            (GtkCList       *clist,
263                                  gint            source_row,
264                                  gint            dest_row);
265   void   (*click_column)        (GtkCList       *clist,
266                                  gint            column);
267   void   (*resize_column)       (GtkCList       *clist,
268                                  gint            column,
269                                  gint            width);
270   void   (*toggle_focus_row)    (GtkCList       *clist);
271   void   (*select_all)          (GtkCList       *clist);
272   void   (*unselect_all)        (GtkCList       *clist);
273   void   (*undo_selection)      (GtkCList       *clist);
274   void   (*start_selection)     (GtkCList       *clist);
275   void   (*end_selection)       (GtkCList       *clist);
276   void   (*extend_selection)    (GtkCList       *clist,
277                                  GtkScrollType   scroll_type,
278                                  gfloat          position,
279                                  gboolean        auto_start_selection);
280   void   (*scroll_horizontal)   (GtkCList       *clist,
281                                  GtkScrollType   scroll_type,
282                                  gfloat          position);
283   void   (*scroll_vertical)     (GtkCList       *clist,
284                                  GtkScrollType   scroll_type,
285                                  gfloat          position);
286   void   (*toggle_add_mode)     (GtkCList       *clist);
287   void   (*abort_column_resize) (GtkCList       *clist);
288   void   (*resync_selection)    (GtkCList       *clist,
289                                  GdkEvent       *event);
290   GList* (*selection_find)      (GtkCList       *clist,
291                                  gint            row_number,
292                                  GList          *row_list_element);
293   void   (*draw_row)            (GtkCList       *clist,
294                                  GdkRectangle   *area,
295                                  gint            row,
296                                  GtkCListRow    *clist_row);
297   void   (*draw_drag_highlight) (GtkCList        *clist,
298                                  GtkCListRow     *target_row,
299                                  gint             target_row_number,
300                                  GtkCListDragPos  drag_pos);
301   void   (*clear)               (GtkCList       *clist);
302   void   (*fake_unselect_all)   (GtkCList       *clist,
303                                  gint            row);
304   void   (*sort_list)           (GtkCList       *clist);
305   gint   (*insert_row)          (GtkCList       *clist,
306                                  gint            row,
307                                  gchar          *text[]);
308   void   (*remove_row)          (GtkCList       *clist,
309                                  gint            row);
310   void   (*set_cell_contents)   (GtkCList       *clist,
311                                  GtkCListRow    *clist_row,
312                                  gint            column,
313                                  GtkCellType     type,
314                                  const gchar    *text,
315                                  guint8          spacing,
316                                  GdkPixmap      *pixmap,
317                                  GdkBitmap      *mask);
318   void   (*cell_size_request)   (GtkCList       *clist,
319                                  GtkCListRow    *clist_row,
320                                  gint            column,
321                                  GtkRequisition *requisition);
322
323 };
324
325 struct _GtkCListColumn
326 {
327   gchar *title;
328   GdkRectangle area;
329   
330   GtkWidget *button;
331   GdkWindow *window;
332   
333   gint width;
334   gint min_width;
335   gint max_width;
336   GtkJustification justification;
337   
338   guint visible        : 1;  
339   guint width_set      : 1;
340   guint resizeable     : 1;
341   guint auto_resize    : 1;
342   guint button_passive : 1;
343 };
344
345 struct _GtkCListRow
346 {
347   GtkCell *cell;
348   GtkStateType state;
349   
350   GdkColor foreground;
351   GdkColor background;
352   
353   GtkStyle *style;
354
355   gpointer data;
356   GtkDestroyNotify destroy;
357   
358   guint fg_set     : 1;
359   guint bg_set     : 1;
360   guint selectable : 1;
361 };
362
363 /* Cell Structures */
364 struct _GtkCellText
365 {
366   GtkCellType type;
367   
368   gint16 vertical;
369   gint16 horizontal;
370   
371   GtkStyle *style;
372
373   gchar *text;
374 };
375
376 struct _GtkCellPixmap
377 {
378   GtkCellType type;
379   
380   gint16 vertical;
381   gint16 horizontal;
382   
383   GtkStyle *style;
384
385   GdkPixmap *pixmap;
386   GdkBitmap *mask;
387 };
388
389 struct _GtkCellPixText
390 {
391   GtkCellType type;
392   
393   gint16 vertical;
394   gint16 horizontal;
395   
396   GtkStyle *style;
397
398   gchar *text;
399   guint8 spacing;
400   GdkPixmap *pixmap;
401   GdkBitmap *mask;
402 };
403
404 struct _GtkCellWidget
405 {
406   GtkCellType type;
407   
408   gint16 vertical;
409   gint16 horizontal;
410   
411   GtkStyle *style;
412
413   GtkWidget *widget;
414 };
415
416 struct _GtkCell
417 {
418   GtkCellType type;
419   
420   gint16 vertical;
421   gint16 horizontal;
422   
423   GtkStyle *style;
424
425   union {
426     gchar *text;
427     
428     struct {
429       GdkPixmap *pixmap;
430       GdkBitmap *mask;
431     } pm;
432     
433     struct {
434       gchar *text;
435       guint8 spacing;
436       GdkPixmap *pixmap;
437       GdkBitmap *mask;
438     } pt;
439     
440     GtkWidget *widget;
441   } u;
442 };
443
444 GtkType gtk_clist_get_type (void) G_GNUC_CONST;
445
446 /* create a new GtkCList */
447 GtkWidget* gtk_clist_new             (gint   columns);
448 GtkWidget* gtk_clist_new_with_titles (gint   columns,
449                                       gchar *titles[]);
450
451 /* set adjustments of clist */
452 void gtk_clist_set_hadjustment (GtkCList      *clist,
453                                 GtkAdjustment *adjustment);
454 void gtk_clist_set_vadjustment (GtkCList      *clist,
455                                 GtkAdjustment *adjustment);
456
457 /* get adjustments of clist */
458 GtkAdjustment* gtk_clist_get_hadjustment (GtkCList *clist);
459 GtkAdjustment* gtk_clist_get_vadjustment (GtkCList *clist);
460
461 /* set the border style of the clist */
462 void gtk_clist_set_shadow_type (GtkCList      *clist,
463                                 GtkShadowType  type);
464
465 /* set the clist's selection mode */
466 void gtk_clist_set_selection_mode (GtkCList         *clist,
467                                    GtkSelectionMode  mode);
468
469 /* enable clists reorder ability */
470 void gtk_clist_set_reorderable (GtkCList *clist,
471                                 gboolean  reorderable);
472 void gtk_clist_set_use_drag_icons (GtkCList *clist,
473                                    gboolean  use_icons);
474 void gtk_clist_set_button_actions (GtkCList *clist,
475                                    guint     button,
476                                    guint8    button_actions);
477
478 /* freeze all visual updates of the list, and then thaw the list after
479  * you have made a number of changes and the updates wil occure in a
480  * more efficent mannor than if you made them on a unfrozen list
481  */
482 void gtk_clist_freeze (GtkCList *clist);
483 void gtk_clist_thaw   (GtkCList *clist);
484
485 /* show and hide the column title buttons */
486 void gtk_clist_column_titles_show (GtkCList *clist);
487 void gtk_clist_column_titles_hide (GtkCList *clist);
488
489 /* set the column title to be a active title (responds to button presses, 
490  * prelights, and grabs keyboard focus), or passive where it acts as just
491  * a title
492  */
493 void gtk_clist_column_title_active   (GtkCList *clist,
494                                       gint      column);
495 void gtk_clist_column_title_passive  (GtkCList *clist,
496                                       gint      column);
497 void gtk_clist_column_titles_active  (GtkCList *clist);
498 void gtk_clist_column_titles_passive (GtkCList *clist);
499
500 /* set the title in the column title button */
501 void gtk_clist_set_column_title (GtkCList    *clist,
502                                  gint         column,
503                                  const gchar *title);
504
505 /* returns the title of column. Returns NULL if title is not set */
506 gchar * gtk_clist_get_column_title (GtkCList *clist,
507                                     gint      column);
508
509 /* set a widget instead of a title for the column title button */
510 void gtk_clist_set_column_widget (GtkCList  *clist,
511                                   gint       column,
512                                   GtkWidget *widget);
513
514 /* returns the column widget */
515 GtkWidget * gtk_clist_get_column_widget (GtkCList *clist,
516                                          gint      column);
517
518 /* set the justification on a column */
519 void gtk_clist_set_column_justification (GtkCList         *clist,
520                                          gint              column,
521                                          GtkJustification  justification);
522
523 /* set visibility of a column */
524 void gtk_clist_set_column_visibility (GtkCList *clist,
525                                       gint      column,
526                                       gboolean  visible);
527
528 /* enable/disable column resize operations by mouse */
529 void gtk_clist_set_column_resizeable (GtkCList *clist,
530                                       gint      column,
531                                       gboolean  resizeable);
532
533 /* resize column automatically to its optimal width */
534 void gtk_clist_set_column_auto_resize (GtkCList *clist,
535                                        gint      column,
536                                        gboolean  auto_resize);
537
538 gint gtk_clist_columns_autosize (GtkCList *clist);
539
540 /* return the optimal column width, i.e. maximum of all cell widths */
541 gint gtk_clist_optimal_column_width (GtkCList *clist,
542                                      gint      column);
543
544 /* set the pixel width of a column; this is a necessary step in
545  * creating a CList because otherwise the column width is chozen from
546  * the width of the column title, which will never be right
547  */
548 void gtk_clist_set_column_width (GtkCList *clist,
549                                  gint      column,
550                                  gint      width);
551
552 /* set column minimum/maximum width. min/max_width < 0 => no restriction */
553 void gtk_clist_set_column_min_width (GtkCList *clist,
554                                      gint      column,
555                                      gint      min_width);
556 void gtk_clist_set_column_max_width (GtkCList *clist,
557                                      gint      column,
558                                      gint      max_width);
559
560 /* change the height of the rows, the default (height=0) is
561  * the hight of the current font.
562  */
563 void gtk_clist_set_row_height (GtkCList *clist,
564                                guint     height);
565
566 /* scroll the viewing area of the list to the given column and row;
567  * row_align and col_align are between 0-1 representing the location the
568  * row should appear on the screnn, 0.0 being top or left, 1.0 being
569  * bottom or right; if row or column is -1 then then there is no change
570  */
571 void gtk_clist_moveto (GtkCList *clist,
572                        gint      row,
573                        gint      column,
574                        gfloat    row_align,
575                        gfloat    col_align);
576
577 /* returns whether the row is visible */
578 GtkVisibility gtk_clist_row_is_visible (GtkCList *clist,
579                                         gint      row);
580
581 /* returns the cell type */
582 GtkCellType gtk_clist_get_cell_type (GtkCList *clist,
583                                      gint      row,
584                                      gint      column);
585
586 /* sets a given cell's text, replacing its current contents */
587 void gtk_clist_set_text (GtkCList    *clist,
588                          gint         row,
589                          gint         column,
590                          const gchar *text);
591
592 /* for the "get" functions, any of the return pointer can be
593  * NULL if you are not interested
594  */
595 gint gtk_clist_get_text (GtkCList  *clist,
596                          gint       row,
597                          gint       column,
598                          gchar    **text);
599
600 /* sets a given cell's pixmap, replacing its current contents */
601 void gtk_clist_set_pixmap (GtkCList  *clist,
602                            gint       row,
603                            gint       column,
604                            GdkPixmap *pixmap,
605                            GdkBitmap *mask);
606
607 gint gtk_clist_get_pixmap (GtkCList   *clist,
608                            gint        row,
609                            gint        column,
610                            GdkPixmap **pixmap,
611                            GdkBitmap **mask);
612
613 /* sets a given cell's pixmap and text, replacing its current contents */
614 void gtk_clist_set_pixtext (GtkCList    *clist,
615                             gint         row,
616                             gint         column,
617                             const gchar *text,
618                             guint8       spacing,
619                             GdkPixmap   *pixmap,
620                             GdkBitmap   *mask);
621
622 gint gtk_clist_get_pixtext (GtkCList   *clist,
623                             gint        row,
624                             gint        column,
625                             gchar     **text,
626                             guint8     *spacing,
627                             GdkPixmap **pixmap,
628                             GdkBitmap **mask);
629
630 /* sets the foreground color of a row, the color must already
631  * be allocated
632  */
633 void gtk_clist_set_foreground (GtkCList       *clist,
634                                gint            row,
635                                const GdkColor *color);
636
637 /* sets the background color of a row, the color must already
638  * be allocated
639  */
640 void gtk_clist_set_background (GtkCList       *clist,
641                                gint            row,
642                                const GdkColor *color);
643
644 /* set / get cell styles */
645 void gtk_clist_set_cell_style (GtkCList *clist,
646                                gint      row,
647                                gint      column,
648                                GtkStyle *style);
649
650 GtkStyle *gtk_clist_get_cell_style (GtkCList *clist,
651                                     gint      row,
652                                     gint      column);
653
654 void gtk_clist_set_row_style (GtkCList *clist,
655                               gint      row,
656                               GtkStyle *style);
657
658 GtkStyle *gtk_clist_get_row_style (GtkCList *clist,
659                                    gint      row);
660
661 /* this sets a horizontal and vertical shift for drawing
662  * the contents of a cell; it can be positive or negitive;
663  * this is particulary useful for indenting items in a column
664  */
665 void gtk_clist_set_shift (GtkCList *clist,
666                           gint      row,
667                           gint      column,
668                           gint      vertical,
669                           gint      horizontal);
670
671 /* set/get selectable flag of a single row */
672 void gtk_clist_set_selectable (GtkCList *clist,
673                                gint      row,
674                                gboolean  selectable);
675 gboolean gtk_clist_get_selectable (GtkCList *clist,
676                                    gint      row);
677
678 /* prepend/append returns the index of the row you just added,
679  * making it easier to append and modify a row
680  */
681 gint gtk_clist_prepend (GtkCList    *clist,
682                         gchar       *text[]);
683 gint gtk_clist_append  (GtkCList    *clist,
684                         gchar       *text[]);
685
686 /* inserts a row at index row and returns the row where it was
687  * actually inserted (may be different from "row" in auto_sort mode)
688  */
689 gint gtk_clist_insert (GtkCList    *clist,
690                        gint         row,
691                        gchar       *text[]);
692
693 /* removes row at index row */
694 void gtk_clist_remove (GtkCList *clist,
695                        gint      row);
696
697 /* sets a arbitrary data pointer for a given row */
698 void gtk_clist_set_row_data (GtkCList *clist,
699                              gint      row,
700                              gpointer  data);
701
702 /* sets a data pointer for a given row with destroy notification */
703 void gtk_clist_set_row_data_full (GtkCList         *clist,
704                                   gint              row,
705                                   gpointer          data,
706                                   GtkDestroyNotify  destroy);
707
708 /* returns the data set for a row */
709 gpointer gtk_clist_get_row_data (GtkCList *clist,
710                                  gint      row);
711
712 /* givin a data pointer, find the first (and hopefully only!)
713  * row that points to that data, or -1 if none do
714  */
715 gint gtk_clist_find_row_from_data (GtkCList *clist,
716                                    gpointer  data);
717
718 /* force selection of a row */
719 void gtk_clist_select_row (GtkCList *clist,
720                            gint      row,
721                            gint      column);
722
723 /* force unselection of a row */
724 void gtk_clist_unselect_row (GtkCList *clist,
725                              gint      row,
726                              gint      column);
727
728 /* undo the last select/unselect operation */
729 void gtk_clist_undo_selection (GtkCList *clist);
730
731 /* clear the entire list -- this is much faster than removing
732  * each item with gtk_clist_remove
733  */
734 void gtk_clist_clear (GtkCList *clist);
735
736 /* return the row column corresponding to the x and y coordinates,
737  * the returned values are only valid if the x and y coordinates
738  * are respectively to a window == clist->clist_window
739  */
740 gint gtk_clist_get_selection_info (GtkCList *clist,
741                                    gint      x,
742                                    gint      y,
743                                    gint     *row,
744                                    gint     *column);
745
746 /* in multiple or extended mode, select all rows */
747 void gtk_clist_select_all (GtkCList *clist);
748
749 /* in all modes except browse mode, deselect all rows */
750 void gtk_clist_unselect_all (GtkCList *clist);
751
752 /* swap the position of two rows */
753 void gtk_clist_swap_rows (GtkCList *clist,
754                           gint      row1,
755                           gint      row2);
756
757 /* move row from source_row position to dest_row position */
758 void gtk_clist_row_move (GtkCList *clist,
759                          gint      source_row,
760                          gint      dest_row);
761
762 /* sets a compare function different to the default */
763 void gtk_clist_set_compare_func (GtkCList            *clist,
764                                  GtkCListCompareFunc  cmp_func);
765
766 /* the column to sort by */
767 void gtk_clist_set_sort_column (GtkCList *clist,
768                                 gint      column);
769
770 /* how to sort : ascending or descending */
771 void gtk_clist_set_sort_type (GtkCList    *clist,
772                               GtkSortType  sort_type);
773
774 /* sort the list with the current compare function */
775 void gtk_clist_sort (GtkCList *clist);
776
777 /* Automatically sort upon insertion */
778 void gtk_clist_set_auto_sort (GtkCList *clist,
779                               gboolean  auto_sort);
780
781 /* Private function for clist, ctree */
782
783 PangoLayout *_gtk_clist_create_cell_layout (GtkCList       *clist,
784                                             GtkCListRow    *clist_row,
785                                             gint            column);
786
787
788 G_END_DECLS
789
790
791 #endif                          /* __GTK_CLIST_H__ */
792
793 #endif /* GTK_DISABLE_DEPRECATED */