|
|
DataMuseum.dkPresents historical artifacts from the history of: ICL Comet 32 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about ICL Comet 32 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 15584 (0x3ce0)
Types: TextFile
Notes: UNIX file
Names: »attribute.c«
└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
└─⟦28c352965⟧ »/a« UNIX Filesystem
└─⟦this⟧ »usr/src/gks/gks/attribute.c«
#include "../h/gks.h"
#include "../h/gksi.h"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_pl_lt - SET POLYLINE LINETYPE.
*
* Input - lt = linetype. Range: (1..n).
* gks.gk_actv = set of active workstations
*
* Process - The 'current linetype' entry in the GKS state list is
* set to the value specified by the parameter.
* Subsequently specified POLYLINE output primitives will
* be displayed with this linetype.
*
* Linetype values produce linetypes as indicated:
* 1. solid line
*
* Output - gks.gk_lr_lt = polyline line type.
* ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_pl_lt(lt)
Ltype lt;
{ static char s_lr_lt[] = "s_pl_lt";
ch_er_st(8, s_lr_lt);
if (lt < 1)
{ rep_er(62, s_lr_lt);
return;
}
gks.gk_lr_lt = lt;
/* Call device dependent set polyline linetype.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.ltp)(lt);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_pl_co - SET POLYLINE COLOR INDEX.
*
* Input - ci = colour index. Range: (0,n)
* gks.gk_actv = set of active workstations
*
* Process - The 'current polyline colour index' entry in the GKS
* state list is set to the value specified by the
* parameter. Subsequently specified POLYLINE output
* primitives will be displayed with the colour referenced
* by this colour index.
*
* The colour index is a pointer into the colour tables
* of the workstations. If the specified colour index is
* not present in a workstation colour table, a workstation
* dependent colour index is used.
* The colours are:
* 0 - BLACK 4 - RED
* 1 - GREEN 5 - YELLOW
* 2 - BLUE 6 - MAGENTA
* 3 - CYAN 7 - WHITE
*
* Output - gks.gk_lr_ci = polyline colour index.
* ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_pl_co(ci)
Cindex ci;
{ static char s_lr_ci[] = "s_pl_co";
ch_er_st(8, s_lr_ci);
if (ci < 0)
{ rep_er(85, s_lr_ci);
return;
}
gks.gk_lr_ci = ci;
/* Call device dependent set polyline colour index.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.lco)(ci);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_mk_ty - SET MARKER TYPE.
*
* Input - mt = marker type. Range: (1..n).
* gks.gk_actv = set of active workstations
*
* Process - The 'current marker type' entry in the GKS state list
* is set to the value specified by the parameter.
* Subsequently specified POLYMARKER output primitives
* will be displayed with this marker type.
*
* Marker type values produce centred symbols as indicated:
* 1. . dot
* 2. + cross
* 3. * star
* 4. 0 circle
* 5. X x
* >=6 implementation dependent
*
* Marker type 1 is always displayed as the smallest
* displayable dot. If the specified marker type is not
* available, marker type 3 is used.
*
* Output - gks.gk_mr_mt = polymarker marker type.
* ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_mk_ty(mt)
Mtype mt;
{ static char s_mr_mt[] = "s_mk_ty";
ch_er_st(8, "s_mk_ty");
if (mt < 1)
{ rep_er(66, s_mr_mt);
return;
}
gks.gk_mr_mt = mt;
/* Call device dependent set marker type.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.mtp)(mt);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_mk_co - SET POLYMARKER COLOR INDEX.
*
* Input - ci = colour index. Range: (0..n).
* gks.gk_actv = set of active workstations
*
* Process - The 'current polymarker colour index' entry in the GKS
* state list is set to the value specified by the
* parameter. Subsequently specified POLYMARKER output
* primitives will be displayed with the colour referenced
* by this colour index.
*
* The colour index is a pointer into the colour tables
* of the workstations. If the specified colour index is
* not present in a workstation colour table, a workstation
* dependent colour index is used.
* Avaible colours are:
* 0 - BLACK 4 - RED
* 1 - GREEN 5 - YELLOW
* 2 - BLUE 6 - MAGENTA
* 3 - CYAN 7 - WHITE
*
* Output - gks.gk_mr_ci = polymarker colour index.
* ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_mk_co(ci)
Cindex ci;
{ static char s_mr_ci[] = "s_mk_co";
ch_er_st(8, s_mr_ci);
if (ci < 0)
{ rep_er(85, s_mr_ci);
return;
}
gks.gk_mr_ci = ci;
/* Call device dependent set polymarker colour index.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.mco)(ci);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_tx_co - SET TEXT COLOR INDEX.
*
* Input - ci = colour index. Range: (0..n).
* gks.gk_actv = set of active workstations
*
* Process - The 'current text colour index' entry in the GKS
* state list is set to the value specified by the
* parameter. Subsequently specified TEXT output
* primitives will be displayed with the colour referenced
* by this colour index.
*
* The colour index is a pointer into the colour tables
* of the workstations. If the specified colour index is
* not present in a workstation colour table, a workstation
* dependent colour index is used.
* Colours:
* 0 - BLACK 4 - RED
* 1 - GREEN 5 - YELLOW
* 2 - BLUE 6 - MAGENTA
* 3 - CYAN 7 - WHITE
*
* Output - gks.gk_tx_ci = text colour index.
* ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_tx_co(ci)
Cindex ci;
{ static char s_tx_ci[] = "s_tx_co";
ch_er_st(8, s_tx_ci);
if (ci < 0)
{ rep_er(85, s_tx_ci);
return;
}
gks.gk_tx_ci = ci;
/* Call device dependent set text colour index.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.tco)(ci);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_ch_ht - SET CHARACTER HEIGHT.
*
* Input - ht = character height. Range: WC > 0.
*
* Process - The 'current character height' entry in the GKS state
* list is set to the value specified by the parameter.
* This value is used when creating subsequent TEXT output
* primitives.
* The NDC values that give the various hardware sizes are :
* 0.01 - Small
* 0.1 - Big
*
* Output - gks.gk_chht = character height.
* gks.chng_attr = indicates that character height needs
* to be changed.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_ch_ht(ht)
Charht ht;
{ static char s_cht[] = "s_ch_ht";
ch_er_st(8, s_cht);
if (ht <= 0.0)
{ rep_er(73, s_cht);
return;
}
gks.gk_chht = ht;
/* Tell TEXT that character height needs to be recomputed.*/
gks.chng_attr = TRUE;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_ch_up - SET CHARACTER UP VECTOR.
*
* Input - v = character up vector. Range: WC.
*
* Process - The 'current character up vector' entry in the GKS state
* list is set to the value specified by the parameter.
* This value is used when creating subsequent TEXT
* primitives.
*
* Output - gks.gk_chup = character up vector.
*
* Comments - Only the single default value is supported, so there
* is no need to call device dependent set character up.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_ch_up(v)
Wc *v;
{ static char s_cup[] = "s_ch_up";
ch_er_st(8, s_cup);
if ((v->w_x == 0.0) && (v->w_y == 0.0))
{ rep_er(74, s_cup);
return;
}
gks.gk_chup = *v;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_ch_al - SET CHARACTER ALIGNMENT.
*
* Input - ha = horizontal alignment. Range: (LEFT, CENTRE, RIGHT).
* va = vertical alignment. Range: (TOP, CAP, HALF, BASE,
* BOTTOM).
* gks.gk_actv = set of active workstations
*
* Process - The 'current character alignment' entries in the GKS
* state list are set to the values specified by the
* parameters. These values are used when creating
* subsequent TEXT output primitives.
*
* Output - gks.gk_tx_ha = text alignment, horizontal.
* gks.gk_tx_va = text alignment, vertical.
* ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_ch_al(ha, va)
Horal ha;
Veral va;
{ ch_er_st(8, "s_ch_al");
gks.gk_tx_ha = ha;
gks.gk_tx_va = va;
/* Call device dependent set character alignment.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.cal)(ha, va);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_fa_is - SET FILL AREA INTERIOR STYLE.
*
* Input - is = interior style. Range: (HOLLOW, SOLID, PATTERN,
* HATCH).
*
* Process - The 'current fill area interior style' entry in the
* GKS state list is set to the value specified by the
* parameter. Subsequently specified FILL AREA output
* primitives will be displayed with this interior style.
*
* The interior style is used to determine in what style
* the area should be filled:
* HOLLOW: No filling, only draw the bounding polyline,
* using the currently selected fill area colour
* index. The linetype is implementation dependent.
* SOLID: Fill the interior of the polygon using the
* currently selected fill area colour index.
*
* If the requested interior style is not available on a
* particular workstation, HOLLOW will be used on that
* workstation.
*
* Output - ws = current workstation state list.
* gks.gk_fa_is = fill area interior style.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_fa_is(is)
Istyle is;
{ static char s_fis[] = "s_fa_is";
ch_er_st(8, s_fis);
if ((is != HOLLOW) && (is != SOLID))
{ rep_er(77, s_fis);
return;
}
gks.gk_fa_is = is;
/* Call device dependent set fill area interior style.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.fis)(is);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_fa_co - SET FILL AREA COLOR INDEX.
*
* Input - ci = colour index. Range: (0..n).
*
* Process - The 'current fill area colour index' entry in the GKS
* state list is set to the value specified by the
* parameters. Subsequently specified FILL AREA output
* primitives will be displayed with the colour referenced
* by this colour index.
*
* The colour index is a pointer into the colour tables
* of the workstations. If the specified colour index is
* not present in a workstation colour table, a workstation
* dependent colour index is used.
*
* Output - ws = current workstation state list.
* gks.gk_fa_ci = fill area color index.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_fa_co(ci)
Cindex ci;
{ static char s_fa_ci[] = "s_fa_co";
ch_er_st(8, s_fa_ci);
if (ci < 0)
{ rep_er(85, s_fa_ci);
return;
}
gks.gk_fa_ci = ci;
/* Call device dependent set fill area interior style.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.fco)(ci);
ENDALLWS
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* col_rep - SET COLOUR REPRESENTATION.
*
* Input - wsi = workstation identifier.
* ci = colour index. Range: (0..n).
* co = colour (red/green/blue intensities). Range: [0,1].
* gks.gk_actv = set of active workstations
*
* Process - In the colour table of the workstation state list, the
* given colour index is associated with the specified
* colour. The colour is mapped by the workstation to the
* nearest available.
*
* The colour table in the workstation state list has
* predefined entries taken from the workstation description
* table; at least indices 0 and 1 shall be predefined for
* every output type workstation. When output primitives
* are displayed, the colour index refers to an entry in
* the colour table. If output primitives are displayed
* with a colour index that is not present in the colour
* table, a workstation dependent colour index will be
* used. The background colour is defined by colour index
* 0. Any table entry (including the predefined entries)
* may be redefined with this function.
*
* Output - ws = current workstation state list.
*
* Comments - On monochrome devices, the intensity is computed from
* the colour values as follows:
* intensity = 0.5 x (M + m)
* where
* M = max(red, green, blue), m = min(red, green, blue).
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_col_rep(wsi, ci, col)
Wsi wsi;
Cindex ci;
Colour *col;
{ static char s_co_r[] = "s_col_rep";
Wss *wst;
ch_er_st(7, s_co_r);
wst = (Wss *)wsi;
/* Check for workstation open.*/
FORALLWS
if (gks.gk_opws[i] == wst)
goto ok;
ENDALLWS
rep_er(25, s_co_r);
return;
ok: if (ci < 0)
{ rep_er(85, s_co_r);
return;
}
if((col->c_red < 0.0) || (col->c_green < 0.0) || (col->c_blue < 0.0) ||
(col->c_red > 1.0) || (col->c_green > 1.0) || (col->c_blue > 1.0))
{ rep_er(88, s_co_r);
return;
}
ws = wst;
(*ws->ws_wsd->wd_func.col)(ci, col);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* s_tx_pa - SET TEXT PATH.
*
* Input - pa = Path. Range: (LEFT, UP, DOWN, RIGHT).
*
* Process - The 'current text path' entries in the GKS
* state list are set to the values specified by the
* parameters. These values are used when creating
* subsequent TEXT output primitives.
*
* Output - gks.gk_tx_pa = text path.
* ws = current workstation state list.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
s_tx_pa(pa)
Int pa;
{ ch_er_st(8, "s_tx_pa");
gks.gk_tx_pa = pa;
/* Call device dependent set text path.*/
FORALLWS
if((ws = gks.gk_actv[i]) != NULL)
(*ws->ws_wsd->wd_func.tpa)(pa);
ENDALLWS
}