summaryrefslogtreecommitdiff
path: root/libslab/mate-utils.c
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2023-10-25 21:43:03 +0800
committerraveit65 <[email protected]>2023-11-05 12:00:50 +0100
commitc2e94e1925f3c7acfa3fd3352dc8fdafe6375adc (patch)
tree3ba609bf57b7bb3eab18d35d78bd1dc86773fba6 /libslab/mate-utils.c
parent23fc7b675ebac7a9b02257a31203974d72f584b1 (diff)
downloadmate-control-center-c2e94e1925f3c7acfa3fd3352dc8fdafe6375adc.tar.bz2
mate-control-center-c2e94e1925f3c7acfa3fd3352dc8fdafe6375adc.tar.xz
Remove libslab library
libslab is only used in mate-c-c and there is no need to provide a library
Diffstat (limited to 'libslab/mate-utils.c')
-rw-r--r--libslab/mate-utils.c82
1 files changed, 0 insertions, 82 deletions
diff --git a/libslab/mate-utils.c b/libslab/mate-utils.c
deleted file mode 100644
index e42d02c4..00000000
--- a/libslab/mate-utils.c
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "mate-utils.h"
-
-#include <string.h>
-
-gboolean
-load_image_by_id (GtkImage *image, GtkIconSize size, const gchar *image_id)
-{
- cairo_surface_t *surface;
- gint width;
- gint height;
- gint scale_factor;
-
- GtkIconTheme *icon_theme;
-
- gchar *id;
-
- gboolean icon_exists;
-
- if (!image_id)
- return FALSE;
-
- id = g_strdup (image_id);
- scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (image));
-
- gtk_icon_size_lookup (size, &width, &height);
- gtk_image_set_pixel_size (image, width);
-
- if (g_path_is_absolute (id))
- {
- GdkPixbuf *pixbuf;
-
- pixbuf = gdk_pixbuf_new_from_file_at_size (id, width * scale_factor, height * scale_factor, NULL);
-
- icon_exists = (pixbuf != NULL);
-
- if (icon_exists)
- {
- surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale_factor, NULL);
- gtk_image_set_from_surface (image, surface);
-
- cairo_surface_destroy (surface);
- g_object_unref (pixbuf);
- }
- else
- gtk_image_set_from_icon_name (image, "image-missing", size);
- }
- else
- {
- if ( /* file extensions are not copesetic with loading by "name" */
- g_str_has_suffix (id, ".png") ||
- g_str_has_suffix (id, ".svg") ||
- g_str_has_suffix (id, ".xpm")
- )
-
- id[strlen (id) - 4] = '\0';
-
- if (gtk_widget_has_screen (GTK_WIDGET (image)))
- icon_theme =
- gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET
- (image)));
- else
- icon_theme = gtk_icon_theme_get_default ();
-
- surface = gtk_icon_theme_load_surface (icon_theme, id,
- width, scale_factor,
- NULL,
- GTK_ICON_LOOKUP_FORCE_SIZE,
- NULL);
- icon_exists = (surface != NULL);
- if (icon_exists) {
- gtk_image_set_from_surface (image, surface);
- cairo_surface_destroy (surface);
- }
- else
- gtk_image_set_from_icon_name (image, "image-missing", size);
-
- }
-
- g_free (id);
-
- return icon_exists;
-}