[gimp/gtk3-port: 124/246] plug-ins: port lighting to GTK+ 3.0
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 124/246] plug-ins: port lighting to GTK+ 3.0
- Date: Sun, 27 Feb 2011 15:55:09 +0000 (UTC)
commit ed8ff9209a5b9d8f0595c15ea0c5c6366ee385c4
Author: Michael Natterer <mitch gimp org>
Date: Tue Nov 2 21:49:54 2010 +0100
plug-ins: port lighting to GTK+ 3.0
plug-ins/lighting/lighting-preview.c | 11 +-----
plug-ins/lighting/lighting-preview.h | 4 +-
plug-ins/lighting/lighting-ui.c | 64 +++++++++++++++++-----------------
3 files changed, 36 insertions(+), 43 deletions(-)
---
diff --git a/plug-ins/lighting/lighting-preview.c b/plug-ins/lighting/lighting-preview.c
index f3c5dc3..7d7598a 100644
--- a/plug-ins/lighting/lighting-preview.c
+++ b/plug-ins/lighting/lighting-preview.c
@@ -387,7 +387,6 @@ preview_compute (void)
compute_preview_rectangle (&startx, &starty, &pw, &ph);
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
-
gdk_window_set_cursor (gtk_widget_get_window (previewarea), cursor);
gdk_cursor_unref (cursor);
@@ -438,13 +437,9 @@ preview_events (GtkWidget *area,
}
gboolean
-preview_expose (GtkWidget *area,
- GdkEventExpose *eevent)
+preview_draw (GtkWidget *area,
+ cairo_t *cr)
{
- cairo_t *cr;
-
- cr = gdk_cairo_create (eevent->window);
-
cairo_set_source_surface (cr, preview_surface, 0.0, 0.0);
cairo_paint (cr);
@@ -455,8 +450,6 @@ preview_expose (GtkWidget *area,
draw_handles ();
}
- cairo_destroy (cr);
-
return FALSE;
}
diff --git a/plug-ins/lighting/lighting-preview.h b/plug-ins/lighting/lighting-preview.h
index f96edb0..2e15d2f 100644
--- a/plug-ins/lighting/lighting-preview.h
+++ b/plug-ins/lighting/lighting-preview.h
@@ -30,8 +30,8 @@ void preview_compute (void);
void interactive_preview_callback (GtkWidget *widget);
gboolean preview_events (GtkWidget *area,
GdkEvent *event);
-gboolean preview_expose (GtkWidget *area,
- GdkEventExpose *eevent);
+gboolean preview_draw (GtkWidget *area,
+ cairo_t *cr);
void update_light (gint xpos,
gint ypos);
diff --git a/plug-ins/lighting/lighting-ui.c b/plug-ins/lighting/lighting-ui.c
index 4480f49..34b588a 100644
--- a/plug-ins/lighting/lighting-ui.c
+++ b/plug-ins/lighting/lighting-ui.c
@@ -282,12 +282,12 @@ envmap_combo_callback (GtkWidget *widget,
static GtkWidget *
create_options_page (void)
{
- GtkWidget *page;
- GtkWidget *frame;
- GtkWidget *vbox;
- GtkWidget *toggle;
- GtkWidget *table;
- GtkObject *adj;
+ GtkWidget *page;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *toggle;
+ GtkWidget *table;
+ GtkAdjustment *adj;
page = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -366,13 +366,13 @@ create_options_page (void)
static GtkWidget *
create_light_page (void)
{
- GtkWidget *page;
- GtkWidget *frame;
- GtkWidget *table;
- GtkWidget *button;
- GtkObject *adj;
- GtkWidget *label;
- gint k = mapvals.light_selected;
+ GtkWidget *page;
+ GtkWidget *frame;
+ GtkWidget *table;
+ GtkWidget *button;
+ GtkAdjustment *adj;
+ GtkWidget *label;
+ gint k = mapvals.light_selected;
page = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -606,16 +606,16 @@ create_light_page (void)
static GtkWidget *
create_material_page (void)
{
- GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- GtkWidget *page;
- GtkWidget *frame;
- GtkWidget *table;
- GtkWidget *label;
- GtkWidget *hbox;
- GtkWidget *spinbutton;
- GtkWidget *image;
- GtkWidget *button;
- GtkObject *adj;
+ GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ GtkWidget *page;
+ GtkWidget *frame;
+ GtkWidget *table;
+ GtkWidget *label;
+ GtkWidget *hbox;
+ GtkWidget *spinbutton;
+ GtkWidget *image;
+ GtkWidget *button;
+ GtkAdjustment *adj;
page = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -787,13 +787,13 @@ create_material_page (void)
static GtkWidget *
create_bump_page (void)
{
- GtkWidget *page;
- GtkWidget *toggle;
- GtkWidget *frame;
- GtkWidget *table;
- GtkWidget *combo;
- GtkWidget *spinbutton;
- GtkObject *adj;
+ GtkWidget *page;
+ GtkWidget *toggle;
+ GtkWidget *frame;
+ GtkWidget *table;
+ GtkWidget *combo;
+ GtkWidget *spinbutton;
+ GtkAdjustment *adj;
page = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -1066,8 +1066,8 @@ main_dialog (GimpDrawable *drawable)
g_signal_connect (previewarea, "event",
G_CALLBACK (preview_events),
previewarea);
- g_signal_connect (previewarea, "expose-event",
- G_CALLBACK (preview_expose),
+ g_signal_connect (previewarea, "draw",
+ G_CALLBACK (preview_draw),
previewarea);
gtk_container_add (GTK_CONTAINER (frame), previewarea);
gtk_widget_show (previewarea);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]