|
|
1.1 ! root 1: .ds ZZ DEVELOPMENT PACKAGE ! 2: .TH GLOBALS 3R "630 MTG" ! 3: .XE "physical" ! 4: .XE "display" ! 5: .XE "Drect" ! 6: .XE "Jrect" ! 7: .XE "mouse" ! 8: .XE "PtCurrent" ! 9: .SH NAME ! 10: globals: physical, display, Drect, Jrect, PtCurrent, P, mouse \- globals describing display and mouse ! 11: .SH SYNOPSIS ! 12: .B #include <dmd.h> ! 13: .sp ! 14: .B Bitmap physical; ! 15: .PP ! 16: .B Bitmap display; ! 17: .PP ! 18: .B Rectangle Drect; ! 19: .PP ! 20: .B Rectangle Jrect; ! 21: .PP ! 22: .B Point PtCurrent; ! 23: .PP ! 24: .B #define XMAX 1024 ! 25: .br ! 26: .B #define YMAX 1024 ! 27: .PP ! 28: .B #define INSET 4 ! 29: .PP ! 30: .B struct Mouse { ! 31: .RS 3 ! 32: .br ! 33: .B Point xy; ! 34: .br ! 35: .B Point jxy; ! 36: .br ! 37: .B short buttons; ! 38: .br ! 39: .RE ! 40: .B } mouse; ! 41: .PP ! 42: .B Proc \(**P; ! 43: .SH DESCRIPTION ! 44: Each global is defined when ! 45: .B dmd.h ! 46: is included. ! 47: One should not include these definitions in their source code. ! 48: .PP ! 49: The global ! 50: .I physical ! 51: is a Bitmap describing the entire screen display in screen coordinates. ! 52: .PP ! 53: The global ! 54: .I display ! 55: is the Bitmap describing an individual window in screen coordinates. ! 56: .PP ! 57: The global ! 58: .I Drect ! 59: is a Rectangle ! 60: defining, in screen coordinates, ! 61: the display area available to the program. ! 62: It is not ! 63: .I display.rect, ! 64: which includes the border around each window. ! 65: .PP ! 66: The global ! 67: .I Jrect ! 68: is the Rectangle ! 69: { 0, 0, \fIXMAX\fR, \fIYMAX\fR } ! 70: .PP ! 71: The global ! 72: .I PtCurrent ! 73: is the current Point in window coordinates which the j-routines reference and update. ! 74: .PP ! 75: The values ! 76: .I XMAX ! 77: and ! 78: .I YMAX ! 79: define the maximum x and y coordinates of the 630 MTG screen. ! 80: These are the same as ! 81: .I physical.rect.corner.x ! 82: and ! 83: .IR physical.rect.corner.y . ! 84: .PP ! 85: The value ! 86: .I INSET ! 87: is the width of the border around a window. ! 88: Therefore, ! 89: .I Drect ! 90: is the same as ! 91: .IR inset(display.rect,INSET) . ! 92: .PP ! 93: The global ! 94: .I mouse ! 95: is a location containing the current mouse coordinates ! 96: and button states. ! 97: The Point ! 98: .I xy ! 99: is in screen coordinates; ! 100: .I jxy ! 101: is in window coordinates. ! 102: The ! 103: .I buttons ! 104: field is a bit vector of the mouse buttons that is ! 105: most easily interpreted by using the button macros. ! 106: The ! 107: .I mouse ! 108: is updated only when requested and the window is current. ! 109: .PP ! 110: \f2P\f1 is a special variable used by the 630 MTG. It ! 111: represents the running process. A process can be a downloaded ! 112: application or the default terminal emulator or an internal ! 113: maintenance process. An example is the ``control'' process ! 114: that puts up the button 3 global menu. ! 115: .PP ! 116: The 630 MTG changes the value of \f2P\f1 whenever one process ! 117: switches out through ``wait'' or ``sleep'' to let another run. ! 118: It always points to the running process's table (Proc). Many ! 119: routines either update \f2P\f1 or use \f2P\f1 to find ! 120: information specific to the process. For example, the memory ! 121: allocator ``alloc'' uses \f2P\f1 to record who owns the memory ! 122: requested. The ``allocown'' routine can be used to change ! 123: this. ! 124: .SH SEE ALSO ! 125: alloc(3R), btoc(3R), buttons(3R/3L), inset(3R), resources(3R), ! 126: sleep(3R), structures(3R), transform(3R/3L). ! 127: .SH WARNING ! 128: These globals (except XMAX, YMAX, and INSET) reside in the terminal. ! 129: They cannot be used in automatic initializations of a program's ! 130: global variables.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.