labwc/include/desktop-entry.h
Consolatis 4ecedcdb3b desktop-entry: separate icon and app_id icon lookup
This patch splits desktop_entry_icon_lookup() into two separate functions
- desktop_entry_load_icon(): load a icon from the configured icon theme
- desktop_entry_load_icon_from_app_id(): load a icon name from a .desktop
  file based on the given app_id and supply it to _load_icon().

The _load_icon() function will be used in a future menu icon
implementation whereas the _load_icon_from_app_id() function is used
within the SSD titlebar window icon lookup routine.
2025-01-09 00:57:06 +09:00

26 lines
814 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_DESKTOP_ENTRY_H
#define LABWC_DESKTOP_ENTRY_H
struct server;
void desktop_entry_init(struct server *server);
void desktop_entry_finish(struct server *server);
struct lab_img *desktop_entry_load_icon_from_app_id(
struct server *server, const char *app_id, int size, float scale);
struct lab_img *desktop_entry_load_icon(
struct server *server, const char *icon_name, int size, float scale);
/**
* desktop_entry_name_lookup() - return the application name
* from the sfdo desktop entry database based on app_id
*
* The lifetime of the returned value is the same as that
* of sfdo_desktop_db (from `struct sfdo.desktop_db`)
*/
const char *desktop_entry_name_lookup(struct server *server,
const char *app_id);
#endif /* LABWC_DESKTOP_ENTRY_H */