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