Improve some sieve-related translations
[claws.git] / src / gtk / gtkcmclist.h
blob07a3a47b32b22465a0a2b72109a6bfde59123144
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>
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.
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.
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.
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/.
28 #ifndef __GTK_CMCLIST_H__
29 #define __GTK_CMCLIST_H__
31 #include <gdk/gdk.h>
32 #include <gtk/gtk.h>
35 G_BEGIN_DECLS
38 /* Generic visibility flags */
39 typedef enum
41 GTK_VISIBILITY_NONE,
42 GTK_VISIBILITY_PARTIAL,
43 GTK_VISIBILITY_FULL
44 } GtkVisibility;
46 /* clist flags */
47 enum {
48 GTK_CMCLIST_IN_DRAG = 1 << 0,
49 GTK_CMCLIST_ROW_HEIGHT_SET = 1 << 1,
50 GTK_CMCLIST_SHOW_TITLES = 1 << 2,
51 /* Unused */
52 GTK_CMCLIST_ADD_MODE = 1 << 4,
53 GTK_CMCLIST_AUTO_SORT = 1 << 5,
54 GTK_CMCLIST_AUTO_RESIZE_BLOCKED = 1 << 6,
55 GTK_CMCLIST_REORDERABLE = 1 << 7,
56 GTK_CMCLIST_USE_DRAG_ICONS = 1 << 8,
57 GTK_CMCLIST_DRAW_DRAG_LINE = 1 << 9,
58 GTK_CMCLIST_DRAW_DRAG_RECT = 1 << 10
59 };
61 /* cell types */
62 typedef enum
64 GTK_CMCELL_EMPTY,
65 GTK_CMCELL_TEXT,
66 GTK_CMCELL_PIXBUF,
67 GTK_CMCELL_PIXTEXT,
68 GTK_CMCELL_WIDGET
69 } GtkCMCellType;
71 typedef enum
73 GTK_CMCLIST_DRAG_NONE,
74 GTK_CMCLIST_DRAG_BEFORE,
75 GTK_CMCLIST_DRAG_INTO,
76 GTK_CMCLIST_DRAG_AFTER
77 } GtkCMCListDragPos;
79 typedef enum
81 GTK_CMBUTTON_IGNORED = 0,
82 GTK_CMBUTTON_SELECTS = 1 << 0,
83 GTK_CMBUTTON_DRAGS = 1 << 1,
84 GTK_CMBUTTON_EXPANDS = 1 << 2
85 } GtkCMButtonAction;
87 #define GTK_TYPE_CMCLIST (gtk_cmclist_get_type ())
88 #define GTK_CMCLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CMCLIST, GtkCMCList))
89 #define GTK_CMCLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CMCLIST, GtkCMCListClass))
90 #define GTK_IS_CMCLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CMCLIST))
91 #define GTK_IS_CMCLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CMCLIST))
92 #define GTK_CMCLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CMCLIST, GtkCMCListClass))
95 #define GTK_CMCLIST_FLAGS(clist) (GTK_CMCLIST (clist)->flags)
96 #define GTK_CMCLIST_SET_FLAG(clist,flag) (GTK_CMCLIST_FLAGS (clist) |= (GTK_ ## flag))
97 #define GTK_CMCLIST_UNSET_FLAG(clist,flag) (GTK_CMCLIST_FLAGS (clist) &= ~(GTK_ ## flag))
99 #define GTK_CMCLIST_IN_DRAG(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_IN_DRAG)
100 #define GTK_CMCLIST_ROW_HEIGHT_SET(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_ROW_HEIGHT_SET)
101 #define GTK_CMCLIST_SHOW_TITLES(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_SHOW_TITLES)
102 #define GTK_CMCLIST_ADD_MODE(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_ADD_MODE)
103 #define GTK_CMCLIST_AUTO_SORT(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_AUTO_SORT)
104 #define GTK_CMCLIST_AUTO_RESIZE_BLOCKED(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_AUTO_RESIZE_BLOCKED)
105 #define GTK_CMCLIST_REORDERABLE(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_REORDERABLE)
106 #define GTK_CMCLIST_USE_DRAG_ICONS(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_USE_DRAG_ICONS)
107 #define GTK_CMCLIST_DRAW_DRAG_LINE(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_DRAW_DRAG_LINE)
108 #define GTK_CMCLIST_DRAW_DRAG_RECT(clist) (GTK_CMCLIST_FLAGS (clist) & GTK_CMCLIST_DRAW_DRAG_RECT)
110 #define GTK_CMCLIST_ROW(_glist_) ((GtkCMCListRow *)((_glist_)->data))
112 /* pointer casting for cells */
113 #define GTK_CMCELL_TEXT(cell) (((GtkCMCellText *) &(cell)))
114 #define GTK_CMCELL_PIXBUF(cell) (((GtkCMCellPixbuf *) &(cell)))
115 #define GTK_CMCELL_PIXTEXT(cell) (((GtkCMCellPixText *) &(cell)))
116 #define GTK_CMCELL_WIDGET(cell) (((GtkCMCellWidget *) &(cell)))
118 typedef struct _GtkCMCList GtkCMCList;
119 typedef struct _GtkCMCListClass GtkCMCListClass;
120 typedef struct _GtkCMCListColumn GtkCMCListColumn;
121 typedef struct _GtkCMCListRow GtkCMCListRow;
123 typedef struct _GtkCMCell GtkCMCell;
124 typedef struct _GtkCMCellText GtkCMCellText;
125 typedef struct _GtkCMCellPixbuf GtkCMCellPixbuf;
126 typedef struct _GtkCMCellPixText GtkCMCellPixText;
127 typedef struct _GtkCMCellWidget GtkCMCellWidget;
129 typedef gint (*GtkCMCListCompareFunc) (GtkCMCList *clist,
130 gconstpointer ptr1,
131 gconstpointer ptr2);
133 typedef struct _GtkCMCListCellInfo GtkCMCListCellInfo;
134 typedef struct _GtkCMCListDestInfo GtkCMCListDestInfo;
136 struct _GtkCMCListCellInfo
138 gint row;
139 gint column;
142 struct _GtkCMCListDestInfo
144 GtkCMCListCellInfo cell;
145 GtkCMCListDragPos insert_pos;
148 struct _GtkCMCList
150 GtkContainer container;
152 guint16 flags;
154 gpointer reserved1;
155 gpointer reserved2;
156 guint freeze_count;
158 /* allocation rectangle after the conatiner_border_width
159 * and the width of the shadow border */
160 GdkRectangle internal_allocation;
162 /* rows */
163 gint rows;
164 gint row_height;
165 GList *row_list;
166 GList *row_list_end;
168 /* columns */
169 gint columns;
170 GdkRectangle column_title_area;
171 GdkWindow *title_window;
173 /* dynamicly allocated array of column structures */
174 GtkCMCListColumn *column;
176 /* the scrolling window and its height and width to
177 * make things a little speedier */
178 GdkWindow *clist_window;
179 gint clist_window_width;
180 gint clist_window_height;
182 /* offsets for scrolling */
183 gint hoffset;
184 gint voffset;
186 /* border shadow style */
187 GtkShadowType shadow_type;
189 /* the list's selection mode (gtkenums.h) */
190 GtkSelectionMode selection_mode;
192 /* list of selected rows */
193 GList *selection;
194 GList *selection_end;
196 GList *undo_selection;
197 GList *undo_unselection;
198 gint undo_anchor;
200 /* mouse buttons */
201 guint8 button_actions[5];
203 guint8 drag_button;
205 /* dnd */
206 GtkCMCListCellInfo click_cell;
208 /* scroll adjustments */
209 GtkAdjustment *hadjustment;
210 GtkAdjustment *vadjustment;
212 gint dash_mode;
214 /* cursor used to indicate dragging */
215 GdkCursor *cursor_drag;
217 /* the current x-pixel location of the xor-drag line */
218 gint x_drag;
220 /* focus handling */
221 gint focus_row;
223 gint focus_header_column;
225 /* dragging the selection */
226 gint anchor;
227 GtkStateType anchor_state;
228 gint drag_pos;
229 gint htimer;
230 gint vtimer;
232 GtkSortType sort_type;
233 GtkCMCListCompareFunc compare;
234 gint sort_column;
236 gint drag_highlight_row;
237 GtkCMCListDragPos drag_highlight_pos;
238 int draw_now;
241 struct _GtkCMCListClass
243 GtkContainerClass parent_class;
245 void (*refresh) (GtkCMCList *clist);
246 void (*select_row) (GtkCMCList *clist,
247 gint row,
248 gint column,
249 GdkEvent *event);
250 void (*unselect_row) (GtkCMCList *clist,
251 gint row,
252 gint column,
253 GdkEvent *event);
254 void (*row_move) (GtkCMCList *clist,
255 gint source_row,
256 gint dest_row);
257 void (*click_column) (GtkCMCList *clist,
258 gint column);
259 void (*resize_column) (GtkCMCList *clist,
260 gint column,
261 gint width);
262 void (*toggle_focus_row) (GtkCMCList *clist);
263 void (*select_all) (GtkCMCList *clist);
264 void (*unselect_all) (GtkCMCList *clist);
265 void (*undo_selection) (GtkCMCList *clist);
266 void (*start_selection) (GtkCMCList *clist);
267 void (*end_selection) (GtkCMCList *clist);
268 void (*extend_selection) (GtkCMCList *clist,
269 GtkScrollType scroll_type,
270 gfloat position,
271 gboolean auto_start_selection);
272 void (*scroll_horizontal) (GtkCMCList *clist,
273 GtkScrollType scroll_type,
274 gfloat position);
275 void (*scroll_vertical) (GtkCMCList *clist,
276 GtkScrollType scroll_type,
277 gfloat position);
278 void (*toggle_add_mode) (GtkCMCList *clist);
279 void (*abort_column_resize) (GtkCMCList *clist);
280 void (*resync_selection) (GtkCMCList *clist,
281 GdkEvent *event);
282 GList* (*selection_find) (GtkCMCList *clist,
283 gint row_number,
284 GList *row_list_element);
285 void (*draw_row) (GtkCMCList *clist,
286 GdkRectangle *area,
287 gint row,
288 GtkCMCListRow *clist_row);
289 void (*clear) (GtkCMCList *clist);
290 void (*fake_unselect_all) (GtkCMCList *clist,
291 gint row);
292 void (*sort_list) (GtkCMCList *clist);
293 gint (*insert_row) (GtkCMCList *clist,
294 gint row,
295 gchar *text[]);
296 void (*remove_row) (GtkCMCList *clist,
297 gint row);
298 void (*set_cell_contents) (GtkCMCList *clist,
299 GtkCMCListRow *clist_row,
300 gint column,
301 GtkCMCellType type,
302 const gchar *text,
303 guint8 spacing,
304 GdkPixbuf *pixbuf);
305 void (*cell_size_request) (GtkCMCList *clist,
306 GtkCMCListRow *clist_row,
307 gint column,
308 GtkRequisition *requisition);
312 struct _GtkCMCListColumn
314 gchar *title;
315 GdkRectangle area;
317 GtkWidget *button;
318 GdkWindow *window;
320 gint width;
321 gint min_width;
322 gint max_width;
323 GtkJustification justification;
325 guint visible : 1;
326 guint width_set : 1;
327 guint resizeable : 1;
328 guint auto_resize : 1;
329 guint button_passive : 1;
332 struct _GtkCMCListRow
334 GtkCMCell *cell;
335 GtkStateType state;
337 GdkColor foreground;
338 GdkColor background;
340 GtkStyle *style;
342 gpointer data;
343 GDestroyNotify destroy;
345 guint fg_set : 1;
346 guint bg_set : 1;
347 guint selectable : 1;
350 /* Cell Structures */
351 struct _GtkCMCellText
353 GtkCMCellType type;
355 gint16 vertical;
356 gint16 horizontal;
358 GtkStyle *style;
360 gchar *text;
363 struct _GtkCMCellPixbuf
365 GtkCMCellType type;
367 gint16 vertical;
368 gint16 horizontal;
370 GtkStyle *style;
372 GdkPixbuf *pixbuf;
375 struct _GtkCMCellPixText
377 GtkCMCellType type;
379 gint16 vertical;
380 gint16 horizontal;
382 GtkStyle *style;
384 gchar *text;
385 guint8 spacing;
386 GdkPixbuf *pixbuf;
389 struct _GtkCMCellWidget
391 GtkCMCellType type;
393 gint16 vertical;
394 gint16 horizontal;
396 GtkStyle *style;
398 GtkWidget *widget;
401 struct _GtkCMCell
403 GtkCMCellType type;
405 gint16 vertical;
406 gint16 horizontal;
408 GtkStyle *style;
410 union {
411 gchar *text;
413 struct {
414 GdkPixbuf *pixbuf;
415 } pm;
417 struct {
418 gchar *text;
419 guint8 spacing;
420 GdkPixbuf *pixbuf;
421 } pt;
423 GtkWidget *widget;
424 } u;
427 GType gtk_cmclist_get_type (void);
429 /* create a new GtkCMCList */
430 GtkWidget* gtk_cmclist_new (gint columns);
431 GtkWidget* gtk_cmclist_new_with_titles (gint columns,
432 gchar *titles[]);
434 /* set adjustments of clist */
435 void gtk_cmclist_set_hadjustment (GtkCMCList *clist,
436 GtkAdjustment *adjustment);
437 void gtk_cmclist_set_vadjustment (GtkCMCList *clist,
438 GtkAdjustment *adjustment);
440 /* get adjustments of clist */
441 GtkAdjustment* gtk_cmclist_get_hadjustment (GtkCMCList *clist);
442 GtkAdjustment* gtk_cmclist_get_vadjustment (GtkCMCList *clist);
444 /* set the border style of the clist */
445 void gtk_cmclist_set_shadow_type (GtkCMCList *clist,
446 GtkShadowType type);
448 /* set the clist's selection mode */
449 void gtk_cmclist_set_selection_mode (GtkCMCList *clist,
450 GtkSelectionMode mode);
452 /* enable clists reorder ability */
453 void gtk_cmclist_set_reorderable (GtkCMCList *clist,
454 gboolean reorderable);
455 void gtk_cmclist_set_use_drag_icons (GtkCMCList *clist,
456 gboolean use_icons);
457 void gtk_cmclist_set_button_actions (GtkCMCList *clist,
458 guint button,
459 guint8 button_actions);
461 /* freeze all visual updates of the list, and then thaw the list after
462 * you have made a number of changes and the updates wil occure in a
463 * more efficent mannor than if you made them on a unfrozen list
465 void gtk_cmclist_freeze (GtkCMCList *clist);
466 void gtk_cmclist_thaw (GtkCMCList *clist);
468 /* show and hide the column title buttons */
469 void gtk_cmclist_column_titles_show (GtkCMCList *clist);
470 void gtk_cmclist_column_titles_hide (GtkCMCList *clist);
472 /* set the column title to be a active title (responds to button presses,
473 * prelights, and grabs keyboard focus), or passive where it acts as just
474 * a title
476 void gtk_cmclist_column_title_active (GtkCMCList *clist,
477 gint column);
478 void gtk_cmclist_column_title_passive (GtkCMCList *clist,
479 gint column);
480 void gtk_cmclist_column_titles_active (GtkCMCList *clist);
481 void gtk_cmclist_column_titles_passive (GtkCMCList *clist);
483 /* set the title in the column title button */
484 void gtk_cmclist_set_column_title (GtkCMCList *clist,
485 gint column,
486 const gchar *title);
488 /* returns the title of column. Returns NULL if title is not set */
489 gchar * gtk_cmclist_get_column_title (GtkCMCList *clist,
490 gint column);
492 /* set a widget instead of a title for the column title button */
493 void gtk_cmclist_set_column_widget (GtkCMCList *clist,
494 gint column,
495 GtkWidget *widget);
497 /* returns the column widget */
498 GtkWidget * gtk_cmclist_get_column_widget (GtkCMCList *clist,
499 gint column);
501 /* set the justification on a column */
502 void gtk_cmclist_set_column_justification (GtkCMCList *clist,
503 gint column,
504 GtkJustification justification);
506 /* set visibility of a column */
507 void gtk_cmclist_set_column_visibility (GtkCMCList *clist,
508 gint column,
509 gboolean visible);
511 /* enable/disable column resize operations by mouse */
512 void gtk_cmclist_set_column_resizeable (GtkCMCList *clist,
513 gint column,
514 gboolean resizeable);
516 /* resize column automatically to its optimal width */
517 void gtk_cmclist_set_column_auto_resize (GtkCMCList *clist,
518 gint column,
519 gboolean auto_resize);
521 gint gtk_cmclist_columns_autosize (GtkCMCList *clist);
523 /* return the optimal column width, i.e. maximum of all cell widths */
524 gint gtk_cmclist_optimal_column_width (GtkCMCList *clist,
525 gint column);
527 /* set the pixel width of a column; this is a necessary step in
528 * creating a CList because otherwise the column width is chozen from
529 * the width of the column title, which will never be right
531 void gtk_cmclist_set_column_width (GtkCMCList *clist,
532 gint column,
533 gint width);
535 /* set column minimum/maximum width. min/max_width < 0 => no restriction */
536 void gtk_cmclist_set_column_min_width (GtkCMCList *clist,
537 gint column,
538 gint min_width);
539 void gtk_cmclist_set_column_max_width (GtkCMCList *clist,
540 gint column,
541 gint max_width);
543 /* change the height of the rows, the default (height=0) is
544 * the hight of the current font.
546 void gtk_cmclist_set_row_height (GtkCMCList *clist,
547 guint height);
549 /* scroll the viewing area of the list to the given column and row;
550 * row_align and col_align are between 0-1 representing the location the
551 * row should appear on the screnn, 0.0 being top or left, 1.0 being
552 * bottom or right; if row or column is -1 then then there is no change
554 void gtk_cmclist_moveto (GtkCMCList *clist,
555 gint row,
556 gint column,
557 gfloat row_align,
558 gfloat col_align);
560 /* returns whether the row is visible */
561 GtkVisibility gtk_cmclist_row_is_visible (GtkCMCList *clist,
562 gint row);
564 /* returns whether the row is above or below current viewport */
565 gboolean gtk_cmclist_row_is_above_viewport (GtkCMCList *clist,
566 gint row);
567 gboolean gtk_cmclist_row_is_below_viewport (GtkCMCList *clist,
568 gint row);
570 /* returns the cell type */
571 GtkCMCellType gtk_cmclist_get_cell_type (GtkCMCList *clist,
572 gint row,
573 gint column);
575 /* sets a given cell's text, replacing its current contents */
576 void gtk_cmclist_set_text (GtkCMCList *clist,
577 gint row,
578 gint column,
579 const gchar *text);
581 /* for the "get" functions, any of the return pointer can be
582 * NULL if you are not interested
584 gint gtk_cmclist_get_text (GtkCMCList *clist,
585 gint row,
586 gint column,
587 gchar **text);
589 /* sets a given cell's pixbuf, replacing its current contents */
590 void gtk_cmclist_set_pixbuf (GtkCMCList *clist,
591 gint row,
592 gint column,
593 GdkPixbuf *pixbuf);
595 gint gtk_cmclist_get_pixbuf (GtkCMCList *clist,
596 gint row,
597 gint column,
598 GdkPixbuf **pixbuf);
600 /* sets a given cell's pixbuf and text, replacing its current contents */
601 void gtk_cmclist_set_pixtext (GtkCMCList *clist,
602 gint row,
603 gint column,
604 const gchar *text,
605 guint8 spacing,
606 GdkPixbuf *pixbuf);
608 gint gtk_cmclist_get_pixtext (GtkCMCList *clist,
609 gint row,
610 gint column,
611 gchar **text,
612 guint8 *spacing,
613 GdkPixbuf **pixbuf);
615 /* sets the foreground color of a row, the color must already
616 * be allocated
618 void gtk_cmclist_set_foreground (GtkCMCList *clist,
619 gint row,
620 const GdkColor *color);
622 /* sets the background color of a row, the color must already
623 * be allocated
625 void gtk_cmclist_set_background (GtkCMCList *clist,
626 gint row,
627 const GdkColor *color);
629 /* set / get cell styles */
630 void gtk_cmclist_set_cell_style (GtkCMCList *clist,
631 gint row,
632 gint column,
633 GtkStyle *style);
635 GtkStyle *gtk_cmclist_get_cell_style (GtkCMCList *clist,
636 gint row,
637 gint column);
639 void gtk_cmclist_set_row_style (GtkCMCList *clist,
640 gint row,
641 GtkStyle *style);
643 GtkStyle *gtk_cmclist_get_row_style (GtkCMCList *clist,
644 gint row);
646 /* this sets a horizontal and vertical shift for drawing
647 * the contents of a cell; it can be positive or negitive;
648 * this is particulary useful for indenting items in a column
650 void gtk_cmclist_set_shift (GtkCMCList *clist,
651 gint row,
652 gint column,
653 gint vertical,
654 gint horizontal);
656 /* set/get selectable flag of a single row */
657 void gtk_cmclist_set_selectable (GtkCMCList *clist,
658 gint row,
659 gboolean selectable);
660 gboolean gtk_cmclist_get_selectable (GtkCMCList *clist,
661 gint row);
663 /* prepend/append returns the index of the row you just added,
664 * making it easier to append and modify a row
666 gint gtk_cmclist_prepend (GtkCMCList *clist,
667 gchar *text[]);
668 gint gtk_cmclist_append (GtkCMCList *clist,
669 gchar *text[]);
671 /* inserts a row at index row and returns the row where it was
672 * actually inserted (may be different from "row" in auto_sort mode)
674 gint gtk_cmclist_insert (GtkCMCList *clist,
675 gint row,
676 gchar *text[]);
678 /* removes row at index row */
679 void gtk_cmclist_remove (GtkCMCList *clist,
680 gint row);
682 /* sets a arbitrary data pointer for a given row */
683 void gtk_cmclist_set_row_data (GtkCMCList *clist,
684 gint row,
685 gpointer data);
687 /* sets a data pointer for a given row with destroy notification */
688 void gtk_cmclist_set_row_data_full (GtkCMCList *clist,
689 gint row,
690 gpointer data,
691 GDestroyNotify destroy);
693 /* returns the data set for a row */
694 gpointer gtk_cmclist_get_row_data (GtkCMCList *clist,
695 gint row);
697 /* givin a data pointer, find the first (and hopefully only!)
698 * row that points to that data, or -1 if none do
700 gint gtk_cmclist_find_row_from_data (GtkCMCList *clist,
701 gpointer data);
703 /* force selection of a row */
704 void gtk_cmclist_select_row (GtkCMCList *clist,
705 gint row,
706 gint column);
708 /* force unselection of a row */
709 void gtk_cmclist_unselect_row (GtkCMCList *clist,
710 gint row,
711 gint column);
713 /* undo the last select/unselect operation */
714 void gtk_cmclist_undo_selection (GtkCMCList *clist);
716 /* clear the entire list -- this is much faster than removing
717 * each item with gtk_cmclist_remove
719 void gtk_cmclist_clear (GtkCMCList *clist);
721 /* return the row column corresponding to the x and y coordinates,
722 * the returned values are only valid if the x and y coordinates
723 * are respectively to a window == clist->clist_window
725 gint gtk_cmclist_get_selection_info (GtkCMCList *clist,
726 gint x,
727 gint y,
728 gint *row,
729 gint *column);
731 /* in multiple or extended mode, select all rows */
732 void gtk_cmclist_select_all (GtkCMCList *clist);
734 /* in all modes except browse mode, deselect all rows */
735 void gtk_cmclist_unselect_all (GtkCMCList *clist);
737 /* swap the position of two rows */
738 void gtk_cmclist_swap_rows (GtkCMCList *clist,
739 gint row1,
740 gint row2);
742 /* move row from source_row position to dest_row position */
743 void gtk_cmclist_row_move (GtkCMCList *clist,
744 gint source_row,
745 gint dest_row);
747 /* sets a compare function different to the default */
748 void gtk_cmclist_set_compare_func (GtkCMCList *clist,
749 GtkCMCListCompareFunc cmp_func);
751 /* the column to sort by */
752 void gtk_cmclist_set_sort_column (GtkCMCList *clist,
753 gint column);
755 /* how to sort : ascending or descending */
756 void gtk_cmclist_set_sort_type (GtkCMCList *clist,
757 GtkSortType sort_type);
759 /* sort the list with the current compare function */
760 void gtk_cmclist_sort (GtkCMCList *clist);
762 /* Automatically sort upon insertion */
763 void gtk_cmclist_set_auto_sort (GtkCMCList *clist,
764 gboolean auto_sort);
766 /* Private function for clist, ctree */
768 PangoLayout *_gtk_cmclist_create_cell_layout (GtkCMCList *clist,
769 GtkCMCListRow *clist_row,
770 gint column);
773 G_END_DECLS
776 #endif /* __GTK_CMCLIST_H__ */