]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - c++/cursesm.h
ncurses 5.3
[ncurses.git] / c++ / cursesm.h
index 03065cffa6e06f7ee9615401ba8038e69e3dbb02..8873eca341c5748b94aa5fcae0127e757497c012 100644 (file)
@@ -1,6 +1,6 @@
 // * This makes emacs happy -*-Mode: C++;-*-
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  ****************************************************************************/
 
 /****************************************************************************
- *   Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1997             *
+ *   Author: Juergen Pfeifer, 1997                                          *
+ *   Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en             *
  ****************************************************************************/
 
-// $Id: cursesm.h,v 1.9 1998/02/11 12:13:41 tom Exp $
+// $Id: cursesm.h,v 1.16 2002/07/06 15:47:52 juergen Exp $
 
-#ifndef _CURSESM_H
-#define _CURSESM_H
+#ifndef NCURSES_CURSESM_H_incl
+#define NCURSES_CURSESM_H_incl 1
 
 #include <cursesp.h>
 
@@ -46,7 +47,7 @@ extern "C" {
 // This wraps the ITEM type of <menu.h>
 // -------------------------------------------------------------------------
 //
-class NCursesMenuItem {
+class NCURSES_IMPEXP NCursesMenuItem {
   friend class NCursesMenu;
   
 protected:
@@ -81,7 +82,7 @@ public:
   }
   // Description of the item
   
-  inline int index (void) const {
+  inline int (index) (void) const {
     return ::item_index (item);
   }
   // Index of the item in an item array (or -1)
@@ -135,12 +136,12 @@ typedef bool ITEMCALLBACK(NCursesMenuItem&);
 // If you don't like to create a child class for individual items to
 // overload action(), you may use this class and provide a callback
 // function pointer for items.
-class NCursesMenuCallbackItem : public NCursesMenuItem {
+class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem {
 private:
-  const ITEMCALLBACK* p_fct;
+  ITEMCALLBACK* p_fct;
 
 public:
-  NCursesMenuCallbackItem(const ITEMCALLBACK* fct = NULL,
+  NCursesMenuCallbackItem(ITEMCALLBACK* fct       = NULL,
                          const char* p_name      = NULL,
                          const char* p_descript  = NULL )
     : NCursesMenuItem (p_name, p_descript),
@@ -156,7 +157,7 @@ public:
 // This wraps the MENU type of <menu.h>
 // -------------------------------------------------------------------------
 //
-class NCursesMenu : public NCursesPanel {
+class NCURSES_IMPEXP NCursesMenu : public NCursesPanel {
 protected:
   MENU *menu;
 
@@ -179,7 +180,7 @@ private:
   // Get the backward pointer to the C++ object from a MENU
   static inline NCursesMenu* getHook(const MENU *m) {
     UserHook* hook = (UserHook*)::menu_userptr(m);
-    assert(hook && hook->m_owner==m);
+    assert(hook != 0 && hook->m_owner==m);
     return (NCursesMenu*)(hook->m_back);
   }
 
@@ -198,13 +199,13 @@ protected:
   // internal routines 
   inline void set_user(void *user) {
     UserHook* uptr = (UserHook*)::menu_userptr (menu);
-    assert (uptr && uptr->m_back==this && uptr->m_owner==menu);
+    assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
     uptr->m_user = user;
   }
 
   inline void *get_user() {
     UserHook* uptr = (UserHook*)::menu_userptr (menu);
-    assert (uptr && uptr->m_back==this && uptr->m_owner==menu);
+    assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
     return uptr->m_user;
   }  
   
@@ -514,7 +515,7 @@ public:
 // to create a UserItem.
 // -------------------------------------------------------------------------
 //
-template<class T> class NCursesUserItem : public NCursesMenuItem
+template<class T> class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem
 {
 public:
   NCursesUserItem (const char* p_name,
@@ -541,7 +542,7 @@ public:
 // The same mechanism is used to attach user data to a menu
 // -------------------------------------------------------------------------
 //
-template<class T> class NCursesUserMenu : public NCursesMenu
+template<class T> class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu
 {
 protected:
   NCursesUserMenu( int  lines, 
@@ -589,4 +590,4 @@ public:
   }
 };
 
-#endif // _CURSESM_H
+#endif // NCURSES_CURSESM_H_incl