Skip to content

Commit

Permalink
Merge pull request #840 from cspiegel/cleanups
Browse files Browse the repository at this point in the history
Cleanups
  • Loading branch information
cspiegel committed Apr 29, 2024
2 parents 2380388 + 6cefb5a commit ac676a8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
4 changes: 0 additions & 4 deletions garglk/garglk.h
Expand Up @@ -35,7 +35,6 @@
#include <cstring>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
Expand Down Expand Up @@ -1090,7 +1089,6 @@ void gli_piclist_increment();
void gli_piclist_decrement();

void win_graphics_rearrange(window_t *win, rect_t *box);
void win_graphics_get_size(window_t *win, glui32 *width, glui32 *height);
void win_graphics_redraw(window_t *win);
void win_graphics_click(window_graphics_t *dwin, int x, int y);

Expand All @@ -1104,8 +1102,6 @@ void win_graphics_set_background_color(window_graphics_t *dwin, glui32 color);
bool win_textbuffer_draw_picture(window_textbuffer_t *dwin, glui32 image, glui32 align, bool scaled, glui32 width, glui32 height);
void win_textbuffer_flow_break(window_textbuffer_t *win);

void gli_calc_padding(window_t *win, int *x, int *y);

void gli_read_config(int argc, char **argv, bool quiet);

// unicode case mapping
Expand Down
31 changes: 3 additions & 28 deletions garglk/window.cpp
Expand Up @@ -550,24 +550,6 @@ void glk_window_get_size(window_t *win, glui32 *width, glui32 *height)
}
}

void gli_calc_padding(window_t *win, int *x, int *y)
{
window_pair_t *wp;
if (win == nullptr) {
return;
}
if (win->type == wintype_Pair) {
wp = win->winpair();
if (wp->vertical) {
*x += gli_wpaddingx;
} else {
*y += gli_wpaddingy;
}
gli_calc_padding(wp->child1, x, y);
gli_calc_padding(wp->child2, x, y);
}
}

//
// Family matters
//
Expand Down Expand Up @@ -653,11 +635,8 @@ winid_t glk_window_get_parent(window_t *win)
gli_strict_warning("window_get_parent: invalid ref");
return nullptr;
}
if (win->parent != nullptr) {
return win->parent;
} else {
return nullptr;
}

return win->parent;
}

winid_t glk_window_get_sibling(window_t *win)
Expand Down Expand Up @@ -707,11 +686,7 @@ strid_t glk_window_get_echo_stream(window_t *win)
return nullptr;
}

if (win->echostr != nullptr) {
return win->echostr;
} else {
return nullptr;
}
return win->echostr;
}

void glk_window_set_echo_stream(window_t *win, stream_t *str)
Expand Down
7 changes: 0 additions & 7 deletions garglk/wingfx.cpp
Expand Up @@ -72,13 +72,6 @@ void win_graphics_rearrange(window_t *win, rect_t *box)
win_graphics_touch(dwin);
}

void win_graphics_get_size(window_t *win, glui32 *width, glui32 *height)
{
window_graphics_t *dwin = win->wingraphics();
*width = dwin->w;
*height = dwin->h;
}

void win_graphics_redraw(window_t *win)
{
window_graphics_t *dwin = win->wingraphics();
Expand Down

0 comments on commit ac676a8

Please sign in to comment.