Blame gtk/gtkclist.h

Packit 98cdb6
/* GTK - The GIMP Toolkit
Packit 98cdb6
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald
Packit 98cdb6
 * Copyright (C) 1997-1998 Jay Painter <jpaint@serv.net><jpaint@gimp.org>
Packit 98cdb6
 *
Packit 98cdb6
 * This library is free software; you can redistribute it and/or
Packit 98cdb6
 * modify it under the terms of the GNU Lesser General Public
Packit 98cdb6
 * License as published by the Free Software Foundation; either
Packit 98cdb6
 * version 2 of the License, or (at your option) any later version.
Packit 98cdb6
 *
Packit 98cdb6
 * This library is distributed in the hope that it will be useful,
Packit 98cdb6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 98cdb6
 * Lesser General Public License for more details.
Packit 98cdb6
 *
Packit 98cdb6
 * You should have received a copy of the GNU Lesser General Public
Packit 98cdb6
 * License along with this library; if not, write to the
Packit 98cdb6
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 98cdb6
 * Boston, MA 02111-1307, USA.
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
/*
Packit 98cdb6
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
Packit 98cdb6
 * file for a list of people on the GTK+ Team.  See the ChangeLog
Packit 98cdb6
 * files for a list of changes.  These files are distributed with
Packit 98cdb6
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_CLIST_C__) || defined (__GTK_CTREE_C__)
Packit 98cdb6
Packit 98cdb6
#ifndef __GTK_CLIST_H__
Packit 98cdb6
#define __GTK_CLIST_H__
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
#include <gtk/gtksignal.h>
Packit 98cdb6
#include <gtk/gtkalignment.h>
Packit 98cdb6
#include <gtk/gtklabel.h>
Packit 98cdb6
#include <gtk/gtkbutton.h>
Packit 98cdb6
#include <gtk/gtkhscrollbar.h>
Packit 98cdb6
#include <gtk/gtkvscrollbar.h>
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
G_BEGIN_DECLS
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
/* clist flags */
Packit 98cdb6
enum {
Packit 98cdb6
  GTK_CLIST_IN_DRAG             = 1 <<  0,
Packit 98cdb6
  GTK_CLIST_ROW_HEIGHT_SET      = 1 <<  1,
Packit 98cdb6
  GTK_CLIST_SHOW_TITLES         = 1 <<  2,
Packit 98cdb6
  /* Unused */
Packit 98cdb6
  GTK_CLIST_ADD_MODE            = 1 <<  4,
Packit 98cdb6
  GTK_CLIST_AUTO_SORT           = 1 <<  5,
Packit 98cdb6
  GTK_CLIST_AUTO_RESIZE_BLOCKED = 1 <<  6,
Packit 98cdb6
  GTK_CLIST_REORDERABLE         = 1 <<  7,
Packit 98cdb6
  GTK_CLIST_USE_DRAG_ICONS      = 1 <<  8,
Packit 98cdb6
  GTK_CLIST_DRAW_DRAG_LINE      = 1 <<  9,
Packit 98cdb6
  GTK_CLIST_DRAW_DRAG_RECT      = 1 << 10
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
/* cell types */
Packit 98cdb6
typedef enum
Packit 98cdb6
{
Packit 98cdb6
  GTK_CELL_EMPTY,
Packit 98cdb6
  GTK_CELL_TEXT,
Packit 98cdb6
  GTK_CELL_PIXMAP,
Packit 98cdb6
  GTK_CELL_PIXTEXT,
Packit 98cdb6
  GTK_CELL_WIDGET
Packit 98cdb6
} GtkCellType;
Packit 98cdb6
Packit 98cdb6
typedef enum
Packit 98cdb6
{
Packit 98cdb6
  GTK_CLIST_DRAG_NONE,
Packit 98cdb6
  GTK_CLIST_DRAG_BEFORE,
Packit 98cdb6
  GTK_CLIST_DRAG_INTO,
Packit 98cdb6
  GTK_CLIST_DRAG_AFTER
Packit 98cdb6
} GtkCListDragPos;
Packit 98cdb6
Packit 98cdb6
typedef enum
Packit 98cdb6
{
Packit 98cdb6
  GTK_BUTTON_IGNORED = 0,
Packit 98cdb6
  GTK_BUTTON_SELECTS = 1 << 0,
Packit 98cdb6
  GTK_BUTTON_DRAGS   = 1 << 1,
Packit 98cdb6
  GTK_BUTTON_EXPANDS = 1 << 2
Packit 98cdb6
} GtkButtonAction;
Packit 98cdb6
Packit 98cdb6
#define GTK_TYPE_CLIST            (gtk_clist_get_type ())
Packit 98cdb6
#define GTK_CLIST(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIST, GtkCList))
Packit 98cdb6
#define GTK_CLIST_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CLIST, GtkCListClass))
Packit 98cdb6
#define GTK_IS_CLIST(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CLIST))
Packit 98cdb6
#define GTK_IS_CLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CLIST))
Packit 98cdb6
#define GTK_CLIST_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CLIST, GtkCListClass))
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
#define GTK_CLIST_FLAGS(clist)             (GTK_CLIST (clist)->flags)
Packit 98cdb6
#define GTK_CLIST_SET_FLAG(clist,flag)     (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag))
Packit 98cdb6
#define GTK_CLIST_UNSET_FLAG(clist,flag)   (GTK_CLIST_FLAGS (clist) &= ~(GTK_ ## flag))
Packit 98cdb6
Packit 98cdb6
#define GTK_CLIST_IN_DRAG(clist)           (GTK_CLIST_FLAGS (clist) & GTK_CLIST_IN_DRAG)
Packit 98cdb6
#define GTK_CLIST_ROW_HEIGHT_SET(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ROW_HEIGHT_SET)
Packit 98cdb6
#define GTK_CLIST_SHOW_TITLES(clist)       (GTK_CLIST_FLAGS (clist) & GTK_CLIST_SHOW_TITLES)
Packit 98cdb6
#define GTK_CLIST_ADD_MODE(clist)          (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ADD_MODE)
Packit 98cdb6
#define GTK_CLIST_AUTO_SORT(clist)         (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_SORT)
Packit 98cdb6
#define GTK_CLIST_AUTO_RESIZE_BLOCKED(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_RESIZE_BLOCKED)
Packit 98cdb6
#define GTK_CLIST_REORDERABLE(clist)       (GTK_CLIST_FLAGS (clist) & GTK_CLIST_REORDERABLE)
Packit 98cdb6
#define GTK_CLIST_USE_DRAG_ICONS(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_USE_DRAG_ICONS)
Packit 98cdb6
#define GTK_CLIST_DRAW_DRAG_LINE(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_LINE)
Packit 98cdb6
#define GTK_CLIST_DRAW_DRAG_RECT(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_RECT)
Packit 98cdb6
Packit 98cdb6
#define GTK_CLIST_ROW(_glist_) ((GtkCListRow *)((_glist_)->data))
Packit 98cdb6
Packit 98cdb6
/* pointer casting for cells */
Packit 98cdb6
#define GTK_CELL_TEXT(cell)     (((GtkCellText *) &(cell)))
Packit 98cdb6
#define GTK_CELL_PIXMAP(cell)   (((GtkCellPixmap *) &(cell)))
Packit 98cdb6
#define GTK_CELL_PIXTEXT(cell)  (((GtkCellPixText *) &(cell)))
Packit 98cdb6
#define GTK_CELL_WIDGET(cell)   (((GtkCellWidget *) &(cell)))
Packit 98cdb6
Packit 98cdb6
typedef struct _GtkCList GtkCList;
Packit 98cdb6
typedef struct _GtkCListClass GtkCListClass;
Packit 98cdb6
typedef struct _GtkCListColumn GtkCListColumn;
Packit 98cdb6
typedef struct _GtkCListRow GtkCListRow;
Packit 98cdb6
Packit 98cdb6
typedef struct _GtkCell GtkCell;
Packit 98cdb6
typedef struct _GtkCellText GtkCellText;
Packit 98cdb6
typedef struct _GtkCellPixmap GtkCellPixmap;
Packit 98cdb6
typedef struct _GtkCellPixText GtkCellPixText;
Packit 98cdb6
typedef struct _GtkCellWidget GtkCellWidget;
Packit 98cdb6
Packit 98cdb6
typedef gint (*GtkCListCompareFunc) (GtkCList     *clist,
Packit 98cdb6
				     gconstpointer ptr1,
Packit 98cdb6
				     gconstpointer ptr2);
Packit 98cdb6
Packit 98cdb6
typedef struct _GtkCListCellInfo GtkCListCellInfo;
Packit 98cdb6
typedef struct _GtkCListDestInfo GtkCListDestInfo;
Packit 98cdb6
Packit 98cdb6
struct _GtkCListCellInfo
Packit 98cdb6
{
Packit 98cdb6
  gint row;
Packit 98cdb6
  gint column;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCListDestInfo
Packit 98cdb6
{
Packit 98cdb6
  GtkCListCellInfo cell;
Packit 98cdb6
  GtkCListDragPos  insert_pos;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCList
Packit 98cdb6
{
Packit 98cdb6
  GtkContainer container;
Packit 98cdb6
  
Packit 98cdb6
  guint16 flags;
Packit 98cdb6
  
Packit 98cdb6
  gpointer reserved1;
Packit 98cdb6
  gpointer reserved2;
Packit 98cdb6
Packit 98cdb6
  guint freeze_count;
Packit 98cdb6
  
Packit 98cdb6
  /* allocation rectangle after the container_border_width
Packit 98cdb6
   * and the width of the shadow border */
Packit 98cdb6
  GdkRectangle internal_allocation;
Packit 98cdb6
  
Packit 98cdb6
  /* rows */
Packit 98cdb6
  gint rows;
Packit 98cdb6
  gint row_height;
Packit 98cdb6
  GList *row_list;
Packit 98cdb6
  GList *row_list_end;
Packit 98cdb6
  
Packit 98cdb6
  /* columns */
Packit 98cdb6
  gint columns;
Packit 98cdb6
  GdkRectangle column_title_area;
Packit 98cdb6
  GdkWindow *title_window;
Packit 98cdb6
  
Packit 98cdb6
  /* dynamicly allocated array of column structures */
Packit 98cdb6
  GtkCListColumn *column;
Packit 98cdb6
  
Packit 98cdb6
  /* the scrolling window and its height and width to
Packit 98cdb6
   * make things a little speedier */
Packit 98cdb6
  GdkWindow *clist_window;
Packit 98cdb6
  gint clist_window_width;
Packit 98cdb6
  gint clist_window_height;
Packit 98cdb6
  
Packit 98cdb6
  /* offsets for scrolling */
Packit 98cdb6
  gint hoffset;
Packit 98cdb6
  gint voffset;
Packit 98cdb6
  
Packit 98cdb6
  /* border shadow style */
Packit 98cdb6
  GtkShadowType shadow_type;
Packit 98cdb6
  
Packit 98cdb6
  /* the list's selection mode (gtkenums.h) */
Packit 98cdb6
  GtkSelectionMode selection_mode;
Packit 98cdb6
  
Packit 98cdb6
  /* list of selected rows */
Packit 98cdb6
  GList *selection;
Packit 98cdb6
  GList *selection_end;
Packit 98cdb6
  
Packit 98cdb6
  GList *undo_selection;
Packit 98cdb6
  GList *undo_unselection;
Packit 98cdb6
  gint undo_anchor;
Packit 98cdb6
  
Packit 98cdb6
  /* mouse buttons */
Packit 98cdb6
  guint8 button_actions[5];
Packit 98cdb6
Packit 98cdb6
  guint8 drag_button;
Packit 98cdb6
Packit 98cdb6
  /* dnd */
Packit 98cdb6
  GtkCListCellInfo click_cell;
Packit 98cdb6
Packit 98cdb6
  /* scroll adjustments */
Packit 98cdb6
  GtkAdjustment *hadjustment;
Packit 98cdb6
  GtkAdjustment *vadjustment;
Packit 98cdb6
  
Packit 98cdb6
  /* xor GC for the vertical drag line */
Packit 98cdb6
  GdkGC *xor_gc;
Packit 98cdb6
  
Packit 98cdb6
  /* gc for drawing unselected cells */
Packit 98cdb6
  GdkGC *fg_gc;
Packit 98cdb6
  GdkGC *bg_gc;
Packit 98cdb6
  
Packit 98cdb6
  /* cursor used to indicate dragging */
Packit 98cdb6
  GdkCursor *cursor_drag;
Packit 98cdb6
  
Packit 98cdb6
  /* the current x-pixel location of the xor-drag line */
Packit 98cdb6
  gint x_drag;
Packit 98cdb6
  
Packit 98cdb6
  /* focus handling */
Packit 98cdb6
  gint focus_row;
Packit 98cdb6
Packit 98cdb6
  gint focus_header_column;
Packit 98cdb6
  
Packit 98cdb6
  /* dragging the selection */
Packit 98cdb6
  gint anchor;
Packit 98cdb6
  GtkStateType anchor_state;
Packit 98cdb6
  gint drag_pos;
Packit 98cdb6
  gint htimer;
Packit 98cdb6
  gint vtimer;
Packit 98cdb6
  
Packit 98cdb6
  GtkSortType sort_type;
Packit 98cdb6
  GtkCListCompareFunc compare;
Packit 98cdb6
  gint sort_column;
Packit 98cdb6
Packit 98cdb6
  gint drag_highlight_row;
Packit 98cdb6
  GtkCListDragPos drag_highlight_pos;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCListClass
Packit 98cdb6
{
Packit 98cdb6
  GtkContainerClass parent_class;
Packit 98cdb6
  
Packit 98cdb6
  void  (*set_scroll_adjustments) (GtkCList       *clist,
Packit 98cdb6
				   GtkAdjustment  *hadjustment,
Packit 98cdb6
				   GtkAdjustment  *vadjustment);
Packit 98cdb6
  void   (*refresh)             (GtkCList       *clist);
Packit 98cdb6
  void   (*select_row)          (GtkCList       *clist,
Packit 98cdb6
				 gint            row,
Packit 98cdb6
				 gint            column,
Packit 98cdb6
				 GdkEvent       *event);
Packit 98cdb6
  void   (*unselect_row)        (GtkCList       *clist,
Packit 98cdb6
				 gint            row,
Packit 98cdb6
				 gint            column,
Packit 98cdb6
				 GdkEvent       *event);
Packit 98cdb6
  void   (*row_move)            (GtkCList       *clist,
Packit 98cdb6
				 gint            source_row,
Packit 98cdb6
				 gint            dest_row);
Packit 98cdb6
  void   (*click_column)        (GtkCList       *clist,
Packit 98cdb6
				 gint            column);
Packit 98cdb6
  void   (*resize_column)       (GtkCList       *clist,
Packit 98cdb6
				 gint            column,
Packit 98cdb6
                                 gint            width);
Packit 98cdb6
  void   (*toggle_focus_row)    (GtkCList       *clist);
Packit 98cdb6
  void   (*select_all)          (GtkCList       *clist);
Packit 98cdb6
  void   (*unselect_all)        (GtkCList       *clist);
Packit 98cdb6
  void   (*undo_selection)      (GtkCList       *clist);
Packit 98cdb6
  void   (*start_selection)     (GtkCList       *clist);
Packit 98cdb6
  void   (*end_selection)       (GtkCList       *clist);
Packit 98cdb6
  void   (*extend_selection)    (GtkCList       *clist,
Packit 98cdb6
				 GtkScrollType   scroll_type,
Packit 98cdb6
				 gfloat          position,
Packit 98cdb6
				 gboolean        auto_start_selection);
Packit 98cdb6
  void   (*scroll_horizontal)   (GtkCList       *clist,
Packit 98cdb6
				 GtkScrollType   scroll_type,
Packit 98cdb6
				 gfloat          position);
Packit 98cdb6
  void   (*scroll_vertical)     (GtkCList       *clist,
Packit 98cdb6
				 GtkScrollType   scroll_type,
Packit 98cdb6
				 gfloat          position);
Packit 98cdb6
  void   (*toggle_add_mode)     (GtkCList       *clist);
Packit 98cdb6
  void   (*abort_column_resize) (GtkCList       *clist);
Packit 98cdb6
  void   (*resync_selection)    (GtkCList       *clist,
Packit 98cdb6
				 GdkEvent       *event);
Packit 98cdb6
  GList* (*selection_find)      (GtkCList       *clist,
Packit 98cdb6
				 gint            row_number,
Packit 98cdb6
				 GList          *row_list_element);
Packit 98cdb6
  void   (*draw_row)            (GtkCList       *clist,
Packit 98cdb6
				 GdkRectangle   *area,
Packit 98cdb6
				 gint            row,
Packit 98cdb6
				 GtkCListRow    *clist_row);
Packit 98cdb6
  void   (*draw_drag_highlight) (GtkCList        *clist,
Packit 98cdb6
				 GtkCListRow     *target_row,
Packit 98cdb6
				 gint             target_row_number,
Packit 98cdb6
				 GtkCListDragPos  drag_pos);
Packit 98cdb6
  void   (*clear)               (GtkCList       *clist);
Packit 98cdb6
  void   (*fake_unselect_all)   (GtkCList       *clist,
Packit 98cdb6
				 gint            row);
Packit 98cdb6
  void   (*sort_list)           (GtkCList       *clist);
Packit 98cdb6
  gint   (*insert_row)          (GtkCList       *clist,
Packit 98cdb6
				 gint            row,
Packit 98cdb6
				 gchar          *text[]);
Packit 98cdb6
  void   (*remove_row)          (GtkCList       *clist,
Packit 98cdb6
				 gint            row);
Packit 98cdb6
  void   (*set_cell_contents)   (GtkCList       *clist,
Packit 98cdb6
				 GtkCListRow    *clist_row,
Packit 98cdb6
				 gint            column,
Packit 98cdb6
				 GtkCellType     type,
Packit 98cdb6
				 const gchar    *text,
Packit 98cdb6
				 guint8          spacing,
Packit 98cdb6
				 GdkPixmap      *pixmap,
Packit 98cdb6
				 GdkBitmap      *mask);
Packit 98cdb6
  void   (*cell_size_request)   (GtkCList       *clist,
Packit 98cdb6
				 GtkCListRow    *clist_row,
Packit 98cdb6
				 gint            column,
Packit 98cdb6
				 GtkRequisition *requisition);
Packit 98cdb6
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCListColumn
Packit 98cdb6
{
Packit 98cdb6
  gchar *title;
Packit 98cdb6
  GdkRectangle area;
Packit 98cdb6
  
Packit 98cdb6
  GtkWidget *button;
Packit 98cdb6
  GdkWindow *window;
Packit 98cdb6
  
Packit 98cdb6
  gint width;
Packit 98cdb6
  gint min_width;
Packit 98cdb6
  gint max_width;
Packit 98cdb6
  GtkJustification justification;
Packit 98cdb6
  
Packit 98cdb6
  guint visible        : 1;  
Packit 98cdb6
  guint width_set      : 1;
Packit 98cdb6
  guint resizeable     : 1;
Packit 98cdb6
  guint auto_resize    : 1;
Packit 98cdb6
  guint button_passive : 1;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCListRow
Packit 98cdb6
{
Packit 98cdb6
  GtkCell *cell;
Packit 98cdb6
  GtkStateType state;
Packit 98cdb6
  
Packit 98cdb6
  GdkColor foreground;
Packit 98cdb6
  GdkColor background;
Packit 98cdb6
  
Packit 98cdb6
  GtkStyle *style;
Packit 98cdb6
Packit 98cdb6
  gpointer data;
Packit 98cdb6
  GDestroyNotify destroy;
Packit 98cdb6
  
Packit 98cdb6
  guint fg_set     : 1;
Packit 98cdb6
  guint bg_set     : 1;
Packit 98cdb6
  guint selectable : 1;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
/* Cell Structures */
Packit 98cdb6
struct _GtkCellText
Packit 98cdb6
{
Packit 98cdb6
  GtkCellType type;
Packit 98cdb6
  
Packit 98cdb6
  gint16 vertical;
Packit 98cdb6
  gint16 horizontal;
Packit 98cdb6
  
Packit 98cdb6
  GtkStyle *style;
Packit 98cdb6
Packit 98cdb6
  gchar *text;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCellPixmap
Packit 98cdb6
{
Packit 98cdb6
  GtkCellType type;
Packit 98cdb6
  
Packit 98cdb6
  gint16 vertical;
Packit 98cdb6
  gint16 horizontal;
Packit 98cdb6
  
Packit 98cdb6
  GtkStyle *style;
Packit 98cdb6
Packit 98cdb6
  GdkPixmap *pixmap;
Packit 98cdb6
  GdkBitmap *mask;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCellPixText
Packit 98cdb6
{
Packit 98cdb6
  GtkCellType type;
Packit 98cdb6
  
Packit 98cdb6
  gint16 vertical;
Packit 98cdb6
  gint16 horizontal;
Packit 98cdb6
  
Packit 98cdb6
  GtkStyle *style;
Packit 98cdb6
Packit 98cdb6
  gchar *text;
Packit 98cdb6
  guint8 spacing;
Packit 98cdb6
  GdkPixmap *pixmap;
Packit 98cdb6
  GdkBitmap *mask;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCellWidget
Packit 98cdb6
{
Packit 98cdb6
  GtkCellType type;
Packit 98cdb6
  
Packit 98cdb6
  gint16 vertical;
Packit 98cdb6
  gint16 horizontal;
Packit 98cdb6
  
Packit 98cdb6
  GtkStyle *style;
Packit 98cdb6
Packit 98cdb6
  GtkWidget *widget;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCell
Packit 98cdb6
{
Packit 98cdb6
  GtkCellType type;
Packit 98cdb6
  
Packit 98cdb6
  gint16 vertical;
Packit 98cdb6
  gint16 horizontal;
Packit 98cdb6
  
Packit 98cdb6
  GtkStyle *style;
Packit 98cdb6
Packit 98cdb6
  union {
Packit 98cdb6
    gchar *text;
Packit 98cdb6
    
Packit 98cdb6
    struct {
Packit 98cdb6
      GdkPixmap *pixmap;
Packit 98cdb6
      GdkBitmap *mask;
Packit 98cdb6
    } pm;
Packit 98cdb6
    
Packit 98cdb6
    struct {
Packit 98cdb6
      gchar *text;
Packit 98cdb6
      guint8 spacing;
Packit 98cdb6
      GdkPixmap *pixmap;
Packit 98cdb6
      GdkBitmap *mask;
Packit 98cdb6
    } pt;
Packit 98cdb6
    
Packit 98cdb6
    GtkWidget *widget;
Packit 98cdb6
  } u;
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
GType gtk_clist_get_type (void) G_GNUC_CONST;
Packit 98cdb6
Packit 98cdb6
/* create a new GtkCList */
Packit 98cdb6
GtkWidget* gtk_clist_new             (gint   columns);
Packit 98cdb6
GtkWidget* gtk_clist_new_with_titles (gint   columns,
Packit 98cdb6
				      gchar *titles[]);
Packit 98cdb6
Packit 98cdb6
/* set adjustments of clist */
Packit 98cdb6
void gtk_clist_set_hadjustment (GtkCList      *clist,
Packit 98cdb6
				GtkAdjustment *adjustment);
Packit 98cdb6
void gtk_clist_set_vadjustment (GtkCList      *clist,
Packit 98cdb6
				GtkAdjustment *adjustment);
Packit 98cdb6
Packit 98cdb6
/* get adjustments of clist */
Packit 98cdb6
GtkAdjustment* gtk_clist_get_hadjustment (GtkCList *clist);
Packit 98cdb6
GtkAdjustment* gtk_clist_get_vadjustment (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* set the border style of the clist */
Packit 98cdb6
void gtk_clist_set_shadow_type (GtkCList      *clist,
Packit 98cdb6
				GtkShadowType  type);
Packit 98cdb6
Packit 98cdb6
/* set the clist's selection mode */
Packit 98cdb6
void gtk_clist_set_selection_mode (GtkCList         *clist,
Packit 98cdb6
				   GtkSelectionMode  mode);
Packit 98cdb6
Packit 98cdb6
/* enable clists reorder ability */
Packit 98cdb6
void gtk_clist_set_reorderable (GtkCList *clist,
Packit 98cdb6
				gboolean  reorderable);
Packit 98cdb6
void gtk_clist_set_use_drag_icons (GtkCList *clist,
Packit 98cdb6
				   gboolean  use_icons);
Packit 98cdb6
void gtk_clist_set_button_actions (GtkCList *clist,
Packit 98cdb6
				   guint     button,
Packit 98cdb6
				   guint8    button_actions);
Packit 98cdb6
Packit 98cdb6
/* freeze all visual updates of the list, and then thaw the list after
Packit 98cdb6
 * you have made a number of changes and the updates wil occure in a
Packit 98cdb6
 * more efficent mannor than if you made them on a unfrozen list
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_freeze (GtkCList *clist);
Packit 98cdb6
void gtk_clist_thaw   (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* show and hide the column title buttons */
Packit 98cdb6
void gtk_clist_column_titles_show (GtkCList *clist);
Packit 98cdb6
void gtk_clist_column_titles_hide (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* set the column title to be a active title (responds to button presses, 
Packit 98cdb6
 * prelights, and grabs keyboard focus), or passive where it acts as just
Packit 98cdb6
 * a title
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_column_title_active   (GtkCList *clist,
Packit 98cdb6
				      gint      column);
Packit 98cdb6
void gtk_clist_column_title_passive  (GtkCList *clist,
Packit 98cdb6
				      gint      column);
Packit 98cdb6
void gtk_clist_column_titles_active  (GtkCList *clist);
Packit 98cdb6
void gtk_clist_column_titles_passive (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* set the title in the column title button */
Packit 98cdb6
void gtk_clist_set_column_title (GtkCList    *clist,
Packit 98cdb6
				 gint         column,
Packit 98cdb6
				 const gchar *title);
Packit 98cdb6
Packit 98cdb6
/* returns the title of column. Returns NULL if title is not set */
Packit 98cdb6
gchar * gtk_clist_get_column_title (GtkCList *clist,
Packit 98cdb6
				    gint      column);
Packit 98cdb6
Packit 98cdb6
/* set a widget instead of a title for the column title button */
Packit 98cdb6
void gtk_clist_set_column_widget (GtkCList  *clist,
Packit 98cdb6
				  gint       column,
Packit 98cdb6
				  GtkWidget *widget);
Packit 98cdb6
Packit 98cdb6
/* returns the column widget */
Packit 98cdb6
GtkWidget * gtk_clist_get_column_widget (GtkCList *clist,
Packit 98cdb6
					 gint      column);
Packit 98cdb6
Packit 98cdb6
/* set the justification on a column */
Packit 98cdb6
void gtk_clist_set_column_justification (GtkCList         *clist,
Packit 98cdb6
					 gint              column,
Packit 98cdb6
					 GtkJustification  justification);
Packit 98cdb6
Packit 98cdb6
/* set visibility of a column */
Packit 98cdb6
void gtk_clist_set_column_visibility (GtkCList *clist,
Packit 98cdb6
				      gint      column,
Packit 98cdb6
				      gboolean  visible);
Packit 98cdb6
Packit 98cdb6
/* enable/disable column resize operations by mouse */
Packit 98cdb6
void gtk_clist_set_column_resizeable (GtkCList *clist,
Packit 98cdb6
				      gint      column,
Packit 98cdb6
				      gboolean  resizeable);
Packit 98cdb6
Packit 98cdb6
/* resize column automatically to its optimal width */
Packit 98cdb6
void gtk_clist_set_column_auto_resize (GtkCList *clist,
Packit 98cdb6
				       gint      column,
Packit 98cdb6
				       gboolean  auto_resize);
Packit 98cdb6
Packit 98cdb6
gint gtk_clist_columns_autosize (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* return the optimal column width, i.e. maximum of all cell widths */
Packit 98cdb6
gint gtk_clist_optimal_column_width (GtkCList *clist,
Packit 98cdb6
				     gint      column);
Packit 98cdb6
Packit 98cdb6
/* set the pixel width of a column; this is a necessary step in
Packit 98cdb6
 * creating a CList because otherwise the column width is chozen from
Packit 98cdb6
 * the width of the column title, which will never be right
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_set_column_width (GtkCList *clist,
Packit 98cdb6
				 gint      column,
Packit 98cdb6
				 gint      width);
Packit 98cdb6
Packit 98cdb6
/* set column minimum/maximum width. min/max_width < 0 => no restriction */
Packit 98cdb6
void gtk_clist_set_column_min_width (GtkCList *clist,
Packit 98cdb6
				     gint      column,
Packit 98cdb6
				     gint      min_width);
Packit 98cdb6
void gtk_clist_set_column_max_width (GtkCList *clist,
Packit 98cdb6
				     gint      column,
Packit 98cdb6
				     gint      max_width);
Packit 98cdb6
Packit 98cdb6
/* change the height of the rows, the default (height=0) is
Packit 98cdb6
 * the hight of the current font.
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_set_row_height (GtkCList *clist,
Packit 98cdb6
			       guint     height);
Packit 98cdb6
Packit 98cdb6
/* scroll the viewing area of the list to the given column and row;
Packit 98cdb6
 * row_align and col_align are between 0-1 representing the location the
Packit 98cdb6
 * row should appear on the screnn, 0.0 being top or left, 1.0 being
Packit 98cdb6
 * bottom or right; if row or column is -1 then then there is no change
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_moveto (GtkCList *clist,
Packit 98cdb6
		       gint      row,
Packit 98cdb6
		       gint      column,
Packit 98cdb6
		       gfloat    row_align,
Packit 98cdb6
		       gfloat    col_align);
Packit 98cdb6
Packit 98cdb6
/* returns whether the row is visible */
Packit 98cdb6
GtkVisibility gtk_clist_row_is_visible (GtkCList *clist,
Packit 98cdb6
					gint      row);
Packit 98cdb6
Packit 98cdb6
/* returns the cell type */
Packit 98cdb6
GtkCellType gtk_clist_get_cell_type (GtkCList *clist,
Packit 98cdb6
				     gint      row,
Packit 98cdb6
				     gint      column);
Packit 98cdb6
Packit 98cdb6
/* sets a given cell's text, replacing its current contents */
Packit 98cdb6
void gtk_clist_set_text (GtkCList    *clist,
Packit 98cdb6
			 gint         row,
Packit 98cdb6
			 gint         column,
Packit 98cdb6
			 const gchar *text);
Packit 98cdb6
Packit 98cdb6
/* for the "get" functions, any of the return pointer can be
Packit 98cdb6
 * NULL if you are not interested
Packit 98cdb6
 */
Packit 98cdb6
gint gtk_clist_get_text (GtkCList  *clist,
Packit 98cdb6
			 gint       row,
Packit 98cdb6
			 gint       column,
Packit 98cdb6
			 gchar    **text);
Packit 98cdb6
Packit 98cdb6
/* sets a given cell's pixmap, replacing its current contents */
Packit 98cdb6
void gtk_clist_set_pixmap (GtkCList  *clist,
Packit 98cdb6
			   gint       row,
Packit 98cdb6
			   gint       column,
Packit 98cdb6
			   GdkPixmap *pixmap,
Packit 98cdb6
			   GdkBitmap *mask);
Packit 98cdb6
Packit 98cdb6
gint gtk_clist_get_pixmap (GtkCList   *clist,
Packit 98cdb6
			   gint        row,
Packit 98cdb6
			   gint        column,
Packit 98cdb6
			   GdkPixmap **pixmap,
Packit 98cdb6
			   GdkBitmap **mask);
Packit 98cdb6
Packit 98cdb6
/* sets a given cell's pixmap and text, replacing its current contents */
Packit 98cdb6
void gtk_clist_set_pixtext (GtkCList    *clist,
Packit 98cdb6
			    gint         row,
Packit 98cdb6
			    gint         column,
Packit 98cdb6
			    const gchar *text,
Packit 98cdb6
			    guint8       spacing,
Packit 98cdb6
			    GdkPixmap   *pixmap,
Packit 98cdb6
			    GdkBitmap   *mask);
Packit 98cdb6
Packit 98cdb6
gint gtk_clist_get_pixtext (GtkCList   *clist,
Packit 98cdb6
			    gint        row,
Packit 98cdb6
			    gint        column,
Packit 98cdb6
			    gchar     **text,
Packit 98cdb6
			    guint8     *spacing,
Packit 98cdb6
			    GdkPixmap **pixmap,
Packit 98cdb6
			    GdkBitmap **mask);
Packit 98cdb6
Packit 98cdb6
/* sets the foreground color of a row, the color must already
Packit 98cdb6
 * be allocated
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_set_foreground (GtkCList       *clist,
Packit 98cdb6
			       gint            row,
Packit 98cdb6
			       const GdkColor *color);
Packit 98cdb6
Packit 98cdb6
/* sets the background color of a row, the color must already
Packit 98cdb6
 * be allocated
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_set_background (GtkCList       *clist,
Packit 98cdb6
			       gint            row,
Packit 98cdb6
			       const GdkColor *color);
Packit 98cdb6
Packit 98cdb6
/* set / get cell styles */
Packit 98cdb6
void gtk_clist_set_cell_style (GtkCList *clist,
Packit 98cdb6
			       gint      row,
Packit 98cdb6
			       gint      column,
Packit 98cdb6
			       GtkStyle *style);
Packit 98cdb6
Packit 98cdb6
GtkStyle *gtk_clist_get_cell_style (GtkCList *clist,
Packit 98cdb6
				    gint      row,
Packit 98cdb6
				    gint      column);
Packit 98cdb6
Packit 98cdb6
void gtk_clist_set_row_style (GtkCList *clist,
Packit 98cdb6
			      gint      row,
Packit 98cdb6
			      GtkStyle *style);
Packit 98cdb6
Packit 98cdb6
GtkStyle *gtk_clist_get_row_style (GtkCList *clist,
Packit 98cdb6
				   gint      row);
Packit 98cdb6
Packit 98cdb6
/* this sets a horizontal and vertical shift for drawing
Packit 98cdb6
 * the contents of a cell; it can be positive or negitive;
Packit 98cdb6
 * this is particulary useful for indenting items in a column
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_set_shift (GtkCList *clist,
Packit 98cdb6
			  gint      row,
Packit 98cdb6
			  gint      column,
Packit 98cdb6
			  gint      vertical,
Packit 98cdb6
			  gint      horizontal);
Packit 98cdb6
Packit 98cdb6
/* set/get selectable flag of a single row */
Packit 98cdb6
void gtk_clist_set_selectable (GtkCList *clist,
Packit 98cdb6
			       gint      row,
Packit 98cdb6
			       gboolean  selectable);
Packit 98cdb6
gboolean gtk_clist_get_selectable (GtkCList *clist,
Packit 98cdb6
				   gint      row);
Packit 98cdb6
Packit 98cdb6
/* prepend/append returns the index of the row you just added,
Packit 98cdb6
 * making it easier to append and modify a row
Packit 98cdb6
 */
Packit 98cdb6
gint gtk_clist_prepend (GtkCList    *clist,
Packit 98cdb6
		        gchar       *text[]);
Packit 98cdb6
gint gtk_clist_append  (GtkCList    *clist,
Packit 98cdb6
			gchar       *text[]);
Packit 98cdb6
Packit 98cdb6
/* inserts a row at index row and returns the row where it was
Packit 98cdb6
 * actually inserted (may be different from "row" in auto_sort mode)
Packit 98cdb6
 */
Packit 98cdb6
gint gtk_clist_insert (GtkCList    *clist,
Packit 98cdb6
		       gint         row,
Packit 98cdb6
		       gchar       *text[]);
Packit 98cdb6
Packit 98cdb6
/* removes row at index row */
Packit 98cdb6
void gtk_clist_remove (GtkCList *clist,
Packit 98cdb6
		       gint      row);
Packit 98cdb6
Packit 98cdb6
/* sets a arbitrary data pointer for a given row */
Packit 98cdb6
void gtk_clist_set_row_data (GtkCList *clist,
Packit 98cdb6
			     gint      row,
Packit 98cdb6
			     gpointer  data);
Packit 98cdb6
Packit 98cdb6
/* sets a data pointer for a given row with destroy notification */
Packit 98cdb6
void gtk_clist_set_row_data_full (GtkCList       *clist,
Packit 98cdb6
			          gint            row,
Packit 98cdb6
			          gpointer        data,
Packit 98cdb6
				  GDestroyNotify  destroy);
Packit 98cdb6
Packit 98cdb6
/* returns the data set for a row */
Packit 98cdb6
gpointer gtk_clist_get_row_data (GtkCList *clist,
Packit 98cdb6
				 gint      row);
Packit 98cdb6
Packit 98cdb6
/* givin a data pointer, find the first (and hopefully only!)
Packit 98cdb6
 * row that points to that data, or -1 if none do
Packit 98cdb6
 */
Packit 98cdb6
gint gtk_clist_find_row_from_data (GtkCList *clist,
Packit 98cdb6
				   gpointer  data);
Packit 98cdb6
Packit 98cdb6
/* force selection of a row */
Packit 98cdb6
void gtk_clist_select_row (GtkCList *clist,
Packit 98cdb6
			   gint      row,
Packit 98cdb6
			   gint      column);
Packit 98cdb6
Packit 98cdb6
/* force unselection of a row */
Packit 98cdb6
void gtk_clist_unselect_row (GtkCList *clist,
Packit 98cdb6
			     gint      row,
Packit 98cdb6
			     gint      column);
Packit 98cdb6
Packit 98cdb6
/* undo the last select/unselect operation */
Packit 98cdb6
void gtk_clist_undo_selection (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* clear the entire list -- this is much faster than removing
Packit 98cdb6
 * each item with gtk_clist_remove
Packit 98cdb6
 */
Packit 98cdb6
void gtk_clist_clear (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* return the row column corresponding to the x and y coordinates,
Packit 98cdb6
 * the returned values are only valid if the x and y coordinates
Packit 98cdb6
 * are respectively to a window == clist->clist_window
Packit 98cdb6
 */
Packit 98cdb6
gint gtk_clist_get_selection_info (GtkCList *clist,
Packit 98cdb6
			     	   gint      x,
Packit 98cdb6
			     	   gint      y,
Packit 98cdb6
			     	   gint     *row,
Packit 98cdb6
			     	   gint     *column);
Packit 98cdb6
Packit 98cdb6
/* in multiple or extended mode, select all rows */
Packit 98cdb6
void gtk_clist_select_all (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* in all modes except browse mode, deselect all rows */
Packit 98cdb6
void gtk_clist_unselect_all (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* swap the position of two rows */
Packit 98cdb6
void gtk_clist_swap_rows (GtkCList *clist,
Packit 98cdb6
			  gint      row1,
Packit 98cdb6
			  gint      row2);
Packit 98cdb6
Packit 98cdb6
/* move row from source_row position to dest_row position */
Packit 98cdb6
void gtk_clist_row_move (GtkCList *clist,
Packit 98cdb6
			 gint      source_row,
Packit 98cdb6
			 gint      dest_row);
Packit 98cdb6
Packit 98cdb6
/* sets a compare function different to the default */
Packit 98cdb6
void gtk_clist_set_compare_func (GtkCList            *clist,
Packit 98cdb6
				 GtkCListCompareFunc  cmp_func);
Packit 98cdb6
Packit 98cdb6
/* the column to sort by */
Packit 98cdb6
void gtk_clist_set_sort_column (GtkCList *clist,
Packit 98cdb6
				gint      column);
Packit 98cdb6
Packit 98cdb6
/* how to sort : ascending or descending */
Packit 98cdb6
void gtk_clist_set_sort_type (GtkCList    *clist,
Packit 98cdb6
			      GtkSortType  sort_type);
Packit 98cdb6
Packit 98cdb6
/* sort the list with the current compare function */
Packit 98cdb6
void gtk_clist_sort (GtkCList *clist);
Packit 98cdb6
Packit 98cdb6
/* Automatically sort upon insertion */
Packit 98cdb6
void gtk_clist_set_auto_sort (GtkCList *clist,
Packit 98cdb6
			      gboolean  auto_sort);
Packit 98cdb6
Packit 98cdb6
/* Private function for clist, ctree */
Packit 98cdb6
Packit 98cdb6
PangoLayout *_gtk_clist_create_cell_layout (GtkCList       *clist,
Packit 98cdb6
					    GtkCListRow    *clist_row,
Packit 98cdb6
					    gint            column);
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
G_END_DECLS
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
#endif				/* __GTK_CLIST_H__ */
Packit 98cdb6
Packit 98cdb6
#endif /* GTK_DISABLE_DEPRECATED */