Gtk2

 view release on metacpan or  search on metacpan

xs/GtkCellLayout.xs  view on Meta::CPAN


=over

=item $cell_layout  The cell layout instance

=item $cell         The cell renderer to set up

=item $model        The tree model

=item $iter         TreeIter of the row for which to set the values

=item $data         The I<$func_data> passed to C<set_cell_data_func>

=back

=cut
void gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell, SV * func, SV * func_data=NULL);
    CODE:
	if (gperl_sv_is_defined (func)) {
		GType param_types[4];
		GPerlCallback * callback;

		param_types[0] = GTK_TYPE_CELL_LAYOUT;
		param_types[1] = GTK_TYPE_CELL_RENDERER;
		param_types[2] = GTK_TYPE_TREE_MODEL;
		param_types[3] = GTK_TYPE_TREE_ITER;
		callback = gperl_callback_new (func, func_data, 4, param_types,
		                               G_TYPE_NONE);
		gtk_cell_layout_set_cell_data_func
		                    (cell_layout, cell,
		                     gtk2perl_cell_layout_data_func, callback,
			             (GDestroyNotify) gperl_callback_destroy);
	} else
		gtk_cell_layout_set_cell_data_func (cell_layout, cell,
						    NULL, NULL, NULL);

=for apidoc
Clears all existing attributes previously set with for I<$cell> with
C<add_attribute> or C<set_attributes>.
=cut
void gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell);

=for apidoc
Re-insert I<$cell> at I<$position>.  I<$cell> must already be packed into
I<$cell_layout>.
=cut
void gtk_cell_layout_reorder (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position)

#if GTK_CHECK_VERSION (2, 12, 0)

=for apidoc
Fetch all of the cell renderers which have been added to I<$cell_layout>.

Note that if there are no cells this functions returns 'undef' instead of an
empty list.
=cut
void
gtk_cell_layout_get_cells (GtkCellLayout *cell_layout)
    PREINIT:
	GList *result, *i;
    PPCODE:
	PUTBACK;
	result = gtk_cell_layout_get_cells (cell_layout);
	SPAGAIN;
	if (!result) /* can happen if the widget doesn't implement get_cells */
		XSRETURN_UNDEF;
	for (i = result; i != NULL; i = i->next)
		XPUSHs (sv_2mortal (newSVGtkCellRenderer (i->data)));
	g_list_free (result);

#endif

MODULE = Gtk2::CellLayout	PACKAGE = Gtk2::CellLayout::DataFunc

=for apidoc __hide__
=cut
void
invoke (SV *code, GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, data)
    PREINIT:
	Gtk2PerlCellLayoutDataFunc *wrapper;
    CODE:
	wrapper = INT2PTR (Gtk2PerlCellLayoutDataFunc*, SvIV (SvRV (code)));
	if (!wrapper || !wrapper->func)
		croak ("Invalid reference encountered in cell data func");
	wrapper->func (cell_layout, cell, tree_model, iter, wrapper->data);

void
DESTROY (SV *code)
    PREINIT:
	Gtk2PerlCellLayoutDataFunc *wrapper;
    CODE:
	if (!gperl_sv_is_defined (code) || !SvROK (code))
		return;
	wrapper = INT2PTR (Gtk2PerlCellLayoutDataFunc*, SvIV (SvRV (code)));
	if (wrapper && wrapper->destroy)
		wrapper->destroy (wrapper->data);
	if (wrapper)
		g_free (wrapper);



( run in 0.757 second using v1.01-cache-2.11-cpan-5511b514fd6 )