Merge topic 'linux-standard-base'
dde0c89
ccmake: Use LSB 4.0 getmaxyx conditionallya3de30e
ccmake: Use LSB 4.0 curses API conditionally7d691ca
ccmake: Port for LSB 4.0 (#11648)
This commit is contained in:
commit
18180cdb50
|
@ -357,8 +357,12 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win)
|
||||||
|
|
||||||
assert(win && field);
|
assert(win && field);
|
||||||
|
|
||||||
|
#if defined(__LSB_VERSION__)
|
||||||
|
getmaxyx(win, height, width);
|
||||||
|
#else
|
||||||
width = getmaxx(win);
|
width = getmaxx(win);
|
||||||
height = getmaxy(win);
|
height = getmaxy(win);
|
||||||
|
#endif
|
||||||
|
|
||||||
for(row=0, pBuffer=field->buf;
|
for(row=0, pBuffer=field->buf;
|
||||||
row < height;
|
row < height;
|
||||||
|
@ -396,7 +400,11 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field)
|
||||||
|
|
||||||
pad = field->pad;
|
pad = field->pad;
|
||||||
p = field->buf;
|
p = field->buf;
|
||||||
|
#if defined(__LSB_VERSION__)
|
||||||
|
{ int width; getmaxyx(win, height, width); }
|
||||||
|
#else
|
||||||
height = getmaxy(win);
|
height = getmaxy(win);
|
||||||
|
#endif
|
||||||
|
|
||||||
for(row=0; (row < height) && (row < field->drows); row++ )
|
for(row=0; (row < height) && (row < field->drows); row++ )
|
||||||
{
|
{
|
||||||
|
@ -871,7 +879,17 @@ 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
|
||||||
|
{
|
||||||
|
#if defined(__LSB_VERSION__)
|
||||||
|
/* getattrs() would be handy, but it is not part of LSB 4.0 */
|
||||||
|
attr_t fwinAttrs;
|
||||||
|
short fwinPair;
|
||||||
|
wattr_get(fwin, &fwinAttrs, &fwinPair, 0);
|
||||||
|
wattr_set(win, fwinAttrs, fwinPair, 0);
|
||||||
|
#else
|
||||||
wattrset(win,getattrs(fwin));
|
wattrset(win,getattrs(fwin));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
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,13 @@ 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)))
|
#if defined(__LSB_VERSION__)
|
||||||
|
getmaxyx(formwin, height, width);
|
||||||
|
#else
|
||||||
|
width = getmaxx(formwin);
|
||||||
|
height = getmaxy(formwin);
|
||||||
|
#endif
|
||||||
|
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