gtkcelllayout.h

00001 /* gtkcelllayout.h
00002  * Copyright (C) 2003  Kristian Rietveld  <kris@gtk.org>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02111-1301, USA.
00018  */
00019 
00020 #ifndef __GTK_CELL_LAYOUT_H__
00021 #define __GTK_CELL_LAYOUT_H__
00022 
00023 #include <glib-object.h>
00024 
00025 #include <gtk/gtkcellrenderer.h>
00026 #include <gtk/gtktreeviewcolumn.h>
00027 
00028 G_BEGIN_DECLS
00029 
00030 #define GTK_TYPE_CELL_LAYOUT            (gtk_cell_layout_get_type ())
00031 #define GTK_CELL_LAYOUT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_LAYOUT, GtkCellLayout))
00032 #define GTK_IS_CELL_LAYOUT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_LAYOUT))
00033 #define GTK_CELL_LAYOUT_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_CELL_LAYOUT, GtkCellLayoutIface))
00034 
00035 typedef struct _GtkCellLayout           GtkCellLayout; /* dummy typedef */
00036 typedef struct _GtkCellLayoutIface      GtkCellLayoutIface;
00037 
00038 /* keep in sync with GtkTreeCellDataFunc */
00039 typedef void (* GtkCellLayoutDataFunc) (GtkCellLayout   *cell_layout,
00040                                         GtkCellRenderer *cell,
00041                                         GtkTreeModel    *tree_model,
00042                                         GtkTreeIter     *iter,
00043                                         gpointer         data);
00044 
00045 struct _GtkCellLayoutIface
00046 {
00047   GTypeInterface g_iface;
00048 
00049   /* Virtual Table */
00050   void (* pack_start)         (GtkCellLayout         *cell_layout,
00051                                GtkCellRenderer       *cell,
00052                                gboolean               expand);
00053   void (* pack_end)           (GtkCellLayout         *cell_layout,
00054                                GtkCellRenderer       *cell,
00055                                gboolean               expand);
00056   void (* clear)              (GtkCellLayout         *cell_layout);
00057   void (* add_attribute)      (GtkCellLayout         *cell_layout,
00058                                GtkCellRenderer       *cell,
00059                                const gchar           *attribute,
00060                                gint                   column);
00061   void (* set_cell_data_func) (GtkCellLayout         *cell_layout,
00062                                GtkCellRenderer       *cell,
00063                                GtkCellLayoutDataFunc  func,
00064                                gpointer               func_data,
00065                                GDestroyNotify         destroy);
00066   void (* clear_attributes)   (GtkCellLayout         *cell_layout,
00067                                GtkCellRenderer       *cell);
00068   void (* reorder)            (GtkCellLayout         *cell_layout,
00069                                GtkCellRenderer       *cell,
00070                                gint                   position);
00071 };
00072 
00073 GType gtk_cell_layout_get_type           (void);
00074 void  gtk_cell_layout_pack_start         (GtkCellLayout         *cell_layout,
00075                                           GtkCellRenderer       *cell,
00076                                           gboolean               expand);
00077 void  gtk_cell_layout_pack_end           (GtkCellLayout         *cell_layout,
00078                                           GtkCellRenderer       *cell,
00079                                           gboolean               expand);
00080 void  gtk_cell_layout_clear              (GtkCellLayout         *cell_layout);
00081 void  gtk_cell_layout_set_attributes     (GtkCellLayout         *cell_layout,
00082                                           GtkCellRenderer       *cell,
00083                                           ...);
00084 void  gtk_cell_layout_add_attribute      (GtkCellLayout         *cell_layout,
00085                                           GtkCellRenderer       *cell,
00086                                           const gchar           *attribute,
00087                                           gint                   column);
00088 void  gtk_cell_layout_set_cell_data_func (GtkCellLayout         *cell_layout,
00089                                           GtkCellRenderer       *cell,
00090                                           GtkCellLayoutDataFunc  func,
00091                                           gpointer               func_data,
00092                                           GDestroyNotify         destroy);
00093 void  gtk_cell_layout_clear_attributes   (GtkCellLayout         *cell_layout,
00094                                           GtkCellRenderer       *cell);
00095 void  gtk_cell_layout_reorder            (GtkCellLayout         *cell_layout,
00096                                           GtkCellRenderer       *cell,
00097                                           gint                   position);
00098 
00099 
00100 G_END_DECLS
00101 
00102 #endif /* __GTK_CELL_LAYOUT_H__ */