Commit graph

118 commits

Author SHA1 Message Date
Daniel Eklöf
321d1cdc7d
particle/progress-bar: handle tag_for_name() failing 2020-11-25 20:41:10 +01:00
Daniel Eklöf
31c015c680
particle/ramp: handle tag_for_name() failing 2020-11-25 20:41:10 +01:00
Daniel Eklöf
df2d8fec36
particle/list: assert sub particles where instantiated correctly 2020-11-25 20:41:09 +01:00
Daniel Eklöf
44db9304c5
particle/ramp: assert sub particles where instantiated correctly 2020-11-25 20:41:09 +01:00
Daniel Eklöf
c3cfae13e8
particle/progress-bar: assert sub particles where instantiated correctly 2020-11-25 20:41:09 +01:00
Daniel Eklöf
86ef9dcc02
particle/map: don’t return NULL from instantiate()
Instead return an empty dynlist.
2020-11-25 20:41:09 +01:00
Daniel Eklöf
198a351c7c
meson: particles: data-driven foreach loop, and link map against dynlist 2020-11-25 20:41:09 +01:00
Daniel Eklöf
1e5a1d0341
particle/map: return NULL if we neither find a matching tag, nor have a default tag 2020-11-25 20:36:46 +01:00
Daniel Eklöf
234a787859
fcft: fcft_glyph_for_wc() has been renamed to fcft_glyph_rasterize() 2020-04-24 10:54:15 +02:00
Daniel Eklöf
e5ef81a064
fcft: max/space advance fields have been renamed 2020-04-23 11:57:50 +02:00
Daniel Eklöf
03a5c8746f
fcft: adjust to fcft-2.0 API changes
* font_*() -> fcft_*()
* struct font -> struct fcft_font
* struct glyph -> struct fcft_glyph
* enum subpixel_order -> enum fcft_subpixel
2020-04-22 11:50:29 +02:00
Daniel Eklöf
8294eb5a80
fcft: update to 1.0.0
Allow/disallow subpixel antialiasing in font_glyph_for_wc(), not using
font_enable_subpixel_antialias().
2020-01-19 12:35:29 +01:00
Daniel Eklöf
b644c75586
particle/string: apply font kerning 2020-01-18 09:27:27 +01:00
Daniel Eklöf
8a4d9137ff
particle/string: remove useless debug log 2019-12-01 19:29:27 +01:00
Daniel Eklöf
51a6631c19
fcft: use fcft instead of local copy of font.{c,h} 2019-12-01 16:00:15 +01:00
Daniel Eklöf
2d343755ce
particle/string: mbstowcs() may fail. When it does, don't crash 2019-11-29 23:32:27 +01:00
Daniel Eklöf
b48365aa86
font: remove the fextents sub-struct 2019-11-27 21:38:49 +01:00
Daniel Eklöf
0550d2799d
tllist: use tllist from external git repository 2019-11-17 19:17:34 +01:00
Daniel Eklöf
9dbbc480e4
Rename project: f00bar -> yambar 2019-09-28 20:39:45 +02:00
Daniel Eklöf
012162837d
particle/progress-bar: expand and replace on-click handler on click events only
No need to do it in motion events.
2019-09-23 18:39:03 +02:00
Daniel Eklöf
6e50872933
particle/progress-bar: improve accuracy of 'where' tag
The progress-bar took *all* particle elements into account when
calculating the (relative) mouse position on mouse events.

This is wrong, since only the progress bar (that is, the empty and
filled cells) should be used. Not the start/end elements.

We now also pass the mouse event through to the start/end elements.
2019-09-23 18:34:43 +02:00
Daniel Eklöf
c11fee4ce3
cairo: replace cairo with pixman in decos, particles and modules
All decoration, particle and module interfaces now takes a
pixman_image_t parameter, and all drawing is done using pixman APIs.

The wayland/xcb backends implement a new interface functions,
get_pixman_image(), that should return a pixman image instance that is
suitable for rendering.

In the wayland backend, the image uses the same backing data as the
cairo surface.

In the XCB backend, we create a new image each time, and then blit it
to the cairo surface at commit time.
2019-09-22 01:56:58 +02:00
Daniel Eklöf
95385863ae
particle: remove cairo context from begin_expose() 2019-09-22 00:55:06 +02:00
Daniel Eklöf
b3a5e0b5d7
font: initial port from cairo scaled fonts to raw freetype + pixman 2019-09-22 00:50:11 +02:00
Daniel Eklöf
08e21a4d3b meson: assign get_option('core-plugins-as-shared-libraries') to variable 2019-05-06 21:49:20 +02:00
Daniel Eklöf
ea9aea8daf cmake: remove build files (replaced with meson) 2019-05-04 11:48:20 +02:00
Daniel Eklöf
2654d37548 meson: no need to build static libs of plugins 2019-05-03 23:18:49 +02:00
Daniel Eklöf
789cdd949b meson: use join_paths() 2019-05-03 23:10:01 +02:00
Daniel Eklöf
e563761093 meson: install plugins 2019-05-01 22:08:15 +02:00
Daniel Eklöf
fdb9a9bc1c meson: initial support for building plugins as shared libraries 2019-05-01 18:21:35 +02:00
Daniel Eklöf
51e9d691e4 meson: initial build conf
Not that well tested yet, does not support plugins-as-modules
2019-05-01 12:39:59 +02:00
Daniel Eklöf
cf680573c2 particle/string: improve font centering
* Use ascent+descent instead of 'height'
* Center around 'ascent', except when 'descent' is negative
2019-03-01 17:55:05 +01:00
Daniel Eklöf
611b5b551c particle/string: use *font* extents to calculate font baseline 2019-02-28 20:10:54 +01:00
Daniel Eklöf
ea38ab3b2f particle/module: pass a cairo context to all begin_expose() 2019-02-28 20:10:26 +01:00
Daniel Eklöf
6bba9200cf particles: use calloc() instead of malloc()
In cases where it makes sense, use calloc() instead of malloc():

* When allocating large objects with many members, many for which
  NULL/0 is a good default value.
* Arrays etc where we explicitly initialize to NULL anyway.
2019-02-09 11:05:12 +01:00
Daniel Eklöf
7ff0f5a2f3 cmake: need CMake >= 3.13 since we use target_link_options() 2019-02-07 12:26:05 +01:00
Daniel Eklöf
727d7b343f cmake: initial support for building wayland-only, or x11-only 2019-02-03 20:05:44 +01:00
Daniel Eklöf
452c4b6015 plugins: export a const function pointer interface struct 2019-01-26 18:32:04 +01:00
Daniel Eklöf
2b3d432164 cmake: we don't *really* need 3.13 2019-01-20 13:07:38 +01:00
Daniel Eklöf
498a3e3d78 particle/string: free glyphs and clusters in destroy() 2019-01-20 10:06:17 +01:00
Daniel Eklöf
5a0d192ec1 particle/string: re-use glyphs calculated in begin_expose()
In begin_expose(), we call cairo_scaled_font_text_to_glyphs()
with (x,y) = (0,0), in order to calculate the glyph extents (needed
for width calculation).

Then, in expose(), we called it again, but with correct (x,y) offsets.

Simplify this, by caching the glyphs from begin_expose(). Then, in
expose(), simply adjust the glyph offsets before calling
cairo_show_text_glyphs().
2019-01-20 10:02:13 +01:00
Daniel Eklöf
bfa9ce9970 particle/ramp: value is *also* offsetted by the minimum value 2019-01-19 20:17:26 +01:00
Daniel Eklöf
04f7f3485f particle/string: don't cut in the middle of an utf-8 multibyte
When limiting a string (due to it exceeding it's max length), make
sure not to cut it in the middle of an utf-8 multibyte, as this
results in an invalid utf-8 string.
2019-01-17 20:44:51 +01:00
Daniel Eklöf
09270c4670 particle/string: handle conversion failures in cairo_scaled_font_text_to_glyphs()
In particular, use cairo_scaled_font_text_to_glyphs() to calculate the
extents, since the cairo_scaled_font_text_extents() will leave the
scaled font in an error state, which is impossible to recuperate from.
2019-01-17 20:18:46 +01:00
Daniel Eklöf
c868a4ac46 particle/list: disable debug 2019-01-15 19:15:57 +01:00
Daniel Eklöf
8f58e161bc particle/string: disable debug 2019-01-15 19:15:48 +01:00
Daniel Eklöf
0d591fe5a1 allow plugins to be compiled into the f00bar main binary 2019-01-14 20:57:03 +01:00
Daniel Eklöf
c6b83ac7dc particles: cmake: compact CMakeLists.txt by using foreach() 2019-01-13 21:55:42 +01:00
Daniel Eklöf
c6ce536cff particle/string: explicitly link against cairo
Because it's the right thing to do. It worked without it, since the
f00bar main binary is linked with -rdynamic (to give plugins access to
core functions).
2019-01-13 21:49:24 +01:00
Daniel Eklöf
bc9c33c187 particle/dynlist: link particle-sdk PRIVATE:ly 2019-01-13 21:45:49 +01:00