Skip to content

Instantly share code, notes, and snippets.

@ma8ma
Last active May 21, 2017 05:55
Show Gist options
  • Save ma8ma/14a425a234c40818d4b221cfba741e33 to your computer and use it in GitHub Desktop.
Save ma8ma/14a425a234c40818d4b221cfba741e33 to your computer and use it in GitHub Desktop.

Note that this is varing, and is overwritten in unannounced.

Important versions about opaque WINDOW

5.6 (20070303)
add NCURSES_OPAQUE symbol
5.7 (20090906)
add is_pad() function
  • Non-opaque

    • WINDOW_HAS_FLAGS is defined
    • NCURSES_OPAQUE is defined as zero or not defined
  • Opaque

    • WINDOW_HAS_FLAGS is not defined
    • NCURSES_OPAQUE is defined as one

Current

  • define always WINDOW_HAS_FLAGS when having ncurses.h
  • check directly _flags field of WINDOW
ncurses non-opaque opaque
< 5.6 (20070303) ok not implemented
>= 5.6 (20070303) ok compile error

Use is_pad

  • define always WINDOW_HAS_FLAGS when having ncurses.h
  • define py_is_pad if having _flags field or is_pad function/macro
  • call py_is_pad
ncurses non-opaque opaque
< 5.6 (20070303) ok not implemented
>= 5.6 (20070303) ok compile error
>= 5.7 (20090906) ok ok

Use is_pad + Removing overwrite of WINDOW_HAS_FLAGS definition

  • define py_is_pad if having _flags field or is_pad function/macro
  • call py_is_pad
ncurses non-opaque opaque
< 5.6 (20070303) ok not implemented
>= 5.6 (20070303) ok retrograde
>= 5.7 (20090906) ok ok
  • define NCURSES_OPAQUE as zero if both HAVE_CURSES_IS_PAD and WINDOW_HAS_FLAGS aren't defined
  • define py_is_pad if having _flags field or is_pad function/macro
  • call py_is_pad
ncurses non-opaque opaque
< 5.6 (20070303) ok not implemented
>= 5.6 (20070303) ok make non-opaque
>= 5.7 (20090906) ok ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment