Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

123
LINES

< > BotCompany Repo | #1033860 // Gazelle 22 Standalone [dev version]

JavaX source code (desktop) [tags: jar-with-libs jar-with-x30 standalone use-pretranspiled use-starter]

Download Jar. Uses 11812K of libraries. Click here for Pure Java version (69583L/361K).

// WELCOME!! This is THE PROGRAM YOU ARE LOOKING FOR.

!7

//please include function scpLS.

//lib 1400562 // Starter
//lib 1400589 // Starter
lib 1400594 // Starter

//set flag OtherLoadableUtils. lib 1033861

// INCLUDE THE MAIN MODULE
!include early #1033862 // Gazelle Screen Cam [dev version]
replace MainModule with GazelleScreenCam.

!include early #1033891 // include GazelleHost early for flags like PingV3

!include early #1034876 // Gazelle 22 Flags [Include]

//set flag InCore.

sS windowTitle = "Gazelle 22";
sS progIDForDBAndAutoUpdate = #1033860;
sbool pingSourceStrictMode;

static GazelleHost host;
static ThreadPool threadPool;

sS devTitleSuffix = "";//" dev";

p {
  godMode();
  
  //loadableUtils.utils.__setJavaX(main.class);
  loadableUtils.utils.__setJavaX(x30.class);
  standaloneInit();
  
  ping_v3_setPingSourceMaker(-> {
    //System.out.println("pingSourceMaker");
    if (pingSourceStrictMode)
      fail("Strict mode - make a ping source first!!");
    ret new PingSource(threadPool, "legacy");
  });
  
  threadPool = new ThreadPool(findIntArg cores(args, numberOfCores()));
  print(threadPool);
  //threadPool.verbose = true;
  PingSource ps = new(threadPool, print("Starting Gazelle"));
  ps.do(-> {
    System.out.println("Pinging");
    ping();
    //if (true) fail("error test");
  
    print("Pinged");
    
    programID = progIDForDBAndAutoUpdate;
    
    AutoVMExit.install();
    
    print("AutoVMExit installed");
    
    addGlobalLastErrorsBufferToDefaultPCallPolicy();
    
    print("Recording global errors");
    
    // patch utils.preferredScreen
    
    preferredScreen = -> {
      if (host == null) ret 0;
      int screen = max(0, screenNrOfWindow(mainWindow()));
      ret screen;
    };
    
    // patch utils.showForm_makeFrame to use JDialog
    // (to avoid dialogs being hidden behind always-on-top window)
    
    showForm_makeFrame = (title, panel) -> {
      var dialog = new JDialog(mainWindow(), title);
      setDialogContents(dialog, withMargin(panel));
      packWindow(dialog);
      minWindowWidth(dialog, 400);
      centerDialogOverOwner(dialog);
      dialog.setVisible(true);
      //setBounds(dialog, defaultNewFrameBounds());
    };
    
    if (cic(args, "delete-session")) {
      print("Deleting session (" + programDir(programID) + ")");
      clearConceptsOf(programID);
    }
    
    // migrate classes for legacy databases
    F1<S, Class> baseClassFinder = cast _defaultClassFinder();
    setDefaultClassFinder(func(S name) -> Class {
      name = replacePrefix("loadableUtils.utils$", "main$", name);
      //print("G22 class finder: " + name);
      
      if (eq(name, "main$Challenge")) {
        print("Legacy Challenge converted!");
        ret Challenge;
      }
        
      ret baseClassFinder.get(name);
    });
    
    host = new GazelleHost(threadPool, -> new MainModule);
    if (sameSnippetID(programID, #1033860))
      windowTitle += devTitleSuffix;
    host.windowTitle = windowTitle;
    host.run(args);
    
    if (!cic(args, "console")) {
      print("Stopping System.out");
      printAlsoToSystemOut = false;
    }
  });
  print("aha.");
}

static Window mainWindow() { ret host.mainWindow(); }

static Map generalMap = syncMap();

Author comment

Began life as a copy of #1033636

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, iveijnkanddl, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, wnsclhtenguj, xeobevbjagfg

No comments. add comment

Snippet ID: #1033860
Snippet name: Gazelle 22 Standalone [dev version]
Eternal ID of this version: #1033860/57
Text MD5: 34043fbe147f058f976b0af94f579f2e
Transpilation MD5: ef70bf5fb9478062048699bb5e9bb9aa
Author: stefan
Category: javax / screen recognition
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-11 14:00:31
Source code size: 3372 bytes / 123 lines
Pitched / IR pitched: No / No
Views / Downloads: 1519 / 61531
Version history: 56 change(s)
Referenced in: #1033636 - Gazelle 22 Standalone [stable version]
#1033860 - Gazelle 22 Standalone [dev version]
#1033862 - GazelleScreenCam [implementation of G22ProjectActions, Gazelle 22 main module]
#1033892 - Gazelle 22 Standalone [stable version backup]
#1034135 - Gazelle 22 Standalone [backup]
#1034390 - Gazelle 22 Standalone [dev version, backup]
#1034528 - g22_loadableUtilsHelper - show which functions and classes can be moved to the library
#1035021 - Gazelle Screen Cam / Gazelle 22 Module [backup]