rofi  1.7.0
rofi-icon-fetcher.c File Reference
#include "config.h"
#include <stdlib.h>
#include <xcb/xproto.h>
#include "helper.h"
#include "rofi-icon-fetcher.h"
#include "rofi-types.h"
#include "settings.h"
#include "keyb.h"
#include "view.h"
#include "xcb.h"
#include "nkutils-enum.h"
#include "nkutils-xdg-theme.h"
#include <stdint.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
Include dependency graph for rofi-icon-fetcher.c:

Go to the source code of this file.

Data Structures

struct  IconFetcher
 
struct  IconFetcherNameEntry
 
struct  IconFetcherEntry
 

Macros

#define G_LOG_DOMAIN   "Helpers.IconFetcher"
 
#define RED_BYTE   2
 
#define GREEN_BYTE   1
 
#define BLUE_BYTE   0
 
#define ALPHA_BYTE   3
 

Functions

static void rofi_icon_fetch_entry_free (gpointer data)
 
void rofi_icon_fetcher_init (void)
 
static void free_wrapper (gpointer data, G_GNUC_UNUSED gpointer user_data)
 
void rofi_icon_fetcher_destroy (void)
 
static guchar alpha_mult (guchar c, guchar a)
 
static cairo_surface_t * rofi_icon_fetcher_get_surface_from_pixbuf (GdkPixbuf *pixbuf)
 
gboolean rofi_icon_fetcher_file_is_image (const char *const path)
 
static void rofi_icon_fetcher_worker (thread_state *sdata, G_GNUC_UNUSED gpointer user_data)
 
uint32_t rofi_icon_fetcher_query_advanced (const char *name, const int wsize, const int hsize)
 
uint32_t rofi_icon_fetcher_query (const char *name, const int size)
 
cairo_surface_t * rofi_icon_fetcher_get (const uint32_t uid)
 

Variables

IconFetcherrofi_icon_fetcher_data = NULL
 

Macro Definition Documentation

◆ ALPHA_BYTE

#define ALPHA_BYTE   3

Location of alpha byte

Definition at line 177 of file rofi-icon-fetcher.c.

◆ BLUE_BYTE

#define BLUE_BYTE   0

Location of blue byte

Definition at line 175 of file rofi-icon-fetcher.c.

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "Helpers.IconFetcher"

The log domain of this Helper.

Definition at line 29 of file rofi-icon-fetcher.c.

◆ GREEN_BYTE

#define GREEN_BYTE   1

Location of green byte

Definition at line 173 of file rofi-icon-fetcher.c.

◆ RED_BYTE

#define RED_BYTE   2

Location of red byte

Definition at line 171 of file rofi-icon-fetcher.c.

Function Documentation

◆ alpha_mult()

static guchar alpha_mult ( guchar  c,
guchar  a 
)
inlinestatic

Definition at line 189 of file rofi-icon-fetcher.c.

Referenced by rofi_icon_fetcher_get_surface_from_pixbuf().

Here is the caller graph for this function:

◆ free_wrapper()

static void free_wrapper ( gpointer  data,
G_GNUC_UNUSED gpointer  user_data 
)
static

Definition at line 143 of file rofi-icon-fetcher.c.

Referenced by rofi_icon_fetcher_destroy().

Here is the caller graph for this function:

◆ rofi_icon_fetch_entry_free()

static void rofi_icon_fetch_entry_free ( gpointer  data)
static

Definition at line 91 of file rofi-icon-fetcher.c.

References IconFetcherNameEntry::name, IconFetcherNameEntry::sizes, and IconFetcherEntry::surface.

Referenced by rofi_icon_fetcher_init().

Here is the caller graph for this function:

◆ rofi_icon_fetcher_get_surface_from_pixbuf()

static cairo_surface_t* rofi_icon_fetcher_get_surface_from_pixbuf ( GdkPixbuf *  pixbuf)
static

Definition at line 203 of file rofi-icon-fetcher.c.

References ALPHA_BYTE, alpha_mult(), BLUE_BYTE, GREEN_BYTE, and RED_BYTE.

Referenced by rofi_icon_fetcher_worker().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_icon_fetcher_worker()

static void rofi_icon_fetcher_worker ( thread_state sdata,
G_GNUC_UNUSED gpointer  user_data 
)
static

Variable Documentation

◆ rofi_icon_fetcher_data