Location: PHPKode > scripts > WPhp > wphp/wphp_defines.php
<?php
/*
$Id: wphp_defines.php,v 1.4 2005/04/22 12:06:55 josheli Exp $
*/

//HELPER FUNCTION
function hex2bin($hexdata) 
{  
  for ($i=0;$i<strlen($hexdata);$i+=2) 
  {
     $bindata.=chr(hexdec(substr($hexdata,$i,2)));
  }
  return $bindata;
}


/******
DEFINED IN THE WPD DOCUMENTATION
******/

DEFINE('HEADER_LENGTH',745);

//stuff like product version, minor version, file type...
DEFINE('BEGIN_HEADER',hex2bin('FF575043CE020000010A02010000000205000000'));

//THE FILE LENGTH IS 2 BYTES THAT WILL GO BETWEEN BEGIN_ AND END_ HEADER.
//mostly the header prefix: font style etc...
DEFINE('END_HEADER',hex2bin('0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000500000000000000000000000055010000004E0000004602000009250100000006000000940200000B3002000000280000009A020000085E010000000C000000C20200002800D61EC30f3908000011090000005A001B01008B143600540069006D006500730020004E0065007700200052006F006D0061006E00200052006500670075006C006100720000000000000000000100010058020100000004002800000000000000000000000000000000000000011202002400A1000000A100000050A54E250000000000000800DD0A10008301030003000200211000DDDD0B0B00030000040B00DD'));

/*****
FIXED LENGTH MULTIBYTE FUNCTIONS
*****/
DEFINE('WP_ATTRIBUTE_ON',chr(242));
DEFINE('WP_ATTRIBUTE_OFF',chr(243));

DEFINE('WP_ATTRIBUTE_CHAPTER_HEADING', chr(0));//  extra large (chapter heading)
DEFINE('WP_ATTRIBUTE_HEADING', chr(1));//  very large (heading)
DEFINE('WP_ATTRIBUTE_SUB_HEADING', chr(2));//  large (sub-heading)
DEFINE('WP_ATTRIBUTE_SMALL_PRINT', chr(3));//  small print
DEFINE('WP_ATTRIBUTE_FINE_PRINT', chr(4));//  fine print
DEFINE('WP_ATTRIBUTE_SUPERSCRIPT', chr(5));//  superscript
DEFINE('WP_ATTRIBUTE_SUBSCRIPT', chr(6));//  subscript
DEFINE('WP_ATTRIBUTE_OUTLINE', chr(7));//  outline
DEFINE('WP_ATTRIBUTE_ITALICS', chr(8));//  italics
DEFINE('WP_ATTRIBUTE_SHADOW', chr(9));//  shadow
DEFINE('WP_ATTRIBUTE_REDLINE', chr(10));//  redline
DEFINE('WP_ATTRIBUTE_DOUBLE_UNDERLINE', chr(11));//  double underline
DEFINE('WP_ATTRIBUTE_BOLD', chr(12));//  bold
DEFINE('WP_ATTRIBUTE_STRIKEOUT', chr(13));//  strikeout
DEFINE('WP_ATTRIBUTE_UNDERLINE', chr(14));//  underline
DEFINE('WP_ATTRIBUTE_SMALL_CAPS', chr(15));//  small caps
DEFINE('WP_ATTRIBUTE_BLINK', chr(16));//  blink


/****
FOR MERGE DATA FILES
*****/
DEFINE('MERGE_FIELDNAMES_ON', hex2bin('DE4E0A000100000A00DE'));
DEFINE('MERGE_FIELDNAMES_OFF', hex2bin('DE4F0A000100000A00DE'));
DEFINE('MERGE_ENDFIELD', hex2bin('DE0A0A000000000A00DE'));
DEFINE('MERGE_ENDRECORD', hex2bin('DE0D0B00000000000B00DE'));


/*****
VARIABLE LENGTH MULTIBYTE FUNCTIONS
*****/

/*
Center Current Page Top to Bottom
*/
DEFINE('VALIGN_CURRENT_PAGE', hex2bin('D1040C0000010001000C00D1'));

DEFINE('LEFT_JUSTIFY_PAGE', 0);
DEFINE('FULL_JUSTIFY_PAGE', 1);
DEFINE('CENTER_JUSTIFY_PAGE', 2);
DEFINE('RIGHT_JUSTIFY_PAGE', 3);


/*******
SINGLE BYTE FUNCTIONS
********/

/*
128 (0x80) Soft Space 
Equivalent of an ASCII 0x20. May not be used as a hidden code.
*/
DEFINE('WP_SOFT_SPACE',chr(128));
/*
129 (0x81) Hard Space 
A hard space holds two words together on one line (names, dates, etc).
*/
DEFINE('WP_HARD_SPACE',chr(129));
/*
132 (0x84) Hard Hyphen in Line 
Hyphen code [-] which will appear whether the word falls at the end of the line or not.
*/
DEFINE('WP_HARD_HYPHEN_IN_LINE',chr(132));
/*
199 (0xC7) Hard EOP 
The user presses Ctrl-Enter to insert a [HRt] code. The insertion point is moved to the beginning of the next page.
*/
DEFINE('WP_HARD_EOP',chr(199));

/*
204 (0xCC) Hard EOL 
User inserts a code (Enter) and the insertion point is moved to the beginning of the next line.
*/
DEFINE('WP_HARD_EOL',chr(204));


/*******
RARE SINGLE BYTE FUNCTIONS
********/

/*
130 (0x82) Soft Hyphen in Line 
A soft hyphen divides a word and displays a hyphen when the word falls near the end of a line. If the word does not need to be broken, the soft hyphen code remains in the document, but has no effect. When the code has no effect, the soft hyphen is in line.
*/
DEFINE('WP_SOFT_HYPHEN_IN_LINE',chr(130));
/*
131 (0x83) Soft Hyphen at End of Line 
When the soft hyphen falls at the end of the line and needs to be displayed, the soft hyphen in line function is changed to a soft hyphen at end of lineand the hyphen is displayed.
*/
DEFINE('WP_SOFT_HYPHEN_END_LINE',chr(131));
/*
133 (0x85) Auto Hyphen at End of Line 
When any function other than the user inserts a hyphen, it is referred to as auto-hyphenation.
*/
DEFINE('WP_AUTO_HYPHEN_END_LINE',chr(133));
/*
134 (0x86) Invisible Return in Line 
The [HyphSrt] code indicates that a word can be broken at this point, but a hyphen won't be visible in the document. It is used in situations like "Fonts/Styles/Graphics," where the string could be broken after a "/" but there is no need for a hyphen to be seen.
*/
DEFINE('WP_INVISIBLE_RETURN_IN_LINE',chr(134));
/*
135 (0x87) Dormant Hard Return 
Whenever a [HRt] code appears alone at the top of a page that starts with a soft page break, the formatter changes the Hard Return code into a Dormant Hard Return code [Dorm HRt]. This ensures that an unwanted blank line is not inserted at the top of a page. As the document is edited, if [Dorm HRt] moves from the top of a page, the formatter changes it back to a normal Hard Return code.
*/
DEFINE('WP_DORMANT_HARD_RETURN',chr(135));
/*
136 (0x88) Soft End of Center/Align 
When text is longer than a single line, it wraps. The formatter inserts a soft End of Line, which causes centering to end, but not the paragraph.
*/
DEFINE('WP_SOFT_END_OF_CENTER_ALIGN',chr(136));
/*
137 (0x89) Hard End of Center/Align 
The Enter key is pressed, ending the line, the centering, and the paragraph. If the original code was [Just:Center], then centering is ended for that line and begins again on the next line.
*/
DEFINE('WP_HARD_END_OF_CENTER_ALIGN',chr(137));
/*
138 (0x8A) Generate Text Place Holder 
This function and the next work as a pair. Together they mark the location of a page number. When tables are generated (ToA, ToC, etc.) these markers are used to find the page numbers quickly.
*/
DEFINE('WP_GENERATE_TEXT_PLACE_HOLDER',chr(138));
/*
139 (0x8B) Generate End Text Holder 
Paired with the previous function, this function marks the end of a page number position.
*/
DEFINE('WP_GENERATE_END_TEXT_HOLDER',chr(139));
/*
140 (0x8C) Style Separator Mark 
Separates styles when the Enter key is used to turn off a style or to link to other styles.
*/
DEFINE('WP_STYLE_SEPARATOR_MARK',chr(140));
/*
141 (0x8D) Start of Text to Skip 
This function and the next work as a pair. Together they surround text for several different reasons. The surrounded text is passed over by the formatter and is not displayed. These codes may be inserted by the merge formatter or they may be used by the outline when using collapsible outlines. Another possible use is within tables, when there is more text than will fit in a cell but the size of the cell doesn't change.
*/
DEFINE('WP_START_OF_TEXT_TO_SKIP',chr(141));
/*
142 (0x8E) End of Text to Skip 
Paired with the previous function, this function marks the end of text to skip.
*/
DEFINE('WP_END_OF_TEXT_TO_SKIP',chr(142));

/*
143 (0x8F) Exited Hyphenation 
This function is used for checking, but is never actually inserted into any document.
*/
DEFINE('WP_EXITED_HYPHENATION',chr(143));

/*
144 (0x90) Cancel Hyphenation
Used to mark a word that WP has hyphenated [HyphIgnWrd] so that it will not be hyphenated and so that the user is not prompted to hyphenate that word again.
*/
DEFINE('WP_CANCEL_HYPHENATION',chr(144));

/*
145 (0x91) Do Subtotal
This function (+) adds all entries above it.
*/
DEFINE('WP_DO_SUBTOTAL',chr(145));

/*
146 (0x92) Subtotal Entry
Subtotal entry function.
*/
DEFINE('WP_SUBTOTAL_ENTRY',chr(146));

/*
147 (0x93) Do Total
This function (=) adds all subtotals above it.
*/
DEFINE('WP_DO_TOTAL',chr(147));

/*
148 (0x94) Total Entry
Total entry function.
*/
DEFINE('WP_TOTAL_ENTRY',chr(148));

/*
149 (0x95) Do Grand Total 
This function (*) adds all totals above it.
*/
DEFINE('WP_DO_GRAND_TOTAL',chr(149));

/*
150 (0x96) Calculation Column 
Calculation column function.
*/
DEFINE('WP_CALCULATION_COLUMN',chr(150));

/*
151 (0x97) Math Negate
Distinguishes a minus sign from a hyphen.
*/
DEFINE('WP_MATH_NEGATE',chr(151));

/*
152 (0x98) Reserved.
*/
DEFINE('WP_RESERVED_SINGLE_BYTE_FUNCTION',chr(152));

/*
153 (0x99) No Revert
No revert for this style.
*/
DEFINE('WP_NO_REVERT',chr(153));

/* 
154 (0x9A) Optional Space 
Optional space for selection cleanup.
*/
DEFINE('WP_OPTIONAL_SPACE',chr(154));

/*
155 (0x9B) Speller Clean On
Start of clean spelled area.
*/
DEFINE('WP_SPELLER_CLEAN_ON',chr(155));

/*
156 (0x9C) Speller Clean Off
End of clean spelled area.
*/
DEFINE('WP_SPELLER_CLEAN_OFF',chr(156));

/*
157 (0x9D) Joiner Control
(Mideast) Joiner control.
*/
DEFINE('WP_JOINER_CONTROL',chr(157));

/*
158 (0x9E) Non-Joiner Control
(Mideast) Non-joiner control.
*/
DEFINE('WP_NON_JOINER_CONTROL',chr(158));

/*
159 (0x9F) Weak On 
International.
*/
DEFINE('WP_WEAK_ON',chr(159));

/*
160 (0xA0) Weak Off 
International.
*/
DEFINE('WP_WEAK_OFF',chr(160));

/*
161 (0xA1) Decimal Align End
(Mideast) End of right-to-left decimal align.
*/
DEFINE('WP_DECIMAL_ALIGN_END',chr(161));


?>
Return current item: WPhp