~hp/notes.lv2

4be1fcb4183f924f516e034df297c62017ecf5e4 — builds.sr.ht 1 year, 5 months ago 6111b91
Squashed 'subprojects/d2tk/' changes from b07b66c..af17e30

af17e30 Merge commit '16a2d741c4be2a8c26e510000973dbdf08f3ac79'
16a2d74 Squashed 'nanovg/' changes from 997c861c1..2505c7b2b
601655f Fix crash in vterm upon non-implemented callbacks

git-subtree-dir: subprojects/d2tk
git-subtree-split: af17e3063c6eacb501370dbc5129c4a437c6eb84
3 files changed, 62 insertions(+), 4 deletions(-)

M meson_options.txt
M nanovg/src/fontstash.h
M src/base_pty.c
M meson_options.txt => meson_options.txt +1 -1
@@ 55,4 55,4 @@ option('use-fontconfig',
	value : 'disabled',
	yield : true)

option('version', type : 'string', value : '0.4.0')
option('version', type : 'string', value : '0.5.1')

M nanovg/src/fontstash.h => nanovg/src/fontstash.h +1 -1
@@ 1643,8 1643,8 @@ void fonsDeleteInternal(FONScontext* stash)
	if (stash->fonts) free(stash->fonts);
	if (stash->texData) free(stash->texData);
	if (stash->scratch) free(stash->scratch);
	free(stash);
	fons__tt_done(stash);
	free(stash);
}

void fonsSetErrorCallback(FONScontext* stash, void (*callback)(void* uptr, int error, int val), void* uptr)

M src/base_pty.c => src/base_pty.c +60 -2
@@ 20,6 20,8 @@

#include "base_internal.h"

#define UNUSED __attribute__((unused))

#define DEFAULT_FG 0xddddddff
#define DEFAULT_BG 0x222222ff



@@ 317,10 319,62 @@ _screen_bell(void *data)
	return 0;
}

static int
_screen_damage(VTermRect rect UNUSED, void *user UNUSED)
{
	// we don't use it, but must be implemented
	return 0;
}

static int
_screen_moverect(VTermRect dest UNUSED, VTermRect src UNUSED,
	void *user UNUSED)
{
	// we don't use it, but must be implemented
	return 0;
}

static int
_screen_movecursor(VTermPos pos UNUSED, VTermPos oldpos UNUSED,
	int visible UNUSED, void *user UNUSED)
{
	// we don't use it, but must be implemented
	return 0;
}

static int
_screen_sb_pushline(int cols UNUSED, const VTermScreenCell *cells UNUSED,
	void *user UNUSED)
{
	// we don't use it, but must be implemented
	return  0;
}

static int
_screen_sb_popline(int cols UNUSED, VTermScreenCell *cells UNUSED,
	void *user UNUSED)
{
	// we don't use it, but must be implemented
	return 0;
}

static int
_screen_sb_clear(void* user UNUSED)
{
	// we don't use it, but must be implemented
	return 0;
}

static const VTermScreenCallbacks screen_callbacks = {
	.damage = _screen_damage,
	.moverect = _screen_moverect,
	.movecursor = _screen_movecursor,
	.settermprop = _screen_settermprop,
	.bell = _screen_bell,
  .resize = _screen_resize
  .resize = _screen_resize,
	.sb_pushline = _screen_sb_pushline,
	.sb_popline = _screen_sb_popline,
	.sb_clear = _screen_sb_clear
};

static inline __attribute__((always_inline)) int


@@ 556,6 610,7 @@ _term_init(d2tk_atom_body_pty_t *vpty, d2tk_base_pty_cb_t cb, void *data,

	vpty->screen = vterm_obtain_screen(vpty->vterm);
	vterm_screen_set_callbacks(vpty->screen, &screen_callbacks, vpty);
	vterm_screen_set_damage_merge(vpty->screen, VTERM_DAMAGE_SCROLL);
	vterm_screen_reset(vpty->screen, 1);

	return 0;


@@ 911,7 966,10 @@ _term_resize(d2tk_atom_body_pty_t *vpty, d2tk_coord_t ncols,
{
	if( (nrows != vpty->nrows) || (ncols != vpty->ncols) )
	{
		fprintf(stderr, "%d %d -> %d %d\n", vpty->ncols, vpty->nrows, ncols, nrows);

		vterm_set_size(vpty->vterm, nrows, ncols);
		vterm_screen_flush_damage(vpty->screen);
	}
}



@@ 1240,7 1298,7 @@ d2tk_pty_not_end(d2tk_pty_t *pty)
}

D2TK_API d2tk_pty_t *
d2tk_pty_next(d2tk_pty_t *pty __attribute__((unused)))
d2tk_pty_next(d2tk_pty_t *pty UNUSED)
{
	return NULL;
}