]> Pileus Git - ~andy/gtk/blob - gtk/gtkclist.h
Remove all references to offscreen flag which was no longer used.
[~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_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   /* dragging the selection */
230   gint anchor;
231   GtkStateType anchor_state;
232   gint drag_pos;
233   gint htimer;
234   gint vtimer;
235   
236   GtkSortType sort_type;
237   GtkCListCompareFunc compare;
238   gint sort_column;
239 };
240
241 struct _GtkCListClass
242 {
243   GtkContainerClass parent_class;
244   
245   void  (*set_scroll_adjustments) (GtkCList       *clist,
246                                    GtkAdjustment  *hadjustment,
247                                    GtkAdjustment  *vadjustment);
248   void   (*refresh)             (GtkCList       *clist);
249   void   (*select_row)          (GtkCList       *clist,
250                                  gint            row,
251                                  gint            column,
252                                  GdkEvent       *event);
253   void   (*unselect_row)        (GtkCList       *clist,
254                                  gint            row,
255                                  gint            column,
256                                  GdkEvent       *event);
257   void   (*row_move)            (GtkCList       *clist,
258                                  gint            source_row,
259                                  gint            dest_row);
260   void   (*click_column)        (GtkCList       *clist,
261                                  gint            column);
262   void   (*resize_column)       (GtkCList       *clist,
263                                  gint            column,
264                                  gint            width);
265   void   (*toggle_focus_row)    (GtkCList       *clist);
266   void   (*select_all)          (GtkCList       *clist);
267   void   (*unselect_all)        (GtkCList       *clist);
268   void   (*undo_selection)      (GtkCList       *clist);
269   void   (*start_selection)     (GtkCList       *clist);
270   void   (*end_selection)       (GtkCList       *clist);
271   void   (*extend_selection)    (GtkCList       *clist,
272                                  GtkScrollType   scroll_type,
273                                  gfloat          position,
274                                  gboolean        auto_start_selection);
275   void   (*scroll_horizontal)   (GtkCList       *clist,
276                                  GtkScrollType   scroll_type,
277                                  gfloat          position);
278   void   (*scroll_vertical)     (GtkCList       *clist,
279                                  GtkScrollType   scroll_type,
280                                  gfloat          position);
281   void   (*toggle_add_mode)     (GtkCList       *clist);
282   void   (*abort_column_resize) (GtkCList       *clist);
283   void   (*resync_selection)    (GtkCList       *clist,
284                                  GdkEvent       *event);
285   GList* (*selection_find)      (GtkCList       *clist,
286                                  gint            row_number,
287                                  GList          *row_list_element);
288   void   (*draw_row)            (GtkCList       *clist,
289                                  GdkRectangle   *area,
290                                  gint            row,
291                                  GtkCListRow    *clist_row);
292   void   (*draw_drag_highlight) (GtkCList        *clist,
293                                  GtkCListRow     *target_row,
294                                  gint             target_row_number,
295                                  GtkCListDragPos  drag_pos);
296   void   (*clear)               (GtkCList       *clist);
297   void   (*fake_unselect_all)   (GtkCList       *clist,
298                                  gint            row);
299   void   (*sort_list)           (GtkCList       *clist);
300   gint   (*insert_row)          (GtkCList       *clist,
301                                  gint            row,
302                                  gchar          *text[]);
303   void   (*remove_row)          (GtkCList       *clist,
304                                  gint            row);
305   void   (*set_cell_contents)   (GtkCList       *clist,
306                                  GtkCListRow    *clist_row,
307                                  gint            column,
308                                  GtkCellType     type,
309                                  const gchar    *text,
310                                  guint8          spacing,
311                                  GdkPixmap      *pixmap,
312                                  GdkBitmap      *mask);
313   void   (*cell_size_request)   (GtkCList       *clist,
314                                  GtkCListRow    *clist_row,
315                                  gint            column,
316                                  GtkRequisition *requisition);
317
318 };
319
320 struct _GtkCListColumn
321 {
322   gchar *title;
323   GdkRectangle area;
324   
325   GtkWidget *button;
326   GdkWindow *window;
327   
328   gint width;
329   gint min_width;
330   gint max_width;
331   GtkJustification justification;
332   
333   guint visible        : 1;  
334   guint width_set      : 1;
335   guint resizeable     : 1;
336   guint auto_resize    : 1;
337   guint button_passive : 1;
338 };
339
340 struct _GtkCListRow
341 {
342   GtkCell *cell;
343   GtkStateType state;
344   
345   GdkColor foreground;
346   GdkColor background;
347   
348   GtkStyle *style;
349
350   gpointer data;
351   GtkDestroyNotify destroy;
352   
353   guint fg_set     : 1;
354   guint bg_set     : 1;
355   guint selectable : 1;
356 };
357
358 /* Cell Structures */
359 struct _GtkCellText
360 {
361   GtkCellType type;
362   
363   gint16 vertical;
364   gint16 horizontal;
365   
366   GtkStyle *style;
367
368   gchar *text;
369 };
370
371 struct _GtkCellPixmap
372 {
373   GtkCellType type;
374   
375   gint16 vertical;
376   gint16 horizontal;
377   
378   GtkStyle *style;
379
380   GdkPixmap *pixmap;
381   GdkBitmap *mask;
382 };
383
384 struct _GtkCellPixText
385 {
386   GtkCellType type;
387   
388   gint16 vertical;
389   gint16 horizontal;
390   
391   GtkStyle *style;
392
393   gchar *text;
394   guint8 spacing;
395   GdkPixmap *pixmap;
396   GdkBitmap *mask;
397 };
398
399 struct _GtkCellWidget
400 {
401   GtkCellType type;
402   
403   gint16 vertical;
404   gint16 horizontal;
405   
406   GtkStyle *style;
407
408   GtkWidget *widget;
409 };
410
411 struct _GtkCell
412 {
413   GtkCellType type;
414   
415   gint16 vertical;
416   gint16 horizontal;
417   
418   GtkStyle *style;
419
420   union {
421     gchar *text;
422     
423     struct {
424       GdkPixmap *pixmap;
425       GdkBitmap *mask;
426     } pm;
427     
428     struct {
429       gchar *text;
430       guint8 spacing;
431       GdkPixmap *pixmap;
432       GdkBitmap *mask;
433     } pt;
434     
435     GtkWidget *widget;
436   } u;
437 };
438
439 GtkType gtk_clist_get_type (void);
440
441 /* constructors useful for gtk-- wrappers */
442 void gtk_clist_construct (GtkCList *clist,
443                           gint      columns,
444                           gchar    *titles[]);
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                                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                                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 #ifdef __cplusplus
788 }
789 #endif                          /* __cplusplus */
790
791 #endif                          /* __GTK_CLIST_H__ */