Skip to content
Myr

application.h

This file

Path

application.h

111 lines · 2.9 KiB · C

Last changed by

dmenu: --with-nth: don't match "other" columnsDaniel Eklöfbefore adoption56526e8

History of this file

Take it

The walk stopped after 200 commits: lines older than c18512f point at it.

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

lines 1–4why, one step back
1#pragma once
23#include <stdbool.h>4#include <pixman.h>

match: do matching/filtering using a thread poolDaniel Eklöfbefore adoption0c3be18

line 5why, one step back
5#include <threads.h>

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

lines 6–46why, one step back
6
7#if defined(FUZZEL_ENABLE_SVG_LIBRSVG)8 #include <librsvg/rsvg.h>9#endif1011#if defined(FUZZEL_ENABLE_SVG_NANOSVG)12 #include <nanosvg/nanosvg.h>13#endif1415#include <fcft/fcft.h>16#include <tllist.h>1718#include "prompt.h"1920enum icon_type { ICON_NONE, ICON_PNG, ICON_SVG };2122struct rasterized {23 pixman_image_t *pix;24 int size;25};26typedef tll(struct rasterized) rasterized_list_t;2728struct icon {29 char *name;30 char *path;31 enum icon_type type;32 union {33#if defined(FUZZEL_ENABLE_PNG_LIBPNG)34 pixman_image_t *png;35#else36 void *png;37#endif38#if defined(FUZZEL_ENABLE_SVG_LIBRSVG)39 RsvgHandle *svg;40#elif defined(FUZZEL_ENABLE_SVG_NANOSVG)41 NSVGimage *svg;42#else43 void *svg;44#endif45 };46

render: use the 'fast' filter to downscale "too large" PNG iconsDaniel Eklöfbefore adoptionfe2a08d

lines 47–49why, one step back
47 /* Icon is "too large" and we've already warned about this */
48 bool png_size_warned;49

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

lines 50–64why, one step back
50 /* List of cached rasterizations (used with SVGs) */
51 rasterized_list_t rasterized;52};5354typedef tll(char32_t *) char32_list_t;55typedef tll(char *) char_list_t;5657struct application {58 char *id; /* Desktop File ID, as defined in the Desktop Entry specicication59 https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html */60 char *path;61 char *exec;62 char *app_id;63 char32_t *title;64 char32_t *render_title;

match: do matching/filtering using a thread poolDaniel Eklöfbefore adoption0c3be18

line 65why, one step back
65 size_t index;

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

lines 66–80why, one step back
66
67 /*68 * To get good search performance, we cache both the lower-case69 * versions of metadata, and their (string) lengths. This way, we70 * can avoid having to call c32len() and toc32lower() over and71 * over and over again when searching...72 */73 char32_t *title_lowercase; /* Lower cased! */74 char32_t *basename; /* Lower cased! */75 char32_t *wexec; /* Lower cased! Same as ‘exec’, but for matching purposes */76 char32_t *generic_name; /* Lower cased! */77 char32_t *comment; /* Lower cased! */78 char32_list_t keywords; /* Lower cased! */79 char32_list_t categories; /* Lower cased! */80

dmenu: --with-nth: don't match "other" columnsDaniel Eklöfbefore adoption56526e8

lines 81–82why, one step back
81 char32_t *dmenu_input; /* Full dmenu input, may contain multiple columns */
82

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

lines 83–94why, one step back
83 size_t title_len;
84 size_t basename_len;85 size_t wexec_len;86 size_t generic_name_len;87 size_t comment_len;88 /* keywords and categories lengths not cached */8990 struct icon icon;91 bool visible;92 bool startup_notify;93 unsigned count;94 struct fcft_text_run *shaped;

render: add support for rendering the selected entry in boldDaniel Eklöfbefore adoption8d77e69

line 95why, one step back
95 struct fcft_text_run *shaped_bold;

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

lines 96–102why, one step back
96};
9798bool application_execute(99 const struct application *app, const struct prompt *prompt,100 const char *launch_prefix, const char *xdg_activation_token);101102struct application_list {

dmenu: start rendering input before STDIN has been closedDaniel Eklöfbefore adoptionb69ba92

line 103why, one step back
103 struct application **v;

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

line 104why, one step back
104 size_t count;

xdg: don't count NoDisplay=true apps towards the match counter's totalChristian Fillionbefore adoptiondb12816

line 105why, one step back
105 size_t visible_count;

dmenu: start rendering input before STDIN has been closedDaniel Eklöfbefore adoptionb69ba92

line 106why, one step back
106 mtx_t lock;

docs: correct with the prev-with-wrap and next-with-wrap docs.Mark Stosbergbefore adoptionc18512f

lines 107–111why, one step back
107};
108109struct application_list *applications_init(void);110void applications_destroy(struct application_list *apps);111void applications_flush_text_run_cache(struct application_list *apps);