Example #1
0
void
gtksharp_override_virtual_method (GType g_type, const gchar *name, GCallback callback)
{
	guint id;
	GClosure *closure;
	if (g_type_class_peek (g_type) == NULL)
		g_type_class_ref (g_type);
	id = g_signal_lookup (name, g_type);
	closure = g_cclosure_new (callback, NULL, NULL);
	g_signal_override_class_closure (id, g_type, closure);
}
Example #2
0
static void
gtk_offscreen_box_class_init (GtkOffscreenBoxClass *klass)
{
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);

  widget_class->realize = gtk_offscreen_box_realize;
  widget_class->unrealize = gtk_offscreen_box_unrealize;
  widget_class->size_request = gtk_offscreen_box_size_request;
  widget_class->size_allocate = gtk_offscreen_box_size_allocate;
  widget_class->expose_event = gtk_offscreen_box_expose;

  g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
                                   GTK_TYPE_OFFSCREEN_BOX,
                                   g_cclosure_new (G_CALLBACK (gtk_offscreen_box_damage),
                                                   NULL, NULL));

  container_class->add = gtk_offscreen_box_add;
  container_class->remove = gtk_offscreen_box_remove;
  container_class->forall = gtk_offscreen_box_forall;
  container_class->child_type = gtk_offscreen_box_child_type;
}
Example #3
0
static void
gtk_mirror_bin_class_init (GtkMirrorBinClass *klass)
{
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);

  widget_class->realize = gtk_mirror_bin_realize;
  widget_class->unrealize = gtk_mirror_bin_unrealize;
  widget_class->size_request = gtk_mirror_bin_size_request;
  widget_class->size_allocate = gtk_mirror_bin_size_allocate;
  widget_class->expose_event = gtk_mirror_bin_expose;

  g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
                                   GTK_TYPE_MIRROR_BIN,
                                   g_cclosure_new (G_CALLBACK (gtk_mirror_bin_damage),
                                                   NULL, NULL));

  container_class->add = gtk_mirror_bin_add;
  container_class->remove = gtk_mirror_bin_remove;
  container_class->forall = gtk_mirror_bin_forall;
  container_class->child_type = gtk_mirror_bin_child_type;
}
Example #4
0
static void
gtk_rotated_bin_class_init (GtkRotatedBinClass *klass)
{
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);

  widget_class->realize = gtk_rotated_bin_realize;
  widget_class->unrealize = gtk_rotated_bin_unrealize;
  widget_class->get_preferred_width = gtk_rotated_bin_get_preferred_width;
  widget_class->get_preferred_height = gtk_rotated_bin_get_preferred_height;
  widget_class->size_allocate = gtk_rotated_bin_size_allocate;
  widget_class->draw = gtk_rotated_bin_draw;

  g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
                                   GTK_TYPE_ROTATED_BIN,
                                   g_cclosure_new (G_CALLBACK (gtk_rotated_bin_damage),
                                                   NULL, NULL));

  container_class->add = gtk_rotated_bin_add;
  container_class->remove = gtk_rotated_bin_remove;
  container_class->forall = gtk_rotated_bin_forall;
  container_class->child_type = gtk_rotated_bin_child_type;
}
Example #5
0
static void
widget_overlay_class_init (WidgetOverlayClass *klass)
{
	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
	GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);

	parent_class = g_type_class_peek_parent (klass);

	widget_class->realize = widget_overlay_realize;
	widget_class->unrealize = widget_overlay_unrealize;
	widget_class->get_preferred_width = widget_overlay_get_preferred_width;
	widget_class->get_preferred_height = widget_overlay_get_preferred_height;
	widget_class->size_allocate = widget_overlay_size_allocate;
	widget_class->draw = widget_overlay_draw;
	widget_class->event = widget_overlay_event;
	widget_class->show = widget_overlay_show;

	g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
					 WIDGET_OVERLAY_TYPE,
					 g_cclosure_new (G_CALLBACK (widget_overlay_damage),
							 NULL, NULL));

	container_class->add = widget_overlay_add;
	container_class->remove = widget_overlay_remove;
	container_class->forall = widget_overlay_forall;
	G_OBJECT_CLASS (klass)->dispose = widget_overlay_dispose;
	G_OBJECT_CLASS (klass)->finalize = widget_overlay_finalize;

	/* Properties */
        G_OBJECT_CLASS (klass)->set_property = widget_overlay_set_property;
        G_OBJECT_CLASS (klass)->get_property = widget_overlay_get_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_ADD_SCALE,
                                         g_param_spec_boolean ("add-scale", NULL, NULL,
                                                               FALSE,
                                                               (G_PARAM_READABLE | G_PARAM_WRITABLE)));
}