Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,142 @@
/* $TOG: Application.h /main/9 1997/09/05 14:40:30 mgreess $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// Application.h:
////////////////////////////////////////////////////////////
#ifndef APPLICATION_H
#define APPLICATION_H
#include "UIComponent.h"
#include <sys/types.h>
#include <unistd.h>
class Application : public UIComponent {
// Allow main and MainWindow to access protected member functions
friend int main ( int, char ** );
friend class MainWindow;
private:
// Functions for registering and unregistering toplevel windows
void registerWindow ( MainWindow * );
void unregisterWindow ( MainWindow * );
protected:
// Functions to handle Xt interface
virtual void initialize ( int *, char ** );
virtual void handleEvents();
virtual void open_catalog();
inline void extractAndRememberEventTime( XEvent * );
char *_applicationClass;
XtAppContext _appContext;
static XtResource
_appResources[];
char *_appWorkspaceList;
int _bMenuButton;
Display *_display;
long _lastInteractiveEventTime;
gid_t _originalEgid; // startup effective gid
gid_t _originalRgid; // startup real gid
int _shutdownEnabled;
MainWindow **_windows; // top-level windows in the program
int _numWindows;
public:
Application ( char * );
virtual ~Application();
// Functions to control session management.
virtual int smpSaveSessionGlobal() = 0;
virtual void smpSaveSessionLocal() = 0;
virtual void restoreSession() = 0;
// Functions to control shutdown.
void disableShutdown() { _shutdownEnabled = 0; }
void enableShutdown() { _shutdownEnabled = 1; }
int isEnabledShutdown() { return _shutdownEnabled; }
virtual void shutdown() = 0;
// Functions to manipulate group execution privileges
void disableGroupPrivileges(void) { (void) setgid(_originalRgid); }
void enableGroupPrivileges(void) { (void) setgid(_originalEgid); }
gid_t originalEgid(void) { return _originalEgid; }
gid_t originalRgid(void) { return _originalRgid; }
// Functions to manipulate application's top-level windows
void iconify();
void manage();
void unmanage();
// Convenient access functions
virtual const char *const
className() { return "Application"; }
Display *display() { return _display; }
XtAppContext appContext() { return _appContext; }
const char *applicationClass() { return _applicationClass; }
int bMenuButton() { return _bMenuButton; }
char *getAppWorkspaceList() { return _appWorkspaceList; }
long lastInteractiveEventTime(void)
{ return _lastInteractiveEventTime; }
int num_windows() { return _numWindows; }
void setAppWorkspaceList(char *workspaceList);
};
// Pointer to single global instance
extern Application *theApplication;
#endif

View File

@@ -0,0 +1,89 @@
/*
*+SNOTICE
*
* $XConsortium: AskFirstCmd.h /main/3 1995/11/06 16:29:53 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
// AskFirstCmd.h: Base class for Cmds that ask for confirmation
////////////////////////////////////////////////////////////////
#ifndef ASKFIRSTCMD_H
#define ASKFIRSTCMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "Cmd.h"
#include "DialogManager.h"
class AskFirstCmd : public Cmd {
private:
// Callback for the yes choice on the dialog
static void yesCallback ( void * );
static void cancelCallback ( void *clientData );
// Derived classes should use setQuestion to change
// the string displayed in the dialog
char *_question;
DialogManager *_dialog;
#ifndef CPLUSPLUS2_1
protected:
Widget _dialogParentWidget;
virtual void doit() = 0; // Specific actions must be defined
virtual void undoit() = 0; // Specific actions must be defined
#endif
public:
AskFirstCmd ( char *, char *, int );
void setQuestion ( char *str );
virtual void execute(); // Overrides the Cmd member function
virtual void doYesCallback();
virtual const char *const className () { return "AskFirstCmd"; }
};
#endif

View File

@@ -0,0 +1,72 @@
/*
*+SNOTICE
*
* $XConsortium: BasicComponent.h /main/4 1996/04/05 16:52:18 mgreess $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
// BasicComponent.h: First version of a class to define
// a protocol for all components
///////////////////////////////////////////////////////////////
#ifndef BASICCOMPONENT_H
#define BASICCOMPONENT_H
#ifndef I_HAVE_NO_IDENT
#endif
#include <Xm/Xm.h>
class BasicComponent {
protected:
char *_name;
Widget _w;
// Protected constructor to prevent instantiation
BasicComponent ( const char * );
public:
virtual ~BasicComponent();
virtual void manage(); // Manage and unmanage widget tree
virtual void unmanage();
const Widget baseWidget() { return _w; }
};
#endif

View File

@@ -0,0 +1,70 @@
/* $XConsortium: BusyPixmap.h /main/4 1996/04/21 19:46:00 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////
// BusyPixmap.h
///////////////////////////////////////////////////
#ifndef BUSYPIXMAP_H
#define BUSYPIXMAP_H
#include "PixmapCycler.h"
class BusyPixmap : public PixmapCycler {
protected:
GC _gc, _inverseGC; // Used to draw Pixmaps
Widget _w; // Widget whose colors are to be used
void createPixmaps(); // Overrides base class pure virtual
virtual Pixmap createBusyPixmap ( int, int );
public:
BusyPixmap ( Widget );
};
#endif

View File

@@ -0,0 +1,68 @@
/* $XConsortium: ButtonInterface.h /main/4 1996/04/21 19:46:03 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// ButtonInterface.h: A push button interface to a Cmd object
///////////////////////////////////////////////////////////////
#ifndef BUTTONINTERFACE
#define BUTTONINTERFACE
#include "CmdInterface.h"
class ButtonInterface : public CmdInterface {
public:
ButtonInterface ( Widget, Cmd * );
#ifndef CAN_INLINE_VIRTUALS
~ButtonInterface ( void );
#endif /* CAN_INLINE_VIRTUALS */
static void mapName(const char * input, char * output);
};
#endif

View File

@@ -0,0 +1,120 @@
/*
*+SNOTICE
*
* $XConsortium: Cmd.h /main/5 1996/08/30 17:03:17 drk $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
// Cmd.h: A base class for all command objects
/////////////////////////////////////////////////////////
#ifndef CMD_H
#define CMD_H
#ifndef I_HAVE_NO_IDENT
#endif
class CmdList;
class CmdInterface;
class Cmd {
friend class CmdInterface;
private:
// Lists of other commands to be activated or deactivated
// when this command is executed or "undone"
CmdList *_activationList;
CmdList *_deactivationList;
void revert(); // Reverts object to previous state
int _active; // Is this command currently active?
int _previouslyActive; // Previous value of _active
char *_name; // Name of this Cmd
char *_label; // Label for the widget associated with Cmd.
protected:
int _hasUndo; // True if this object supports undo
static Cmd *_lastCmd; // Pointer to last Cmd executed
CmdInterface **_ci;
int _numInterfaces;
virtual void doit() = 0; // Specific actions must be defined
virtual void undoit() = 0; // by derived classes
public:
Cmd ( char *, char *, int ); // Protected constructor
virtual ~Cmd (); // Destructor
// public interface for executing and undoing commands
virtual void execute();
void undo();
void activate(); // Activate this object
void deactivate(); // Deactivate this object
char *getLabel() { return _label; }
#ifdef DEAD_WOOD
// Functions to register dependent commands
void addToActivationList ( Cmd * );
void addToDeactivationList ( Cmd * );
#endif /* DEAD_WOOD */
// Register an UIComponent used to execute this command
void registerInterface ( CmdInterface * );
// Access functions
int active () { return _active; }
int hasUndo() { return _hasUndo; }
const char *const name () { return _name; }
#ifdef CAN_INLINE_VIRTUALS
virtual const char *const className () { return "Cmd"; }
#else /* ! CAN_INLINE_VIRTUALS */
virtual const char *const className ();
#endif /* ! CAN_INLINE_VIRTUALS */
};
#endif

View File

@@ -0,0 +1,78 @@
/* $XConsortium: CmdInterface.h /main/5 1996/08/30 17:03:37 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// CmdInterface.h
///////////////////////////////////////////////////////
#ifndef CMDINTERFACE
#define CMDINTERFACE
#include "UIComponent.h"
class Cmd;
class CmdInterface : public UIComponent {
friend class Cmd;
protected:
Cmd *_cmd;
static void executeCmdCallback ( Widget,
XtPointer,
XtPointer );
int _active;
CmdInterface ( Cmd * );
virtual void activate();
virtual void deactivate();
};
#endif

View File

@@ -0,0 +1,87 @@
/*
*+SNOTICE
*
* $XConsortium: CmdList.h /main/3 1995/11/06 16:30:40 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
#ifndef CMDLIST_H
#define CMDLIST_H
#ifndef I_HAVE_NO_IDENT
#endif
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// CmdList.h: Maintain a list of Cmd objects
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// MODIFIED TO INHERIT FROM CMD - not described in Book
///////////////////////////////////////////////////////////
#include <X11/Intrinsic.h>
#include "Cmd.h"
class CmdList : public Cmd {
private:
Cmd **_contents; // The list of objects
int _numElements; // Current size of list
Widget _pane;
virtual void doit();
virtual void undoit();
public:
CmdList();
CmdList(char *, char *); // Construct an empty list
virtual ~CmdList(); // Destroys list, but not objects in list
void add ( Cmd * ); // Add a single Cmd object to list
void setPaneWidget(Widget pane) { _pane = pane; }
Widget getPaneWidget(void) { return _pane; }
Cmd **contents() { return _contents; } // Return the list
int size() { return _numElements; } // Return list size
Cmd *operator[]( int ); // Return an element of the list
virtual const char *const className () { return "CmdList"; }
};
#endif

View File

@@ -0,0 +1,71 @@
/* $XConsortium: ColorView.h /main/4 1996/04/21 19:46:09 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// ColorMView.h: Abstract base class. Defines protocol for
// all views attached to the ColorModel
/////////////////////////////////////////////////////////////
#ifndef COLORVIEW_H
#define COLORVIEW_H
#include "UIComponent.h"
class ColorModel;
class ColorView : public UIComponent {
protected:
ColorView ( char *name ) : UIComponent ( name ) { }
public:
virtual void update ( ColorModel * ) = 0;
virtual const char *const className() { return "ColorView"; }
};
#endif

View File

@@ -0,0 +1,91 @@
/* $XConsortium: DialogCallbackData.h /main/4 1996/04/21 19:46:12 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// DialogCallbackData.h: Auxiliary class used by DialogManager
//////////////////////////////////////////////////////////////
#ifndef DIALOGCALLBACKDATA
#define DIALOGCALLBACKDATA
class DialogManager;
typedef void (*DialogCallback)( void * );
class DialogCallbackData {
private:
DialogManager *_dialogManager;
DialogCallback _ok;
DialogCallback _help;
DialogCallback _cancel;
void *_clientData;
public:
DialogCallbackData ( DialogManager *dialog,
void *clientData,
DialogCallback ok,
DialogCallback cancel,
DialogCallback help)
{
_dialogManager = dialog;
_ok = ok;
_help = help;
_cancel = cancel;
_clientData = clientData;
}
DialogManager *dialogManager() { return _dialogManager; }
DialogCallback ok() { return _ok; }
DialogCallback help() { return _help; }
DialogCallback cancel() { return _cancel; }
void *clientData() { return _clientData; }
};
#endif

View File

@@ -0,0 +1,134 @@
/* $XConsortium: DialogManager.h /main/4 1996/04/21 19:46:15 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// DialogManager.h: A base class for cached dialogs
//////////////////////////////////////////////////////////
#ifndef DIALOGMANAGER_H
#define DIALOGMANAGER_H
#include "UIComponent.h"
#include "DialogCallbackData.h"
class DialogManager : public UIComponent {
private:
static void destroyTmpDialogCallback ( Widget,
XtPointer,
XtPointer );
void cleanup ( Widget, DialogCallbackData* );
protected:
void forceUpdate( Widget );
// Called to get a new dialog
Widget getDialog();
Widget getDialog(Widget );
virtual Widget createDialog ( Widget ) = 0;
static void okCallback ( Widget,
XtPointer,
XtPointer );
static void cancelCallback ( Widget,
XtPointer,
XtPointer );
static void helpCallback ( Widget,
XtPointer,
XtPointer );
public:
DialogManager ( char * );
virtual Widget post (
char *,
char *,
Widget w,
void *clientData = NULL,
DialogCallback ok = NULL,
DialogCallback cancel = NULL,
DialogCallback help = NULL );
virtual Widget post (
char *,
char *,
void *clientData = NULL,
DialogCallback ok = NULL,
DialogCallback cancel = NULL,
DialogCallback help = NULL );
virtual int post_and_return(
char *,
char *,
Widget);
virtual int post_and_return(
char *,
char *,
char *,
Widget);
virtual int post_and_return(
char *,
char *,
char *,
char *,
Widget);
};
#endif

View File

@@ -0,0 +1,108 @@
/* $XConsortium: Help.hh /main/5 1996/10/11 20:05:13 cde-hp $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
#ifndef HELP_HH
#define HELP_HH
#include <Dt/Help.h>
// Option defines for menubar help access
#define HELP_ON_ITEM 1
#define HELP_ON_TOPIC 2
#define HELP_ON_VERSION 3
#define DTMAILCONTAINERMENUID "DTMAILVIEWMAINWINDOWMENUBARFILE"
#define DTMAILEDITMENUID "DTMAILVIEWMAINWINDOWMENUBAREDIT"
#define DTMAILMESSAGEMENUID "DTMAILVIEWMAINWINDOWMENUBARMESSAGE"
#define DTMAILATTACHMENUID "DTMAILVIEWMAINWINDOWMENUBARATTACH"
#define DTMAILVIEWMENUID "DTMAILVIEWMAINWINDOWMENUBARVIEW"
#define DTMAILCOMPOSEMENUID "DTMAILVIEWMAINWINDOWMENUBARCOMPOSE"
#define APP_MENU_ID "onApplicationMenu"
#define VER_MENU_ID "_copyright"
/************************************************************************
* Help location ids for edit area and status line of the DtEditor widget
************************************************************************/
#define EDIT_AREA_HELP "TextEditorWindow"
/* -----> fields/buttons within the status line */
#define STATUS_LINE_HELP "statusLine"
#define STATUS_CURRENT_LINE_HELP "status-currentLine"
#define STATUS_TOTAL_LINES_HELP "status-totalLines"
#define STATUS_MESSAGE_HELP "status-message"
#define STATUS_OVERSTRIKE_HELP "status-overstrike"
/************************************************************************
* Help location ids for the dialog posted by [Format] menu [Settings...]
* (this dialog is controlled by the DtEditor widget)
************************************************************************/
#define FORMAT_SETTINGS_HELP "formatDialog"
/* -----> fields/buttons within the Format Settings dialog */
#define FORMAT_LEFT_MARGIN_HELP "format-leftmargin"
#define FORMAT_RIGHT_MARGIN_HELP "format-rightmargin"
#define FORMAT_ALIGNMENT_HELP "format-alignment"
/************************************************************************
* Help location ids for the dialog posted by [Edit] menu [Find/Change...]
* (this dialog is controlled by the DtEditor widget)
************************************************************************/
#define FINDCHANGE_HELP "findchangeDialog"
/* -----> fields/buttons within the Find/Change dialog */
#define FINDCHANGE_FIND_HELP "fc-find"
#define FINDCHANGE_CHANGETO_HELP "fc-changeto"
/************************************************************************
* Help location ids for the dialog posted by [Edit] menu [Find/Change...]
* (this dialog is controlled by the DtEditor widget)
************************************************************************/
#define SPELL_HELP "spellDialog"
/* -----> fields/buttons within the Check Spelling dialog */
#define SPELL_MISSPELLED_WORDS_HELP "sp-spelllist"
#define SPELL_CHANGETO_HELP "sp-changeto"
char *getHelpId(Widget);
void printHelpId(char *, Widget);
#ifdef DEAD_WOOD
void HelpMenuCB(Widget, XtPointer, XtPointer);
#endif /* DEAD_WOOD */
void HelpCB(Widget, XtPointer, XtPointer);
void HelpTexteditCB( Widget, XtPointer, XtPointer ) ;
extern void DisplayMain(Widget, char *, char *);
Widget getErrorHelpWidget(void);
void clearErrorHelpWidget(void);
extern void DisplayErrorHelp(Widget, char *, char *);
void HelpErrorCB(Widget, XtPointer, XtPointer);
extern void DisplayVersion(Widget, char *, char *);
static void CloseMainCB(Widget, XtPointer, XtPointer);
#endif

View File

@@ -0,0 +1,63 @@
/*
*+SNOTICE
*
* $XConsortium: IconifyCmd.h /main/3 1995/11/06 16:31:17 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// IconifyCmd.h: Iconify all windows in a MotifApp application.
////////////////////////////////////////////////////////////////
#ifndef ICONIFYCMD_H
#define ICONIFYCMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "NoUndoCmd.h"
class IconifyCmd : public NoUndoCmd {
protected:
virtual void doit(); // Iconify all windows
public:
IconifyCmd ( char *, char *, int );
virtual const char *const className () { return "IconifyCmd"; }
};
#endif

View File

@@ -0,0 +1,69 @@
/* $XConsortium: InfoDialogManager.h /main/4 1996/04/21 19:46:21 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// InfoDialogManager.h
//////////////////////////////////////////////////////////
#ifndef INFODIALOGMANAGER_H
#define INFODIALOGMANAGER_H
#include "DialogManager.h"
class InfoDialogManager : public DialogManager {
protected:
Widget createDialog ( Widget );
public:
InfoDialogManager ( char * );
};
extern DialogManager *theInfoDialogManager;
#endif

View File

@@ -0,0 +1,88 @@
/*
*+SNOTICE
*
* $XConsortium: InterruptibleCmd.h /main/3 1995/11/06 16:31:32 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// InterruptibleCmd.h: Abstract class that supports lengthy,
// user-interruptible activities
//////////////////////////////////////////////////////////////
#ifndef INTERRUPTIBLECMD_H
#define INTERRUPTIBLECMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include <Xm/Xm.h>
#include "NoUndoCmd.h"
// Define a type for the callback invoked when the task is finished
class InterruptibleCmd;
typedef void (*TaskDoneCallback) ( InterruptibleCmd *, Boolean, void * );
class InterruptibleCmd : public NoUndoCmd {
private:
XtWorkProcId _wpId; // The ID of the workproc
TaskDoneCallback _callback; // Application-defined callback
void *_clientData;
Boolean workProc ();
static Boolean workProcCallback ( XtPointer );
static void interruptCallback ( void * );
void interrupt();
protected:
Boolean _done; // TRUE if the task has been completed
virtual void cleanup(); // Called when task ends
virtual void updateMessage ( char * );
// Derived classes implement doit(), declared by Cmd
public:
InterruptibleCmd ( char *, char *, int );
virtual ~InterruptibleCmd();
virtual void execute(); // Overrides base class member function
virtual void execute ( TaskDoneCallback, void * );
};
#endif

View File

@@ -0,0 +1,126 @@
/* $TOG: MainWindow.h /main/11 1998/08/21 15:57:56 mgreess $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// MainWindow.h: Support a toplevel window
////////////////////////////////////////////////////////////////////
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "UIComponent.h"
class MainWindow : public UIComponent {
protected:
Widget _main; // The XmMainWindow widget
Widget _workArea; // Widget created by derived class
Boolean _allow_resize;
Pixmap _icon;
GC _icon_invert;
GC _window_invert;
int _last_state;
Window _flash_owin;
Window _flash_iwin;
XWindowAttributes
_window_attributes;
// Derived classes must define this function to
// create the application-specific work area.
virtual Widget createWorkArea ( Widget ) = 0;
virtual void getIconColors(Pixmap & fore, Pixmap & back);
public:
MainWindow ( char *name, Boolean allowResize=FALSE );
virtual ~MainWindow();
// The Application class automatically calls initialize()
// for all registered main window objects
virtual void initialize();
virtual void disableWorkAreaResize();
virtual void enableWorkAreaResize();
virtual void manage(); // popup the window
virtual void unmanage(); // pop down the window
virtual void iconify();
virtual void setIconTitle(const char * title);
virtual void setIconName(const char * name);
virtual void title(const char *);
virtual void flash(const int count);
virtual void quit(Boolean delete_win = FALSE)=0;
virtual void panicQuit()=0;
virtual Boolean isIconified();
// Functions to control session management.
virtual int smpSaveSessionGlobal(void) = 0;
virtual void smpSaveSessionLocal(void) = 0;
virtual void busyCursor(void);
virtual void normalCursor(void);
virtual void setStatus(const char *);
virtual void clearStatus(void);
virtual void propsChanged(void) = 0;
void setWorkspacesOccupied(char *workspaces);
char *MbStrchr(char *str, int ch);
private:
static void quitCallback( Widget, XtPointer, XmAnyCallbackStruct * );
static void flashCallback(XtPointer, XtIntervalId *);
void doFlash(XtIntervalId *);
int _flashing;
};
#endif

View File

@@ -0,0 +1,63 @@
/*
*+SNOTICE
*
* $XConsortium: ManageCmd.h /main/3 1995/11/06 16:31:48 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
// ManageCmd.h: Manage all windows in a MotifApp application.
//////////////////////////////////////////////////////////////
#ifndef MANAGECMD_H
#define MANAGECMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "NoUndoCmd.h"
class ManageCmd : public NoUndoCmd {
protected:
virtual void doit(); // Manage all windows
public:
ManageCmd ( char *, char *, int );
virtual const char *const className () { return "ManageCmd"; }
};
#endif

View File

@@ -0,0 +1,112 @@
/* $XConsortium: MenuBar.h /main/4 1996/04/21 19:46:27 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// MenuBar.h: A menu bar, whose panes support items
// that execute Cmds
//////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// MODIFIED TO SUPPORT SUBMENUS - not described in Book
///////////////////////////////////////////////////////////
#ifndef MENUBAR_H
#define MENUBAR_H
#include "UIComponent.h"
#include <Xm/RowColumn.h>
class Cmd;
class CmdList;
class MenuBar : public UIComponent {
protected:
#ifdef DEAD_WOOD
virtual Boolean isValidMenuPane(Widget);
#endif /* DEAD_WOOD */
virtual Widget createPulldown ( Widget, CmdList *,
Boolean, unsigned char);
virtual Widget createPulldown ( Widget, CmdList *,
Widget *, Boolean, unsigned char);
public:
MenuBar ( Widget, char *, unsigned char = XmMENU_BAR );
// Create a named menu pane from a list of Cmd objects
virtual Widget addCommands ( Widget *, CmdList *, Boolean = FALSE,
unsigned char = XmMENU_BAR);
virtual Widget addCommands ( CmdList *, Boolean = FALSE,
unsigned char = XmMENU_BAR);
virtual Widget addCommands ( Widget, CmdList *);
virtual void addCommand ( Widget, Cmd *);
virtual void removeCommands( Widget, CmdList *);
virtual void removeCommand( Widget, int at);
virtual void removeOnlyCommands( Widget, CmdList *);
virtual void changeLabel ( Widget, int, char *);
virtual void changeLabel(Widget, const char * wid_name, const char * label);
virtual void rotateLabels ( Widget, int, int );
virtual const char *const className() { return "MenuBar"; }
};
#endif

View File

@@ -0,0 +1,83 @@
/* $TOG: MenuWindow.h /main/5 1997/06/04 18:43:25 mgreess $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// MenuWindow.C: Add a menubar to the features of MainWindow
//////////////////////////////////////////////////////////////
#ifndef MENUWINDOW_H
#define MENUWINDOW_H
#include "MainWindow.h"
class MenuBar;
class MenuWindow : public MainWindow {
private:
protected:
MenuBar *_menuBar;
virtual void initialize(); // Called by Application
virtual void createMenuPanes() = 0; // Defined by derived
// classes to specify the
// contents of the menu
#ifndef CPLUSPLUS2_1
virtual Widget createWorkArea ( Widget ) = 0;
#endif
virtual void getIconColors(Pixmap & fore, Pixmap & back);
public:
MenuWindow ( char *name, Boolean allowResize=FALSE );
virtual ~MenuWindow();
};
#endif

View File

@@ -0,0 +1,85 @@
/* $TOG: MotifCmds.h /main/5 1998/09/21 18:52:49 mgreess $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
/////////////////////////////////////////////////////////
// MotifCmds.h: Menu cmds
/////////////////////////////////////////////////////////
#ifndef MOTIFCMDS_H
#define MOTIFCMDS_H
#include "Cmd.h"
#include "CmdInterface.h"
#include <Xm/Xm.h>
#include <Xm/ToggleB.h>
// Elsewhere in MotifApp, we refer to instances of these classes
// via their className() method. We compare them to SeparatorCmd
// or ToggleButtonCmd.
// We want derived classes to also answer to the same className().
// So, we make className() a non-virtual method.
class SeparatorCmd : public Cmd {
public:
virtual void doit();
virtual void undoit();
SeparatorCmd( char *, char *, int );
const char *const className () { return "SeparatorCmd"; }
};
// Its critical that children of ToggleButtonCmd not have a
// const className() method.
// Make className() a non-virtual method then.
class ToggleButtonCmd : public Cmd {
public:
virtual void doit();
virtual void undoit();
ToggleButtonCmd(
char *name, char *label, int active,
Boolean visible_when_off=TRUE,
unsigned char indicator_type=XmONE_OF_MANY_ROUND);
unsigned char indicatorType();
Boolean visibleWhenOff();
Boolean getButtonState();
void setButtonState(Boolean, Boolean);
#ifdef CAN_INLINE_VIRTUALS
const char *const className () { return "ToggleButtonCmd"; }
#else /* ! CAN_INLINE_VIRTUALS */
const char *const className ();
#endif /* ! CAN_INLINE_VIRTUALS */
unsigned char _indicator_type;
Boolean _visible_when_off;
};
#endif

View File

@@ -0,0 +1,66 @@
/*
*+SNOTICE
*
* $XConsortium: NoUndoCmd.h /main/3 1995/11/06 16:32:22 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// NoUndoCmd.h: Base class for all commands without undo
//////////////////////////////////////////////////////////
#ifndef NOUNDOCMD_H
#define NOUNDOCMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "Cmd.h"
class NoUndoCmd : public Cmd {
protected:
#ifndef CPLUSPLUS2_1
virtual void doit() = 0; // Specific actions must be defined
#endif
virtual void undoit();
public:
NoUndoCmd ( char *, char *, int );
};
#endif

View File

@@ -0,0 +1,78 @@
/* $XConsortium: PixmapCycler.h /main/4 1996/04/21 19:46:36 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// PixmapCycler.h: Abstract class that supports a continuous cycle
// of pixmaps for short animation sequences.
////////////////////////////////////////////////////////////////////
#ifndef PIXMAPCYCLER_H
#define PIXMAPCYCLER_H
#include <Xm/Xm.h>
class PixmapCycler {
protected:
int _numPixmaps; // Total number of pixmaps in cycle
int _current; // Index of the current pixmap
Pixmap *_pixmapList; // The array of pixmaps
Dimension _width, _height; // Pixmap size
virtual void createPixmaps() = 0; // Derived class must implement
PixmapCycler ( int, Dimension, Dimension );
public:
virtual ~PixmapCycler();
Dimension width() { return _width; }
Dimension height() { return _height; }
Pixmap next(); // Return the next pixmap in the cycle
};
#endif

View File

@@ -0,0 +1,86 @@
/* $XConsortium: PromptDialogManager.h /main/4 1996/04/21 19:46:39 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// PromptDialogManager.h
//////////////////////////////////////////////////////////
#ifndef PROMPTDIALOGMANAGER_H
#define PROMPTDIALOGMANAGER_H
#include "DialogManager.h"
class PromptDialogManager : public DialogManager {
protected:
Widget createDialog ( Widget );
public:
PromptDialogManager ( char * );
virtual Widget post (char*,
char *,
void *clientData = NULL,
DialogCallback ok = NULL,
DialogCallback cancel = NULL,
DialogCallback help = NULL );
virtual Widget post (char *,
char *,
Widget ,
void *clientData = NULL,
DialogCallback ok = NULL,
DialogCallback cancel = NULL,
DialogCallback help = NULL );
};
extern PromptDialogManager *thePromptDialogManager;
#endif

View File

@@ -0,0 +1,72 @@
/* $XConsortium: QuestionDialogManager.h /main/4 1996/04/21 19:46:42 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// QuestionDialogManager.h
//////////////////////////////////////////////////////////
#ifndef QuestionDIALOGMANAGER_H
#define QuestionDIALOGMANAGER_H
#include "DialogManager.h"
class QuestionDialogManager : public DialogManager {
protected:
Widget createDialog ( Widget );
public:
QuestionDialogManager ( char * );
};
#ifdef DEAD_WOOD
extern QuestionDialogManager *theQuestionDialogManager;
#endif /* DEAD_WOOD */
#endif

View File

@@ -0,0 +1,66 @@
/*
*+SNOTICE
*
* $XConsortium: QuitCmd.h /main/3 1995/11/06 16:32:51 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// QuitCmd.h: Exit an application after checking with user.
////////////////////////////////////////////////////////////
#ifndef QUITCMD_H
#define QUITCMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "WarnNoUndoCmd.h"
#include "MainWindow.h"
class QuitCmd : public WarnNoUndoCmd {
protected:
virtual void doit(); // Call exit
MainWindow *_mywindow;
public:
QuitCmd ( char *, char *, int, MainWindow *);
virtual const char *const className () { return "QuitCmd"; }
virtual void execute(); // Overrides the AskFirstCmd member function
};
#endif

View File

@@ -0,0 +1,48 @@
/* $XConsortium: ScrollingList.h /main/4 1996/04/21 19:46:45 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
#ifndef SCROLLINGLIST_H
#define SCROLLINGLIST_H
#include "UIComponent.h"
#include <Xm/List.h>
#include <stdlib.h>
class ScrollingList : public UIComponent {
private:
static void defaultActionCallback( Widget, XtPointer, XmListCallbackStruct * );
public:
ScrollingList ( Widget, char * );
~ScrollingList ();
virtual const char *const className() { return ( "ScrollingList" ); }
virtual void defaultAction( Widget, XtPointer, XmListCallbackStruct * ) = 0;
};
#endif

View File

@@ -0,0 +1,120 @@
/*
*+SNOTICE
*
* $TOG: SelectFileCmd.h /main/5 1997/05/30 17:47:20 mgreess $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// SelectFileCmd.h: Allow the user to select a file interactively
///////////////////////////////////////////////////////////////////
#ifndef SELECTFILECMD_H
#define SELECTFILECMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "NoUndoCmd.h"
#include <Xm/Xm.h>
#include <Xm/ToggleB.h>
typedef void (*FileCallback) ( void *, char * );
class SelectFileCmd : public NoUndoCmd {
private:
static void fileSelectedCB ( Widget, XtPointer, XtPointer );
static void fileCanceledCB ( Widget, XtPointer, XtPointer );
static void hiddenCB(Widget, XtPointer, XtPointer);
void doHidden(int);
protected:
void doit(); // Called by base class
char * _ok_label;
char * _title;
FileCallback _ok_callback; // Function called when user selects file.
void *_ok_clientData; // Data provided for ok callback.
FileCallback _cancel_callback; // Function called when user cancels.
void *_cancel_clientData; // Data provided for cancel callback.
Widget _fileBrowser; // The Motif widget used to get file
Widget _parentWidget; // Need it to parent fileBrowser.
Widget _hidden_button;
XmString _directory; // The directory pointed to.
virtual void fileSelected (char *);
virtual void fileCanceled ();
public:
SelectFileCmd (const char * name,
const char * label,
const char * title,
const char * ok_label,
int active,
FileCallback callback, // ok callback
void * clientData, // ok data
Widget parent);
SelectFileCmd (const char * name,
const char * label,
const char * title,
const char * ok_label,
int active,
FileCallback ok_callback, // ok callback
void * ok_clientData, // ok data
FileCallback cancel_callback, // cancel callback
void * cancel_clientData, // cancel data
Widget parent);
~SelectFileCmd ();
char *getDirectory();
char *getSelected();
int getHidden();
void setDirectory(char *);
void setSelected(char *);
void setHidden(int);
Widget fileBrowser(void) { return _fileBrowser; }
Widget hiddenButton(void) { return _hidden_button; }
};
#endif

View File

@@ -0,0 +1,39 @@
/* $XConsortium: ShutdownActions.hh /main/3 1996/04/21 19:46:48 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
#ifndef _SHUTDOWNACTIONS_HH
#define _SHUTDOWNACTIONS_HH
class ShutdownActions {
public:
ShutdownActions(int num_actions = 32);
~ShutdownActions(void);
typedef int (*ShutdownActionProc)(void *);
void addAction(ShutdownActionProc, void * cb_data);
void removeAction(ShutdownActionProc, void * cb_data);
int doActions(void);
private:
struct ActionEntry {
ShutdownActionProc proc;
void * call_back_data;
};
ActionEntry *_actions;
int _action_list_size;
int _action_count;
void removeEntry(int);
};
#endif

View File

@@ -0,0 +1,49 @@
/* $XConsortium: ToggleButtonInterface.h /main/4 1996/04/21 19:46:51 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
//////////////////////////////////////////////////////////////
// ToggleButtonInterface.h: A togglebutton interface to a Cmd object
///////////////////////////////////////////////////////////////
#ifndef TOGGLEBUTTONINTERFACE
#define TOGGLEBUTTONINTERFACE
#include "CmdInterface.h"
class ToggleButtonInterface : public CmdInterface {
public:
ToggleButtonInterface ( Widget, Cmd * );
#ifndef CAN_INLINE_VIRTUALS
~ToggleButtonInterface ( void );
#endif /* ! CAN_INLINE_VIRTUALS */
};
#endif

View File

@@ -0,0 +1,113 @@
/*
*+SNOTICE
*
* $TOG: UIComponent.h /main/6 1998/01/29 15:18:31 mgreess $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
// UIComponent.h: Base class for all C++/Motif UI components
///////////////////////////////////////////////////////////////
#ifndef UICOMPONENT_H
#define UICOMPONENT_H
#ifndef I_HAVE_NO_IDENT
#endif
#include <Xm/Xm.h>
#include "BasicComponent.h"
class UIComponent : public BasicComponent {
private:
// Interface between XmNdestroyCallback and this class
static void widgetDestroyedCallback ( Widget,
XtPointer,
XtPointer );
protected:
//
// Number of pending tasks.
// UIComponents with pending tasks should not be terminated.
// Used in Application and MainWindow classes to block termination.
//
int _numPendingTasks;
// Protect constructor to prevent direct instantiation
UIComponent ( const char * );
void installDestroyHandler(); // Easy hook for derived classes
// Called by widgetDestroyedCallback() if base widget is destroyed
virtual void widgetDestroyed();
#ifdef DEAD_WOOD
// Loads component's default resources into database
void setDefaultResources ( const Widget , const String *);
#endif /* DEAD_WOOD */
// Retrieve resources for this clsss from the resource manager
void getResources ( const XtResourceList, const int );
public:
virtual ~UIComponent();
// Manage the entire widget subtree represented
// by this component. Overrides BasicComponent method
virtual void manage();
virtual void displayInCurrentWorkspace();
virtual void displayInCurrentWorkspace(Widget);
// Public access functions
#ifdef CAN_INLINE_VIRTUALS
virtual const char *const className() { return "UIComponent"; }
#else
virtual const char *const className();
#endif
//
// Functions for registering and unregistering tasks
// which will block termination.
//
void registerPendingTask() { _numPendingTasks++; }
void unregisterPendingTask() { _numPendingTasks--; }
};
#endif

View File

@@ -0,0 +1,65 @@
/*
*+SNOTICE
*
* $XConsortium: UndoCmd.h /main/3 1995/11/06 16:33:29 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// UndoCmd.h: An interface for undoing the last command
//////////////////////////////////////////////////////////
#ifndef UNDOCMD_H
#define UNDOCMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "NoUndoCmd.h"
class UndoCmd : public NoUndoCmd {
protected:
virtual void doit();
public:
UndoCmd ( char *, char * );
};
extern UndoCmd *theUndoCmd;
#endif

View File

@@ -0,0 +1,63 @@
/*
*+SNOTICE
*
* $XConsortium: WarnNoUndoCmd.h /main/3 1995/11/06 16:33:36 rswiston $
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// WarnNoUndoCmd.h: Warns user before executing a command
//////////////////////////////////////////////////////////
#ifndef WARNNOUNDOCMD_H
#define WARNNOUNDOCMD_H
#ifndef I_HAVE_NO_IDENT
#endif
#include "AskFirstCmd.h"
class WarnNoUndoCmd : public AskFirstCmd {
protected:
virtual void undoit();
public:
WarnNoUndoCmd ( char *, char *, int );
virtual const char *const className () { return "WarnNoUndoCmd"; }
};
#endif

View File

@@ -0,0 +1,99 @@
/* $XConsortium: WorkingDialogManager.h /main/4 1996/04/21 19:46:54 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1996 Hewlett-Packard Company.
* (c) Copyright 1996 International Business Machines Corp.
* (c) Copyright 1996 Sun Microsystems, Inc.
* (c) Copyright 1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/*
*+SNOTICE
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*+ENOTICE
*/
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// This example code is from the book:
//
// Object-Oriented Programming with C++ and OSF/Motif
// by
// Douglas Young
// Prentice Hall, 1992
// ISBN 0-13-630252-1
//
// Copyright 1991 by Prentice Hall
// All Rights Reserved
//
// Permission to use, copy, modify, and distribute this software for
// any purpose except publication and without fee is hereby granted, provided
// that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
// WorkingDialogManager.h
//////////////////////////////////////////////////////////
#ifndef WORKINGDIALOGMANAGER_H
#define WORKINGDIALOGMANAGER_H
#include "DialogManager.h"
class PixmapCycler;
class WorkingDialogManager : public DialogManager {
protected:
Widget createDialog ( Widget );
PixmapCycler *_busyPixmaps; // Source of animated pixmap sequence
XtIntervalId _intervalId; // ID of the last timeout
static void unpostCallback ( Widget, XtPointer, XtPointer );
static void timerCallback ( XtPointer, XtIntervalId * );
void timer ( );
public:
WorkingDialogManager ( char * );
virtual Widget post (char *,
char *,
void *clientData = NULL,
DialogCallback ok = NULL,
DialogCallback cancel = NULL,
DialogCallback help = NULL );
virtual Widget post (char *,
char *,
Widget ,
void *clientData = NULL,
DialogCallback ok = NULL,
DialogCallback cancel = NULL,
DialogCallback help = NULL );
void unpost(); // Remove the dialog from the screen
void updateMessage ( char * ); // Change the text in the dialog
};
extern WorkingDialogManager *theWorkingDialogManager;
#endif

View File

@@ -0,0 +1,56 @@
/* $XConsortium: dtmailopts.h /main/3 1995/11/06 16:33:51 rswiston $ */
/*** DTB_USER_CODE_START vvv Add file header below vvv ***/
/*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
/*
* File: dtmailopts.h
* Contains: object data structures and callback declarations
*
* This file was generated by dtcodegen, from project dtmailopts
*
* Any text may be added between the DTB_USER_CODE_START and
* DTB_USER_CODE_END comments (even non-C code). Descriptive comments
* are provided only as an aid.
*
* ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS. **
* ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR **
* ** DELETE THE GENERATED COMMENTS! **
*/
#ifndef _DTMAILOPTS_H_
#define _DTMAILOPTS_H_
#include <stdlib.h>
#include <X11/Intrinsic.h>
#include <nl_types.h>
#define DTB_PROJECT_CATALOG "dtmailopts"
/* Handle for standard message catalog for the project */
extern nl_catd Dtb_project_catd;
/*
* Structure to store values for Application Resources
*/
typedef struct {
char *session_file;
/*** DTB_USER_CODE_START vvv Add structure fields below vvv ***/
/*** DTB_USER_CODE_END ^^^ Add structure fields above ^^^ ***/
} DtbAppResourceRec;
extern DtbAppResourceRec dtb_app_resource_rec;
/**************************************************************************
*** DTB_USER_CODE_START
***
*** Add types, macros, and externs here
***/
/*** DTB_USER_CODE_END
***
*** End of user code section
***
**************************************************************************/
#endif /* _DTMAILOPTS_H_ */

View File

@@ -0,0 +1,31 @@
/* $XConsortium: mailtest.h /main/3 1995/11/06 16:33:59 rswiston $ */
/*
* File: mailtest.h
* Contains object data structures and callback declarations
*
* This file was generated from mailtest by dtcodegen
*
* ** DO NOT MODIFY BY HAND - ALL MODIFICATIONS WILL BE LOST **
*
*/
#ifndef _MAILTEST_H_
#define _MAILTEST_H_
#include <stdlib.h>
#include <X11/Intrinsic.h>
/*
* Structure to store values for Application Resources
*/
typedef struct {
char *session_file;
/* vvv Add client code below vvv */
} DtbAppResourceRec;
extern DtbAppResourceRec dtb_app_resource_rec;
#endif /* _MAILTEST_H_ */