summaryrefslogtreecommitdiff
path: root/src/entry.h
AgeCommit message (Collapse)Author
2023-05-14Add --print-index option.Phil Jones
2023-03-06Add fractional scaling support.Phil Jones
The main change is that we now always have to set up the dummy surface which was previously only used when multiple monitors were present. This is because there's no way to determine an output's fractional scale factor without displaying a surface on it, and we need to know the scale factor before we create our main window surface. The extra compositor round-trips lead to a slight slowdown for single monitor setups (to the same speed as multi-monitor setups), but it's currently unavoidable as far as I know.
2023-03-05Remove unused image.h.Phil Jones
2022-12-21Add text cursor support.Phil Jones
This turned out to be much more complex than anticipated, and the potential for bugs is therefore quite high.
2022-11-28Refactor string vector code.Phil Jones
Previously, string vectors were built by reading input line-by line, and multiple copies of string vectors were made when searching. Now, input is read into one big buffer, and string vectors only contain references to the strings in this buffer. This both speeds up reading of input, and avoids unnecessary copying of strings in various places. The main downside currently is that input read from stdin is no longer UTF-8 normalised. This means, for example, that a search for `e` won't necessarily match `é`. Normalisation is very slow relative to the rest of tofi, however, and not needed for most use-cases. This could either be solved by accepting the slowdown, or making this an option, such as --unicode or --unicode-normalize.
2022-11-22Fix new theme options not following scale factor.Phil Jones
2022-11-21Add --clip-to-padding option.Phil Jones
2022-11-21Overhaul text theming.Phil Jones
Each piece of text is now individually themable, with foreground and background colours and optionally rounded background corners.
2022-11-21Add --font-variations option.Phil Jones
2022-11-20Add --font-features option.Phil Jones
2022-11-16Add placeholder text options.Phil Jones
2022-10-23Replace wchar and friends with Unicode handling.Phil Jones
All text handling should now be explicitly UTF-8 or UTF-32, removing the ambiguity around wchar_t and related functions.
2022-10-05Add options to hide input for passwords etc.Phil Jones
2022-08-22Add --prompt-padding option.Phil Jones
2022-08-07Delay scaling of percentage values.Phil Jones
The config file code now delays calculation of percentage values until `config_fix_percentages()` is called. This allows the config file to be parsed before output configuration is complete, thus allowing `--output` and `--late-keyboard-init` to be specified in the config file.
2022-08-04Improve pagination.Phil Jones
Pagination was broken in horizontal mode before, and in general tried to render too many results (leading to a cut-off last result). This commit fixes both of those, with the minor caveat that you can no longer scroll straight to the last result.
2022-08-03Add pagination of results.Phil Jones
2022-07-30Add option to colour matching portion of results.Phil Jones
This was done by breaking the selected result into three parts, and rendering each separately. A side-effect is that ligatures split when a match ends inside them, but I think that's the correct behaviour (rather than highlighting the whole ligature). There may be issues with some non-latin languages that make much more extensive use of ligatures / combining characters, however.
2022-07-29Make a selection-padding of -1 be infinite.Phil Jones
2022-07-29Add --selection-padding option.Phil Jones
This adds some extra padding in the selection background, rather than tightly wrapping the selection text.
2022-07-26Add automatic detection of number of results.Phil Jones
Tofi will now try to autodetect how many results can be drawn if --num-results=0 is specified, which is now the default.
2022-07-24Add drun mode.Phil Jones
This is a pretty simple implementation, but it should work for most use cases. Notably, generic application names aren't used (though that could be added without too much hassle), and neither are keywords (that would be more difficult).
2022-06-26Add optional background around selected result.Phil Jones
2022-06-25Fix padding and split into top/bottom/left/right.Phil Jones
2022-06-24Horizontal mode fixes.Phil Jones
Implement horizontal mode for Pango, and add min-input-width option.
2022-06-23Fix default sizes and hide_cursor option.Phil Jones
2022-06-23Combine Harfbuzz & Pango backends.Phil Jones
Tofi now uses Harfbuzz if a file is passed to --font-name, and Pango otherwise.
2022-06-23Remove Cairo scale factor.Phil Jones
The scale factor is now only used to scale font sizes, not all Cairo drawing operations. This makes pixel-sized options correct.
2022-06-23Allow percentages for window size & margins.Phil Jones
2022-06-21Add result selection.Phil Jones
2022-06-21Add config file handling.Phil Jones
Single letter style arguments have been removed.
2022-06-21Add various command line arguments.Phil Jones
There are too many really to use single-character args, so the next step should be a config file.
2022-06-10Avoid an unnecessary copy of the image buffer.Phil Jones
By pointing Cairo at the mmap-ed file used to create wl_shm buffers, we can eliminate a memcpy() on every draw, providing a decent speedup (especially for large window sizes). This comes at the expense of having to keep track of two Cairo contexts, one for each of our two buffers used for double buffering. Additionally, a single memcpy() is still required for initialisation of the second buffer, so the startup latency isn't affected much.
2022-06-09Add Harfbuzz backend.Phil Jones
Another source of slow startup is initialising Pango. If the user supplies a ttf file, we can skip any Pango stuff and use Harfbuzz directly with Cairo to do our font rendering, providing a large speedup.
2021-11-17Add sorting by run frequency.Phil Jones
This implements a rofi-like run cache. Other smaller changes include simplification of resize logic now that there's only one surface.
2021-11-15Multiple smaller changes.Phil Jones
- Remove the background image and libpng dependency - Add a prompt - Add xmalloc with out-of-memory handling - Add beginnings of a rofi-like run cache
2021-11-15Switch from subsurface setup to just one surface.Phil Jones
The subsurface was playing havoc with layer shell stuff, and I don't think any potential efficiency gain is worth the complicated code to work out how big the subsurface should be. Instead, the entry code now just draws directly onto the main surface. Damage information should be passed to glTexSubImage2D() in future, to avoid redrawing the entire window every keypress.
2021-11-14Rename main struct to tofi.Phil Jones
2021-11-07Initial working build.Phil Jones
2021-11-03Don't use Pango by default.Phil Jones
Initialising Pango makes up a large portion of the startup time, and we can achieve neater rendering with pure Cairo if we're just drawing circles anyway. Therefore, this commit avoids loading Pango if no options which require it are specified (such as --font-name or --password-character). This reduces startup time with no background image to ~40ms on my machine (2015 MacBook Pro).
2021-11-01Add extra cleanup code to debug builds.Phil Jones
Also fix some memory leaks.
2021-10-31Add actual greetd functionality.Phil Jones
Useable, but very barebones — not even any error message reporting.
2021-10-31Add HiDPI support and lots of cleanup.Phil Jones
2021-10-29Basic text entry working.Phil Jones