Added GtkCellRendererState flags to GtkCellArea->event/render() methods
This commit is contained in:
@ -628,11 +628,12 @@ gtk_cell_area_forall (GtkCellArea *area,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
gtk_cell_area_event (GtkCellArea *area,
|
gtk_cell_area_event (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
const GdkRectangle *cell_area)
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags)
|
||||||
{
|
{
|
||||||
GtkCellAreaClass *class;
|
GtkCellAreaClass *class;
|
||||||
|
|
||||||
@ -645,7 +646,7 @@ gtk_cell_area_event (GtkCellArea *area,
|
|||||||
class = GTK_CELL_AREA_GET_CLASS (area);
|
class = GTK_CELL_AREA_GET_CLASS (area);
|
||||||
|
|
||||||
if (class->event)
|
if (class->event)
|
||||||
return class->event (area, iter, widget, event, cell_area);
|
return class->event (area, iter, widget, event, cell_area, flags);
|
||||||
|
|
||||||
g_warning ("GtkCellAreaClass::event not implemented for `%s'",
|
g_warning ("GtkCellAreaClass::event not implemented for `%s'",
|
||||||
g_type_name (G_TYPE_FROM_INSTANCE (area)));
|
g_type_name (G_TYPE_FROM_INSTANCE (area)));
|
||||||
@ -653,11 +654,12 @@ gtk_cell_area_event (GtkCellArea *area,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_cell_area_render (GtkCellArea *area,
|
gtk_cell_area_render (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
const GdkRectangle *cell_area)
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags)
|
||||||
{
|
{
|
||||||
GtkCellAreaClass *class;
|
GtkCellAreaClass *class;
|
||||||
|
|
||||||
@ -670,7 +672,7 @@ gtk_cell_area_render (GtkCellArea *area,
|
|||||||
class = GTK_CELL_AREA_GET_CLASS (area);
|
class = GTK_CELL_AREA_GET_CLASS (area);
|
||||||
|
|
||||||
if (class->render)
|
if (class->render)
|
||||||
class->render (area, iter, widget, cr, cell_area);
|
class->render (area, iter, widget, cr, cell_area, flags);
|
||||||
else
|
else
|
||||||
g_warning ("GtkCellAreaClass::render not implemented for `%s'",
|
g_warning ("GtkCellAreaClass::render not implemented for `%s'",
|
||||||
g_type_name (G_TYPE_FROM_INSTANCE (area)));
|
g_type_name (G_TYPE_FROM_INSTANCE (area)));
|
||||||
|
|||||||
@ -83,12 +83,14 @@ struct _GtkCellAreaClass
|
|||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
const GdkRectangle *cell_area);
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags);
|
||||||
void (* render) (GtkCellArea *area,
|
void (* render) (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
const GdkRectangle *cell_area);
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags);
|
||||||
|
|
||||||
/* Geometry */
|
/* Geometry */
|
||||||
GtkCellAreaIter *(* create_iter) (GtkCellArea *area);
|
GtkCellAreaIter *(* create_iter) (GtkCellArea *area);
|
||||||
@ -142,23 +144,25 @@ struct _GtkCellAreaClass
|
|||||||
GType gtk_cell_area_get_type (void) G_GNUC_CONST;
|
GType gtk_cell_area_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
/* Basic methods */
|
/* Basic methods */
|
||||||
void gtk_cell_area_add (GtkCellArea *area,
|
void gtk_cell_area_add (GtkCellArea *area,
|
||||||
GtkCellRenderer *renderer);
|
GtkCellRenderer *renderer);
|
||||||
void gtk_cell_area_remove (GtkCellArea *area,
|
void gtk_cell_area_remove (GtkCellArea *area,
|
||||||
GtkCellRenderer *renderer);
|
GtkCellRenderer *renderer);
|
||||||
void gtk_cell_area_forall (GtkCellArea *area,
|
void gtk_cell_area_forall (GtkCellArea *area,
|
||||||
GtkCellCallback callback,
|
GtkCellCallback callback,
|
||||||
gpointer callback_data);
|
gpointer callback_data);
|
||||||
gint gtk_cell_area_event (GtkCellArea *area,
|
gint gtk_cell_area_event (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
const GdkRectangle *cell_area);
|
const GdkRectangle *cell_area,
|
||||||
void gtk_cell_area_render (GtkCellArea *area,
|
GtkCellRendererState flags);
|
||||||
GtkCellAreaIter *iter,
|
void gtk_cell_area_render (GtkCellArea *area,
|
||||||
GtkWidget *widget,
|
GtkCellAreaIter *iter,
|
||||||
cairo_t *cr,
|
GtkWidget *widget,
|
||||||
const GdkRectangle *cell_area);
|
cairo_t *cr,
|
||||||
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags);
|
||||||
|
|
||||||
/* Geometry */
|
/* Geometry */
|
||||||
GtkCellAreaIter *gtk_cell_area_create_iter (GtkCellArea *area);
|
GtkCellAreaIter *gtk_cell_area_create_iter (GtkCellArea *area);
|
||||||
|
|||||||
@ -31,71 +31,73 @@
|
|||||||
|
|
||||||
|
|
||||||
/* GObjectClass */
|
/* GObjectClass */
|
||||||
static void gtk_cell_area_box_finalize (GObject *object);
|
static void gtk_cell_area_box_finalize (GObject *object);
|
||||||
static void gtk_cell_area_box_dispose (GObject *object);
|
static void gtk_cell_area_box_dispose (GObject *object);
|
||||||
static void gtk_cell_area_box_set_property (GObject *object,
|
static void gtk_cell_area_box_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gtk_cell_area_box_get_property (GObject *object,
|
static void gtk_cell_area_box_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
/* GtkCellAreaClass */
|
/* GtkCellAreaClass */
|
||||||
static void gtk_cell_area_box_add (GtkCellArea *area,
|
static void gtk_cell_area_box_add (GtkCellArea *area,
|
||||||
GtkCellRenderer *renderer);
|
GtkCellRenderer *renderer);
|
||||||
static void gtk_cell_area_box_remove (GtkCellArea *area,
|
static void gtk_cell_area_box_remove (GtkCellArea *area,
|
||||||
GtkCellRenderer *renderer);
|
GtkCellRenderer *renderer);
|
||||||
static void gtk_cell_area_box_forall (GtkCellArea *area,
|
static void gtk_cell_area_box_forall (GtkCellArea *area,
|
||||||
GtkCellCallback callback,
|
GtkCellCallback callback,
|
||||||
gpointer callback_data);
|
gpointer callback_data);
|
||||||
static gint gtk_cell_area_box_event (GtkCellArea *area,
|
static gint gtk_cell_area_box_event (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
const GdkRectangle *cell_area);
|
const GdkRectangle *cell_area,
|
||||||
static void gtk_cell_area_box_render (GtkCellArea *area,
|
GtkCellRendererState flags);
|
||||||
GtkCellAreaIter *iter,
|
static void gtk_cell_area_box_render (GtkCellArea *area,
|
||||||
GtkWidget *widget,
|
GtkCellAreaIter *iter,
|
||||||
cairo_t *cr,
|
GtkWidget *widget,
|
||||||
const GdkRectangle *cell_area);
|
cairo_t *cr,
|
||||||
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags);
|
||||||
|
|
||||||
static void gtk_cell_area_box_set_cell_property (GtkCellArea *area,
|
static void gtk_cell_area_box_set_cell_property (GtkCellArea *area,
|
||||||
GtkCellRenderer *renderer,
|
GtkCellRenderer *renderer,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gtk_cell_area_box_get_cell_property (GtkCellArea *area,
|
static void gtk_cell_area_box_get_cell_property (GtkCellArea *area,
|
||||||
GtkCellRenderer *renderer,
|
GtkCellRenderer *renderer,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static GtkCellAreaIter *gtk_cell_area_box_create_iter (GtkCellArea *area);
|
static GtkCellAreaIter *gtk_cell_area_box_create_iter (GtkCellArea *area);
|
||||||
static GtkSizeRequestMode gtk_cell_area_box_get_request_mode (GtkCellArea *area);
|
static GtkSizeRequestMode gtk_cell_area_box_get_request_mode (GtkCellArea *area);
|
||||||
static void gtk_cell_area_box_get_preferred_width (GtkCellArea *area,
|
static void gtk_cell_area_box_get_preferred_width (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
gint *minimum_width,
|
gint *minimum_width,
|
||||||
gint *natural_width);
|
gint *natural_width);
|
||||||
static void gtk_cell_area_box_get_preferred_height (GtkCellArea *area,
|
static void gtk_cell_area_box_get_preferred_height (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
gint *minimum_height,
|
gint *minimum_height,
|
||||||
gint *natural_height);
|
gint *natural_height);
|
||||||
static void gtk_cell_area_box_get_preferred_height_for_width (GtkCellArea *area,
|
static void gtk_cell_area_box_get_preferred_height_for_width (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
gint width,
|
gint width,
|
||||||
gint *minimum_height,
|
gint *minimum_height,
|
||||||
gint *natural_height);
|
gint *natural_height);
|
||||||
static void gtk_cell_area_box_get_preferred_width_for_height (GtkCellArea *area,
|
static void gtk_cell_area_box_get_preferred_width_for_height (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
gint height,
|
gint height,
|
||||||
gint *minimum_width,
|
gint *minimum_width,
|
||||||
gint *natural_width);
|
gint *natural_width);
|
||||||
|
|
||||||
/* GtkCellLayoutIface */
|
/* GtkCellLayoutIface */
|
||||||
static void gtk_cell_area_box_cell_layout_init (GtkCellLayoutIface *iface);
|
static void gtk_cell_area_box_cell_layout_init (GtkCellLayoutIface *iface);
|
||||||
@ -751,11 +753,12 @@ gtk_cell_area_box_forall (GtkCellArea *area,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
gtk_cell_area_box_event (GtkCellArea *area,
|
gtk_cell_area_box_event (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
const GdkRectangle *cell_area)
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@ -763,11 +766,12 @@ gtk_cell_area_box_event (GtkCellArea *area,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_cell_area_box_render (GtkCellArea *area,
|
gtk_cell_area_box_render (GtkCellArea *area,
|
||||||
GtkCellAreaIter *iter,
|
GtkCellAreaIter *iter,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
const GdkRectangle *cell_area)
|
const GdkRectangle *cell_area,
|
||||||
|
GtkCellRendererState flags)
|
||||||
{
|
{
|
||||||
GtkCellAreaBox *box = GTK_CELL_AREA_BOX (area);
|
GtkCellAreaBox *box = GTK_CELL_AREA_BOX (area);
|
||||||
GtkCellAreaBoxPrivate *priv = box->priv;
|
GtkCellAreaBoxPrivate *priv = box->priv;
|
||||||
@ -800,9 +804,11 @@ gtk_cell_area_box_render (GtkCellArea *area,
|
|||||||
*/
|
*/
|
||||||
gtk_cell_area_inner_cell_area (area, &background_area, &inner_area);
|
gtk_cell_area_inner_cell_area (area, &background_area, &inner_area);
|
||||||
|
|
||||||
|
/* XXX We have to do some per-cell considerations for the 'flags'
|
||||||
|
* for focus handling */
|
||||||
gtk_cell_renderer_render (cell->renderer, cr, widget,
|
gtk_cell_renderer_render (cell->renderer, cr, widget,
|
||||||
&background_area, &inner_area,
|
&background_area, &inner_area,
|
||||||
/* flags */0);
|
flags);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user