Merge branch 'wip/otte/for-main' into 'main'

keynames: Use C types

See merge request GNOME/gtk!7737
This commit is contained in:
Benjamin Otte
2024-09-25 02:07:23 +00:00
34 changed files with 73 additions and 55 deletions

View File

@@ -276,7 +276,7 @@ gtk_font_plane_class_init (GtkFontPlaneClass *class)
GtkWidget *
gtk_font_plane_new (GtkAdjustment *weight_adj,
GtkAdjustment *width_adj)
GtkAdjustment *width_adj)
{
return g_object_new (GTK_TYPE_FONT_PLANE,
"weight-adjustment", weight_adj,

View File

@@ -55,7 +55,7 @@ struct _GtkFontPlaneClass
GType gtk_font_plane_get_type (void) G_GNUC_CONST;
GtkWidget * gtk_font_plane_new (GtkAdjustment *width_adj,
GtkAdjustment *weight_adj);
GtkWidget * gtk_font_plane_new (GtkAdjustment *weight_adj,
GtkAdjustment *width_adj);
G_END_DECLS

View File

@@ -55,7 +55,7 @@ void gtk_fishbowl_set_animating (GtkFishbowl *fishbowl,
gboolean animating);
gboolean gtk_fishbowl_get_benchmark (GtkFishbowl *fishbowl);
void gtk_fishbowl_set_benchmark (GtkFishbowl *fishbowl,
gboolean animating);
gboolean benchmark);
double gtk_fishbowl_get_framerate (GtkFishbowl *fishbowl);
gint64 gtk_fishbowl_get_update_delay (GtkFishbowl *fishbowl);
void gtk_fishbowl_set_update_delay (GtkFishbowl *fishbowl,

View File

@@ -1,5 +1,7 @@
#pragma once
#include <gdk/gdk.h>
typedef struct _GdkHSLA GdkHSLA;
struct _GdkHSLA {

View File

@@ -5,4 +5,4 @@
#define NODE_TYPE_WIDGET (node_widget_get_type ())
G_DECLARE_FINAL_TYPE (NodeWidget, node_widget, NODE, WIDGET, GtkWidget)
GtkWidget * node_widget_new (const char *file);
GtkWidget * node_widget_new (const char *resource);

View File

@@ -43,7 +43,7 @@ GtkListItemFactory *
suggestion_entry_get_factory (SuggestionEntry *self);
void suggestion_entry_set_use_filter (SuggestionEntry *self,
gboolean use_ilter);
gboolean use_filter);
gboolean suggestion_entry_get_use_filter (SuggestionEntry *self);
void suggestion_entry_set_expression (SuggestionEntry *self,

View File

@@ -111,7 +111,7 @@ gboolean broadway_server_surface_translate (BroadwayServer *
int dx,
int dy);
guint32 broadway_server_upload_texture (BroadwayServer *server,
GBytes *texture);
GBytes *bytes);
void broadway_server_release_texture (BroadwayServer *server,
guint32 id);
cairo_surface_t * broadway_server_create_surface (int width,

View File

@@ -56,7 +56,7 @@ void _gdk_broadway_surface_translate (GdkSurface *surface,
int dx,
int dy);
gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
BroadwayInputMsg *msg);
BroadwayInputMsg *event);
gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
GdkSurface *surface);
void _gdk_broadway_roundtrip_notify (GdkSurface *surface,

View File

@@ -17,6 +17,7 @@
#pragma once
#include <gio/gio.h>
void file_transfer_portal_register (void);

View File

@@ -79,6 +79,6 @@ gdk_cicp_equivalent (const GdkCicp *p1,
return gdk_cicp_equal (&n1, &n2);
}
const GdkCicp * gdk_cicp_params_get_cicp (GdkCicpParams *params);
const GdkCicp * gdk_cicp_params_get_cicp (GdkCicpParams *self);
GdkCicpParams * gdk_cicp_params_new_for_cicp (const GdkCicp *cicp);

View File

@@ -20,6 +20,9 @@
* and tests, and must not include other headers.
*/
#include <glib.h>
#include <math.h>
static inline int
sign (float v)
{

View File

@@ -18,6 +18,8 @@
#pragma once
#include "gdkcolorprivate.h"
#include "gdkcolorstateprivate.h"

View File

@@ -79,8 +79,8 @@ void gdk_color_init_from_rgba (GdkColor *self,
const GdkRGBA *rgba);
void gdk_color_finish (GdkColor *self);
gboolean gdk_color_equal (const GdkColor *color1,
const GdkColor *color2);
gboolean gdk_color_equal (const GdkColor *self,
const GdkColor *other);
gboolean gdk_color_is_clear (const GdkColor *self);
gboolean gdk_color_is_opaque (const GdkColor *self);

View File

@@ -78,7 +78,7 @@ extern GdkDefaultColorState gdk_default_color_states[GDK_COLOR_STATE_N_IDS];
(GdkDefaultColorState *) (c) < &gdk_default_color_states[GDK_COLOR_STATE_N_IDS])
#define GDK_DEFAULT_COLOR_STATE_ID(c) ((GdkColorStateId) (((GdkDefaultColorState *) c) - gdk_default_color_states))
const char * gdk_color_state_get_name (GdkColorState *color_state);
const char * gdk_color_state_get_name (GdkColorState *self);
GdkColorState * gdk_color_state_get_no_srgb_tf (GdkColorState *self);
GdkColorState * gdk_color_state_new_for_cicp (const GdkCicp *cicp,

View File

@@ -117,7 +117,7 @@ struct _GdkDeviceClass
};
void _gdk_device_set_associated_device (GdkDevice *device,
GdkDevice *relative);
GdkDevice *associated);
void _gdk_device_reset_axes (GdkDevice *device);
guint _gdk_device_add_axis (GdkDevice *device,

View File

@@ -240,15 +240,15 @@ GdkVulkanContext * gdk_display_create_vulkan_context (GdkDisplay *self,
GdkSurface *surface,
GError **error);
GdkGLContext * gdk_display_get_gl_context (GdkDisplay *display);
GdkGLContext * gdk_display_get_gl_context (GdkDisplay *self);
gboolean gdk_display_init_egl (GdkDisplay *display,
gboolean gdk_display_init_egl (GdkDisplay *self,
int /*EGLenum*/ platform,
gpointer native_display,
gboolean allow_any,
GError **error);
gpointer gdk_display_get_egl_display (GdkDisplay *display);
gpointer gdk_display_get_egl_config (GdkDisplay *display,
gpointer gdk_display_get_egl_display (GdkDisplay *self);
gpointer gdk_display_get_egl_config (GdkDisplay *self,
GdkMemoryDepth depth);
void gdk_display_set_rgba (GdkDisplay *display,
@@ -289,7 +289,7 @@ void gdk_display_set_double_click_time (GdkDisplay *display,
void gdk_display_set_double_click_distance (GdkDisplay *display,
guint distance);
void gdk_display_set_cursor_theme (GdkDisplay *display,
const char *theme,
const char *name,
int size);
G_END_DECLS

View File

@@ -25,11 +25,11 @@ struct _GdkDmabufDownloaderInterface
gsize stride);
};
void gdk_dmabuf_downloader_close (GdkDmabufDownloader *downloader);
gboolean gdk_dmabuf_downloader_supports (GdkDmabufDownloader *downloader,
void gdk_dmabuf_downloader_close (GdkDmabufDownloader *self);
gboolean gdk_dmabuf_downloader_supports (GdkDmabufDownloader *self,
GdkDmabufTexture *texture,
GError **error);
void gdk_dmabuf_downloader_download (GdkDmabufDownloader *downloader,
void gdk_dmabuf_downloader_download (GdkDmabufDownloader *self,
GdkDmabufTexture *texture,
GdkMemoryFormat format,
GdkColorState *color_state,

View File

@@ -5,9 +5,9 @@
G_BEGIN_DECLS
const GdkDmabuf * gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *builder);
const GdkDmabuf * gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *self);
void gdk_dmabuf_texture_builder_set_dmabuf (GdkDmabufTextureBuilder *builder,
void gdk_dmabuf_texture_builder_set_dmabuf (GdkDmabufTextureBuilder *self,
const GdkDmabuf *dmabuf);
G_END_DECLS

View File

@@ -511,9 +511,9 @@ gdk_draw_context_end_frame (GdkDrawContext *context)
* Use `GskRenderNode` and `GskRenderer`.
*/
const cairo_region_t *
_gdk_draw_context_get_frame_region (GdkDrawContext *context)
_gdk_draw_context_get_frame_region (GdkDrawContext *self)
{
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (self);
return priv->frame_region;
}

View File

@@ -133,16 +133,16 @@ void gdk_gl_context_set_version (GdkGLContext
const GdkGLVersion *version);
void gdk_gl_context_set_is_legacy (GdkGLContext *context,
gboolean is_legacy);
gboolean gdk_gl_context_check_gl_version (GdkGLContext *context,
gboolean gdk_gl_context_check_gl_version (GdkGLContext *self,
const GdkGLVersion *gl_version,
const GdkGLVersion *gles_version);
static inline gboolean
gdk_gl_context_check_version (GdkGLContext *context,
gdk_gl_context_check_version (GdkGLContext *self,
const char *gl_version,
const char *gles_version)
{
return gdk_gl_context_check_gl_version (context,
return gdk_gl_context_check_gl_version (self,
gl_version ? &GDK_GL_VERSION_STRING (gl_version) : NULL,
gles_version ? &GDK_GL_VERSION_STRING (gles_version) : NULL);
}

View File

@@ -2479,8 +2479,8 @@ void
gdk_memory_convert_color_state (guchar *data,
gsize stride,
GdkMemoryFormat format,
GdkColorState *src_cs,
GdkColorState *dest_cs,
GdkColorState *src_color_state,
GdkColorState *dest_color_state,
gsize width,
gsize height)
{
@@ -2488,24 +2488,24 @@ gdk_memory_convert_color_state (guchar *data,
.data = data,
.stride = stride,
.format = format,
.src_cs = src_cs,
.dest_cs = dest_cs,
.src_cs = src_color_state,
.dest_cs = dest_color_state,
.width = width,
.height = height,
};
if (gdk_color_state_equal (src_cs, dest_cs))
if (gdk_color_state_equal (src_color_state, dest_color_state))
return;
if (format == GDK_MEMORY_B8G8R8A8_PREMULTIPLIED &&
src_cs == GDK_COLOR_STATE_SRGB &&
dest_cs == GDK_COLOR_STATE_SRGB_LINEAR)
src_color_state == GDK_COLOR_STATE_SRGB &&
dest_color_state == GDK_COLOR_STATE_SRGB_LINEAR)
{
gdk_parallel_task_run (gdk_memory_convert_color_state_srgb_to_srgb_linear, &mc);
}
else if (format == GDK_MEMORY_B8G8R8A8_PREMULTIPLIED &&
src_cs == GDK_COLOR_STATE_SRGB_LINEAR &&
dest_cs == GDK_COLOR_STATE_SRGB)
src_color_state == GDK_COLOR_STATE_SRGB_LINEAR &&
dest_color_state == GDK_COLOR_STATE_SRGB)
{
gdk_parallel_task_run (gdk_memory_convert_color_state_srgb_linear_to_srgb, &mc);
}

View File

@@ -96,11 +96,11 @@ const char * gdk_memory_format_get_name (GdkMemoryFormat
void gdk_memory_convert (guchar *dest_data,
gsize dest_stride,
GdkMemoryFormat dest_format,
GdkColorState *src_cs,
GdkColorState *dest_cs,
const guchar *src_data,
gsize src_stride,
GdkMemoryFormat src_format,
GdkColorState *dest_cs,
GdkColorState *src_cs,
gsize width,
gsize height);
void gdk_memory_convert_color_state (guchar *data,

View File

@@ -63,8 +63,8 @@ print ";\n\n";
print <<EOT;
typedef struct {
guint keyval;
guint offset;
unsigned int keyval;
unsigned int offset;
} gdk_key;
static const gdk_key gdk_keys_by_keyval[] = {

View File

@@ -52,11 +52,11 @@ gsk_gpu_buffer_map (GskGpuBuffer *self)
void
gsk_gpu_buffer_unmap (GskGpuBuffer *self,
gsize size)
gsize used)
{
GSK_GPU_BUFFER_GET_CLASS (self)->unmap (self, size);
GSK_GPU_BUFFER_GET_CLASS (self)->unmap (self, used);
profiler_buffer_uploads += size;
profiler_buffer_uploads += used;
gdk_profiler_set_int_counter (profiler_buffer_uploads_id, profiler_buffer_uploads);
}

View File

@@ -44,8 +44,8 @@ static inline void gsk_vulkan_free (GskVulk
GskVulkanAllocation *alloc);
static inline GskVulkanAllocator *
gsk_vulkan_allocator_ref (GskVulkanAllocator *allocator);
static inline void gsk_vulkan_allocator_unref (GskVulkanAllocator *allocator);
gsk_vulkan_allocator_ref (GskVulkanAllocator *self);
static inline void gsk_vulkan_allocator_unref (GskVulkanAllocator *self);
GskVulkanAllocator * gsk_vulkan_direct_allocator_new (VkDevice device,
uint32_t vk_type_index,

View File

@@ -450,9 +450,9 @@ pango_stretch_to_string (PangoStretch stretch)
}
const char *
pango_underline_to_string (PangoUnderline value)
pango_underline_to_string (PangoUnderline underline)
{
switch (value)
switch (underline)
{
case PANGO_UNDERLINE_NONE:
return "none";
@@ -473,9 +473,9 @@ pango_underline_to_string (PangoUnderline value)
}
const char *
pango_overline_to_string (PangoOverline value)
pango_overline_to_string (PangoOverline overline)
{
switch (value)
switch (overline)
{
case PANGO_OVERLINE_NONE:
return "none";

View File

@@ -57,7 +57,7 @@ gtk_pango_attribute_start_element (GtkBuildableParseContext *context,
const char *pango_wrap_mode_to_string (PangoWrapMode mode);
const char *pango_underline_to_string (PangoUnderline underline);
const char *pango_overline_to_string (PangoOverline underline);
const char *pango_overline_to_string (PangoOverline overline);
const char *pango_stretch_to_string (PangoStretch stretch);
const char *pango_style_to_string (PangoStyle style);
const char *pango_variant_to_string (PangoVariant variant);

View File

@@ -24,10 +24,10 @@
#pragma once
G_BEGIN_DECLS
#include "gtktextbuffer.h"
G_BEGIN_DECLS
/* This is a private uninstalled header shared between
* GtkTextView and GtkEntry
*/

View File

@@ -19,6 +19,8 @@
#pragma once
#include <gsk/gsk.h>
void assert_path_equal_func (const char *domain,
const char *file,
int line,

View File

@@ -17,6 +17,8 @@
#pragma once
#include <glib.h>
G_BEGIN_DECLS
/* reftest-snapshot.c */

View File

@@ -1,5 +1,7 @@
#pragma once
#include <glib.h>
char * diff_with_file (const char *file1,
const char *text,
gssize len,

View File

@@ -1,6 +1,7 @@
#pragma once
#include <gdk/gdk.h>
void do_compare (int *argc, const char ***argv);
void do_convert (int *argc, const char ***argv);
void do_info (int *argc, const char ***argv);

View File

@@ -1,5 +1,7 @@
#pragma once
#include <gsk/gsk.h>
void do_info (int *argc, const char ***argv);
void do_decompose (int *argc, const char ***argv);
void do_restrict (int *argc, const char ***argv);

View File

@@ -1,6 +1,7 @@
#pragma once
#include <gsk/gsk.h>
void do_benchmark (int *argc, const char ***argv);
void do_compare (int *argc, const char ***argv);
void do_info (int *argc, const char ***argv);