Skip to content

Commit f1aa241

Browse files
committed
Use Gargoyle extension for determining banner size
TADS used to reach into Gargoyle's internal data structures for this, but that was always fragile, and since garglk.h is now C++, it can no longer be included in a C program. A custom extension was made for TADS which does exactly what this code did, but with a stable C API.
1 parent edaabc7 commit f1aa241

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

glk/osglkban.c

+1-9
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
#include "os.h"
2929
#include "glk.h"
3030

31-
#ifdef GARGLK
32-
#include "garglk.h" /* for-size to-contents hack */
33-
#endif /* GARGLK */
34-
3531
typedef struct os_banner_s *osbanid_t;
3632
typedef struct banner_contents_s *contentid_t;
3733

@@ -548,11 +544,7 @@ void os_banner_size_to_contents(void *banner_handle)
548544
#ifdef GARGLK
549545
if (banner->type == wintype_TextBuffer)
550546
{
551-
winid_t win = banner->win;
552-
window_textbuffer_t *dwin = win->data;
553-
int size = dwin->scrollmax;
554-
if (dwin->numchars)
555-
size ++;
547+
int size = garglk_tads_os_banner_size(banner->win);
556548
os_banner_set_size(banner, size, OS_BANNER_SIZE_ABS, 0);
557549
}
558550
#endif /* GARGLK */

0 commit comments

Comments
 (0)