forked from AuroraMiddleware/gtk
Drop GtkGLArea::has-alpha
We now always behave as if has-alpha is TRUE. Update all callers.
This commit is contained in:
parent
5711fb9b26
commit
f3927f1155
@ -154,7 +154,6 @@ typedef struct {
|
||||
guint texture;
|
||||
guint depth_stencil_buffer;
|
||||
|
||||
gboolean has_alpha;
|
||||
gboolean has_depth_buffer;
|
||||
gboolean has_stencil_buffer;
|
||||
|
||||
@ -168,7 +167,6 @@ enum {
|
||||
PROP_0,
|
||||
|
||||
PROP_CONTEXT,
|
||||
PROP_HAS_ALPHA,
|
||||
PROP_HAS_DEPTH_BUFFER,
|
||||
PROP_HAS_STENCIL_BUFFER,
|
||||
PROP_USE_ES,
|
||||
@ -219,10 +217,6 @@ gtk_gl_area_set_property (GObject *gobject,
|
||||
gtk_gl_area_set_auto_render (self, g_value_get_boolean (value));
|
||||
break;
|
||||
|
||||
case PROP_HAS_ALPHA:
|
||||
gtk_gl_area_set_has_alpha (self, g_value_get_boolean (value));
|
||||
break;
|
||||
|
||||
case PROP_HAS_DEPTH_BUFFER:
|
||||
gtk_gl_area_set_has_depth_buffer (self, g_value_get_boolean (value));
|
||||
break;
|
||||
@ -254,10 +248,6 @@ gtk_gl_area_get_property (GObject *gobject,
|
||||
g_value_set_boolean (value, priv->auto_render);
|
||||
break;
|
||||
|
||||
case PROP_HAS_ALPHA:
|
||||
g_value_set_boolean (value, priv->has_alpha);
|
||||
break;
|
||||
|
||||
case PROP_HAS_DEPTH_BUFFER:
|
||||
g_value_set_boolean (value, priv->has_depth_buffer);
|
||||
break;
|
||||
@ -732,27 +722,6 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkGLArea:has-alpha:
|
||||
*
|
||||
* If set to %TRUE the buffer allocated by the widget will have an alpha channel
|
||||
* component, and when rendering to the window the result will be composited over
|
||||
* whatever is below the widget.
|
||||
*
|
||||
* If set to %FALSE there will be no alpha channel, and the buffer will fully
|
||||
* replace anything below the widget.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_props[PROP_HAS_ALPHA] =
|
||||
g_param_spec_boolean ("has-alpha",
|
||||
P_("Has alpha"),
|
||||
P_("Whether the color buffer has an alpha component"),
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkGLArea:has-depth-buffer:
|
||||
*
|
||||
@ -1071,60 +1040,6 @@ gtk_gl_area_get_required_version (GtkGLArea *area,
|
||||
*minor = priv->required_gl_version % 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_gl_area_get_has_alpha:
|
||||
* @area: a #GtkGLArea
|
||||
*
|
||||
* Returns whether the area has an alpha component.
|
||||
*
|
||||
* Returns: %TRUE if the @area has an alpha component, %FALSE otherwise
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
gboolean
|
||||
gtk_gl_area_get_has_alpha (GtkGLArea *area)
|
||||
{
|
||||
GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
|
||||
|
||||
g_return_val_if_fail (GTK_IS_GL_AREA (area), FALSE);
|
||||
|
||||
return priv->has_alpha;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_gl_area_set_has_alpha:
|
||||
* @area: a #GtkGLArea
|
||||
* @has_alpha: %TRUE to add an alpha component
|
||||
*
|
||||
* If @has_alpha is %TRUE the buffer allocated by the widget will have
|
||||
* an alpha channel component, and when rendering to the window the
|
||||
* result will be composited over whatever is below the widget.
|
||||
*
|
||||
* If @has_alpha is %FALSE there will be no alpha channel, and the
|
||||
* buffer will fully replace anything below the widget.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gtk_gl_area_set_has_alpha (GtkGLArea *area,
|
||||
gboolean has_alpha)
|
||||
{
|
||||
GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
|
||||
|
||||
g_return_if_fail (GTK_IS_GL_AREA (area));
|
||||
|
||||
has_alpha = !!has_alpha;
|
||||
|
||||
if (priv->has_alpha != has_alpha)
|
||||
{
|
||||
priv->has_alpha = has_alpha;
|
||||
|
||||
g_object_notify (G_OBJECT (area), "has-alpha");
|
||||
|
||||
gtk_gl_area_delete_buffers (area);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_gl_area_get_has_depth_buffer:
|
||||
* @area: a #GtkGLArea
|
||||
|
@ -99,11 +99,6 @@ void gtk_gl_area_get_required_version (GtkGLArea *area,
|
||||
gint *major,
|
||||
gint *minor);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gtk_gl_area_get_has_alpha (GtkGLArea *area);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gtk_gl_area_set_has_alpha (GtkGLArea *area,
|
||||
gboolean has_alpha);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
gboolean gtk_gl_area_get_has_depth_buffer (GtkGLArea *area);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gtk_gl_area_set_has_depth_buffer (GtkGLArea *area,
|
||||
|
@ -7,14 +7,6 @@
|
||||
* DEMO CODE *
|
||||
************************************************************************/
|
||||
|
||||
static void
|
||||
toggle_alpha (GtkWidget *checkbutton,
|
||||
GtkWidget *gears)
|
||||
{
|
||||
gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears),
|
||||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton)));
|
||||
}
|
||||
|
||||
static void
|
||||
toggle_overlay (GtkWidget *checkbutton,
|
||||
GtkWidget *revealer)
|
||||
@ -187,13 +179,6 @@ main (int argc, char *argv[])
|
||||
g_signal_connect (check, "toggled",
|
||||
G_CALLBACK (toggle_spin), spinner);
|
||||
|
||||
check = gtk_check_button_new_with_label ("Alpha");
|
||||
gtk_box_pack_end (GTK_BOX (hbox), check);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
|
||||
gtk_widget_show (check);
|
||||
g_signal_connect (check, "toggled",
|
||||
G_CALLBACK (toggle_alpha), gears);
|
||||
|
||||
check = gtk_check_button_new_with_label ("Overlay");
|
||||
gtk_box_pack_end (GTK_BOX (hbox), check);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
|
||||
|
@ -38,12 +38,6 @@ main (int argc, char *argv[])
|
||||
gtk_widget_set_size_request (gears, 70, 50);
|
||||
gtk_fixed_put (GTK_FIXED (fixed), gears, 60, 100);
|
||||
|
||||
gears = gtk_gears_new ();
|
||||
gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears), TRUE);
|
||||
gtk_widget_set_size_request (gears, 70, 50);
|
||||
gtk_fixed_put (GTK_FIXED (fixed), gears, 120, 100);
|
||||
|
||||
|
||||
spinner = gtk_spinner_new ();
|
||||
gtk_spinner_start (GTK_SPINNER (spinner));
|
||||
gtk_widget_set_size_request (spinner, 50, 50);
|
||||
@ -64,12 +58,6 @@ main (int argc, char *argv[])
|
||||
gtk_widget_set_size_request (gears, 70, 50);
|
||||
gtk_fixed_put (GTK_FIXED (fixed), gears, 60, 130);
|
||||
|
||||
gears = gtk_gears_new ();
|
||||
gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears), TRUE);
|
||||
gtk_widget_set_size_request (gears, 70, 50);
|
||||
gtk_fixed_put (GTK_FIXED (fixed), gears, 120, 130);
|
||||
|
||||
|
||||
spinner = gtk_spinner_new ();
|
||||
gtk_spinner_start (GTK_SPINNER (spinner));
|
||||
gtk_widget_set_size_request (spinner, 50, 50);
|
||||
|
Loading…
Reference in New Issue
Block a user