]> Pileus Git - ~andy/gtk/blob - gtk/gtkclist.h
321fea5dc9ef119bab0c35af7393cd978c2b49ee
[~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 Library 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  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library 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-1999.  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_CLIST_H__
29 #define __GTK_CLIST_H__
30
31 #include <gdk/gdk.h>
32 #include <gtk/gtksignal.h>
33 #include <gtk/gtkalignment.h>
34 #include <gtk/gtklabel.h>
35 #include <gtk/gtkbutton.h>
36 #include <gtk/gtkhscrollbar.h>
37 #include <gtk/gtkvscrollbar.h>
38 #include <gtk/gtkenums.h>
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43
44 /* clist flags */
45 enum {
46   GTK_CLIST_IN_DRAG             = 1 <<  0,
47   GTK_CLIST_ROW_HEIGHT_SET      = 1 <<  1,
48   GTK_CLIST_SHOW_TITLES         = 1 <<  2,
49   GTK_CLIST_CHILD_HAS_FOCUS     = 1 <<  3,
50   GTK_CLIST_ADD_MODE            = 1 <<  4,
51   GTK_CLIST_AUTO_SORT           = 1 <<  5,
52   GTK_CLIST_AUTO_RESIZE_BLOCKED = 1 <<  6,
53   GTK_CLIST_REORDERABLE         = 1 <<  7,
54   GTK_CLIST_USE_DRAG_ICONS      = 1 <<  8,
55   GTK_CLIST_DRAW_DRAG_LINE      = 1 <<  9,
56   GTK_CLIST_DRAW_DRAG_RECT      = 1 << 10
57 }; 
58
59 /* cell types */
60 typedef enum
61 {
62   GTK_CELL_EMPTY,
63   GTK_CELL_TEXT,
64   GTK_CELL_PIXMAP,
65   GTK_CELL_PIXTEXT,
66   GTK_CELL_WIDGET
67 } GtkCellType;
68
69 typedef enum
70 {
71   GTK_CLIST_DRAG_NONE,
72   GTK_CLIST_DRAG_BEFORE,
73   GTK_CLIST_DRAG_INTO,
74   GTK_CLIST_DRAG_AFTER
75 } GtkCListDragPos;
76
77 typedef enum
78 {
79   GTK_BUTTON_IGNORED = 0,
80   GTK_BUTTON_SELECTS = 1 << 0,
81   GTK_BUTTON_DRAGS   = 1 << 1,
82   GTK_BUTTON_EXPANDS = 1 << 2
83 } GtkButtonAction;
84
85 #define GTK_TYPE_CLIST            (gtk_clist_get_type ())
86 #define GTK_CLIST(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_CLIST, GtkCList))
87 #define GTK_CLIST_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CLIST, GtkCListClass))
88 #define GTK_IS_CLIST(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_CLIST))
89 #define GTK_IS_CLIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CLIST))
90 #define GTK_CLIST_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CLIST, GtkCListClass))
91
92
93 #define GTK_CLIST_FLAGS(clist)             (GTK_CLIST (clist)->flags)
94 #define GTK_CLIST_SET_FLAG(clist,flag)     (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag))
95 #define GTK_CLIST_UNSET_FLAG(clist,flag)   (GTK_CLIST_FLAGS (clist) &= ~(GTK_ ## flag))
96
97 #define GTK_CLIST_IN_DRAG(clist)           (GTK_CLIST_FLAGS (clist) & GTK_CLIST_IN_DRAG)
98 #define GTK_CLIST_ROW_HEIGHT_SET(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ROW_HEIGHT_SET)
99 #define GTK_CLIST_SHOW_TITLES(clist)       (GTK_CLIST_FLAGS (clist) & GTK_CLIST_SHOW_TITLES)
100 #define GTK_CLIST_CHILD_HAS_FOCUS(clist)   (GTK_CLIST_FLAGS (clist) & GTK_CLIST_CHILD_HAS_FOCUS)
101 #define GTK_CLIST_ADD_MODE(clist)          (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ADD_MODE)
102 #define GTK_CLIST_AUTO_SORT(clist)         (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_SORT)
103 #define GTK_CLIST_AUTO_RESIZE_BLOCKED(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_RESIZE_BLOCKED)
104 #define GTK_CLIST_REORDERABLE(clist)       (GTK_CLIST_FLAGS (clist) & GTK_CLIST_REORDERABLE)
105 #define GTK_CLIST_USE_DRAG_ICONS(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_USE_DRAG_ICONS)
106 #define GTK_CLIST_DRAW_DRAG_LINE(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_LINE)
107 #define GTK_CLIST_DRAW_DRAG_RECT(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_RECT)
108
109 #define GTK_CLIST_ROW(_glist_) ((GtkCListRow *)((_glist_)->data))
110
111 /* pointer casting for cells */
112 #define GTK_CELL_TEXT(cell)     (((GtkCellText *) &(cell)))
113 #define GTK_CELL_PIXMAP(cell)   (((GtkCellPixmap *) &(cell)))
114 #define GTK_CELL_PIXTEXT(cell)  (((GtkCellPixText *) &(cell)))
115 #define GTK_CELL_WIDGET(cell)   (((GtkCellWidget *) &(cell)))
116
117 typedef struct _GtkCList GtkCList;
118 typedef struct _GtkCListClass GtkCListClass;
119 typedef struct _GtkCListColumn GtkCListColumn;
120 typedef struct _GtkCListRow GtkCListRow;
121
122 typedef struct _GtkCell GtkCell;
123 typedef struct _GtkCellText GtkCellText;
124 typedef struct _GtkCellPixmap GtkCellPixmap;
125 typedef struct _GtkCellPixText GtkCellPixText;
126 typedef struct _GtkCellWidget GtkCellWidget;
127
128 typedef gint (*GtkCListCompareFunc) (GtkCList     *clist,
129                                      gconstpointer ptr1,
130                                      gconstpointer ptr2);
131
132 typedef struct _GtkCListCellInfo GtkCListCellInfo;
133 typedef struct _GtkCListDestInfo GtkCListDestInfo;
134
135 struct _GtkCListCellInfo
136 {
137   gint row;
138   gint column;
139 };
140
141 struct _GtkCListDestInfo
142 {
143   GtkCListCellInfo cell;
144   GtkCListDragPos  insert_pos;
145 };
146
147 struct _GtkCList
148 {
149   GtkContainer container;
150   
151   guint16 flags;
152   
153   /* mem chunks */
154   GMemChunk *row_mem_chunk;
155   GMemChunk *cell_mem_chunk;
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_center_offset;
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   /* dragging the selection */
231   gint anchor;
232   GtkStateType anchor_state;
233   gint drag_pos;
234   gint htimer;
235   gint vtimer;
236   
237   GtkSortType sort_type;
238   GtkCListCompareFunc compare;
239   gint sort_column;
240 };
241
242 struct _GtkCListClass
243 {
244   GtkContainerClass parent_class;
245   
246   void  (*set_scroll_adjustments) (GtkCList       *clist,
247                                    GtkAdjustment  *hadjustment,
248                                    GtkAdjustment  *vadjustment);
249   void   (*refresh)             (GtkCList       *clist);
250   void   (*select_row)          (GtkCList       *clist,
251                                  gint            row,
252                                  gint            column,
253                                  GdkEvent       *event);
254   void   (*unselect_row)        (GtkCList       *clist,
255                                  gint            row,
256                                  gint            column,
257                                  GdkEvent       *event);
258   void   (*row_move)            (GtkCList       *clist,
259                                  gint            source_row,
260                                  gint            dest_row);
261   void   (*click_column)        (GtkCList       *clist,
262                                  gint            column);
263   void   (*resize_column)       (GtkCList       *clist,
264                                  gint            column,
265                                  gint            width);
266   void   (*toggle_focus_row)    (GtkCList       *clist);
267   void   (*select_all)          (GtkCList       *clist);
268   void   (*unselect_all)        (GtkCList       *clist);
269   void   (*undo_selection)      (GtkCList       *clist);
270   void   (*start_selection)     (GtkCList       *clist);
271   void   (*end_selection)       (GtkCList       *clist);
272   void   (*extend_selection)    (GtkCList       *clist,
273                                  GtkScrollType   scroll_type,
274                                  gfloat          position,
275                                  gboolean        auto_start_selection);
276   void   (*scroll_horizontal)   (GtkCList       *clist,
277                                  GtkScrollType   scroll_type,
278                                  gfloat          position);
279   void   (*scroll_vertical)     (GtkCList       *clist,
280                                  GtkScrollType   scroll_type,
281                                  gfloat          position);
282   void   (*toggle_add_mode)     (GtkCList       *clist);
283   void   (*abort_column_resize) (GtkCList       *clist);
284   void   (*resync_selection)    (GtkCList       *clist,
285                                  GdkEvent       *event);
286   GList* (*selection_find)      (GtkCList       *clist,
287                                  gint            row_number,
288                                  GList          *row_list_element);
289   void   (*draw_row)            (GtkCList       *clist,
290                                  GdkRectangle   *area,
291                                  gint            row,
292                                  GtkCListRow    *clist_row);
293   void   (*draw_drag_highlight) (GtkCList        *clist,
294                                  GtkCListRow     *target_row,
295                                  gint             target_row_number,
296                                  GtkCListDragPos  drag_pos);
297   void   (*clear)               (GtkCList       *clist);
298   void   (*fake_unselect_all)   (GtkCList       *clist,
299                                  gint            row);
300   void   (*sort_list)           (GtkCList       *clist);
301   gint   (*insert_row)          (GtkCList       *clist,
302                                  gint            row,
303                                  gchar          *text[]);
304   void   (*remove_row)          (GtkCList       *clist,
305                                  gint            row);
306   void   (*set_cell_contents)   (GtkCList       *clist,
307                                  GtkCListRow    *clist_row,
308                                  gint            column,
309                                  GtkCellType     type,
310                                  const gchar    *text,
311                                  guint8          spacing,
312                                  GdkPixmap      *pixmap,
313                                  GdkBitmap      *mask);
314   void   (*cell_size_request)   (GtkCList       *clist,
315                                  GtkCListRow    *clist_row,
316                                  gint            column,
317                                  GtkRequisition *requisition);
318
319 };
320
321 struct _GtkCListColumn
322 {
323   gchar *title;
324   GdkRectangle area;
325   
326   GtkWidget *button;
327   GdkWindow *window;
328   
329   gint width;
330   gint min_width;
331   gint max_width;
332   GtkJustification justification;
333   
334   guint visible        : 1;  
335   guint width_set      : 1;
336   guint resizeable     : 1;
337   guint auto_resize    : 1;
338   guint button_passive : 1;
339 };
340
341 struct _GtkCListRow
342 {
343   GtkCell *cell;
344   GtkStateType state;
345   
346   GdkColor foreground;
347   GdkColor background;
348   
349   GtkStyle *style;
350
351   gpointer data;
352   GtkDestroyNotify destroy;
353   
354   guint fg_set     : 1;
355   guint bg_set     : 1;
356   guint selectable : 1;
357 };
358
359 /* Cell Structures */
360 struct _GtkCellText
361 {
362   GtkCellType type;
363   
364   gint16 vertical;
365   gint16 horizontal;
366   
367   GtkStyle *style;
368
369   gchar *text;
370 };
371
372 struct _GtkCellPixmap
373 {
374   GtkCellType type;
375   
376   gint16 vertical;
377   gint16 horizontal;
378   
379   GtkStyle *style;
380
381   GdkPixmap *pixmap;
382   GdkBitmap *mask;
383 };
384
385 struct _GtkCellPixText
386 {
387   GtkCellType type;
388   
389   gint16 vertical;
390   gint16 horizontal;
391   
392   GtkStyle *style;
393
394   gchar *text;
395   guint8 spacing;
396   GdkPixmap *pixmap;
397   GdkBitmap *mask;
398 };
399
400 struct _GtkCellWidget
401 {
402   GtkCellType type;
403   
404   gint16 vertical;
405   gint16 horizontal;
406   
407   GtkStyle *style;
408
409   GtkWidget *widget;
410 };
411
412 struct _GtkCell
413 {
414   GtkCellType type;
415   
416   gint16 vertical;
417   gint16 horizontal;
418   
419   GtkStyle *style;
420
421   union {
422     gchar *text;
423     
424     struct {
425       GdkPixmap *pixmap;
426       GdkBitmap *mask;
427     } pm;
428     
429     struct {
430       gchar *text;
431       guint8 spacing;
432       GdkPixmap *pixmap;
433       GdkBitmap *mask;
434     } pt;
435     
436     GtkWidget *widget;
437   } u;
438 };
439
440 GtkType gtk_clist_get_type (void);
441
442 /* constructors useful for gtk-- wrappers */
443 void gtk_clist_construct (GtkCList *clist,
444                           gint      columns,
445                           gchar    *titles[]);
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
783 #ifdef __cplusplus
784 }
785 #endif                          /* __cplusplus */
786
787 #endif                          /* __GTK_CLIST_H__ */