// * 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>
// This wraps the ITEM type of <menu.h>
// -------------------------------------------------------------------------
//
-class NCursesMenuItem {
+class NCURSES_IMPEXP NCursesMenuItem {
friend class NCursesMenu;
protected:
}
// 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)
// 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),
// This wraps the MENU type of <menu.h>
// -------------------------------------------------------------------------
//
-class NCursesMenu : public NCursesPanel {
+class NCURSES_IMPEXP NCursesMenu : public NCursesPanel {
protected:
MENU *menu;
// 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);
}
// 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;
}
// 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,
// 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,
}
};
-#endif // _CURSESM_H
+#endif // NCURSES_CURSESM_H_incl