/* Return string "prefix" + "id"; malloc()'s string, remember to call free()! */
static char * string_prefixed_id(char * prefix, char id);
-
-
/* Create Winconf, init ->view/height_type/width_type to 0, ->id to "id". */
static void create_winconf(char id, struct WinConf * wcp);
/* Free data pointed to inside WinConf struct. */
static void free_winconf_data(char id);
-
-
/* Write geometry of a window to its WinConf, as positive or negative values
* (dependent on state ofWinConf->height_type / WinConf->width_type).
*/
static void set_winconf_geometry(char id);
-
-
/* Get WinConf by "id"; get id of WinConf mothering "win". */
static struct WinConf * get_winconf_by_id(char id);
static void init_win_from_winconf(char id)
{
- char * tmp = "Trouble in init_win_from_file() with init_win() (win id: _).";
- char * err = try_malloc(strlen(tmp) + 1, "init_win_from_file()");
- memcpy(err, tmp, strlen(tmp) + 1);
- err[strlen(tmp) - 3] = id;
+ char * err = "get_drawfunc_by_char() returns NULL to init_win_from_file().";
struct WinConf * winconf = get_winconf_by_id(id);
void * f = get_drawfunc_by_char(winconf->draw);
exit_err(NULL == f, err);
- uint8_t test = init_win(world.wmeta, &winconf->win, winconf->title,
- winconf->height, winconf->width, f);
- exit_err(test, err);
- free(err);
+ init_win(&winconf->win, winconf->title, winconf->height, winconf->width, f);
}
{
return draw_win_inventory;
}
- if ('i' == c)
+ else if ('i' == c)
{
return draw_win_info;
}
extern void toggle_window(char id)
{
- char * err = "Trouble with toggle_window().";
struct Win * win = get_win_by_id(id);
- if (0 == win->prev && world.wmeta->chain_start != win) /* Win outside chain. */
- {
- exit_err(append_win(world.wmeta, win), err);
+ if (0 == win->prev && world.wmeta->chain_start != win) /* Win struct is */
+ { /* outside chain. */
+ append_win(win);
}
else
{
- exit_err(suspend_win(world.wmeta, win), err);
+ suspend_win(win);
}
}
{
if ('+' == dir)
{
- reset_pad_offset(world.wmeta, world.wmeta->pad_offset + 1);
+ reset_pad_offset(world.wmeta->pad_offset + 1);
}
else if ('-' == dir)
{
- reset_pad_offset(world.wmeta, world.wmeta->pad_offset - 1);
+ reset_pad_offset(world.wmeta->pad_offset - 1);
}
}
extern void growshrink_active_window(char change)
{
- char * err = "Trouble with resize_active_win() in "
- "growshink_active_window().";
if (0 != world.wmeta->active)
{
struct yx_uint16 size = world.wmeta->active->framesize;
{
size.x++;
}
- exit_err(resize_active_win(world.wmeta, size), err);
+ resize_active_win(size);
struct WinConf * wcp = get_winconf_by_win(world.wmeta->active);
if ( 1 == wcp->width_type
&& world.wmeta->active->framesize.x > world.wmeta->padsize.x)