|
54 | 54 | end |
55 | 55 |
|
56 | 56 | const global G_API = [C_NULL] |
57 | | -const global PSname = [""] # The PS file (filled in __init__) where, in classic mode, all lands. |
| 57 | +const PSname = Ref{String}("") # The PS file (filled in __init__) where, in classic mode, all lands. |
58 | 58 | const global TMPDIR_USR = [tempdir(), "", ""] # Save the tmp dir and user name (also filled in __init__) |
59 | 59 | const global TESTSDIR = joinpath(dirname(pathof(GMT))[1:end-4], "test", "") # To have easy access to test files |
60 | | -const global IMG_MEM_LAYOUT = [""] # "TCP" For Images.jl. The default is "TRBa" |
61 | | -const global GRD_MEM_LAYOUT = [""] # "BRP" is the default for GMT PS images. |
62 | | -const global CURRENT_VIEW = [""] # To store the current viewpoint (-p) |
63 | | -const global MULTI_COL = Vector{Bool}(undef, 1);MULTI_COL[1] = false # To allow plottig multiple columns at once. |
64 | | -const global IamModern = Vector{Bool}(undef, 1);IamModern[1] = false # To know if we are in modern mode |
65 | | -const global FirstModern = Vector{Bool}(undef, 1);FirstModern[1] = false # To know |
66 | | -const global DidOneGmtCmd = [Bool(0)] # To know when first gmt() call. Used in first modern mode cmd to not restart what is still fresh |
67 | | -const global IamModernBySubplot = Vector{Bool}(undef, 1); IamModernBySubplot[1] = false # To know if set in subpot |
68 | | -const global IamSubplot = Vector{Bool}(undef, 1);IamSubplot[1] = false # To know if we are in subplot mode |
| 60 | +const IMG_MEM_LAYOUT = Ref{String}("") # "TCP" For Images.jl. The default is "TRBa" |
| 61 | +const GRD_MEM_LAYOUT = Ref{String}("") # "BRP" is the default for GMT PS images. |
| 62 | +const CURRENT_VIEW = Ref{String}("") # To store the current viewpoint (-p) |
| 63 | +const MULTI_COL = Ref{Bool}(false) # To allow plottig multiple columns at once. |
| 64 | +const IamModern = Ref{Bool}(false) # To know if we are in modern mode |
| 65 | +const FirstModern = Ref{Bool}(false) # To know |
| 66 | +const DidOneGmtCmd = Ref{Bool}(false) # To know when first gmt() call. Used in first modern mode cmd to not restart what is still fresh |
| 67 | +const IamModernBySubplot = Ref{Bool}(false) # To know if set in subpot |
| 68 | +const IamSubplot = Ref{Bool}(false) # To know if we are in subplot mode |
69 | 69 | const global IamInset = [false, false] # To know if we are in Inset mode |
70 | | -const global usedConfPar = Vector{Bool}(undef, 1);usedConfPar[1] = false # Hacky solution for the session's memory trouble |
71 | | -const global ThemeIsOn = Vector{Bool}(undef, 1);ThemeIsOn[1] = false # To know if we have an active plot theme |
72 | | -const global CONVERT_SYNTAX = Vector{Bool}(undef, 1);CONVERT_SYNTAX[1] = false # To only convert to hard core GMT syntax (like Vd=2) |
73 | | -const global SHOW_KWARGS = Vector{Bool}(undef, 1);SHOW_KWARGS[1] = false # To just print the kwargs of a option call) |
74 | | -const global isFranklin = Vector{Bool}(undef, 1);isFranklin[1] = false # Only set/unset by the Docs building scripts. |
75 | | -const global isJupyter = [Bool(0)] # Jupyter and Modern need special treatment (Quarto). |
76 | | -const global isPSclosed = [Bool(0)] # Modern mode will close the PS at the end. We need to know that |
77 | | -const global noGrdCopy = Vector{Bool}(undef, 1);noGrdCopy[1] = false # If true, grids are sent without transpose/copy |
78 | | -const global GMTCONF = Vector{Bool}(undef, 1);GMTCONF[1] = false # Flag if gmtset was used and must be 'unused' |
79 | | -const global FMT = ["png"] # The default plot format |
80 | | -const global BOX_STR = [""] # Used in plotyy to know -R of first call |
| 70 | +const usedConfPar = Ref{Bool}(false) # Hacky solution for the session's memory trouble |
| 71 | +const ThemeIsOn = Ref{Bool}(false) # To know if we have an active plot theme |
| 72 | +const CONVERT_SYNTAX = Ref{Bool}(false) # To only convert to hard core GMT syntax (like Vd=2) |
| 73 | +const SHOW_KWARGS = Ref{Bool}(false) # To just print the kwargs of a option call) |
| 74 | +const isFranklin = Ref{Bool}(false) # Only set/unset by the Docs building scripts. |
| 75 | +const isJupyter = Ref{Bool}(false) # Jupyter and Modern need special treatment (Quarto). |
| 76 | +const isPSclosed = Ref{Bool}(false) # Modern mode will close the PS at the end. We need to know that |
| 77 | +const noGrdCopy = Ref{Bool}(false) # If true, grids are sent without transpose/copy |
| 78 | +const GMTCONF = Ref{Bool}(false) # Flag if gmtset was used and must be 'unused' |
| 79 | +const FMT = Ref{String}("png") # The default plot format |
| 80 | +const BOX_STR = Ref{String}("") # Used in plotyy to know -R of first call |
81 | 81 | const global POSTMAN = [Dict{String,String}()] # To pass messages to functions (start with get_dataset) |
82 | | -const global SACO = [Dict{String,Union{AbstractArray, Vector{AbstractArray}}}()] # When funs (fillsinks) want to return extra data but not via the return mechanism |
| 82 | +#const global SACO = [Dict{String,Union{AbstractArray, Vector{AbstractArray}}}()] # When funs (fillsinks) want to return extra data but not via the return mechanism |
83 | 83 | const DEF_FIG_SIZE = "15c/10c" # Default fig size for plot like programs. Approx 16/11 |
84 | 84 | const DEF_FIG_AXES_BAK = " -Baf -BWSen" # Default fig axes for plot like programs |
85 | 85 | const DEF_FIG_AXES3_BAK = " -Baf -Bza" # "" but for 3D views |
86 | | -const global DEF_FIG_AXES = [DEF_FIG_AXES_BAK] # This one may be be changed by theme() |
87 | | -const global DEF_FIG_AXES3 = [DEF_FIG_AXES3_BAK] # "" |
88 | | -const global FIG_MARGIN = [1] # Figure margin in points after convertion by 'psconvert'. Accessible 'margin' common option |
| 86 | +const DEF_FIG_AXES = Ref{String}(DEF_FIG_AXES_BAK) # This one may be be changed by theme() |
| 87 | +const DEF_FIG_AXES3 = Ref{String}(DEF_FIG_AXES3_BAK) # "" |
| 88 | +const FIG_MARGIN = Ref{Int}(1) # Figure margin in points after convertion by 'psconvert'. Accessible 'margin' common option |
89 | 89 | const global CTRL = CTRLstruct(zeros(13), zeros(6), [true], [false], |
90 | 90 | [:arrows, :bubblechart, :basemap, :band, :clip, :coast, :colorbar, :grdcontour, :hband, :hlines, :inset, :logo, :lines, :grdvector, :plot, :plot3, :quiver, :scatter, :scatter3, :stairs, :text, :vlines, :vband], fill(nothing, 6), ["","",""], ["","", "", " "], ["",""], ["",""], [false,true], [C_NULL], [Dict()]) |
91 | 91 | const global CTRLshapes = CTRLstruct2([true], [true], [""]) # Used in sub-module Drawing |
@@ -464,14 +464,14 @@ function __init__(test::Bool=false) |
464 | 464 | clear_sessions(3600) # Delete stray sessions dirs older than 1 hour |
465 | 465 | G_API[1] = GMT_Create_Session("GMT", 2, GMT_SESSION_BITFLAGS) # (0.010179 sec) |
466 | 466 | theme_modern() # Set the MODERN theme and some more gmtlib_setparameter() calls |
467 | | - haskey(ENV, "JULIA_GMT_IMGFORMAT") && (FMT[1] = ENV["JULIA_GMT_IMGFORMAT"]) |
| 467 | + haskey(ENV, "JULIA_GMT_IMGFORMAT") && (FMT[] = ENV["JULIA_GMT_IMGFORMAT"]) |
468 | 468 | f = joinpath(GMTuserdir[1], "theme_jl.txt") |
469 | | - (isfile(f)) && (theme(readline(f)); ThemeIsOn[1] = false) # False because we don't want it reset in showfig() |
| 469 | + (isfile(f)) && (theme(readline(f)); ThemeIsOn[] = false) # False because we don't want it reset in showfig() |
470 | 470 | user = (Sys.isunix() || Sys.isapple()) ? Libc.getpwuid(Libc.getuid(), true).username : Sys.iswindows() ? ENV["USERNAME"] : "" |
471 | 471 | TMPDIR_USR[2] = replace(user, " " => "_") |
472 | 472 | haskey(ENV, "JULIA_GMT_MULTIFILE") && (TMPDIR_USR[3] = string("_", getpid())) |
473 | | - PSname[1] = TMPDIR_USR[1] * "/" * "GMTjl_" * TMPDIR_USR[2] * TMPDIR_USR[3] * ".ps" |
474 | | - DidOneGmtCmd[1] = false |
| 473 | + PSname[] = TMPDIR_USR[1] * "/" * "GMTjl_" * TMPDIR_USR[2] * TMPDIR_USR[3] * ".ps" |
| 474 | + DidOneGmtCmd[] = false |
475 | 475 | end |
476 | 476 |
|
477 | 477 | """ |
|
0 commit comments