mirror of https://github.com/GNOME/gimp.git
app: port the splash to GTK+ 3.0
This commit is contained in:
parent
05e5a1d1cd
commit
bb6c901364
|
@ -71,14 +71,14 @@ static void splash_position_layouts (GimpSplash *splash,
|
||||||
const gchar *text1,
|
const gchar *text1,
|
||||||
const gchar *text2,
|
const gchar *text2,
|
||||||
GdkRectangle *area);
|
GdkRectangle *area);
|
||||||
static gboolean splash_area_expose (GtkWidget *widget,
|
static gboolean splash_area_draw (GtkWidget *widget,
|
||||||
GdkEventExpose *event,
|
cairo_t *cr,
|
||||||
GimpSplash *splash);
|
GimpSplash *splash);
|
||||||
static void splash_rectangle_union (GdkRectangle *dest,
|
static void splash_rectangle_union (GdkRectangle *dest,
|
||||||
PangoRectangle *pango_rect,
|
PangoRectangle *pango_rect,
|
||||||
gint offset_x,
|
gint offset_x,
|
||||||
gint offset_y);
|
gint offset_y);
|
||||||
static gboolean splash_average_text_area (GimpSplash *splash,
|
static void splash_average_text_area (GimpSplash *splash,
|
||||||
GdkPixbuf *pixbuf,
|
GdkPixbuf *pixbuf,
|
||||||
GdkColor *color);
|
GdkColor *color);
|
||||||
|
|
||||||
|
@ -197,9 +197,9 @@ splash_create (gboolean be_verbose,
|
||||||
|
|
||||||
g_object_unref (pixbuf);
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
g_signal_connect_after (splash->area, "expose-event",
|
g_signal_connect_after (splash->area, "draw",
|
||||||
G_CALLBACK (splash_area_expose),
|
G_CALLBACK (splash_area_draw),
|
||||||
splash);
|
splash);
|
||||||
|
|
||||||
/* add a progress bar */
|
/* add a progress bar */
|
||||||
splash->progress = gtk_progress_bar_new ();
|
splash->progress = gtk_progress_bar_new ();
|
||||||
|
@ -289,15 +289,10 @@ splash_update (const gchar *text1,
|
||||||
/* private functions */
|
/* private functions */
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
splash_area_expose (GtkWidget *widget,
|
splash_area_draw (GtkWidget *widget,
|
||||||
GdkEventExpose *event,
|
cairo_t *cr,
|
||||||
GimpSplash *splash)
|
GimpSplash *splash)
|
||||||
{
|
{
|
||||||
cairo_t *cr = gdk_cairo_create (event->window);
|
|
||||||
|
|
||||||
gdk_cairo_region (cr, event->region);
|
|
||||||
cairo_clip (cr);
|
|
||||||
|
|
||||||
gdk_cairo_set_source_color (cr, &splash->color);
|
gdk_cairo_set_source_color (cr, &splash->color);
|
||||||
|
|
||||||
cairo_move_to (cr, splash->upper_x, splash->upper_y);
|
cairo_move_to (cr, splash->upper_x, splash->upper_y);
|
||||||
|
@ -306,8 +301,6 @@ splash_area_expose (GtkWidget *widget,
|
||||||
cairo_move_to (cr, splash->lower_x, splash->lower_y);
|
cairo_move_to (cr, splash->lower_x, splash->lower_y);
|
||||||
pango_cairo_show_layout (cr, splash->lower);
|
pango_cairo_show_layout (cr, splash->lower);
|
||||||
|
|
||||||
cairo_destroy (cr);
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +406,7 @@ splash_rectangle_union (GdkRectangle *dest,
|
||||||
/* This function chooses a gray value for the text color, based on
|
/* This function chooses a gray value for the text color, based on
|
||||||
* the average luminance of the text area of the splash image.
|
* the average luminance of the text area of the splash image.
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static void
|
||||||
splash_average_text_area (GimpSplash *splash,
|
splash_average_text_area (GimpSplash *splash,
|
||||||
GdkPixbuf *pixbuf,
|
GdkPixbuf *pixbuf,
|
||||||
GdkColor *color)
|
GdkColor *color)
|
||||||
|
@ -426,8 +419,8 @@ splash_average_text_area (GimpSplash *splash,
|
||||||
GdkRectangle image = { 0, 0, 0, 0 };
|
GdkRectangle image = { 0, 0, 0, 0 };
|
||||||
GdkRectangle area = { 0, 0, 0, 0 };
|
GdkRectangle area = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), FALSE);
|
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
|
||||||
g_return_val_if_fail (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8, FALSE);
|
g_return_if_fail (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8);
|
||||||
|
|
||||||
image.width = gdk_pixbuf_get_width (pixbuf);
|
image.width = gdk_pixbuf_get_width (pixbuf);
|
||||||
image.height = gdk_pixbuf_get_height (pixbuf);
|
image.height = gdk_pixbuf_get_height (pixbuf);
|
||||||
|
@ -472,9 +465,6 @@ splash_average_text_area (GimpSplash *splash,
|
||||||
}
|
}
|
||||||
|
|
||||||
color->red = color->green = color->blue = (luminance << 8 | luminance);
|
color->red = color->green = color->blue = (luminance << 8 | luminance);
|
||||||
|
|
||||||
return gdk_colormap_alloc_color (gtk_widget_get_colormap (splash->area),
|
|
||||||
color, FALSE, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkPixbufAnimation *
|
static GdkPixbufAnimation *
|
||||||
|
|
Loading…
Reference in New Issue