00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef CP_GRID_H_
00033 #define CP_GRID_H_
00034
00035 #include <gtk/gtkcontainer.h>
00036 #include "cp-grid-item.h"
00037
00038 G_BEGIN_DECLS
00039
00040 #define GRID_MAXIMUM_NUMBER_OF_GRIDS 10
00041
00042 #define CP_GRID_FOCUS_FROM_ABOVE 0
00043 #define CP_GRID_FOCUS_FIRST 1
00044 #define CP_GRID_FOCUS_FROM_BELOW 2
00045 #define CP_GRID_FOCUS_LAST 3
00046
00047 #define CP_TYPE_GRID (cp_grid_get_type ())
00048 #define CP_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
00049 CP_TYPE_GRID, \
00050 CPGrid))
00051 #define CP_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
00052 CP_TYPE_GRID, \
00053 CPGridClass))
00054 #define CP_OBJECT_IS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
00055 CP_TYPE_GRID))
00056 #define CP_OBJECT_IS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
00057 CP_TYPE_GRID))
00058 #define CP_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
00059 CP_TYPE_GRID, \
00060 CPGridClass))
00061 typedef struct _CPGrid CPGrid;
00062 typedef struct _CPGridClass CPGridClass;
00063
00064
00065 struct _CPGrid {
00066 GtkContainer parent;
00067 };
00068
00069 struct _CPGridClass {
00070 GtkContainerClass parent_class;
00071
00072 void (*activate_child) (CPGrid * grid, CPGridItem * item);
00073 void (*popup_context_menu) (CPGrid * grid, CPGridItem * item);
00074 };
00075
00076 GType cp_grid_get_type(void) G_GNUC_CONST;
00077 GtkWidget *cp_grid_new(void);
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 void cp_grid_set_style(CPGrid * grid, const gchar * style_name);
00089 const gchar *cp_grid_get_style(CPGrid * grid);
00090
00091 void cp_grid_set_scrollbar_pos(CPGrid * grid, gint scrollbar_pos);
00092 gint cp_grid_get_scrollbar_pos(CPGrid * grid);
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 void cp_grid_activate_child(CPGrid * grid, CPGridItem * item);
00111
00112 gboolean cp_grid_has_focus(CPGrid *grid);
00113
00114 void cp_grid_focus_first_item(CPGrid *grid);
00115
00116
00117 G_END_DECLS
00118 #endif