More consistency fixes for texture utils

Be consistent about filename vs path.
This commit is contained in:
Matthias Clasen 2024-04-29 00:42:49 -04:00
parent 60a43ddce0
commit bef6352401
4 changed files with 25 additions and 25 deletions

View File

@ -526,17 +526,17 @@ make_symbolic_pixbuf_from_resource (const char *path,
}
static GdkPixbuf *
make_symbolic_pixbuf_from_path (const char *path,
int width,
int height,
double scale,
GError **error)
make_symbolic_pixbuf_from_filename (const char *filename,
int width,
int height,
double scale,
GError **error)
{
char *data;
gsize size;
GdkPixbuf *pixbuf;
if (!g_file_get_contents (path, &data, &size, error))
if (!g_file_get_contents (filename, &data, &size, error))
return NULL;
pixbuf = gtk_make_symbolic_pixbuf_from_data (data, size, width, height, scale, NULL, error);
@ -692,17 +692,17 @@ gdk_texture_new_from_resource_at_scale (const char *path,
/* {{{ Symbolic texture API */
GdkTexture *
gdk_texture_new_from_path_symbolic (const char *path,
int width,
int height,
double scale,
gboolean *only_fg,
GError **error)
gdk_texture_new_from_filename_symbolic (const char *filename,
int width,
int height,
double scale,
gboolean *only_fg,
GError **error)
{
GdkPixbuf *pixbuf;
GdkTexture *texture = NULL;
pixbuf = make_symbolic_pixbuf_from_path (path, width, height, scale, error);
pixbuf = make_symbolic_pixbuf_from_filename (filename, width, height, scale, error);
if (pixbuf)
{
*only_fg = pixbuf_is_only_fg (pixbuf);
@ -864,15 +864,15 @@ gdk_paintable_new_from_bytes_scaled (GBytes *bytes,
}
GdkPaintable *
gdk_paintable_new_from_path_scaled (const char *path,
double scale)
gdk_paintable_new_from_filename_scaled (const char *filename,
double scale)
{
char *contents;
gsize length;
GBytes *bytes;
GdkPaintable *paintable;
if (!g_file_get_contents (path, &contents, &length, NULL))
if (!g_file_get_contents (filename, &contents, &length, NULL))
return NULL;
bytes = g_bytes_new_take (contents, length);

View File

@ -52,7 +52,7 @@ GdkTexture *gdk_texture_new_from_resource_at_scale (const char *path,
gboolean *only_fg,
GError **error);
GdkTexture *gdk_texture_new_from_path_symbolic (const char *path,
GdkTexture *gdk_texture_new_from_filename_symbolic (const char *path,
int width,
int height,
double scale,
@ -72,9 +72,9 @@ GdkTexture *gdk_texture_new_from_resource_symbolic (const char *path,
GError **error);
GdkTexture *gtk_load_symbolic_texture_from_file (GFile *file);
GdkTexture *gtk_load_symbolic_texture_from_resource (const char *data);
GdkTexture *gtk_load_symbolic_texture_from_resource (const char *path);
GdkPaintable *gdk_paintable_new_from_path_scaled (const char *path,
GdkPaintable *gdk_paintable_new_from_filename_scaled (const char *filename,
double scale);
GdkPaintable *gdk_paintable_new_from_resource_scaled (const char *path,
double scale);

View File

@ -3762,11 +3762,11 @@ icon_ensure_texture__locked (GtkIconPaintable *icon,
if (icon->is_svg)
{
if (icon->is_symbolic)
icon->texture = gdk_texture_new_from_path_symbolic (icon->filename,
pixel_size, pixel_size,
icon->desired_scale,
&only_fg,
&load_error);
icon->texture = gdk_texture_new_from_filename_symbolic (icon->filename,
pixel_size, pixel_size,
icon->desired_scale,
&only_fg,
&load_error);
else
{
GFile *file = g_file_new_for_path (icon->filename);

View File

@ -598,7 +598,7 @@ gtk_image_set_from_file (GtkImage *image,
}
scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (image));
paintable = gdk_paintable_new_from_path_scaled (filename, scale_factor);
paintable = gdk_paintable_new_from_filename_scaled (filename, scale_factor);
if (paintable == NULL)
{