home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed window positioning bug, cleared up code and comments in place_win().
[plomrogue]
/
src
/
wincontrol.c
diff --git
a/src/wincontrol.c
b/src/wincontrol.c
index 2798455f9e7a3abd290a45e11af5664cf13fab54..7830636543232ba047a0c5f24fbbd4036a3642fa 100644
(file)
--- a/
src/wincontrol.c
+++ b/
src/wincontrol.c
@@
-33,8
+33,6
@@
/* Return string "prefix" + "id"; malloc()'s string, remember to call free()! */
static char * string_prefixed_id(char * prefix, char id);
/* 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);
/* Create Winconf, init ->view/height_type/width_type to 0, ->id to "id". */
static void create_winconf(char id, struct WinConf * wcp);
@@
-50,15
+48,11
@@
static void save_win_config(char id);
/* Free data pointed to inside WinConf struct. */
static void free_winconf_data(char id);
/* 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);
/* 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);
/* Get WinConf by "id"; get id of WinConf mothering "win". */
static struct WinConf * get_winconf_by_id(char id);
@@
-157,17
+151,11
@@
static void init_winconf_from_file(char id)
static void init_win_from_winconf(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);
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);
}
}
@@
-278,7
+266,7
@@
static void * get_drawfunc_by_char(char c)
{
return draw_win_inventory;
}
{
return draw_win_inventory;
}
-
if
('i' == c)
+
else if
('i' == c)
{
return draw_win_info;
}
{
return draw_win_info;
}
@@
-499,15
+487,14
@@
extern void save_win_configs()
extern void toggle_window(char id)
{
extern void toggle_window(char id)
{
- char * err = "Trouble with toggle_window().";
struct Win * win = get_win_by_id(id);
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
{
}
else
{
-
exit_err(suspend_win(world.wmeta, win), err
);
+
suspend_win(win
);
}
}
}
}
@@
-579,11
+566,11
@@
extern void scroll_pad(char dir)
{
if ('+' == dir)
{
{
if ('+' == dir)
{
- reset_pad_offset(world.wmeta
, world.wmeta
->pad_offset + 1);
+ reset_pad_offset(world.wmeta->pad_offset + 1);
}
else if ('-' == dir)
{
}
else if ('-' == dir)
{
- reset_pad_offset(world.wmeta
, world.wmeta
->pad_offset - 1);
+ reset_pad_offset(world.wmeta->pad_offset - 1);
}
}
}
}
@@
-591,8
+578,6
@@
extern void scroll_pad(char dir)
extern void growshrink_active_window(char change)
{
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;
if (0 != world.wmeta->active)
{
struct yx_uint16 size = world.wmeta->active->framesize;
@@
-612,7
+597,7
@@
extern void growshrink_active_window(char change)
{
size.x++;
}
{
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)
struct WinConf * wcp = get_winconf_by_win(world.wmeta->active);
if ( 1 == wcp->width_type
&& world.wmeta->active->framesize.x > world.wmeta->padsize.x)