Functions | |
void | Style_Segment (const char *style) |
HC_KEY | KStyle_Segment (const char *style) |
void | Style_Segment_By_Key (HC_KEY seg_key) |
HC_KEY | KStyle_Segment_By_Key (HC_KEY seg_key) |
void | Conditional_Style (const char *style, const char *conditions) |
HC_KEY | KConditional_Style (const char *style, const char *conditions) |
void | Conditional_Style_By_Key (HC_KEY seg_key, const char *conditions) |
HC_KEY | KConditional_Style_By_Key (HC_KEY seg_key, const char *conditions) |
void Style_Segment | ( | const char * | style | ) |
"Styles" the currently open segment to be drawn in the style of the referenced ones.
style | - Name, possibly including wildcards, of other segment(s). |
The most common use of "styling" is when you want to change something in a large or arbitrary number of places without having to go to, or refer to, all those places.
By convention, style segments should have no life of their own---they should have no drawing primitives inside. Also by convention, Stylee's live in the "Style Library" segment tree---their full names should begin with "?Style Library/...". There is no reason for this, though, besides aesthetics.
The attribute inheritance rules are as follows:
If the current segment has an opinion about an attribute, the style's opinion about it is ignored. Otherwise, the style's opinion, if any, is used. If the style has subsegments or includee's, they have no effect on the requester. If there are several styles to be applied to the current segment, they have equal precedence. If they conflict about their attributes, the results are random. If the style itself is styled, the net opinion to be applied to the current segment is figured first.
This should be compared with Include_Segment() , which adds to but does not change the current segment in any way.
The referenced segment (the segment that's to be used as a style) doesn't need to have anything in it, but it must at least exist at the time Style_Segment() is called.
HC_KEY KStyle_Segment | ( | const char * | style | ) |
Similar to Style_Segment(), but returns an HC_KEY to the style.
style | - Name, possibly including wildcards, of other segment(s). |
void Style_Segment_By_Key | ( | HC_KEY | seg_key | ) |
Similar to Style_Segment(), but operates on an style referenced by an HC_KEY.
seg_key | - A key to the segment whose style you want to reference. |
HC_KEY KStyle_Segment_By_Key | ( | HC_KEY | seg_key | ) |
Similar to KStyle_Segment(), but returns the style reference key.
seg_key | - A key to the segment whose style to want to reference. |
void Conditional_Style | ( | const char * | style, | |
const char * | conditions | |||
) |
Similar to Style_Segment(), but uses a list of conditions that must be satisfied in order for the inclusion to apply.
style | - Pathname to extra segment(s) to be styled when displaying the current segment. | |
conditions | - The conditions that are associated with a particular conditional style and that are valid input to Set_Conditions(). |
HC_KEY KConditional_Style | ( | const char * | style, | |
const char * | conditions | |||
) |
Similar to Conditional_Style(), but returns a key to the styled segment.
style | - Pathname to extra segment(s) to be styled when displaying the current segment. | |
conditions | - The conditions that are associated with a particular conditional style and that are valid input to Set_Conditions(). |
void Conditional_Style_By_Key | ( | HC_KEY | seg_key, | |
const char * | conditions | |||
) |
Similar to Conditional_Style(), but accepts a key rather than a pathname to identify the segment to be styled.
seg_key | - Segment key to extra segment(s) to be styled when displaying the current segment. | |
conditions | - The conditions that are associated with a particular conditional style and that are valid input to Set_Conditions(). |
HC_KEY KConditional_Style_By_Key | ( | HC_KEY | seg_key, | |
const char * | conditions | |||
) |
Similar to Conditional_Style(), but accepts a key rather than a pathname to identify the segment to be styled.
seg_key | - Segment key to extra segment(s) to be styled when displaying the current segment. | |
conditions | - The conditions that are associated with a particular conditional style and that are valid input to Set_Conditions(). |