Gtk2

 view release on metacpan or  search on metacpan

xs/GtkWidget.xs  view on Meta::CPAN

#	guint          * n_properties

=for apidoc Gtk2::Widget::list_style_properties
=for signature list = $widget_or_class_name->list_style_properties
=for arg ... (__hide__)
Return a list of C<Glib::ParamSpec> objects which are the style
properties available on C<$widget_or_class_name>.  See L<Glib::Object>
C<list_properties> for the fields in a ParamSpec.
=cut
=for apidoc Gtk2::Widget::find_style_property
=for signature pspec or undef = $widget_or_class_name->find_style_property ($name)
=for arg name (string)
=for arg ... (__hide__)
Return a C<Glib::ParamSpec> for style property C<$name> on widget
C<$widget_or_class_name>.  If there's no property C<$name> then return
C<undef>.  See L<Glib::Object> C<list_properties> for the fields in a
ParamSpec.
=cut
void
find_style_property (widget_or_class_name, ...)
	SV * widget_or_class_name
    ALIAS:
        Gtk2::Widget::list_style_properties = 1
    PREINIT:
	GType type;
	gchar *name = NULL;
	GtkWidgetClass *widget_class;
    PPCODE:
	/* ENHANCE-ME: share this SV to GType lookup code with
	   Glib::Object::find_property and Gtk2::Container::find_child_property
	   and probably other places.  Might pass GTK_TYPE_WIDGET to say it
	   should be a widget. */
	if (gperl_sv_is_defined (widget_or_class_name) &&
	    SvROK (widget_or_class_name)) {
		GtkWidget * widget = SvGtkWidget (widget_or_class_name);
		if (!widget)
			croak ("wha?  NULL widget in list_style_properties");
		type = G_OBJECT_TYPE (widget);
	} else {
		type = gperl_object_type_from_package
			(SvPV_nolen (widget_or_class_name));
		if (!type)
			croak ("package %s is not registered with GPerl",
			       SvPV_nolen (widget_or_class_name));
	}

	switch (ix) {
	case 0:
		if (items != 2)
			croak ("Usage: Gtk2::Widget::find_style_property (class, name)");
		name = SvGChar (ST (1));
		break;
	default: /* ix==1 */
		if (items != 1)
			croak ("Usage: Gtk2::Widget::list_style_properties (class)");
		break;
	}
	if (! g_type_is_a (type, GTK_TYPE_WIDGET))
		croak ("Not a Gtk2::Widget");

	/* classes registered by perl are kept alive by the bindings.
	 * those coming straight from C are not.  if we had an actual
	 * widget, the class will be alive, but if we just had a
	 * package, the class may not exist yet.  thus, we'll have to
	 * do an honest ref here, rather than a peek.
	 */
	widget_class = g_type_class_ref (type);

	if (ix == 0) {
		GParamSpec *pspec
		  = gtk_widget_class_find_style_property
		      (widget_class, name);
		XPUSHs (pspec
			? sv_2mortal (newSVGParamSpec (pspec))
			: &PL_sv_undef);
	}
	else if (ix == 1) {
		GParamSpec **props;
		guint n_props, i;
		props = gtk_widget_class_list_style_properties
			  (widget_class, &n_props);
		if (n_props) {
			EXTEND (SP, n_props);
			for (i = 0; i < n_props; i++)
				PUSHs (sv_2mortal (newSVGParamSpec (props[i])));
		}
		g_free (props); /* must free even when n_props==0 */
	}

	g_type_class_unref (widget_class);


#GtkClipboard* gtk_widget_get_clipboard (GtkWidget *widget, GdkAtom selection)
GtkClipboard *
gtk_widget_get_clipboard (widget, selection=GDK_SELECTION_CLIPBOARD)
	GtkWidget * widget
	GdkAtom     selection


GdkDisplay * gtk_widget_get_display (GtkWidget * widget)

GdkWindow * gtk_widget_get_root_window (GtkWidget * widget)

GdkScreen * gtk_widget_get_screen (GtkWidget * widget)

gboolean gtk_widget_has_screen (GtkWidget * widget);

#endif


#if GTK_CHECK_VERSION(2,4,0)

void gtk_widget_set_no_show_all (GtkWidget *widget, gboolean no_show_all);

gboolean gtk_widget_get_no_show_all (GtkWidget *widget);

void gtk_widget_queue_resize_no_redraw (GtkWidget *widget);

gboolean
gtk_widget_can_activate_accel (widget, signal_id)
	GtkWidget *widget
	guint signal_id



( run in 0.626 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )