Exemplo n.º 1
0
VOID
FreeExit( LONG rc )
{
    if( Menus )
    {
        if( WindowPtr )
        {
            ClearMenuStrip( WindowPtr );
        }

        FreeMenus( Menus );
    }

    CloseGUI();

    if( Screen )
    {
        FreeScreenDrawInfo( Screen, DrawInfo );
        UnlockPubScreen (NULL, Screen );
    }

    if( GadToolsBase )
    {
        FreeVisualInfo( VisualInfo );
    }

    if( FileReq )
    {
        rtFreeRequest( FileReq );
    }

    if( DiskObject )
    {
        FreeDiskObject( DiskObject );
    }

    FreeArgs( RDArgs );
    FreeLocale();

    CloseLib( GadToolsBase );
    CloseLib( IconBase );
    CloseLib( IntuitionBase );
    CloseLib( ReqToolsBase );
    CloseLib( UtilityBase );

    CloseLibrary( ( struct Library * ) GfxBase );
    __exit( rc );
}
Exemplo n.º 2
0
void CPartFileConvertDlg::OnCloseButton(wxCommandEvent& WXUNUSED(event))
{
	CloseGUI();
}
Exemplo n.º 3
0
void CPartFileConvertDlg::OnClose(wxCloseEvent& WXUNUSED(event))
{
	CloseGUI();
}
Exemplo n.º 4
0
int main(int argc, char **argv) {
  struct RDArgs *rdargs = NULL;
  int i;
  char pubscreen[32];

  if(argc) {
    rdargs=ReadArgs( TEMPLATE , (LONG *) &args, NULL);
    SaveIcons  = FALSE;
  }
  else {
    struct WBStartup *WBenchMsg = (struct WBStartup *)argv;
    struct WBArg *wbarg;
    BPTR olddir;
    struct DiskObject *dobj;
    STRPTR* toolarray;
    UBYTE *s;

    SaveIcons  = TRUE;

    for(i=0, wbarg=WBenchMsg->sm_ArgList;
      i < WBenchMsg->sm_NumArgs;
      i++, wbarg++) {

      olddir = (BPTR) -1;
      if((wbarg->wa_Lock)&&(*wbarg->wa_Name))
          olddir = CurrentDir(wbarg->wa_Lock);


      if((*wbarg->wa_Name) && (dobj=GetDiskObject(wbarg->wa_Name))) {
        toolarray = dobj->do_ToolTypes;

        s = FindToolType(toolarray,"CREATEICONS");

        if( s != NULL ) {
          if( MatchToolValue(s,"NO") ||
              MatchToolValue(s,"FALSE")) {
            SaveIcons = FALSE;
          }
        }

        s = (char *) FindToolType(toolarray,"PUBSCREEN");

        if( s != NULL ) {
          strncpy(pubscreen, s, sizeof pubscreen);
          args.pubscreen = pubscreen;
        }

        s = (char *) FindToolType(toolarray,"ACTION");

        if( s != NULL ) {
          if(MatchToolValue(s,"EDIT")) {
            args.edit = TRUE;
          }
          else if(MatchToolValue(s,"USE")) {
            args.use = TRUE;
          }
          else if(MatchToolValue(s,"SAVE")) {
            args.save = TRUE;
          }
        }

        FreeDiskObject(dobj);
      }

      if((i>0)&&(*wbarg->wa_Name)) {
        args.from = wbarg->wa_Name;
      }

      if(olddir != (BPTR) -1) {
        CurrentDir(olddir); /* CD back where we were */
      }
    }
  
  }

  if(args.from == NULL) {
    args.from = ENVFILE;
  }

  if(args.edit) {
    args.use  = FALSE;
    args.save = FALSE;
  }

  if((SetSignal(0L,SIGBREAKF_CTRL_C) & SIGBREAKF_CTRL_C) == 0) {
    if(Initialize()) {

      NewSettings(args.from);

      if((!args.use && !args.save) || args.edit) {
        if(BuildGUI(args.pubscreen)) {
          EventLoop();
        }
        CloseGUI();
      }

      if(args.use || args.save) {
        SaveSettings(ENVFILE, UnitList);
      }

      if(args.save) {
        SaveSettings(ENVARCFILE, UnitList);
      }
    }
  }

  if(rdargs) {
    FreeArgs(rdargs);
  }

  FreeVec(Units);
  FreeVec(Modes);
  FreeVec(Outputs);
  FreeVec(Inputs);
  FreeList(ModeList);
  FreeList(UnitList);

  CleanUp();

  return 0;
}