
/******************************************************************
 *                                                                *
 *                  Computer Science Department                   *
 *                                                                *
 *                        Master's Project                        *
 *                                                                *
 *                Graphical Development Environment               *
 *                                                                *
 *                     for Postgres Database                      *
 *                                                                *
 *                    Designed Especially for                     *
 *                                                                *
 *                 Postgres Developers and Users                  *
 *                                                                *
 *                              At                                *
 *                                                                *
 *                     Concordia University                       *
 *                                                                *
 ******************************************************************
 *                                                                *
 * Designer and Programmer:  Khaled Jababo                        *
 * Email                  :  jababo@cs.concordia.ca               *
 *                                                                *
 * Supervised by          :  Dr. Bipin C. Desai.                  *
 *                           Computer Science Department.         *
 * Email                  :  bcdesai@cs.concordia.ca              *
 *                                                                *
 * Last Modified          :  June 18, 1994                        *
 *                                                                *
 *                                                                *
 *                                                                *
 * Disclaimer:  There are no guarantees as to the accuracy, cu-   *
 *             rrency, quality, or usefulness of these programs   *
 *             or any information that is provided by using it.   *
 *             Furthermore, there is no assumption of responsi-   *
 *             bility for any los or damage which may be caused   *
 *             by their use.                                      *
 *                                                                *
 *                                                                *
 * Forward comments or questions about this report or the GDEP    *
 * system to:                                                     *
 *              bcdesai@cs.concordia.ca                           *
 *              jababo@cs.concordia.ca                            *
 *                                                                *
 ******************************************************************/


/******************************************************************/
/***********************     xaevents.c    ************************/
/******************************************************************/
/*                                                                */
/*    This File Contains all the functions  needed to handle the  */
/*  events that occur  in the mainfile  with respect to the user  */
/*  request whether it is an input command,  a submenu choice, a  */
/*  menu choice or any other request.                             */
/*                                                                */
/******************************************************************/

#include "mainfile.h"

void extern XaFexit(), 
            XaFsetWindow() ;

/*****************************************************************/
/*****************************************************************/
/*                                                               */
/*                      XaMainMenuBar Events                     */
/*   This section contains all the fnctions needed to handle the */
/*  events that occur in the Main Menu Bar window.               */
/*                                                               */
/*****************************************************************/
/*****************************************************************/


/*****************************************************************/
/*                 XaFeventMainMenubarApplication                */
/*    Function that take care of Events that occur in the Appli- */
/*  cation Option of Main Menubar.                               */
/*                                                               */
/*****************************************************************/

void XaFeventMainMenubarApplication(XaLwidget, XaLitemNo)
  Widget  XaLwidget ;
  int     XaLitemNo ;

  { /* begin XaFeventMainMenubarApplication function */

    if (XaLitemNo == 0)
      XaFhandleLoad(XaLwidget) ;
    else if (XaLitemNo == 1)
      XaFhandleSetRootClass(XaLwidget) ;
    else if (XaLitemNo == 2)
      XaFhandleCreate(XaLwidget) ;
    else
      XaFhandleQuit(XaLwidget) ;

  } /* end   XaFeventMainMenubarApplication function */


/*****************************************************************/
/*                    XaFeventMainMenubarEdit                    */
/*    Function that take care  of Events that  occur in the Edit */
/*  Option of Main Menubar.                                      */
/*                                                               */
/*****************************************************************/

void XaFeventMainMenubarEdit(XaLwidget, XaLitemNo)
  Widget  XaLwidget ;
  int     XaLitemNo ;

  { /* begin XaFeventMainMenubarEdit function */

    if (XaLitemNo == 0)
      XaFhandleEditCreateNewClass(XaLwidget) ;
    else if (XaLitemNo == 1)
      XaFhandleEditDestroyRootClass(XaLwidget) ;
    else if (XaLitemNo == 2)
      XaFhandleEditAddNewChildClass(XaLwidget) ;
    else if (XaLitemNo == 3)
      XaFhandleEditAddAttributeClass(XaLwidget) ;
    else if (XaLitemNo == 4)
      XaFhandleAddInstanceClass(XaLwidget) ;
    else if (XaLitemNo == 5)
      XaFhandleEditInstanceClass(XaLwidget) ;
    else if (XaLitemNo == 6)
      XaFhandleEditChangeParentClass(XaLwidget) ;
    else
      XaFhandleHelpEdit(XaLwidget) ;

  } /* end   XaFeventMainMenubarEdit function */


/*****************************************************************/
/*                    XaFeventMainMenubarView                    */
/*    Function that take care of  Events that  occur in the View */
/*  Option of Main Menubar.                                      */
/*                                                               */
/*****************************************************************/

void XaFeventMainMenubarView(XaLwidget, XaLitemNo)
  Widget  XaLwidget ;
  int     XaLitemNo ;

  { /* begin XaFeventMainMenubarView function */

    if (XaLitemNo == 0)
      XaFhandleViewClassDescription(XaLwidget) ;
    else if (XaLitemNo == 1)
      XaFhandleViewClassParent(XaLwidget) ;
    else if (XaLitemNo == 2)
      XaFhandleViewClassChildren(XaLwidget) ;
    else if (XaLitemNo == 3)
      XaFhandleViewClassInstances(XaLwidget) ;
    else if (XaLitemNo == 4)
      XaFhandleViewClassInstancesByTuple(XaLwidget) ;
    else
      XaFhandleHelpView(XaLwidget) ;

  } /* end   XaFeventMainMenubarView function */


/*****************************************************************/
/*                 XaFeventMainMenubarUtilities                  */
/*    Function that take care of Events that occur in the Utili- */
/*  ties Option of Main Menubar.                                 */
/*                                                               */
/*****************************************************************/

void XaFeventMainMenubarUtilities(XaLwidget, XaLitemNo)
  Widget  XaLwidget ;
  int     XaLitemNo ;

  { /* begin XaFeventMainMenubarUtilities function */

    if (XaLitemNo == 0)
      XaFhandleHideCommandWindow() ;
    else if (XaLitemNo == 1)
      XaFhandleShowCommandWindow() ;
    else if (XaLitemNo == 2)
      XaFhandleResizeWindows() ;
    else if (XaLitemNo == 3)
      XaFhandleRefreshWindows() ;
    else if (XaLitemNo == 4)
      XaFhandleClearDisplayArea() ;
    else if (XaLitemNo == 5)
      XaFhandleExportClassDefinition(XaLwidget) ;
    else if (XaLitemNo == 6)
      XaFhandleExportClassDefInherit(XaLwidget) ;
    else if (XaLitemNo == 7)
      XaFhandleExportClassInstances(XaLwidget) ;
    else if (XaLitemNo == 8)
      XaFhandleExportClassTree(XaLwidget) ;
    else if (XaLitemNo == 9)
      XaFhandleImportPostquelFile(XaLwidget) ;
    else
      XaFhandleHelpUtilities(XaLwidget) ;

  } /* end   XaFeventMainMenubarUtilities function */


/*****************************************************************/
/*                     XaFeventMainMenubarMosaic                 */
/*    Function that take care of Events that occur in the Mosaic */
/*  Option of Main Menubar.                                      */
/*                                                               */
/*****************************************************************/

void XaFeventMainMenubarMosaic(XaLwidget, XaLitemNo)
  Widget  XaLwidget ;
  int     XaLitemNo ;

  { /* begin XaFeventMainMenubarMosaic function */

    if (XaLitemNo == 0)
      XaFhandleMosaicLaunchMainApplication(XaLwidget) ;
    else if (XaLitemNo == 1)
      XaFhandleMosaicLaunchSelectedDocument(XaLwidget) ;
    else
      XaFhandleHelpMosaic(XaLwidget) ;

  } /* end   XaFeventMainMenubarMosaic function */


/*****************************************************************/
/*                    XaFeventMainMenubarHelp                    */
/*    Function that take care of  Events that occur  in the Help */
/*  Option of Main Menubar.                                      */
/*                                                               */
/*****************************************************************/

void XaFeventMainMenubarHelp(XaLwidget, XaLitemNo)
  Widget  XaLwidget ;
  int     XaLitemNo ;

  { /* begin XaFeventMainMenubarHelp function */

    if (XaLitemNo == 0)
      XaFhandleHelpHelp_1(XaLwidget) ;
    else if (XaLitemNo == 1)
      XaFhandleHelpHelp_2(XaLwidget) ;
    else
      XaFhandleHelpHelp_3(XaLwidget) ;

  } /* end   XaFeventMainMenubarHelp function */


/*****************************************************************/
/*****************************************************************/
/*                                                               */
/*                      XaWorkAreaHeader Events                  */
/*   This section contains all the fnctions needed to handle the */
/*  events that occur in the Work Area Header window.            */
/*                                                               */
/*****************************************************************/
/*****************************************************************/




/*****************************************************************/
/*****************************************************************/
/*                                                               */
/*                     XaWorkAreaDisplay Events                  */
/*   This section contains all the fnctions needed to handle the */
/*  events that occur in the Work Area Display window.           */
/*                                                               */
/*****************************************************************/
/*****************************************************************/



/*****************************************************************/
/*****************************************************************/
/*                                                               */
/*                     XaWorkAreaCommand Events                  */
/*   This section contains all the fnctions needed to handle the */
/*  events that occur in the Work Area Command window.           */
/*                                                               */
/*****************************************************************/
/*****************************************************************/

void XaFeventWorkAreaCommand(XaLwidget, XaLitemNo)
  Widget  XaLwidget ;
  int     XaLitemNo ;

  { /* begin XaFeventWorkAreaCommand function */

    if (XaLitemNo == 0)
      XaFhandleWorkAreaCommandClear(XaLwidget) ;
    else if (XaLitemNo == 1)
      XaFhandleWorkAreaCommandExecute(XaLwidget) ;
    else
      XaFhandleWorkAreaCommandLog(XaLwidget) ;

  } /* end   XaFeventWorkAreaCommand function */


/*****************************************************************/
/*****************************************************************/
/*                                                               */
/*                     XaWorkAreaBottom Events                   */
/*   This section contains all the fnctions needed to handle the */
/*  events that occur in the Work Area Bottom window.            */
/*                                                               */
/*****************************************************************/
/*****************************************************************/


/*****************************************************************/
/*                                                               */
/*                       END OF xaevents.c FILE                  */
/*                                                               */
/*****************************************************************/