Functions | |
HC_KEY | Style_Segment (const char *style) |
HC_KEY | Style_Segment_By_Key (HC_KEY seg_key) |
HC_KEY | Style_Segment_Key_By_Key (HC_KEY target_segment, HC_KEY style_segment) |
HC_KEY | Named_Style_Segment (char const *style_name) |
HC_KEY | Named_Style_Segment_By_Key (HC_KEY target_segment, char const *style_name) |
HC_KEY | Conditional_Style (const char *style, const char *conditions) |
HC_KEY | Conditional_Style_By_Key (HC_KEY seg_key, const char *conditions) |
HC_KEY 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 Style_Segment_By_Key | ( | HC_KEY | seg_key | ) |
Similar to Style_Segment(), but operates on a style referenced by an HC_KEY.
seg_key | - A key to the segment whose style you want to reference. |
HC_KEY Style_Segment_Key_By_Key | ( | HC_KEY | target_segment, | |
HC_KEY | style_segment | |||
) |
Similar to Style_Segment(), but styles a segment identified by target_segment.
target_segment | - A key to the segment to be styled. | |
style_segment | - A key to the segment whose style you want to reference. |
HC_KEY Named_Style_Segment | ( | char const * | style_name | ) |
Requests that the current segment be drawn in the style of the segment associated with the given name.
style_name | - Name of the custom style. |
HC_KEY Named_Style_Segment_By_Key | ( | HC_KEY | target_segment, | |
char const * | style_name | |||
) |
Similar to Named_Style_Segment() but operates on a key rather than an open segment.
target_segment | - The segment to receive the indicated style. | |
style_name | - Name of the custom style. |
HC_KEY 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 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(). |