- capture_region, a new [global_hotkeys] action, on PrintScreen by default (Windows only; none on macOS). Existing settings files get the line appended on the next launch. When the key cannot be registered, the log names Snagit and Windows' "Print screen opens screen capture" setting. - app/screen_capture_win32.jai: every screen copied the moment the key fires (BitBlt with CAPTUREBLT over the virtual desktop), shown darkened in a topmost GDI window in a modal loop of its own, so it works with mcap hidden in the tray. Dragging shows the region bright and outlined; a magnifier shows the pixels under the cursor with its position or the selection's size; arrow keys move a pixel (ten with Shift). A click or Enter takes the whole screen under the cursor; Escape, a right click or losing the focus cancels. Only the parts that change are redrawn. - app/screen_capture.jai: the region goes on the clipboard (CF_DIB) at once, then a thread writes it into the library's "Screen Captures" folder as a PNG .mcap: metadata.json with the window under the region's middle (its title as WindowName, its program's description as AppName) and capture.json (where on the desktop, the program's path, the hash). mcap then comes to the front showing it, and OCR, labels and segmentation read it as they read an import. - A "screen capture" group in the import tests: the file written, its pixels, preview and Capture Text read back. README and the format's README describe it.
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
// Type-checks src/App.jai for another OS without producing or linking a binary, to catch errors
|
|
// in code your machine does not build:
|
|
//
|
|
// jai check_targets.jai - linux (from any OS)
|
|
// jai check_targets.jai - macos (from a Mac only: the Objective_C module runs code at compile time)
|
|
//
|
|
// The constants below stand in for the ones first.jai generates; keep their names in step.
|
|
#run,stallable {
|
|
set_build_options_dc(.{do_output = false});
|
|
args := get_build_options().compile_time_command_line;
|
|
target := Operating_System_Tag.LINUX;
|
|
cpu := CPU_Tag.X64;
|
|
if array_find(args, "macos") { target = .MACOS; cpu = .ARM64; }
|
|
|
|
options := get_build_options();
|
|
options.os_target = target;
|
|
options.cpu_target = cpu;
|
|
options.output_type = .NO_OUTPUT;
|
|
options.backend = .LLVM;
|
|
options.output_executable_name = "check";
|
|
options.output_path = ".build";
|
|
|
|
w := compiler_create_workspace("check");
|
|
set_build_options(options, w);
|
|
compiler_begin_intercept(w);
|
|
add_build_file("src/App.jai", w);
|
|
add_build_string(#string S
|
|
APP_NAME :: "mcap";
|
|
APP_FOLDER_NAME :: "mcap";
|
|
GIT_BRANCH :: "check";
|
|
GIT_HASH :: "-";
|
|
VERSION :: "0.1.1";
|
|
BUILD_DATE :: "-";
|
|
DEBUG :: true;
|
|
COMPILE_TESTS :: true;
|
|
COMPILE_ARGS :: "";
|
|
NO_CRASH_DIALOG :: false;
|
|
S, w);
|
|
while true {
|
|
message := compiler_wait_for_message();
|
|
if message.kind == .COMPLETE {
|
|
m := cast(*Message_Complete) message;
|
|
log("% check: %", target, m.error_code);
|
|
break;
|
|
}
|
|
}
|
|
compiler_end_intercept(w);
|
|
}
|
|
|
|
#import "Basic";
|
|
#import "Compiler";
|