Compare commits

..

3 Commits

Author SHA1 Message Date
Matthias Clasen 49e93f6ee4 textview: Don't validate during snapshot
Do it during size_allocate, and go back there
if needed.
2023-02-21 15:04:30 -05:00
Matthias Clasen 4ec2234537 widget: Warn for invalidation during paint 2023-02-21 15:04:30 -05:00
Matthias Clasen 5a3755b233 frameclock: Add a debug helper
Begin able to query the current phase
is useful for debugging purposes.
2023-02-21 15:04:30 -05:00
60 changed files with 6189 additions and 6953 deletions
+2 -56
View File
@@ -1,59 +1,5 @@
Overview of Changes in 4.10.0, 04-03-2023
=========================================
* GtkTextView
- Document hanging indentation
* GtkListView
- Fix a size allocation problem
* GtkFileChooser
- Fix paned behavior
- Fix a crash
* GtkText
- Fix various problems with undo
* Accessibility
- Make some getters transfer-full
- Allow setting accessible parents and siblings
- Add a role for toggle buttons
- Miscellaneous property fixes and improvements
* gtk
- Improve the handling resize-during-size-allocate
* gdk
- Introduce GdkTextureDownloader and use it
- Make gdk_texture_get_format public
* gsk
- Make mask nodes more versatile
- Improve the GL implementation for texture scale nodes
* X11
- Fix key handling during DND
* Tools
- gtk-builder-tool: Try harder to handle templates
- gtk-builder-tool: Prefer properties over <child>
* Translation updates
Basque
Belarusian
Bulgarian
Indonesian
Galician
Georgian
German
Hebrew
Lithuanian
Portuguese
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in 4.9.5, xx-xx-xxxx
========================================
Overview of Changes in 4.9.4, 12-02-2023
========================================
+9 -44
View File
@@ -13,13 +13,20 @@
static GtkWidget *app_picker;
static void
set_file (GFile *file,
gpointer data)
file_opened (GObject *source,
GAsyncResult *result,
void *data)
{
GFile *file;
GError *error = NULL;
char *name;
file = gtk_file_dialog_open_finish (GTK_FILE_DIALOG (source), result, &error);
if (!file)
{
g_print ("%s\n", error->message);
g_error_free (error);
gtk_widget_set_sensitive (app_picker, FALSE);
g_object_set_data (G_OBJECT (app_picker), "file", NULL);
return;
@@ -33,25 +40,6 @@ set_file (GFile *file,
g_object_set_data_full (G_OBJECT (app_picker), "file", g_object_ref (file), g_object_unref);
}
static void
file_opened (GObject *source,
GAsyncResult *result,
void *data)
{
GFile *file;
GError *error = NULL;
file = gtk_file_dialog_open_finish (GTK_FILE_DIALOG (source), result, &error);
if (!file)
{
g_print ("%s\n", error->message);
g_error_free (error);
}
set_file (file, data);
}
static gboolean
abort_mission (gpointer data)
{
@@ -142,28 +130,11 @@ launch_uri (GtkButton *picker)
g_object_unref (launcher);
}
static gboolean
on_drop (GtkDropTarget *target,
const GValue *value,
double x,
double y,
gpointer data)
{
if (G_VALUE_HOLDS (value, G_TYPE_FILE))
{
set_file (g_value_get_object (value), data);
return TRUE;
}
return FALSE;
}
GtkWidget *
do_pickers (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *table, *label, *picker, *button;
GtkDropTarget *drop_target;
if (!window)
{
@@ -208,13 +179,7 @@ do_pickers (GtkWidget *do_widget)
picker = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
button = gtk_button_new_from_icon_name ("document-open-symbolic");
label = gtk_label_new ("None");
drop_target = gtk_drop_target_new (G_TYPE_FILE, GDK_ACTION_COPY);
g_signal_connect (drop_target, "drop", G_CALLBACK (on_drop), label);
gtk_widget_add_controller (button, GTK_EVENT_CONTROLLER (drop_target));
gtk_label_set_xalign (GTK_LABEL (label), 0.);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE);
gtk_widget_set_hexpand (label, TRUE);
-1
View File
@@ -22,7 +22,6 @@ show_shortcuts (GtkWidget *window,
gtk_window_set_transient_for (GTK_WINDOW (overlay), GTK_WINDOW (window));
g_object_set (overlay, "view-name", view, NULL);
g_object_unref (builder);
gtk_window_present (GTK_WINDOW (overlay));
}
G_MODULE_EXPORT void
-4
View File
@@ -66,10 +66,6 @@ You can compile the program above with GCC using:
gcc $( pkg-config --cflags gtk4 ) -o example-0 example-0.c $( pkg-config --libs gtk4 )
```
**Note**: If the above compilation does not work due to an error regarding `G_APPLICATION_DEFAULT_FLAGS`
this could be due to your OS providing an older version of GLib. For GLib versions older than 2.74 you
will need to replace `G_APPLICATION_DEFAULT_FLAGS` with `G_APPLICATION_FLAGS_NONE` in this example, and
others in this documentation.
For more information on how to compile a GTK application, please
refer to the [Compiling GTK Applications](compiling.html)
section in this reference.
+11
View File
@@ -584,6 +584,8 @@ gdk_frame_clock_paint_idle (void *data)
{
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_LAYOUT;
_gdk_frame_clock_emit_layout (clock);
if (priv->requested & GDK_FRAME_CLOCK_PHASE_LAYOUT)
g_print ("looping in layout %d\n", iter);
}
if (iter == 5)
g_warning ("gdk-frame-clock: layout continuously requested, giving up after 4 tries");
@@ -809,3 +811,12 @@ _gdk_frame_clock_idle_new (void)
return GDK_FRAME_CLOCK (clock);
}
GdkFrameClockPhase
gdk_frame_clock_get_current_phase (GdkFrameClock *clock)
{
GdkFrameClockIdle *clock_idle = GDK_FRAME_CLOCK_IDLE (clock);
GdkFrameClockIdlePrivate *priv = clock_idle->priv;
return priv->phase;
}
+2
View File
@@ -127,6 +127,8 @@ void _gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock);
GdkFrameClockPhase gdk_frame_clock_get_current_phase (GdkFrameClock *frame_clock);
G_END_DECLS
#endif /* __GDK_FRAME_CLOCK_PRIVATE_H__ */
+4 -4
View File
@@ -178,10 +178,10 @@ gdk_memory_texture_new_subtexture (GdkMemoryTexture *source,
GBytes *bytes;
g_return_val_if_fail (GDK_IS_MEMORY_TEXTURE (source), NULL);
g_return_val_if_fail (x >= 0 && x < GDK_TEXTURE (source)->width, NULL);
g_return_val_if_fail (y >= 0 && y < GDK_TEXTURE (source)->height, NULL);
g_return_val_if_fail (width > 0 && x + width <= GDK_TEXTURE (source)->width, NULL);
g_return_val_if_fail (height > 0 && y + height <= GDK_TEXTURE (source)->height, NULL);
g_return_val_if_fail (x >= 0 || x < GDK_TEXTURE (source)->width, NULL);
g_return_val_if_fail (y >= 0 || y < GDK_TEXTURE (source)->height, NULL);
g_return_val_if_fail (width > 0 || x + width <= GDK_TEXTURE (source)->width, NULL);
g_return_val_if_fail (height > 0 || y + height <= GDK_TEXTURE (source)->height, NULL);
texture = GDK_TEXTURE (source);
bpp = gdk_memory_format_bytes_per_pixel (texture->format);
+105 -91
View File
@@ -872,21 +872,6 @@ gsk_gl_render_job_transform_bounds (GskGLRenderJob *job,
}
}
static inline void
gsk_gl_render_job_untransform_bounds (GskGLRenderJob *job,
const graphene_rect_t *rect,
graphene_rect_t *out_rect)
{
GskTransform *transform;
transform = gsk_transform_invert (gsk_transform_ref (job->current_modelview->transform));
gsk_transform_transform_bounds (transform, rect, out_rect);
out_rect->origin.x -= job->offset_x;
out_rect->origin.y -= job->offset_y;
}
static inline void
gsk_gl_render_job_transform_rounded_rect (GskGLRenderJob *job,
const GskRoundedRect *rect,
@@ -3630,98 +3615,127 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job,
int min_filter = min_filters[scaling_filter];
int mag_filter = mag_filters[scaling_filter];
int max_texture_size = job->command_queue->max_texture_size;
graphene_rect_t clip_rect;
GskGLRenderTarget *render_target;
GskGLRenderOffscreen offscreen = {0};
graphene_rect_t viewport;
graphene_rect_t prev_viewport;
graphene_matrix_t prev_projection;
float prev_alpha;
guint prev_fbo;
guint texture_id;
float u0, u1, v0, v1;
gsk_gl_render_job_untransform_bounds (job, &job->current_clip->rect.bounds, &clip_rect);
if (!graphene_rect_intersection (bounds, &clip_rect, &clip_rect))
return;
if G_UNLIKELY (clip_rect.size.width > max_texture_size ||
clip_rect.size.height > max_texture_size)
if (scaling_filter == GSK_SCALING_FILTER_LINEAR)
{
gsk_gl_render_job_visit_texture (job, texture, bounds);
return;
}
viewport = GRAPHENE_RECT_INIT (0, 0,
clip_rect.size.width,
clip_rect.size.height);
if (!gsk_gl_driver_create_render_target (job->driver,
(int) ceilf (clip_rect.size.width),
(int) ceilf (clip_rect.size.height),
get_target_format (job, node),
GL_LINEAR, GL_LINEAR,
&render_target))
if G_LIKELY (texture->width <= max_texture_size &&
texture->height <= max_texture_size)
{
gsk_gl_render_job_visit_texture (job, texture, bounds);
return;
GskGLRenderTarget *render_target;
GskGLRenderOffscreen offscreen = {0};
graphene_rect_t viewport;
graphene_rect_t prev_viewport;
graphene_matrix_t prev_projection;
float prev_alpha;
guint prev_fbo;
guint texture_id;
viewport = GRAPHENE_RECT_INIT (0, 0,
bounds->size.width,
bounds->size.height);
if (!gsk_gl_driver_create_render_target (job->driver,
(int) ceilf (viewport.size.width),
(int) ceilf (viewport.size.height),
get_target_format (job, node),
GL_LINEAR, GL_LINEAR,
&render_target))
{
/* viewport is too big, slice the texture and try again */
goto slice;
}
gsk_gl_render_job_upload_texture (job, texture, min_filter, mag_filter, &offscreen);
g_assert (offscreen.texture_id);
g_assert (offscreen.was_offscreen == FALSE);
gsk_gl_render_job_set_viewport (job, &viewport, &prev_viewport);
gsk_gl_render_job_set_projection_from_rect (job, &viewport, &prev_projection);
gsk_gl_render_job_set_modelview (job, NULL);
prev_alpha = gsk_gl_render_job_set_alpha (job, 1.0f);
gsk_gl_render_job_push_clip (job, &GSK_ROUNDED_RECT_INIT_FROM_RECT (viewport));
prev_fbo = gsk_gl_command_queue_bind_framebuffer (job->command_queue, render_target->framebuffer_id);
gsk_gl_command_queue_clear (job->command_queue, 0, &viewport);
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_gl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
GL_TEXTURE0,
offscreen.texture_id);
gsk_gl_render_job_draw_offscreen (job, &viewport, &offscreen);
gsk_gl_render_job_end_draw (job);
gsk_gl_render_job_pop_clip (job);
gsk_gl_render_job_pop_modelview (job);
gsk_gl_render_job_set_viewport (job, &prev_viewport, NULL);
gsk_gl_render_job_set_projection (job, &prev_projection);
gsk_gl_render_job_set_alpha (job, prev_alpha);
gsk_gl_command_queue_bind_framebuffer (job->command_queue, prev_fbo);
texture_id = gsk_gl_driver_release_render_target (job->driver, render_target, FALSE);
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_gl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
GL_TEXTURE0,
texture_id);
gsk_gl_render_job_draw_offscreen_rect (job, bounds);
gsk_gl_render_job_end_draw (job);
}
else
slice:
{
float min_x = bounds->origin.x;
float min_y = bounds->origin.y;
float max_x = min_x + bounds->size.width;
float max_y = min_y + bounds->size.height;
float scale_x = (max_x - min_x) / texture->width;
float scale_y = (max_y - min_y) / texture->height;
GskGLTextureSlice *slices = NULL;
guint n_slices = 0;
GdkGLContext *context = gsk_gl_driver_get_context (job->driver);
guint rows, cols;
gsk_gl_render_job_upload_texture (job, texture, min_filter, mag_filter, &offscreen);
/* Slice enough that neither the original texture nor the scaled texture
* exceed the texture size limit
*/
cols = (int)(MAX (bounds->size.width, texture->width) / (max_texture_size / 4)) + 1;
rows = (int)(MAX (bounds->size.height, texture->height) / (max_texture_size / 4)) + 1;
g_assert (offscreen.texture_id);
g_assert (offscreen.was_offscreen == FALSE);
gsk_gl_driver_slice_texture (job->driver, texture, GL_NEAREST, GL_NEAREST, cols, rows, &slices, &n_slices);
u0 = (clip_rect.origin.x - bounds->origin.x) / bounds->size.width;
v0 = (clip_rect.origin.y - bounds->origin.y) / bounds->size.height;
u1 = (clip_rect.origin.x + clip_rect.size.width - bounds->origin.x) / bounds->size.width;
v1 = (clip_rect.origin.y + clip_rect.size.height - bounds->origin.y) / bounds->size.height;
g_assert (slices != NULL);
g_assert (n_slices > 0);
gsk_gl_render_job_set_viewport (job, &viewport, &prev_viewport);
gsk_gl_render_job_set_projection_from_rect (job, &viewport, &prev_projection);
gsk_gl_render_job_set_modelview (job, NULL);
prev_alpha = gsk_gl_render_job_set_alpha (job, 1.0f);
gsk_gl_render_job_push_clip (job, &GSK_ROUNDED_RECT_INIT_FROM_RECT (viewport));
for (guint i = 0; i < n_slices; i ++)
{
const GskGLTextureSlice *slice = &slices[i];
float x1, x2, y1, y2;
GdkTexture *sub_texture;
GskRenderNode *sub_node;
prev_fbo = gsk_gl_command_queue_bind_framebuffer (job->command_queue, render_target->framebuffer_id);
gsk_gl_command_queue_clear (job->command_queue, 0, &viewport);
x1 = min_x + (scale_x * slice->rect.x);
x2 = x1 + (slice->rect.width * scale_x);
y1 = min_y + (scale_y * slice->rect.y);
y2 = y1 + (slice->rect.height * scale_y);
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_gl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
GL_TEXTURE0,
offscreen.texture_id);
gsk_gl_render_job_draw_coords (job,
0, 0, clip_rect.size.width, clip_rect.size.height,
u0, v0, u1, v1,
(guint16[]) { FP16_ZERO, FP16_ZERO, FP16_ZERO, FP16_ZERO });
gsk_gl_render_job_end_draw (job);
sub_texture = gdk_gl_texture_new (context, slice->texture_id, slice->rect.width, slice->rect.height, NULL, NULL);
gsk_gl_render_job_pop_clip (job);
gsk_gl_render_job_pop_modelview (job);
gsk_gl_render_job_set_viewport (job, &prev_viewport, NULL);
gsk_gl_render_job_set_projection (job, &prev_projection);
gsk_gl_render_job_set_alpha (job, prev_alpha);
gsk_gl_command_queue_bind_framebuffer (job->command_queue, prev_fbo);
sub_node = gsk_texture_scale_node_new (sub_texture, &GRAPHENE_RECT_INIT (x1, y1, x2 - x1, y2 - y1), scaling_filter);
texture_id = gsk_gl_driver_release_render_target (job->driver, render_target, FALSE);
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_gl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
GL_TEXTURE0,
texture_id);
gsk_gl_render_job_draw_coords (job,
job->offset_x + clip_rect.origin.x,
job->offset_y + clip_rect.origin.y,
job->offset_x + clip_rect.origin.x + clip_rect.size.width,
job->offset_y + clip_rect.origin.y + clip_rect.size.height,
0, clip_rect.size.width / ceilf (clip_rect.size.width),
clip_rect.size.height / ceilf (clip_rect.size.height), 0,
(guint16[]){ FP16_ZERO, FP16_ZERO, FP16_ZERO, FP16_ZERO } );
gsk_gl_render_job_end_draw (job);
gsk_gl_render_job_visit_node (job, sub_node);
gsk_render_node_unref (sub_node);
g_object_unref (sub_texture);
}
}
}
static inline void
+11 -27
View File
@@ -58,16 +58,6 @@ rectangle_init_from_graphene (cairo_rectangle_int_t *cairo,
cairo->height = ceilf (graphene->origin.y + graphene->size.height) - cairo->y;
}
static void
_graphene_rect_init_from_clip_extents (graphene_rect_t *rect,
cairo_t *cr)
{
double x1c, y1c, x2c, y2c;
cairo_clip_extents (cr, &x1c, &y1c, &x2c, &y2c);
graphene_rect_init (rect, x1c, y1c, x2c - x1c, y2c - y1c);
}
/* {{{ GSK_COLOR_NODE */
/**
@@ -1635,21 +1625,15 @@ gsk_texture_scale_node_draw (GskRenderNode *node,
};
cairo_t *cr2;
cairo_surface_t *surface2;
graphene_rect_t clip_rect;
/* Make sure we draw the minimum region by using the clip */
gsk_cairo_rectangle (cr, &node->bounds);
cairo_clip (cr);
_graphene_rect_init_from_clip_extents (&clip_rect, cr);
if (clip_rect.size.width <= 0 || clip_rect.size.height <= 0)
return;
surface2 = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
(int) ceilf (clip_rect.size.width),
(int) ceilf (clip_rect.size.height));
cairo_surface_set_device_offset (surface2, -clip_rect.origin.x, -clip_rect.origin.y);
(int) ceilf (node->bounds.size.width),
(int) ceilf (node->bounds.size.height));
cr2 = cairo_create (surface2);
cairo_set_source_rgba (cr2, 0, 0, 0, 0);
cairo_paint (cr2);
surface = gdk_texture_download_surface (self->texture);
pattern = cairo_pattern_create_for_surface (surface);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
@@ -2088,15 +2072,15 @@ gsk_inset_shadow_node_draw (GskRenderNode *node,
GskInsetShadowNode *self = (GskInsetShadowNode *) node;
GskRoundedRect box, clip_box;
int clip_radius;
graphene_rect_t clip_rect;
double x1c, y1c, x2c, y2c;
double blur_radius;
/* We don't need to draw invisible shadows */
if (gdk_rgba_is_clear (&self->color))
return;
_graphene_rect_init_from_clip_extents (&clip_rect, cr);
if (!gsk_rounded_rect_intersects_rect (&self->outline, &clip_rect))
cairo_clip_extents (cr, &x1c, &y1c, &x2c, &y2c);
if (!gsk_rounded_rect_intersects_rect (&self->outline, &GRAPHENE_RECT_INIT (x1c, y1c, x2c - x1c, y2c - y1c)))
return;
blur_radius = self->blur_radius / 2;
@@ -2384,7 +2368,7 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
GskOutsetShadowNode *self = (GskOutsetShadowNode *) node;
GskRoundedRect box, clip_box;
int clip_radius;
graphene_rect_t clip_rect;
double x1c, y1c, x2c, y2c;
float top, right, bottom, left;
double blur_radius;
@@ -2392,8 +2376,8 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
if (gdk_rgba_is_clear (&self->color))
return;
_graphene_rect_init_from_clip_extents (&clip_rect, cr);
if (!gsk_rounded_rect_intersects_rect (&self->outline, &clip_rect))
cairo_clip_extents (cr, &x1c, &y1c, &x2c, &y2c);
if (gsk_rounded_rect_contains_rect (&self->outline, &GRAPHENE_RECT_INIT (x1c, y1c, x2c - x1c, y2c - y1c)))
return;
blur_radius = self->blur_radius / 2;
+1 -4
View File
@@ -158,12 +158,9 @@ component_handle_method (GDBusConnection *connection,
}
else
{
GtkATContext *context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (child));
GtkAtSpiContext *ctx = GTK_AT_SPI_CONTEXT (context);
GtkAtSpiContext *ctx = GTK_AT_SPI_CONTEXT (gtk_accessible_get_at_context (GTK_ACCESSIBLE (child)));
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (ctx)));
g_object_unref (context);
}
}
else if (g_strcmp0 (method_name, "GetExtents") == 0)
+30 -99
View File
@@ -246,7 +246,7 @@ collect_states (GtkAtSpiContext *self,
case GTK_ACCESSIBLE_INVALID_TRUE:
case GTK_ACCESSIBLE_INVALID_GRAMMAR:
case GTK_ACCESSIBLE_INVALID_SPELLING:
set_atspi_state (&states, ATSPI_STATE_INVALID_ENTRY);
set_atspi_state (&states, ATSPI_STATE_INVALID);
break;
case GTK_ACCESSIBLE_INVALID_FALSE:
default:
@@ -282,34 +282,6 @@ collect_states (GtkAtSpiContext *self,
}
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_REQUIRED))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_REQUIRED);
if (gtk_boolean_accessible_value_get (value))
set_atspi_state (&states, ATSPI_STATE_REQUIRED);
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE);
if (gtk_boolean_accessible_value_get (value))
set_atspi_state (&states, ATSPI_STATE_MULTISELECTABLE);
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_HAS_POPUP))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_HAS_POPUP);
if (gtk_boolean_accessible_value_get (value))
set_atspi_state (&states, ATSPI_STATE_HAS_POPUP);
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE);
if (gtk_autocomplete_accessible_value_get (value) != GTK_ACCESSIBLE_AUTOCOMPLETE_NONE)
set_atspi_state (&states, ATSPI_STATE_SUPPORTS_AUTOCOMPLETION);
}
g_variant_builder_add (builder, "u", (guint32) (states & 0xffffffff));
g_variant_builder_add (builder, "u", (guint32) (states >> 32));
}
@@ -327,11 +299,11 @@ collect_relations (GtkAtSpiContext *self,
{ GTK_ACCESSIBLE_RELATION_LABELLED_BY, ATSPI_RELATION_LABELLED_BY },
{ GTK_ACCESSIBLE_RELATION_CONTROLS, ATSPI_RELATION_CONTROLLER_FOR },
{ GTK_ACCESSIBLE_RELATION_DESCRIBED_BY, ATSPI_RELATION_DESCRIBED_BY },
{ GTK_ACCESSIBLE_RELATION_DETAILS, ATSPI_RELATION_DETAILS },
{ GTK_ACCESSIBLE_RELATION_FLOW_TO, ATSPI_RELATION_FLOWS_TO},
};
GtkAccessibleValue *value;
GList *list, *l;
GtkATContext *target_ctx;
int i;
for (i = 0; i < G_N_ELEMENTS (map); i++)
@@ -346,16 +318,13 @@ collect_relations (GtkAtSpiContext *self,
for (l = list; l; l = l->next)
{
GtkATContext *target_ctx =
gtk_accessible_get_at_context (GTK_ACCESSIBLE (l->data));
target_ctx = gtk_accessible_get_at_context (GTK_ACCESSIBLE (l->data));
/* Realize the ATContext of the target, so we can ask for its ref */
gtk_at_context_realize (target_ctx);
g_variant_builder_add (&b, "@(so)",
gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (target_ctx)));
g_object_unref (target_ctx);
}
g_variant_builder_add (builder, "(ua(so))", map[i].s, &b);
@@ -367,17 +336,17 @@ static int
get_index_in (GtkAccessible *parent,
GtkAccessible *child)
{
GtkAccessible *candidate;
guint res;
if (parent == NULL)
return -1;
guint res = 0;
GtkAccessible *candidate;
res = 0;
for (candidate = gtk_accessible_get_first_accessible_child (parent);
candidate != NULL;
candidate = gtk_accessible_get_next_accessible_sibling (candidate))
{
g_object_unref (candidate);
if (candidate == child)
return res;
@@ -396,13 +365,7 @@ get_index_in_parent (GtkAccessible *accessible)
GtkAccessible *parent = gtk_accessible_get_accessible_parent (accessible);
if (parent != NULL)
{
int res = get_index_in (parent, accessible);
g_object_unref (parent);
return res;
}
return get_index_in (parent, accessible);
return -1;
}
@@ -438,6 +401,7 @@ static GVariant *
get_parent_context_ref (GtkAccessible *accessible)
{
GVariant *res = NULL;
GtkAccessible *parent = gtk_accessible_get_accessible_parent (accessible);
if (parent == NULL)
@@ -446,19 +410,13 @@ get_parent_context_ref (GtkAccessible *accessible)
GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (context);
res = gtk_at_spi_root_to_ref (self->root);
g_object_unref (context);
}
else
{
GtkATContext *parent_context = gtk_accessible_get_at_context (parent);
gtk_at_context_realize (parent_context);
res = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (parent_context));
g_object_unref (parent_context);
g_object_unref (parent);
}
if (res == NULL)
@@ -539,32 +497,31 @@ handle_accessible_method (GDBusConnection *connection,
{
GtkATContext *context = NULL;
GtkAccessible *accessible;
GtkAccessible *child = NULL;
int idx, presentable_idx;
g_variant_get (parameters, "(i)", &idx);
accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
presentable_idx = 0;
GtkAccessible *child;
presentable_idx = 0;
for (child = gtk_accessible_get_first_accessible_child (accessible);
child != NULL;
child = gtk_accessible_get_next_accessible_sibling (child))
{
g_object_unref (child);
if (!gtk_accessible_should_present (child))
continue;
continue;
if (presentable_idx == idx)
break;
presentable_idx++;
presentable_idx += 1;
}
if (child != NULL)
context = gtk_accessible_get_at_context (child);
if (child)
{
context = gtk_accessible_get_at_context (child);
}
if (context == NULL)
{
@@ -579,23 +536,20 @@ handle_accessible_method (GDBusConnection *connection,
gtk_at_context_realize (context);
GVariant *ref = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (context));
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(@(so))", ref));
g_object_unref (context);
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(@(so))", ref));
}
else if (g_strcmp0 (method_name, "GetChildren") == 0)
{
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a(so)"));
GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
GtkAccessible *child = NULL;
GtkAccessible *child;
for (child = gtk_accessible_get_first_accessible_child (accessible);
child != NULL;
child = gtk_accessible_get_next_accessible_sibling (child))
{
g_object_unref (child);
{
if (!gtk_accessible_should_present (child))
continue;
@@ -608,8 +562,6 @@ handle_accessible_method (GDBusConnection *connection,
if (ref != NULL)
g_variant_builder_add (&builder, "@(so)", ref);
g_object_unref (context);
}
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a(so))", &builder));
@@ -789,13 +741,8 @@ emit_property_changed (GtkAtSpiContext *self,
const char *name,
GVariant *value)
{
GVariant *value_owned = g_variant_ref_sink (value);
if (self->connection == NULL)
{
g_variant_unref (value_owned);
return;
}
return;
g_dbus_connection_emit_signal (self->connection,
NULL,
@@ -803,9 +750,8 @@ emit_property_changed (GtkAtSpiContext *self,
"org.a11y.atspi.Event.Object",
"PropertyChange",
g_variant_new ("(siiva{sv})",
name, 0, 0, value_owned, NULL),
name, 0, 0, value, NULL),
NULL);
g_variant_unref (value_owned);
}
static void
@@ -904,6 +850,8 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
if (changed_states & GTK_ACCESSIBLE_STATE_CHANGE_HIDDEN)
{
GtkAccessible *parent;
GtkATContext *context;
GtkAccessibleChildChange change;
value = gtk_accessible_attribute_set_get_value (states, GTK_ACCESSIBLE_STATE_HIDDEN);
@@ -919,15 +867,10 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
}
else
{
GtkAccessible *parent =
gtk_accessible_get_accessible_parent (accessible);
GtkATContext *context =
gtk_accessible_get_at_context (parent);
parent = gtk_accessible_get_accessible_parent (accessible);
context = gtk_accessible_get_at_context (parent);
gtk_at_context_child_changed (context, change, accessible);
g_object_unref (context);
g_object_unref (parent);
}
}
@@ -1176,18 +1119,9 @@ gtk_at_spi_context_child_change (GtkATContext *ctx,
int idx = 0;
if (parent == NULL)
{
idx = -1;
}
idx = -1;
else if (parent == accessible)
{
idx = get_index_in (accessible, child);
g_object_unref (parent);
}
else
{
g_object_unref (parent);
}
idx = get_index_in (accessible, child);
if (change & GTK_ACCESSIBLE_CHILD_CHANGE_ADDED)
emit_children_changed (self,
@@ -1199,8 +1133,6 @@ gtk_at_spi_context_child_change (GtkATContext *ctx,
GTK_AT_SPI_CONTEXT (child_context),
idx,
GTK_ACCESSIBLE_CHILD_STATE_REMOVED);
g_object_unref (child_context);
}
/* }}} */
/* {{{ D-Bus Registration */
@@ -1769,16 +1701,15 @@ gtk_at_spi_context_get_child_count (GtkAtSpiContext *self)
int n_children = 0;
GtkAccessible *child = NULL;
for (child = gtk_accessible_get_first_accessible_child (accessible);
child != NULL;
child = gtk_accessible_get_next_accessible_sibling (child))
{
g_object_unref (child);
if (!gtk_accessible_should_present (child))
continue;
n_children += 1;
n_children++;
}
return n_children;
-1
View File
@@ -225,7 +225,6 @@ typedef enum {
ATSPI_RELATION_PARENT_WINDOW_OF,
ATSPI_RELATION_DESCRIPTION_FOR,
ATSPI_RELATION_DESCRIBED_BY,
ATSPI_RELATION_DETAILS,
ATSPI_RELATION_LAST_DEFINED,
} AtspiRelationType;
-6
View File
@@ -314,8 +314,6 @@ handle_accessible_method (GDBusConnection *connection,
const char *path = gtk_at_spi_context_get_context_path (GTK_AT_SPI_CONTEXT (context));
g_dbus_method_invocation_return_value (invocation, g_variant_new ("((so))", name, path));
g_object_unref (context);
}
else if (g_strcmp0 (method_name, "GetChildren") == 0)
{
@@ -336,8 +334,6 @@ handle_accessible_method (GDBusConnection *connection,
const char *path = gtk_at_spi_context_get_context_path (GTK_AT_SPI_CONTEXT (context));
g_variant_builder_add (&builder, "(so)", name, path);
g_object_unref (context);
}
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a(so))", &builder));
@@ -457,8 +453,6 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot *self,
GtkATContext *context = gtk_accessible_get_at_context (child);
window_ref = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (context));
g_object_unref (context);
}
switch (change)
+5 -12
View File
@@ -94,9 +94,7 @@ listbox_handle_method (GDBusConnection *connection,
else
{
GtkATContext *ctx = gtk_accessible_get_at_context (GTK_ACCESSIBLE (counter.child));
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
g_object_unref (ctx);
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
}
}
else if (g_strcmp0 (method_name, "SelectChild") == 0)
@@ -273,8 +271,7 @@ listview_handle_method (GDBusConnection *connection,
{
GtkATContext *ctx = gtk_accessible_get_at_context (GTK_ACCESSIBLE (child));
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
g_object_unref (ctx);
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
}
}
else if (g_strcmp0 (method_name, "SelectChild") == 0)
@@ -498,9 +495,7 @@ flowbox_handle_method (GDBusConnection *connection,
else
{
GtkATContext *ctx = gtk_accessible_get_at_context (GTK_ACCESSIBLE (counter.child));
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
g_object_unref (ctx);
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
}
}
else if (g_strcmp0 (method_name, "SelectChild") == 0)
@@ -766,8 +761,7 @@ stackswitcher_handle_method (GDBusConnection *connection,
{
GtkATContext *ctx = gtk_accessible_get_at_context (GTK_ACCESSIBLE (child));
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
g_object_unref (ctx);
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
}
}
else if (g_strcmp0 (method_name, "SelectChild") == 0)
@@ -897,8 +891,7 @@ notebook_handle_method (GDBusConnection *connection,
{
GtkATContext *ctx = gtk_accessible_get_at_context (GTK_ACCESSIBLE (child));
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
g_object_unref (ctx);
g_variant_new ("(@(so))", gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (ctx))));
}
}
else if (g_strcmp0 (method_name, "SelectChild") == 0)
+2 -4
View File
@@ -169,7 +169,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
return ATSPI_ROLE_OPTION_PANE;
case GTK_ACCESSIBLE_ROLE_PRESENTATION:
return ATSPI_ROLE_FILLER;
return ATSPI_ROLE_SECTION;
case GTK_ACCESSIBLE_ROLE_PROGRESS_BAR:
return ATSPI_ROLE_PROGRESS_BAR;
@@ -205,7 +205,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
return ATSPI_ROLE_ENTRY;
case GTK_ACCESSIBLE_ROLE_SECTION:
return ATSPI_ROLE_SECTION;
return ATSPI_ROLE_FILLER;
case GTK_ACCESSIBLE_ROLE_SECTION_HEAD:
return ATSPI_ROLE_FILLER;
@@ -273,8 +273,6 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
case GTK_ACCESSIBLE_ROLE_WINDOW:
return ATSPI_ROLE_FRAME;
case GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON:
return ATSPI_ROLE_TOGGLE_BUTTON;
default:
break;
}
+32 -99
View File
@@ -91,9 +91,9 @@ gtk_accessible_default_init (GtkAccessibleInterface *iface)
* gtk_accessible_get_at_context:
* @self: a `GtkAccessible`
*
* Retrieves the accessible implementation for the given `GtkAccessible`.
* Retrieves the `GtkATContext` for the given `GtkAccessible`.
*
* Returns: (transfer full): the accessible implementation object
* Returns: (transfer none): the `GtkATContext`
*
* Since: 4.10
*/
@@ -109,11 +109,11 @@ gtk_accessible_get_at_context (GtkAccessible *self)
* gtk_accessible_get_accessible_parent:
* @self: a `GtkAccessible`
*
* Retrieves the accessible parent for an accessible object.
* Retrieves the accessible accessible for an accessible object
*
* This function returns `NULL` for top level widgets.
* This function returns `NULL` for top level widgets
*
* Returns: (transfer full) (nullable): the accessible parent
* Returns: (transfer none) (nullable): the accessible parent
*
* Since: 4.10
*/
@@ -127,13 +127,10 @@ gtk_accessible_get_accessible_parent (GtkAccessible *self)
context = gtk_accessible_get_at_context (self);
if (context != NULL)
{
parent = gtk_at_context_get_accessible_parent (context);
g_object_unref (context);
}
parent = gtk_at_context_get_accessible_parent (context);
if (parent != NULL)
return g_object_ref (parent);
return parent;
else
return GTK_ACCESSIBLE_GET_IFACE (self)->get_accessible_parent (self);
}
@@ -164,7 +161,6 @@ gtk_accessible_set_accessible_parent (GtkAccessible *self,
g_return_if_fail (GTK_IS_ACCESSIBLE (self));
g_return_if_fail (parent == NULL || GTK_IS_ACCESSIBLE (parent));
g_return_if_fail (next_sibling == NULL || GTK_IS_ACCESSIBLE (parent));
GtkATContext *context;
context = gtk_accessible_get_at_context (self);
@@ -172,7 +168,6 @@ gtk_accessible_set_accessible_parent (GtkAccessible *self,
{
gtk_at_context_set_accessible_parent (context, parent);
gtk_at_context_set_next_accessible_sibling (context, next_sibling);
g_object_unref (context);
}
}
@@ -182,7 +177,6 @@ gtk_accessible_set_accessible_parent (GtkAccessible *self,
* @new_sibling: (nullable): the new next accessible sibling to set
*
* Updates the next accessible sibling of @self.
*
* That might be useful when a new child of a custom `GtkAccessible`
* is created, and it needs to be linked to a previous child.
*
@@ -193,26 +187,20 @@ gtk_accessible_update_next_accessible_sibling (GtkAccessible *self,
GtkAccessible *new_sibling)
{
GtkATContext *context;
GtkAccessible *parent;
g_return_if_fail (GTK_IS_ACCESSIBLE (self));
context = gtk_accessible_get_at_context (self);
if (context == NULL)
if (!context)
return;
parent = gtk_at_context_get_accessible_parent (context);
if (parent == NULL)
{
g_object_unref (context);
g_critical ("Failed to update next accessible sibling: no parent accessible set for this accessible");
return;
}
if (gtk_at_context_get_accessible_parent (context) == NULL)
{
g_critical ("Failed to update next accessible sibling: no parent accessible set for this accessible");
return;
}
gtk_at_context_set_next_accessible_sibling (context, new_sibling);
g_object_unref (parent);
g_object_unref (context);
}
/**
@@ -221,7 +209,7 @@ gtk_accessible_update_next_accessible_sibling (GtkAccessible *self,
*
* Retrieves the first accessible child of an accessible object.
*
* Returns: (transfer full) (nullable): the first accessible child
* Returns: (transfer none) (nullable): the first accessible child
*
* since: 4.10
*/
@@ -239,7 +227,7 @@ gtk_accessible_get_first_accessible_child (GtkAccessible *self)
*
* Retrieves the next accessible sibling of an accessible object
*
* Returns: (transfer full) (nullable): the next accessible sibling
* Returns: (transfer none) (nullable): the next accessible sibling
*
* since: 4.10
*/
@@ -251,21 +239,8 @@ gtk_accessible_get_next_accessible_sibling (GtkAccessible *self)
GtkATContext *context;
context = gtk_accessible_get_at_context (self);
if (context != NULL)
{
GtkAccessible *sibling = NULL;
if (gtk_at_context_get_accessible_parent (context) != NULL)
{
sibling = gtk_at_context_get_next_accessible_sibling (context);
if (sibling != NULL)
sibling = g_object_ref (sibling);
}
g_object_unref (context);
return sibling;
}
if (context != NULL && gtk_at_context_get_accessible_parent (context) != NULL)
return gtk_at_context_get_next_accessible_sibling (context);
else
return GTK_ACCESSIBLE_GET_IFACE (self)->get_next_accessible_sibling (self);
}
@@ -281,21 +256,13 @@ gtk_accessible_get_next_accessible_sibling (GtkAccessible *self)
GtkAccessibleRole
gtk_accessible_get_accessible_role (GtkAccessible *self)
{
GtkAccessibleRole role = GTK_ACCESSIBLE_ROLE_NONE;
GtkAccessibleRole role;
g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), GTK_ACCESSIBLE_ROLE_NONE);
GtkATContext *context = gtk_accessible_get_at_context (self);
if (context != NULL)
{
if (gtk_at_context_is_realized (context))
role = gtk_at_context_get_accessible_role (context);
g_object_unref (context);
if (role != GTK_ACCESSIBLE_ROLE_NONE)
return role;
}
if (context != NULL && gtk_at_context_is_realized (context))
return gtk_at_context_get_accessible_role (context);
g_object_get (G_OBJECT (self), "accessible-role", &role, NULL);
@@ -369,8 +336,6 @@ gtk_accessible_update_state (GtkAccessible *self,
out:
va_end (args);
g_object_unref (context);
}
/**
@@ -424,7 +389,6 @@ gtk_accessible_update_state_value (GtkAccessible *self,
}
gtk_at_context_update (context);
g_object_unref (context);
}
/**
@@ -448,7 +412,6 @@ gtk_accessible_reset_state (GtkAccessible *self,
gtk_at_context_set_accessible_state (context, state, NULL);
gtk_at_context_update (context);
g_object_unref (context);
}
/**
@@ -520,8 +483,6 @@ gtk_accessible_update_property (GtkAccessible *self,
out:
va_end (args);
g_object_unref (context);
}
/**
@@ -575,7 +536,6 @@ gtk_accessible_update_property_value (GtkAccessible *self,
}
gtk_at_context_update (context);
g_object_unref (context);
}
/**
@@ -599,7 +559,6 @@ gtk_accessible_reset_property (GtkAccessible *self,
gtk_at_context_set_accessible_property (context, property, NULL);
gtk_at_context_update (context);
g_object_unref (context);
}
/**
@@ -671,8 +630,6 @@ gtk_accessible_update_relation (GtkAccessible *self,
out:
va_end (args);
g_object_unref (context);
}
/**
@@ -701,8 +658,6 @@ gtk_accessible_update_relation_value (GtkAccessible *self,
g_return_if_fail (n_relations > 0);
context = gtk_accessible_get_at_context (self);
if (context == NULL)
return;
for (int i = 0; i < n_relations; i++)
{
@@ -721,14 +676,15 @@ gtk_accessible_update_relation_value (GtkAccessible *self,
break;
}
gtk_at_context_set_accessible_relation (context, relation, real_value);
if (context)
gtk_at_context_set_accessible_relation (context, relation, real_value);
if (real_value != NULL)
gtk_accessible_value_unref (real_value);
}
gtk_at_context_update (context);
g_object_unref (context);
if (context)
gtk_at_context_update (context);
}
/**
@@ -752,7 +708,6 @@ gtk_accessible_reset_relation (GtkAccessible *self,
gtk_at_context_set_accessible_relation (context, relation, NULL);
gtk_at_context_update (context);
g_object_unref (context);
}
static const char *role_names[] = {
@@ -913,22 +868,13 @@ gtk_accessible_platform_changed (GtkAccessible *self,
/* propagate changes up from ignored widgets */
if (gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_NONE)
{
GtkAccessible *parent = gtk_accessible_get_accessible_parent (self);
if (parent != NULL)
{
context = gtk_accessible_get_at_context (parent);
g_object_unref (parent);
}
}
context = gtk_accessible_get_at_context (gtk_accessible_get_accessible_parent (self));
if (context == NULL)
return;
gtk_at_context_platform_changed (context, change);
gtk_at_context_update (context);
g_object_unref (context);
}
/**
@@ -982,7 +928,6 @@ gtk_accessible_bounds_changed (GtkAccessible *self)
return;
gtk_at_context_bounds_changed (context);
g_object_unref (context);
}
/**
@@ -1035,7 +980,6 @@ gtk_accessible_should_present (GtkAccessible *self)
{
GtkAccessibleRole role;
GtkATContext *context;
gboolean res = TRUE;
if (GTK_IS_WIDGET (self) &&
!gtk_widget_get_visible (GTK_WIDGET (self)))
@@ -1056,12 +1000,10 @@ gtk_accessible_should_present (GtkAccessible *self)
value = gtk_at_context_get_accessible_state (context, GTK_ACCESSIBLE_STATE_HIDDEN);
if (gtk_boolean_accessible_value_get (value))
res = FALSE;
return FALSE;
}
g_object_unref (context);
return res;
return TRUE;
}
void
@@ -1075,24 +1017,15 @@ gtk_accessible_update_children (GtkAccessible *self,
gtk_widget_get_root (GTK_WIDGET (self)) == NULL)
return;
context = gtk_accessible_get_at_context (self);
/* propagate changes up from ignored widgets */
if (gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_NONE)
{
GtkAccessible *parent = gtk_accessible_get_accessible_parent (self);
context = gtk_accessible_get_at_context (parent);
g_object_unref (parent);
}
else
{
context = gtk_accessible_get_at_context (self);
}
context = gtk_accessible_get_at_context (gtk_accessible_get_accessible_parent (self));
if (context == NULL)
return;
gtk_at_context_child_changed (context, 1 << state, child);
gtk_at_context_update (context);
g_object_unref (context);
}
+4 -4
View File
@@ -73,7 +73,7 @@ struct _GtkAccessibleInterface
* Retrieves the platform-specific accessibility context for the
* accessible implementation.
*
* Returns: (transfer full) (nullable): the accessibility context
* Returns: (transfer none) (nullable): the accessibility context
*
* Since: 4.10
*/
@@ -101,7 +101,7 @@ struct _GtkAccessibleInterface
*
* This virtual function should return `NULL` for top level objects.
*
* Returns: (nullable) (transfer full): the accessible parent
* Returns: (nullable) (transfer none): the accessible parent
*
* Since: 4.10
*/
@@ -113,7 +113,7 @@ struct _GtkAccessibleInterface
*
* Retrieves the first accessible child of an accessible object.
*
* Returns: (transfer full) (nullable): an accessible object
* Returns: (transfer none) (nullable): an accessible object
*
* Since: 4.10
*/
@@ -125,7 +125,7 @@ struct _GtkAccessibleInterface
*
* Retrieves the next accessible sibling of an accessible object.
*
* Returns: (transfer full) (nullable): an accessible object
* Returns: (transfer none) (nullable): an accessible object
*
* Since: 4.10
*/
+7 -46
View File
@@ -85,20 +85,6 @@ gtk_at_context_dispose (GObject *gobject)
gtk_at_context_unrealize (self);
if (self->accessible_parent != NULL)
{
g_object_remove_weak_pointer (G_OBJECT (self->accessible_parent),
(gpointer *) &self->accessible_parent);
self->accessible_parent = NULL;
}
if (self->next_accessible_sibling != NULL)
{
g_object_remove_weak_pointer (G_OBJECT (self->next_accessible_sibling),
(gpointer *) &self->next_accessible_sibling);
self->next_accessible_sibling = NULL;
}
G_OBJECT_CLASS (gtk_at_context_parent_class)->dispose (gobject);
}
@@ -473,14 +459,14 @@ GtkAccessible *
gtk_at_context_get_accessible_parent (GtkATContext *self)
{
g_return_val_if_fail (GTK_IS_AT_CONTEXT (self), NULL);
return self->accessible_parent;
}
/*< private >
* gtk_at_context_set_accessible_parent:
* @self: a `GtkAtContext`
* @parent: (nullable): the parent `GtkAccessible` to set
* @parent: the parent `GtkAccessible` to set
*
* Sets the parent accessible object of the given `GtkAtContext`.
*/
@@ -489,18 +475,8 @@ gtk_at_context_set_accessible_parent (GtkATContext *self,
GtkAccessible *parent)
{
g_return_if_fail (GTK_IS_AT_CONTEXT (self));
if (self->accessible_parent != parent)
{
if (self->accessible_parent != NULL)
g_object_remove_weak_pointer (G_OBJECT (self->accessible_parent),
(gpointer *) &self->accessible_parent);
self->accessible_parent = parent;
if (self->accessible_parent != NULL)
g_object_add_weak_pointer (G_OBJECT (self->accessible_parent),
(gpointer *) &self->accessible_parent);
}
g_set_object (&self->accessible_parent, parent);
}
/*< private >
@@ -515,7 +491,7 @@ GtkAccessible *
gtk_at_context_get_next_accessible_sibling (GtkATContext *self)
{
g_return_val_if_fail (GTK_IS_AT_CONTEXT (self), NULL);
return self->next_accessible_sibling;
}
@@ -531,19 +507,8 @@ gtk_at_context_set_next_accessible_sibling (GtkATContext *self,
GtkAccessible *sibling)
{
g_return_if_fail (GTK_IS_AT_CONTEXT (self));
if (self->next_accessible_sibling != sibling)
{
if (self->next_accessible_sibling != NULL)
g_object_remove_weak_pointer (G_OBJECT (self->next_accessible_sibling),
(gpointer *) &self->next_accessible_sibling);
self->next_accessible_sibling = sibling;
if (self->next_accessible_sibling != NULL)
g_object_add_weak_pointer (G_OBJECT (self->next_accessible_sibling),
(gpointer *) &self->next_accessible_sibling);
}
g_set_object (&self->next_accessible_sibling, sibling);
}
/*< private >
@@ -1028,8 +993,6 @@ gtk_at_context_get_name_accumulate (GtkATContext *self,
GtkATContext *rel_context = gtk_accessible_get_at_context (rel);
gtk_at_context_get_name_accumulate (rel_context, names, FALSE);
g_object_unref (rel_context);
}
}
@@ -1102,8 +1065,6 @@ gtk_at_context_get_description_accumulate (GtkATContext *self,
GtkATContext *rel_context = gtk_accessible_get_at_context (rel);
gtk_at_context_get_description_accumulate (rel_context, labels, FALSE);
g_object_unref (rel_context);
}
}
+1 -8
View File
@@ -1608,7 +1608,6 @@ create_subparser (GObject *object,
subparser->object = object;
subparser->child = child;
subparser->tagname = g_strdup (element_name);
subparser->level = 1;
subparser->start = element_name;
subparser->parser = g_memdup2 (parser, sizeof (GtkBuildableParser));
subparser->data = user_data;
@@ -1639,8 +1638,6 @@ subparser_start (GtkBuildableParseContext *context,
if (subparser->start)
{
subparser->level++;
if (subparser->parser->start_element)
subparser->parser->start_element (context,
element_name, names, values,
@@ -1656,8 +1653,6 @@ subparser_end (GtkBuildableParseContext *context,
ParserData *data,
GError **error)
{
data->subparser->level--;
if (data->subparser->parser->end_element)
data->subparser->parser->end_element (context, element_name,
data->subparser->data, error);
@@ -1665,11 +1660,9 @@ subparser_end (GtkBuildableParseContext *context,
if (*error)
return;
if (data->subparser->level > 0)
if (strcmp (data->subparser->start, element_name) != 0)
return;
g_assert (strcmp (data->subparser->start, element_name) == 0);
gtk_buildable_custom_tag_end (GTK_BUILDABLE (data->subparser->object),
data->builder,
data->subparser->child,
-1
View File
@@ -165,7 +165,6 @@ struct _GtkBuildableParseContext {
typedef struct {
GtkBuildableParser *parser;
char *tagname;
int level;
const char *start;
gpointer data;
GObject *object;
+4 -1
View File
@@ -19,7 +19,7 @@
* Modified by the GTK+ Team and others 1997-2001. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/**
@@ -63,6 +63,7 @@
#include "gtkactionhelperprivate.h"
#include "gtkbuildable.h"
#include "gtkcheckbutton.h"
#include "gtkgestureclick.h"
#include "gtkeventcontrollerkey.h"
#include "gtkbinlayout.h"
@@ -828,6 +829,8 @@ gtk_button_set_label (GtkButton *button,
gtk_label_set_use_underline (GTK_LABEL (child), priv->use_underline);
gtk_label_set_mnemonic_widget (GTK_LABEL (child), GTK_WIDGET (button));
}
if (GTK_IS_CHECK_BUTTON (button))
gtk_label_set_xalign (GTK_LABEL (child), 0.0);
gtk_button_set_child (button, child);
}
+1 -5
View File
@@ -1306,9 +1306,6 @@ typedef enum {
* @GTK_ACCESSIBLE_ROLE_WIDGET: An interactive component of a graphical user
* interface. This is the role that GTK uses by default for widgets.
* @GTK_ACCESSIBLE_ROLE_WINDOW: An application window.
* @GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON: A type of push button
* which stays pressed until depressed by a second activation.
* Since: 4.10
*
* The accessible role for a [iface@Accessible] implementation.
*
@@ -1393,8 +1390,7 @@ typedef enum {
GTK_ACCESSIBLE_ROLE_TREE_GRID,
GTK_ACCESSIBLE_ROLE_TREE_ITEM,
GTK_ACCESSIBLE_ROLE_WIDGET,
GTK_ACCESSIBLE_ROLE_WINDOW,
GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON
GTK_ACCESSIBLE_ROLE_WINDOW
} GtkAccessibleRole;
/**
+2 -5
View File
@@ -3549,12 +3549,9 @@ show_and_select_files (GtkFileChooserWidget *impl,
if (!g_file_info_get_attribute_boolean (info, "filechooser::visible"))
{
gboolean has_is_hidden = g_file_info_has_attribute (info, "standard::is-hidden");
gboolean has_is_backup = g_file_info_has_attribute (info, "standard::is-backup");
if (!enabled_hidden &&
((has_is_hidden && g_file_info_get_is_hidden (info)) ||
(has_is_backup && g_file_info_get_is_backup (info))))
(g_file_info_get_is_hidden (info) ||
g_file_info_get_is_backup (info)))
{
set_show_hidden (impl, TRUE);
enabled_hidden = TRUE;
+5 -10
View File
@@ -209,18 +209,13 @@ node_should_be_visible (GtkFileSystemModel *model,
gboolean filtered_out)
{
FileModelNode *node = get_node (model, id);
gboolean has_is_hidden;
gboolean has_is_backup;
gboolean result;
if (node->info == NULL)
return FALSE;
has_is_hidden = g_file_info_has_attribute (node->info, "standard::is-hidden");
has_is_backup = g_file_info_has_attribute (node->info, "standard::is-backup");
if (!model->show_hidden &&
((has_is_hidden && g_file_info_get_is_hidden (node->info)) ||
(has_is_backup && g_file_info_get_is_backup (node->info))))
(g_file_info_get_is_hidden (node->info) || g_file_info_get_is_backup (node->info)))
return FALSE;
if (_gtk_file_info_consider_as_directory (node->info))
@@ -464,7 +459,7 @@ remove_file (GtkFileSystemModel *model,
g_return_if_fail (G_IS_FILE (file));
id = node_get_for_file (model, file);
if (id == GTK_INVALID_LIST_POSITION)
if (id == 0)
return;
node = get_node (model, id);
@@ -946,7 +941,7 @@ _gtk_file_system_model_set_filter_folders (GtkFileSystemModel *model,
* @model: the model
*
* Gets the cancellable used by the @model. This is the cancellable used
* internally by the @model that will be cancelled when @model is
* internally by the @model that will be cancelled when @model is
* disposed. So you can use it for operations that should be cancelled
* when the model goes away.
*
@@ -1010,7 +1005,7 @@ _gtk_file_system_model_update_files (GtkFileSystemModel *model,
* _gtk_file_system_model_set_filter:
* @mode: a `GtkFileSystemModel`
* @filter: (nullable): %NULL or filter to use
*
*
* Sets a filter to be used for deciding if a row should be visible or not.
* Whether this filter applies to directories can be toggled with
* _gtk_file_system_model_set_filter_folders().
@@ -1033,7 +1028,7 @@ _gtk_file_system_model_set_filter (GtkFileSystemModel *model,
* @file: the file to add
* @attributes: attributes to query before adding the file
*
* This is a convenience function that calls g_file_query_info_async() on
* This is a convenience function that calls g_file_query_info_async() on
* the given file, and when successful, adds it to the model.
* Upon failure, the @file is discarded.
**/
+7 -20
View File
@@ -78,10 +78,7 @@ update_image (GtkFileThumbnail *self)
int scale;
if (!g_file_info_has_attribute (self->info, G_FILE_ATTRIBUTE_STANDARD_ICON))
{
gtk_image_clear (GTK_IMAGE (self->image));
return FALSE;
}
return FALSE;
scale = gtk_widget_get_scale_factor (GTK_WIDGET (self));
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (self)));
@@ -94,6 +91,7 @@ update_image (GtkFileThumbnail *self)
g_object_unref (icon);
return TRUE;
}
static void
@@ -104,19 +102,10 @@ thumbnail_queried_cb (GObject *object,
GtkFileThumbnail *self = user_data; /* might be unreffed if operation was cancelled */
GFile *file = G_FILE (object);
GFileInfo *queried;
GError *error = NULL;
queried = g_file_query_info_finish (file, result, &error);
if (error)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_file_info_set_attribute_boolean (self->info, "filechooser::queried", TRUE);
g_clear_error (&error);
return;
}
g_file_info_set_attribute_boolean (self->info, "filechooser::queried", TRUE);
queried = g_file_query_info_finish (file, result, NULL);
if (queried == NULL)
return;
copy_attribute (self->info, queried, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
copy_attribute (self->info, queried, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
@@ -140,10 +129,7 @@ static void
get_thumbnail (GtkFileThumbnail *self)
{
if (!self->info)
{
gtk_image_clear (GTK_IMAGE (self->image));
return;
}
return;
if (!update_image (self))
{
@@ -156,6 +142,7 @@ get_thumbnail (GtkFileThumbnail *self)
self->cancellable = g_cancellable_new ();
file = _gtk_file_info_get_file (self->info);
g_file_info_set_attribute_boolean (self->info, "filechooser::queried", TRUE);
g_file_query_info_async (file,
G_FILE_ATTRIBUTE_THUMBNAIL_PATH ","
G_FILE_ATTRIBUTE_THUMBNAILING_FAILED ","
-2
View File
@@ -351,8 +351,6 @@ init_compose_table_thread_cb (GTask *task,
gtk_im_context_simple_init_compose_table ();
g_task_return_boolean (task, TRUE);
gdk_profiler_end_mark (before, "im compose table load (thread)", NULL);
}
+1 -3
View File
@@ -329,8 +329,6 @@ update_at_context (GtkModelButton *button)
if (was_realized)
gtk_at_context_realize (context);
g_object_unref (context);
}
static void
@@ -1201,7 +1199,7 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
* A GIcon that will be used if iconic appearance for the button is
* desired.
*/
properties[PROP_ICON] =
properties[PROP_ICON] =
g_param_spec_object ("icon", NULL, NULL,
G_TYPE_ICON,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
+3 -5
View File
@@ -4033,6 +4033,9 @@ gtk_notebook_insert_notebook_page (GtkNotebook *notebook,
g_signal_connect (controller, "enter", G_CALLBACK (gtk_notebook_tab_drop_enter), page);
g_signal_connect (controller, "leave", G_CALLBACK (gtk_notebook_tab_drop_leave), page);
gtk_widget_add_controller (page->tab_widget, controller);
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
GTK_ACCESSIBLE_PROPERTY_LABEL, _("Tab"),
-1);
page->expand = FALSE;
page->fill = TRUE;
@@ -4332,11 +4335,6 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
text = page->tab_text;
else
text = string;
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
GTK_ACCESSIBLE_PROPERTY_LABEL, text,
-1);
if (notebook->show_tabs)
{
if (page->default_tab)
+5 -9
View File
@@ -218,7 +218,7 @@ gtk_path_bar_init (GtkPathBar *path_bar)
desktop = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
if (desktop != NULL)
path_bar->desktop_file = g_file_new_for_path (desktop);
else
else
path_bar->desktop_file = NULL;
}
else
@@ -306,7 +306,7 @@ update_visibility_up_to_next_root (GtkPathBar *path_bar,
{
gboolean fake_root_found = FALSE;
GList *l;
for (l = start_from_button; l; l = l->next)
{
GtkWidget *button = BUTTON_DATA (l->data)->button;
@@ -776,7 +776,6 @@ gtk_path_bar_get_info_callback (GObject *source,
GFileInfo *info;
ButtonData *button_data;
const char *display_name;
gboolean has_is_hidden, has_is_backup;
gboolean is_hidden;
info = g_file_query_info_finish (file, result, NULL);
@@ -795,10 +794,7 @@ gtk_path_bar_get_info_callback (GObject *source,
file_info->cancellable = NULL;
display_name = g_file_info_get_display_name (info);
has_is_hidden = g_file_info_has_attribute (info, "standard::is-hidden");
has_is_backup = g_file_info_has_attribute (info, "standard::is-backup");
is_hidden = (has_is_hidden && g_file_info_get_is_hidden (info)) ||
(has_is_backup && g_file_info_get_is_backup (info));
is_hidden = g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info);
button_data = make_directory_button (file_info->path_bar, display_name,
file_info->file,
@@ -883,7 +879,7 @@ _gtk_path_bar_set_file (GtkPathBar *path_bar,
/**
* _gtk_path_bar_up:
* @path_bar: a `GtkPathBar`
*
*
* If the selected button in the pathbar is not the furthest button up (in the
* root direction), act as if the user clicked on the next button up.
**/
@@ -910,7 +906,7 @@ _gtk_path_bar_up (GtkPathBar *path_bar)
/**
* _gtk_path_bar_down:
* @path_bar: a `GtkPathBar`
*
*
* If the selected button in the pathbar is not the furthest button down (in the
* leaf direction), act as if the user clicked on the next button down.
**/
+10 -30
View File
@@ -219,7 +219,6 @@ struct _GtkStackPage
guint needs_attention : 1;
guint visible : 1;
guint use_underline : 1;
guint in_destruction : 1;
};
typedef struct _GtkStackPageClass GtkStackPageClass;
@@ -236,14 +235,6 @@ gtk_stack_page_accessible_get_at_context (GtkAccessible *accessible)
{
GtkStackPage *page = GTK_STACK_PAGE (accessible);
if (page->in_destruction)
{
GTK_DEBUG (A11Y, "ATContext for “%s” [%p] accessed during destruction",
G_OBJECT_TYPE_NAME (accessible),
accessible);
return NULL;
}
if (page->at_context == NULL)
{
GtkAccessibleRole role = GTK_ACCESSIBLE_ROLE_TAB_PANEL;
@@ -255,11 +246,9 @@ gtk_stack_page_accessible_get_at_context (GtkAccessible *accessible)
display = gdk_display_get_default ();
page->at_context = gtk_at_context_create (role, accessible, display);
if (page->at_context == NULL)
return NULL;
}
return g_object_ref (page->at_context);
return page->at_context;
}
static gboolean
@@ -273,36 +262,30 @@ static GtkAccessible *
gtk_stack_page_accessible_get_accessible_parent (GtkAccessible *accessible)
{
GtkStackPage *page = GTK_STACK_PAGE (accessible);
GtkWidget *parent;
if (page->widget == NULL)
return NULL;
parent = _gtk_widget_get_parent (page->widget);
return GTK_ACCESSIBLE (g_object_ref (parent));
else
return GTK_ACCESSIBLE (gtk_widget_get_parent (page->widget));
}
static GtkAccessible *
gtk_stack_page_accessible_get_first_accessible_child (GtkAccessible *accessible)
gtk_stack_page_accessible_get_first_accessible_child(GtkAccessible *accessible)
{
GtkStackPage *page = GTK_STACK_PAGE (accessible);
if (page->widget == NULL)
if (page->widget != NULL)
return GTK_ACCESSIBLE (page->widget);
else
return NULL;
return GTK_ACCESSIBLE (g_object_ref (page->widget));
}
static GtkAccessible *
gtk_stack_page_accessible_get_next_accessible_sibling (GtkAccessible *accessible)
gtk_stack_page_accessible_get_next_accessible_sibling(GtkAccessible *accessible)
{
GtkStackPage *page = GTK_STACK_PAGE (accessible);
if (page->next_page == NULL)
return NULL;
return GTK_ACCESSIBLE (g_object_ref (page->next_page));
return GTK_ACCESSIBLE (page->next_page);
}
static gboolean
@@ -362,8 +345,6 @@ gtk_stack_page_dispose (GObject *object)
{
GtkStackPage *page = GTK_STACK_PAGE (object);
page->in_destruction = TRUE;
g_clear_object (&page->at_context);
G_OBJECT_CLASS (gtk_stack_page_parent_class)->dispose (object);
@@ -810,8 +791,7 @@ gtk_stack_accessible_get_first_accessible_child (GtkAccessible *accessible)
GtkStack *stack = GTK_STACK (accessible);
GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
GtkStackPage *page = g_ptr_array_index (priv->children, 0);
return GTK_ACCESSIBLE (g_object_ref (page));
return GTK_ACCESSIBLE (page);
}
static void
+3 -21
View File
@@ -172,7 +172,6 @@ gtk_test_accessible_has_property (GtkAccessible *accessible,
GtkAccessibleProperty property)
{
GtkATContext *context;
gboolean res;
g_return_val_if_fail (GTK_IS_ACCESSIBLE (accessible), FALSE);
@@ -180,11 +179,7 @@ gtk_test_accessible_has_property (GtkAccessible *accessible,
if (context == NULL)
return FALSE;
res = gtk_at_context_has_accessible_property (context, property);
g_object_unref (context);
return res;
return gtk_at_context_has_accessible_property (context, property);
}
/**
@@ -235,7 +230,6 @@ gtk_test_accessible_check_property (GtkAccessible *accessible,
out:
gtk_accessible_value_unref (check_value);
g_object_unref (context);
return res;
}
@@ -254,7 +248,6 @@ gtk_test_accessible_has_state (GtkAccessible *accessible,
GtkAccessibleState state)
{
GtkATContext *context;
gboolean res;
g_return_val_if_fail (GTK_IS_ACCESSIBLE (accessible), FALSE);
@@ -262,11 +255,7 @@ gtk_test_accessible_has_state (GtkAccessible *accessible,
if (context == NULL)
return FALSE;
res = gtk_at_context_has_accessible_state (context, state);
g_object_unref (context);
return res;
return gtk_at_context_has_accessible_state (context, state);
}
/**
@@ -317,7 +306,6 @@ gtk_test_accessible_check_state (GtkAccessible *accessible,
out:
gtk_accessible_value_unref (check_value);
g_object_unref (context);
return res;
}
@@ -336,7 +324,6 @@ gtk_test_accessible_has_relation (GtkAccessible *accessible,
GtkAccessibleRelation relation)
{
GtkATContext *context;
gboolean res;
g_return_val_if_fail (GTK_IS_ACCESSIBLE (accessible), FALSE);
@@ -344,11 +331,7 @@ gtk_test_accessible_has_relation (GtkAccessible *accessible,
if (context == NULL)
return FALSE;
res = gtk_at_context_has_accessible_relation (context, relation);
g_object_unref (context);
return res;
return gtk_at_context_has_accessible_relation (context, relation);
}
/**
@@ -399,7 +382,6 @@ gtk_test_accessible_check_relation (GtkAccessible *accessible,
out:
gtk_accessible_value_unref (check_value);
g_object_unref (context);
return res;
}
+7 -44
View File
@@ -247,7 +247,6 @@ struct _GtkTextPrivate
guint populate_all : 1;
guint propagate_text_width : 1;
guint text_handles_enabled : 1;
guint enable_undo : 1;
};
struct _GtkTextPasswordHint
@@ -398,9 +397,6 @@ static void gtk_text_set_max_width_chars (GtkText *self,
static void gtk_text_set_alignment (GtkText *self,
float xalign);
static void gtk_text_set_enable_undo (GtkText *self,
gboolean enable_undo);
/* Default signal handlers
*/
static GMenuModel *gtk_text_get_menu_model (GtkText *self);
@@ -565,7 +561,6 @@ static void begin_change (GtkText *self);
static void end_change (GtkText *self);
static void emit_changed (GtkText *self);
static void gtk_text_update_history (GtkText *self);
static void gtk_text_update_clipboard_actions (GtkText *self);
static void gtk_text_update_emoji_action (GtkText *self);
static void gtk_text_update_handles (GtkText *self);
@@ -1607,7 +1602,11 @@ gtk_text_set_property (GObject *object,
break;
case NUM_PROPERTIES + GTK_EDITABLE_PROP_ENABLE_UNDO:
gtk_text_set_enable_undo (self, g_value_get_boolean (value));
if (g_value_get_boolean (value) != gtk_text_history_get_enabled (priv->history))
{
gtk_text_history_set_enabled (priv->history, g_value_get_boolean (value));
g_object_notify_by_pspec (object, pspec);
}
break;
/* GtkText properties */
@@ -1733,7 +1732,7 @@ gtk_text_get_property (GObject *object,
break;
case NUM_PROPERTIES + GTK_EDITABLE_PROP_ENABLE_UNDO:
g_value_set_boolean (value, priv->enable_undo);
g_value_set_boolean (value, gtk_text_history_get_enabled (priv->history));
break;
/* GtkText properties */
@@ -1859,7 +1858,6 @@ gtk_text_init (GtkText *self)
priv->cursor_alpha = 1.0;
priv->invisible_char = 0;
priv->history = gtk_text_history_new (&history_funcs, self);
priv->enable_undo = TRUE;
gtk_text_history_set_max_undo_levels (priv->history, DEFAULT_MAX_UNDO);
@@ -3402,15 +3400,11 @@ gtk_text_insert_text (GtkText *self,
* The incoming text may a password or other secret. We make sure
* not to copy it into temporary buffers.
*/
if (priv->change_count == 0)
gtk_text_history_begin_irreversible_action (priv->history);
begin_change (self);
n_inserted = gtk_entry_buffer_insert_text (get_buffer (self), *position, text, n_chars);
end_change (self);
if (priv->change_count == 0)
gtk_text_history_end_irreversible_action (priv->history);
if (n_inserted != n_chars)
gtk_widget_error_bell (GTK_WIDGET (self));
@@ -3432,16 +3426,11 @@ gtk_text_delete_text (GtkText *self,
if (start_pos == end_pos)
return;
if (priv->change_count == 0)
gtk_text_history_begin_irreversible_action (priv->history);
begin_change (self);
gtk_entry_buffer_delete_text (get_buffer (self), start_pos, end_pos - start_pos);
end_change (self);
if (priv->change_count == 0)
gtk_text_history_end_irreversible_action (priv->history);
update_placeholder_visibility (self);
if (priv->propagate_text_width)
gtk_widget_queue_resize (GTK_WIDGET (self));
@@ -5536,7 +5525,6 @@ gtk_text_set_editable (GtkText *self,
gtk_event_controller_key_set_im_context (GTK_EVENT_CONTROLLER_KEY (priv->key_controller),
is_editable ? priv->im_context : NULL);
gtk_text_update_history (self);
gtk_text_update_clipboard_actions (self);
gtk_text_update_emoji_action (self);
@@ -5617,7 +5605,7 @@ gtk_text_set_visibility (GtkText *self,
gtk_text_recompute (self);
/* disable undo when invisible text is used */
gtk_text_update_history (self);
gtk_text_history_set_enabled (priv->history, visible);
gtk_text_update_clipboard_actions (self);
}
@@ -7296,28 +7284,3 @@ gtk_text_history_select_cb (gpointer funcs_data,
selection_insert,
selection_bound);
}
static void
gtk_text_set_enable_undo (GtkText *self,
gboolean enable_undo)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
if (priv->enable_undo == enable_undo)
return;
priv->enable_undo = enable_undo;
gtk_text_update_history (self);
g_object_notify (G_OBJECT (self), "enable-undo");
}
static void
gtk_text_update_history (GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
gtk_text_history_set_enabled (priv->history,
priv->enable_undo &&
priv->visible &&
priv->editable);
}
+1 -1
View File
@@ -5336,7 +5336,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
GdkRGBA *rgba;
char *value;
g_object_get (tag, "foreground-rgba", &rgba, NULL);
g_object_get (tag, "foreground", &rgba, NULL);
value = g_strdup_printf ("%u,%u,%u",
(guint) rgba->red * 65535,
(guint) rgba->green * 65535,
+5 -4
View File
@@ -4689,10 +4689,6 @@ gtk_text_view_size_allocate (GtkWidget *widget,
}
g_object_unref (layout);
/* The GTK resize loop processes all the pending exposes right
* after doing the resize stuff, so the idle sizer won't have a
* chance to run. So we do the work here.
*/
gtk_text_view_flush_first_validate (text_view);
chooser = g_object_get_data (G_OBJECT (text_view), "gtk-emoji-chooser");
@@ -4876,6 +4872,8 @@ gtk_text_view_invalidate (GtkTextView *text_view)
DV (g_print (G_STRLOC": adding incremental validate idle %d\n",
priv->incremental_validate_idle));
}
gtk_widget_queue_allocate (GTK_WIDGET (text_view));
}
static void
@@ -5843,6 +5841,9 @@ gtk_text_view_paint (GtkWidget *widget,
g_return_if_fail (priv->xoffset >= - priv->left_padding);
g_return_if_fail (priv->yoffset >= - priv->top_margin);
if (priv->first_validate_idle != 0)
g_critical ("textview: paint with unfinished validation\n");
while (priv->first_validate_idle != 0)
{
DV (g_print (G_STRLOC": first_validate_idle: %d\n",
-6
View File
@@ -67,10 +67,6 @@
* `GtkToggleButton` has a single CSS node with name button. To differentiate
* it from a plain `GtkButton`, it gets the `.toggle` style class.
*
* ## Accessibility
*
* `GtkToggleButton` uses the %GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON role.
*
* ## Creating two `GtkToggleButton` widgets.
*
* ```c
@@ -315,8 +311,6 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
G_TYPE_NONE, 0);
gtk_widget_class_set_css_name (widget_class, I_("button"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON);
}
static void
+27 -70
View File
@@ -75,6 +75,7 @@
#include "gdk/gdkeventsprivate.h"
#include "gdk/gdkprofilerprivate.h"
#include "gdk/gdkframeclockprivate.h"
#include "gsk/gskdebugprivate.h"
#include "gsk/gskrendererprivate.h"
@@ -633,7 +634,6 @@ static void remove_parent_surface_transform_changed_listener (GtkWidget *wid
static void add_parent_surface_transform_changed_listener (GtkWidget *widget);
static void gtk_widget_queue_compute_expand (GtkWidget *widget);
static GtkATContext *create_at_context (GtkWidget *self);
static int GtkWidget_private_offset = 0;
@@ -905,18 +905,8 @@ gtk_widget_get_accessible_role (GtkWidget *self)
GtkATContext *context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (self));
GtkWidgetClassPrivate *class_priv;
if (context != NULL)
{
GtkAccessibleRole role = GTK_ACCESSIBLE_ROLE_NONE;
if (gtk_at_context_is_realized (context))
role = gtk_at_context_get_accessible_role (context);
g_object_unref (context);
if (role != GTK_ACCESSIBLE_ROLE_NONE)
return role;
}
if (context != NULL && gtk_at_context_is_realized (context))
return gtk_at_context_get_accessible_role (context);
if (priv->accessible_role != GTK_ACCESSIBLE_ROLE_WIDGET)
return priv->accessible_role;
@@ -2372,7 +2362,7 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
gtk_widget_add_controller (widget, controller);
}
priv->at_context = create_at_context (widget);
priv->at_context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (widget));
}
static void
@@ -4043,8 +4033,6 @@ gtk_widget_allocate (GtkWidget *widget,
priv->height = adjusted.height;
priv->baseline = baseline;
priv->alloc_needed_on_child = FALSE;
if (priv->layout_manager != NULL)
{
gtk_layout_manager_allocate (priv->layout_manager, widget,
@@ -4072,6 +4060,7 @@ gtk_widget_allocate (GtkWidget *widget,
gtk_widget_ensure_resize (widget);
priv->alloc_needed = FALSE;
priv->alloc_needed_on_child = FALSE;
gtk_widget_update_paintables (widget);
@@ -7364,6 +7353,7 @@ gtk_widget_dispose (GObject *object)
GtkWidget *widget = GTK_WIDGET (object);
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
GSList *sizegroups;
GtkATContext *at_context;
if (priv->muxer != NULL)
g_object_run_dispose (G_OBJECT (priv->muxer));
@@ -7413,11 +7403,9 @@ gtk_widget_dispose (GObject *object)
gtk_size_group_remove_widget (size_group, widget);
}
if (priv->at_context != NULL)
{
gtk_at_context_unrealize (priv->at_context);
g_clear_object (&priv->at_context);
}
at_context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (widget));
if (at_context != NULL)
gtk_at_context_unrealize (at_context);
g_clear_object (&priv->muxer);
@@ -8440,8 +8428,9 @@ gtk_widget_set_vexpand_set (GtkWidget *widget,
*/
static GtkATContext *
create_at_context (GtkWidget *self)
gtk_widget_accessible_get_at_context (GtkAccessible *accessible)
{
GtkWidget *self = GTK_WIDGET (accessible);
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (self);
GtkWidgetClass *widget_class = GTK_WIDGET_GET_CLASS (self);
GtkWidgetClassPrivate *class_priv = widget_class->priv;
@@ -8455,6 +8444,9 @@ create_at_context (GtkWidget *self)
return NULL;
}
if (priv->at_context != NULL)
return priv->at_context;
/* Widgets have two options to set the accessible role: either they
* define it in their class_init() function, and the role applies to
* all instances; or an instance is created with the :accessible-role
@@ -8469,35 +8461,9 @@ create_at_context (GtkWidget *self)
role = class_priv->accessible_role;
priv->accessible_role = role;
priv->at_context = gtk_at_context_create (role, GTK_ACCESSIBLE (self), gdk_display_get_default ());
if (priv->at_context != NULL)
return g_object_ref (priv->at_context);
priv->at_context = gtk_at_context_create (role, accessible, gdk_display_get_default ());
return NULL;
}
static GtkATContext *
gtk_widget_accessible_get_at_context (GtkAccessible *accessible)
{
GtkWidget *self = GTK_WIDGET (accessible);
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (self);
if (priv->in_destruction)
{
GTK_DEBUG (A11Y, "ATContext for widget “%s” [%p] accessed during destruction",
G_OBJECT_TYPE_NAME (self),
self);
return NULL;
}
if (priv->at_context != NULL)
return g_object_ref (priv->at_context);
priv->at_context = create_at_context (self);
if (priv->at_context != NULL)
return g_object_ref (priv->at_context);
return NULL;
return priv->at_context;
}
static gboolean
@@ -8520,34 +8486,19 @@ gtk_widget_accessible_get_platform_state (GtkAccessible *self,
static GtkAccessible *
gtk_widget_accessible_get_accessible_parent (GtkAccessible *self)
{
GtkWidget *parent = _gtk_widget_get_parent (GTK_WIDGET (self));
if (parent == NULL)
return NULL;
return GTK_ACCESSIBLE (g_object_ref (parent));
return GTK_ACCESSIBLE (gtk_widget_get_parent (GTK_WIDGET (self)));
}
static GtkAccessible *
gtk_widget_accessible_get_next_accessible_sibling (GtkAccessible *self)
{
GtkWidget *sibling = _gtk_widget_get_next_sibling (GTK_WIDGET (self));
if (sibling == NULL)
return NULL;
return GTK_ACCESSIBLE (g_object_ref (sibling));
return GTK_ACCESSIBLE (gtk_widget_get_next_sibling (GTK_WIDGET (self)));
}
static GtkAccessible *
gtk_widget_accessible_get_first_accessible_child (GtkAccessible *self)
{
GtkWidget *child = _gtk_widget_get_first_child (GTK_WIDGET (self));
if (child == NULL)
return NULL;
return GTK_ACCESSIBLE (g_object_ref (child));
return GTK_ACCESSIBLE (gtk_widget_get_first_child (GTK_WIDGET (self)));
}
static gboolean
@@ -9334,8 +9285,6 @@ gtk_widget_buildable_finish_accessibility_properties (GtkWidget *widget,
}
g_slist_free_full (attributes, accessibility_attribute_info_free);
g_object_unref (context);
}
static void
@@ -10623,6 +10572,14 @@ static void
gtk_widget_set_alloc_needed (GtkWidget *widget)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
GdkFrameClock *frame_clock = gtk_widget_get_frame_clock (widget);
if (frame_clock != NULL &&
gdk_frame_clock_get_current_phase (frame_clock) == GDK_FRAME_CLOCK_PHASE_PAINT)
{
g_warning ("%s %p set alloc-needed during PAINT\n",
G_OBJECT_TYPE_NAME (widget), widget);
}
priv->alloc_needed = TRUE;
+8 -15
View File
@@ -3595,20 +3595,9 @@ gtk_window_set_default_size_internal (GtkWindow *window,
*
* Sets the default size of a window.
*
* The default size of a window is the size that will be used if no other constraints apply.
*
* The default size will be updated whenever the window is resized
* to reflect the new size, unless the window is forced to a size,
* like when it is maximized or fullscreened.
*
* If the windows minimum size request is larger than
* If the windows natural size (its size request) is larger than
* the default, the default will be ignored.
*
* Setting the default size to a value <= 0 will cause it to be
* ignored and the natural size request will be used instead. It
* is possible to do this while the window is showing to "reset"
* it to its initial size.
*
* Unlike [method@Gtk.Widget.set_size_request], which sets a size
* request for a widget and thus would keep users from shrinking
* the window, this function only sets the initial size, just as
@@ -3617,6 +3606,13 @@ gtk_window_set_default_size_internal (GtkWindow *window,
* size of -1 means to use the natural default size (the size request
* of the window).
*
* The default size of a window only affects the first time a window is
* shown; if a window is hidden and re-shown, it will remember the size
* it had prior to hiding, rather than using the default size.
*
* Windows cant actually be 0x0 in size, they must be at least 1x1, but
* passing 0 for @width and @height is OK, resulting in a 1x1 default size.
*
* If you use this function to reestablish a previously saved window size,
* note that the appropriate size to save is the one returned by
* [method@Gtk.Window.get_default_size]. Using the window allocation
@@ -3647,9 +3643,6 @@ gtk_window_set_default_size (GtkWindow *window,
* A value of 0 for the width or height indicates that a default
* size has not been explicitly set for that dimension, so the
* natural size of the window will be used.
*
* This function is the recommended way for [saving window state
* across restarts of applications](https://developer.gnome.org/documentation/tutorials/save-state.html).
*/
void
gtk_window_get_default_size (GtkWindow *window,
+6 -21
View File
@@ -244,8 +244,6 @@ update_path (GtkInspectorA11y *sl)
}
else
path = "not on bus";
g_clear_object (&context);
#endif
gtk_label_set_label (GTK_LABEL (sl->path), path);
@@ -272,7 +270,7 @@ update_attributes (GtkInspectorA11y *sl)
gboolean has_value;
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
if (context == NULL)
if (!context)
return;
store = g_list_store_new (G_TYPE_OBJECT);
@@ -349,8 +347,6 @@ update_attributes (GtkInspectorA11y *sl)
g_object_unref (selection);
gtk_widget_set_visible (sl->attributes, g_list_model_get_n_items (G_LIST_MODEL (filter_model)) > 0);
g_object_unref (context);
}
static void
@@ -424,11 +420,8 @@ gtk_inspector_a11y_set_object (GtkInspectorA11y *sl,
if (sl->object && GTK_IS_ACCESSIBLE (sl->object))
{
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
if (context != NULL)
{
g_signal_handlers_disconnect_by_func (context, refresh_all, sl);
g_object_unref (context);
}
if (context)
g_signal_handlers_disconnect_by_func (context, refresh_all, sl);
}
g_set_object (&sl->object, object);
@@ -439,12 +432,8 @@ gtk_inspector_a11y_set_object (GtkInspectorA11y *sl,
if (GTK_IS_ACCESSIBLE (sl->object))
{
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
if (context != NULL)
{
g_signal_connect_swapped (context, "state-change", G_CALLBACK (refresh_all), sl);
g_object_unref (context);
}
if (context)
g_signal_connect_swapped (context, "state-change", G_CALLBACK (refresh_all), sl);
gtk_stack_page_set_visible (page, TRUE);
update_role (sl);
update_path (sl);
@@ -472,11 +461,7 @@ dispose (GObject *o)
GtkATContext *context;
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
if (context != NULL)
{
g_signal_handlers_disconnect_by_func (context, refresh_all, sl);
g_object_unref (context);
}
g_signal_handlers_disconnect_by_func (context, refresh_all, sl);
}
g_clear_object (&sl->object);
+1 -1
View File
@@ -185,7 +185,7 @@ action_state_changed_cb (GActionGroup *group,
static void
update_widgets (GtkInspectorActionEditor *r)
{
GVariant *state = NULL;
GVariant *state;
if (G_IS_ACTION_GROUP (r->owner))
g_action_group_query_action (G_ACTION_GROUP (r->owner), r->name,
-18
View File
@@ -658,7 +658,6 @@ init_icons (GtkInspectorVisual *vis)
GList *list, *l;
int i;
GtkStringList *names;
const char * const *dirs;
t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -670,14 +669,6 @@ init_icons (GtkInspectorVisual *vis)
fill_icons (path, t);
g_free (path);
dirs = g_get_system_data_dirs ();
for (i = 0; dirs[i]; i++)
{
path = g_build_filename (dirs[i], "icons", NULL);
fill_icons (path, t);
g_free (path);
}
list = NULL;
g_hash_table_iter_init (&iter, t);
while (g_hash_table_iter_next (&iter, (gpointer *)&theme, NULL))
@@ -732,7 +723,6 @@ init_cursors (GtkInspectorVisual *vis)
GList *list, *l;
GtkStringList *names;
int i;
const char * const *dirs;
t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -744,14 +734,6 @@ init_cursors (GtkInspectorVisual *vis)
fill_cursors (path, t);
g_free (path);
dirs = g_get_system_data_dirs ();
for (i = 0; dirs[i]; i++)
{
path = g_build_filename (dirs[i], "icons", NULL);
fill_cursors (path, t);
g_free (path);
}
list = NULL;
g_hash_table_iter_init (&iter, t);
while (g_hash_table_iter_next (&iter, (gpointer *)&theme, NULL))
+1 -1
View File
@@ -1,5 +1,5 @@
project('gtk', 'c',
version: '4.10.0',
version: '4.9.5',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
+869 -923
View File
File diff suppressed because it is too large Load Diff
+288 -286
View File
File diff suppressed because it is too large Load Diff
+284 -283
View File
File diff suppressed because it is too large Load Diff
+536 -556
View File
File diff suppressed because it is too large Load Diff
+676 -698
View File
File diff suppressed because it is too large Load Diff
+1068 -1108
View File
File diff suppressed because it is too large Load Diff
+488 -494
View File
File diff suppressed because it is too large Load Diff
+284 -283
View File
File diff suppressed because it is too large Load Diff
+578 -591
View File
File diff suppressed because it is too large Load Diff
+444 -457
View File
File diff suppressed because it is too large Load Diff
+342 -339
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -33,7 +33,7 @@ test_object_accessible_get_at_context (GtkAccessible *accessible)
accessible,
gdk_display_get_default ());
return g_object_ref (self->at_context);
return self->at_context;
}
static void
@@ -1,8 +0,0 @@
clip {
clip: 24995 24995 10 10;
child: texture-scale {
texture: url("data:;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAKElEQVQYlWNkYGD4z4AG/v/HEGJgwhDBAQZQIQs2hzMyMtLBauorBACQUgcSISWLRgAAAABJRU5ErkJggg==");
bounds: 0 0 50000 50000;
filter: nearest;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

@@ -1,8 +0,0 @@
clip {
clip: 3950 3950 100 100;
child: texture-scale {
bounds: 0 0 19991 19991;
filter: nearest;
texture: url('data:,<svg><rect width="10" height="10" style="fill:red" /></svg>');
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

+7 -9
View File
@@ -66,21 +66,19 @@ compare_render_tests = [
'outset_shadow_offset_y',
'outset_shadow_rounded_top',
'outset_shadow_simple',
'scaled-cairo',
'scale-textures-negative-ngl',
'scale-up-down',
'shadow-in-opacity',
'texture-url',
'repeat',
'repeat-no-repeat',
'repeat-negative-coords',
'repeat-texture',
'rounded-clip-in-clip-3d', # not really 3d, but cairo fails it
'scale-textures-negative-ngl',
'scale-up-down',
'scaled-cairo',
'scaled-texture',
'shadow-in-opacity',
'texture-scale-magnify-10000x',
'texture-scale-stripes',
'texture-url',
'transform-in-transform',
'transform-in-transform-in-transform',
'rounded-clip-in-clip-3d', # not really 3d, but cairo fails it
'scaled-texture',
]
# these are too sensitive to differences in the renderers
-105
View File
@@ -2796,110 +2796,6 @@ test_child_dispose_order (void)
g_assert_cmpuint (data.destroy_count, ==, 2);
}
#define MY_GTK_BUILDABLE_TEMPLATE "\
<interface>\n\
<template class=\"MyGtkBuildable\" parent=\"GtkWidget\">\n\
<custom/>\n\
<custom>\n\
<custom/>\n\
</custom>\n\
</template>\n\
</interface>\n"
#define MY_TYPE_GTK_BUILDABLE (my_gtk_buildable_get_type ())
G_DECLARE_FINAL_TYPE (MyGtkBuildable, my_gtk_buildable, MY, GTK_BUILDABLE, GtkWidget)
struct _MyGtkBuildable
{
GtkWidget parent_instance;
};
static void my_gtk_buildable_buildable_init (GtkBuildableIface *iface);
static GtkBuildableIface *parent_buildable_iface;
G_DEFINE_TYPE_WITH_CODE (MyGtkBuildable, my_gtk_buildable, GTK_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
my_gtk_buildable_buildable_init));
static void
my_gtk_buildable_init (MyGtkBuildable *buildable)
{
gtk_widget_init_template (GTK_WIDGET (buildable));
}
static void
my_gtk_buildable_class_init (MyGtkBuildableClass *klass)
{
GBytes *template = g_bytes_new_static (MY_GTK_BUILDABLE_TEMPLATE, strlen (MY_GTK_BUILDABLE_TEMPLATE));
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gtk_widget_class_set_template (widget_class, template);
}
static const GtkBuildableParser custom_parser = {
NULL,
NULL,
NULL,
NULL
};
static gboolean
my_gtk_buildable_custom_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
GtkBuildableParser *parser,
gpointer *parser_data)
{
if (strcmp (tagname, "custom") == 0) {
*parser = custom_parser;
*parser_data = NULL;
return TRUE;
}
return FALSE;
}
static void
my_gtk_buildable_custom_finished (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
gpointer user_data)
{
if (strcmp (tagname, "custom") == 0)
return;
parent_buildable_iface->custom_finished (buildable, builder, child,
tagname, user_data);
}
static void
my_gtk_buildable_buildable_init (GtkBuildableIface *iface)
{
parent_buildable_iface = g_type_interface_peek_parent (iface);
iface->custom_tag_start = my_gtk_buildable_custom_tag_start;
iface->custom_finished = my_gtk_buildable_custom_finished;
}
static void
test_buildable (void)
{
MyGtkBuildable *my_gtk_buildable;
/* make sure the type we are trying to register does not exist */
g_assert_false (g_type_from_name ("MyGtkBuildable"));
/* create the template object */
my_gtk_buildable = g_object_new (MY_TYPE_GTK_BUILDABLE, NULL);
/* Check everything is fine */
g_assert_true (g_type_from_name ("MyGtkBuildable"));
g_assert_true (MY_IS_GTK_BUILDABLE (my_gtk_buildable));
}
int
main (int argc, char **argv)
{
@@ -2948,7 +2844,6 @@ main (int argc, char **argv)
g_test_add_func ("/Builder/Transforms", test_transforms);
g_test_add_func ("/Builder/Expressions", test_expressions);
g_test_add_func ("/Builder/Child Dispose Order", test_child_dispose_order);
g_test_add_func ("/Builder/Buildable", test_buildable);
return g_test_run();
}
@@ -1 +1 @@
invalid5.ui:3:1 Required GTK version 5.10, current version is 4.10
invalid5.ui:3:1 Required GTK version 5.10, current version is 4.9