From 2ea9a3788156f96769b6849e1946731fdab61d01 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Thu, 29 Jan 2015 00:16:11 +0100 Subject: [PATCH] Rename 'graphics mode' -> 'shape mode' --- doc/parts/man/index.sxml | 12 ++++++------ doc/parts/structure/chap-guidelines.sxml | 14 +++++++------- doc/parts/structure/chap-result.sxml | 12 ++++++------ source/main.cc | 18 +++++++++--------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/parts/man/index.sxml b/doc/parts/man/index.sxml index 7eb80043..24ee6f10 100644 --- a/doc/parts/man/index.sxml +++ b/doc/parts/man/index.sxml @@ -59,7 +59,7 @@
Description -

shapes compiles a source file written in the language, with filename suffix .shape (graphics mode) or .blank (blank mode). On success and unless in blank mode, this results in a file (or a directory of files) containing a viewable representation of the graphics described by the source.

+

shapes compiles a source file written in the language, with filename suffix .shape (shape mode) or .blank (blank mode). On success and unless in blank mode, this results in a file (or a directory of files) containing a viewable representation of the graphics described by the source.

@@ -142,7 +142,7 @@  file -

Specify the file where to store labels between iterations. Defaults to the basename with the suffix .labels.pdf in the output directory. Used in both graphics and blank mode.

+

Specify the file where to store labels between iterations. Defaults to the basename with the suffix .labels.pdf in the output directory. Used in both shape and blank mode.

See also --iteration.

@@ -194,12 +194,12 @@ - + -

Select blank or graphics mode (do not select mode based on the input filename suffix).

-

Blank mode is the default for input filenames with the .blank suffix, while graphics mode is the default for input filenames with the .shape suffix. Graphics mode has precedence over blank mode when the mode cannot be determined from input filename suffix (including when input is read from a stream).

+

Select blank or shape mode (do not select mode based on the input filename suffix).

+

Blank mode is the default for input filenames with the .blank suffix, while shape mode is the default for input filenames with the .shape suffix. Shape mode has precedence over blank mode when the mode cannot be determined from input filename suffix (including when input is read from a stream).

In blank mode, the program is not required to produce any graphics, and no result will be written to the output file or directory. Any input filename must have the .blank suffix.

-

In graphics mode, the program is required to produce graphics, which will be written to the output file or directory upon successful compilation. Any input filename must have the .shape suffix.

+

In shape mode, the program is required to produce graphics, which will be written to the output file or directory upon successful compilation. Any input filename must have the .shape suffix.

diff --git a/doc/parts/structure/chap-guidelines.sxml b/doc/parts/structure/chap-guidelines.sxml index 1a6a0554..76f76601 100644 --- a/doc/parts/structure/chap-guidelines.sxml +++ b/doc/parts/structure/chap-guidelines.sxml @@ -47,7 +47,7 @@ It produces a circular mark.
A typical <str-Shapes /> program -

Let us discuss the big picture of a typical graphics mode program. (Recall that graphics mode means that compilation of this program will result in graphics.)

+

Let us discuss the big picture of a typical shape mode program. (Recall that shape mode means that compilation of this program will result in graphics.)

First, a typical program will list a couple of standard extensions, with the ##needs preprocessor directive.

 
@@ -73,7 +73,7 @@ b: [putblockFarRight •page [longblock (TeX `$\bm{b}$´)] a]
 ignore [] [connect •page a b]]]>
 

Unless something is out of sync, the whole program is included in the example below.

- + ]]> @@ -92,15 +92,15 @@ ignore [] [connect •page a b]]]> -In graphics mode, this would not be a valid program since no graphics is produced. The reason is that is primarily designed for graphics tasks, and in graphics mode it should generally be considered an indication of failure if no graphics is produced.

+In shape mode, this would not be a valid program since no graphics is produced. The reason is that is primarily designed for graphics tasks, and in shape mode it should generally be considered an indication of failure if no graphics is produced.

To solve the problem, the primary option would be to run the program in blank mode, by naming the input file with the .blank suffix.

The secondary option would be to end the program with any simple expression that evaluates to a , for instance

-
+
 
-The comment makes it clear that the expression has nothing to do with the main purpose of the program. One advantage of this solution is that the program will work both in graphics mode and in blank mode. The complete program is given in the example below. +The comment makes it clear that the expression has nothing to do with the main purpose of the program. One advantage of this solution is that the program will work both in shape mode and in blank mode. The complete program is given in the example below.

- + ]]> @@ -109,7 +109,7 @@ The comment makes it clear that the expression has nothing to do with the main p ]]> -

A text-producing program in graphics mode must produce graphics as well.

+

A text-producing program in shape mode must produce graphics as well.

diff --git a/doc/parts/structure/chap-result.sxml b/doc/parts/structure/chap-result.sxml index 2bab5c97..c728f2fa 100644 --- a/doc/parts/structure/chap-result.sxml +++ b/doc/parts/structure/chap-result.sxml @@ -18,14 +18,14 @@
Program result -

The compiler will run either in graphics mode or in blank mode, typically determined by the suffix of the input filename.

+

The compiler will run either in shape mode or in blank mode, typically determined by the suffix of the input filename.

-
-Graphics mode +
+Shape mode -

Graphics mode is selected for input files with suffix .shapes, or when in doubt.

-

In graphics mode, the only necessary aspect to discuss regarding the global structure of a program is how the graphical output is defined. There are three means for defining the output of a program: +

Shape mode is selected for input files with suffix .shapes, or when in doubt.

+

In shape mode, the only necessary aspect to discuss regarding the global structure of a program is how the graphical output is defined. There are three means for defining the output of a program:

  • Through the value of the program as an expression. If the program results in a non- value, it must be a , and not a null-picture. The result will be a single-page document.
  • Through a non-empty final value of . For single-page documents. This is equivalent to ending the program with the expression ().
  • @@ -36,7 +36,7 @@

    It is illegal to both add pages to and let the program evaluate to a value. The other combinations are allowed by giving precedence to and program value over . Hence, is only used when it is the only alternative in use.

    The rationale behind the precedence rule is that may be used to define pages of multi-page documents, and then the rule relieves us from having to clear at the end of the program. Similarly, if one finds that the final content of needs to be transformed for some reason, one may apply the transform to () at the end of the program, without having to clear .

    -
+
Blank mode diff --git a/source/main.cc b/source/main.cc index 47ee7f3f..d330aed7 100644 --- a/source/main.cc +++ b/source/main.cc @@ -51,7 +51,7 @@ main( int argc, char ** argv ) bool useResources = true; bool interactiveMode = false; bool forceBlankMode = false; - bool forceGraphicsMode = false; + bool forceShapeMode = false; { char * cwd = getcwd( 0, 0 ); @@ -227,21 +227,21 @@ main( int argc, char ** argv ) } else if( strcmp( *argv, "--blank") == 0 ) { - if( forceGraphicsMode ){ - std::cerr << "Conflicting forcing of both blank mode and graphics mode." << std::endl ; + if( forceShapeMode ){ + std::cerr << "Conflicting forcing of both blank mode and shape mode." << std::endl ; exit( Interaction::EXIT_INVOCATION_ERROR ); } forceBlankMode = true; argv += 1; argc -= 1; } - else if( strcmp( *argv, "--graphics") == 0 ) + else if( strcmp( *argv, "--shape") == 0 ) { if( forceBlankMode ){ - std::cerr << "Conflicting forcing of both blank mode and graphics mode." << std::endl ; + std::cerr << "Conflicting forcing of both blank mode and shape mode." << std::endl ; exit( Interaction::EXIT_INVOCATION_ERROR ); } - forceGraphicsMode = true; + forceShapeMode = true; argv += 1; argc -= 1; } @@ -904,7 +904,7 @@ main( int argc, char ** argv ) if( ! forceBlankMode ){ suffixes.push_back( "shape" ); } - if( ! forceGraphicsMode ){ + if( ! forceShapeMode ){ suffixes.push_back( "blank" ); } struct stat theStat; @@ -1041,7 +1041,7 @@ main( int argc, char ** argv ) if( ! forceBlankMode ){ suffixes.push_back( "shape" ); } - if( ! forceGraphicsMode ){ + if( ! forceShapeMode ){ suffixes.push_back( "blank" ); } SuffixesType::const_iterator i = suffixes.begin( ); @@ -1082,7 +1082,7 @@ main( int argc, char ** argv ) if( forceBlankMode ) { Interaction::blankMode = true; - } else if( forceGraphicsMode ){ + } else if( forceShapeMode ){ Interaction::blankMode = false; } else { Interaction::blankMode = ( inputName.size() >= 6 && inputName.compare(inputName.size() - 6, std::string::npos, ".blank") == 0 ); -- 2.11.4.GIT