ccmake: Port for LSB 4.0 (#11648)
Use getmaxyx instead of getmax[xy]. Avoid using getattrs.
This commit is contained in:
parent
a67fd72659
commit
7d691cab9b
|
@ -357,8 +357,7 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win)
|
||||||
|
|
||||||
assert(win && field);
|
assert(win && field);
|
||||||
|
|
||||||
width = getmaxx(win);
|
getmaxyx(win, height, width);
|
||||||
height = getmaxy(win);
|
|
||||||
|
|
||||||
for(row=0, pBuffer=field->buf;
|
for(row=0, pBuffer=field->buf;
|
||||||
row < height;
|
row < height;
|
||||||
|
@ -390,13 +389,13 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field)
|
||||||
int pad;
|
int pad;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
char *p;
|
char *p;
|
||||||
int row, height;
|
int row, height, width;
|
||||||
|
|
||||||
assert(win && field && field->buf );
|
assert(win && field && field->buf );
|
||||||
|
|
||||||
pad = field->pad;
|
pad = field->pad;
|
||||||
p = field->buf;
|
p = field->buf;
|
||||||
height = getmaxy(win);
|
getmaxyx(win, height, width);
|
||||||
|
|
||||||
for(row=0; (row < height) && (row < field->drows); row++ )
|
for(row=0; (row < height) && (row < field->drows); row++ )
|
||||||
{
|
{
|
||||||
|
@ -856,6 +855,8 @@ static int Display_Or_Erase_Field(FIELD * field, bool bEraseFlag)
|
||||||
{
|
{
|
||||||
WINDOW *win;
|
WINDOW *win;
|
||||||
WINDOW *fwin;
|
WINDOW *fwin;
|
||||||
|
attr_t fwinAttrs;
|
||||||
|
short fwinPair;
|
||||||
|
|
||||||
if (!field)
|
if (!field)
|
||||||
return E_SYSTEM_ERROR;
|
return E_SYSTEM_ERROR;
|
||||||
|
@ -871,7 +872,12 @@ static int Display_Or_Erase_Field(FIELD * field, bool bEraseFlag)
|
||||||
if (field->opts & O_VISIBLE)
|
if (field->opts & O_VISIBLE)
|
||||||
Set_Field_Window_Attributes(field,win);
|
Set_Field_Window_Attributes(field,win);
|
||||||
else
|
else
|
||||||
wattrset(win,getattrs(fwin));
|
{
|
||||||
|
/* getattrs() would be handy, but it is not part of LSB 4.0 */
|
||||||
|
/* wattrset(win,getattrs(fwin)); */
|
||||||
|
wattr_get(fwin, &fwinAttrs, &fwinPair, 0);
|
||||||
|
wattr_set(win, fwinAttrs, fwinPair, 0);
|
||||||
|
}
|
||||||
werase(win);
|
werase(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ int post_form(FORM * form)
|
||||||
WINDOW *formwin;
|
WINDOW *formwin;
|
||||||
int err;
|
int err;
|
||||||
int page;
|
int page;
|
||||||
|
int height, width;
|
||||||
|
|
||||||
if (!form)
|
if (!form)
|
||||||
RETURN(E_BAD_ARGUMENT);
|
RETURN(E_BAD_ARGUMENT);
|
||||||
|
@ -62,7 +63,8 @@ int post_form(FORM * form)
|
||||||
RETURN(E_NOT_CONNECTED);
|
RETURN(E_NOT_CONNECTED);
|
||||||
|
|
||||||
formwin = Get_Form_Window(form);
|
formwin = Get_Form_Window(form);
|
||||||
if ((form->cols > getmaxx(formwin)) || (form->rows > getmaxy(formwin)))
|
getmaxyx(formwin, height, width);
|
||||||
|
if ((form->cols > width) || (form->rows > height))
|
||||||
RETURN(E_NO_ROOM);
|
RETURN(E_NO_ROOM);
|
||||||
|
|
||||||
/* reset form->curpage to an invald value. This forces Set_Form_Page
|
/* reset form->curpage to an invald value. This forces Set_Form_Page
|
||||||
|
|
Loading…
Reference in New Issue