panel.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /****************************************************************************
  2. * apps/include/graphics/panel.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. /* Public Domain Curses -- Panels for PDCurses
  21. * $Id: panel.h,v 1.19 2008/07/13 16:08:16 wmcbrine Exp $
  22. */
  23. #ifndef __APPS_INCLUDE_GRAPHICS_PANEL_H
  24. #define __APPS_INCLUDE_GRAPHICS_PANEL_H
  25. /****************************************************************************
  26. * Included Files
  27. ****************************************************************************/
  28. #include "graphics/curses.h"
  29. /****************************************************************************
  30. * Public Types
  31. ****************************************************************************/
  32. #if defined(__cplusplus)
  33. extern "C"
  34. {
  35. # define EXTERN extern "C"
  36. #else
  37. # define EXTERN extern
  38. #endif
  39. typedef struct panelobs
  40. {
  41. struct panelobs *above;
  42. struct panel *pan;
  43. } PANELOBS;
  44. typedef struct panel
  45. {
  46. WINDOW *win;
  47. int wstarty;
  48. int wendy;
  49. int wstartx;
  50. int wendx;
  51. struct panel *below;
  52. struct panel *above;
  53. const void *user;
  54. struct panelobs *obscure;
  55. } PANEL;
  56. /****************************************************************************
  57. * Public Function Prototypes
  58. ****************************************************************************/
  59. int bottom_panel(PANEL *pan);
  60. int del_panel(PANEL *pan);
  61. int hide_panel(PANEL *pan);
  62. int move_panel(PANEL *pan, int starty, int startx);
  63. PANEL *new_panel(WINDOW *win);
  64. PANEL *panel_above(const PANEL *pan);
  65. PANEL *panel_below(const PANEL *pan);
  66. int panel_hidden(const PANEL *pan);
  67. const void *panel_userptr(const PANEL *pan);
  68. WINDOW *panel_window(const PANEL *pan);
  69. int replace_panel(PANEL *pan, WINDOW *win);
  70. int set_panel_userptr(PANEL *pan, const void *uptr);
  71. int show_panel(PANEL *pan);
  72. int top_panel(PANEL *pan);
  73. void update_panels(void);
  74. #undef EXTERN
  75. #if defined(__cplusplus)
  76. }
  77. #endif
  78. #endif /* __APPS_INCLUDE_GRAPHICS_PANEL_H */