home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 January / Chip_1997-01_cd.bin / ms95 / disk22 / dir03 / f015100.re_ / f015100.re
Text File  |  1996-04-02  |  9KB  |  272 lines

  1. /*----------------------------------------------------------------------+
  2. |                                    |
  3. |  Copyright (1995) Bentley Systems, Inc., All rights reserved.        |
  4. |                                    |
  5. |  "MicroStation" is a registered trademark and "MDL" and "MicroCSL"    |
  6. |  are trademarks of Bentley Systems, Inc.                    |
  7. |                                    |
  8. |  Limited permission is hereby granted to reproduce and modify this    |
  9. |  copyrighted material provided that the resulting code is used only     |
  10. |  in conjunction with Bentley Systems products under the terms of the    |
  11. |  license agreement provided therein, and that this notice is retained    |
  12. |  in its entirety in any such reproduction or modification.        |
  13. |                                    |
  14. +----------------------------------------------------------------------*/
  15. /*----------------------------------------------------------------------+
  16. |                                    |
  17. |    $Logfile:   J:/mdl/examples/iconedit/iconedit.h_v  $
  18. |   $Workfile:   iconedit.h  $
  19. |   $Revision:   6.0  $
  20. |       $Date:   29 Jun 1995 10:04:40  $
  21. |                                    |
  22. +----------------------------------------------------------------------*/
  23. /*----------------------------------------------------------------------+
  24. |                                    |
  25. |   Function -                                |
  26. |                                    |
  27. |       Icon edit structures and definitions                    |
  28. |                                    |
  29. +----------------------------------------------------------------------*/
  30. #if !defined (__iconeditH__)
  31. #define __iconeditH__
  32.  
  33. #ifndef        __basetypeH__
  34. #include    <basetype.h>
  35. #endif
  36.  
  37. #ifndef        __rscdefsH__
  38. #include    <rscdefs.h>
  39. #endif
  40.  
  41. #ifndef        __msdefsH__
  42. #include    <msdefs.h>
  43. #endif
  44.  
  45. #if defined (msdos)
  46. # define    SEPCHAR '\\'
  47. #elif defined (unix)
  48. # define    SEPCHAR '/'
  49. #elif defined (macintosh)
  50. # define    SEPCHAR ':'
  51. #else
  52. # define    SEPCHAR '.'
  53. #endif
  54.  
  55. /*----------------------------------------------------------------------+
  56. |                                    |
  57. |                                       |
  58. |                                    |
  59. +----------------------------------------------------------------------*/
  60. #define        BASEID_IconEditor        90500
  61. #define        DIALOGID_Icon        BASEID_IconEditor+1
  62. #define        DIALOGID_OpenIconResource   BASEID_IconEditor+2
  63. #define        DIALOGID_UserSize        BASEID_IconEditor+3
  64. #define        DIALOGID_SelectCell         BASEID_IconEditor+4
  65.  
  66. #define        STRINGID_Messages        BASEID_IconEditor+1
  67. #define        STRINGID_Errors        BASEID_IconEditor+2
  68. #define        STRINGID_FormatMsgs        BASEID_IconEditor+3
  69.  
  70. #define        GENERICID_IconSmall        BASEID_IconEditor+1
  71. #define        GENERICID_IconLarge        BASEID_IconEditor+2
  72. #define        GENERICID_ShiftUp        BASEID_IconEditor+3
  73. #define        GENERICID_ShiftDown        BASEID_IconEditor+4
  74. #define        GENERICID_ShiftLeft        BASEID_IconEditor+5
  75. #define        GENERICID_ShiftRight    BASEID_IconEditor+6
  76. #define        GENERICID_Clear        BASEID_IconEditor+7
  77. #define        GENERICID_SelectCell    BASEID_IconEditor+8
  78.  
  79. #define        ICONID_ShiftUp        BASEID_IconEditor+1
  80. #define        ICONID_ShiftDown        BASEID_IconEditor+2
  81. #define        ICONID_ShiftLeft        BASEID_IconEditor+3
  82. #define        ICONID_ShiftRight        BASEID_IconEditor+4
  83. #define        ICONID_Clear        BASEID_IconEditor+5
  84.  
  85. #define        MENUBARID_Icon        BASEID_IconEditor+3
  86.  
  87. #define        PULLDOWNMENUID_IconFile    BASEID_IconEditor+1
  88. #define        PULLDOWNMENUID_IconEdit    BASEID_IconEditor+2
  89. #define        PULLDOWNMENUID_Import    BASEID_IconEditor+3
  90.  
  91. #define        LISTBOXID_RscNum        BASEID_IconEditor+1
  92. #define        LISTBOXID_SelectCell    BASEID_IconEditor+2
  93.  
  94. #define        OPTIONBUTTONID_Tool        BASEID_IconEditor+1
  95. #define        OPTIONBUTTONID_Mode        BASEID_IconEditor+2
  96. #define        OPTIONBUTTONID_Size        BASEID_IconEditor+3
  97.  
  98. #define        TEXTID_IconName        BASEID_IconEditor+1
  99. #define        TEXTID_Width        BASEID_IconEditor+2
  100. #define        TEXTID_Height        BASEID_IconEditor+3
  101. #define        TEXTID_IconResourceType    BASEID_IconEditor+4
  102. #define        TEXTID_RscId        BASEID_IconEditor+5
  103. #define        TEXTID_SelectCell           BASEID_IconEditor+6
  104.  
  105. #define        LABELID_Position        BASEID_IconEditor+1
  106. #define        LABELID_IconSize        BASEID_IconEditor+2
  107.  
  108. #define        HOOKITEMID_Generic_IconLarge    BASEID_IconEditor+1
  109. #define        HOOKITEMID_Generic_IconSmall    BASEID_IconEditor+2
  110. #define        HOOKITEMID_Option_Size        BASEID_IconEditor+3
  111. #define        HOOKITEMID_List_RscNum        BASEID_IconEditor+4
  112. #define        HOOKDIALOGID_Icon            BASEID_IconEditor+5
  113. #define        HOOKDIALOGID_OpenIconResource   BASEID_IconEditor+6
  114. #define        HOOKITEMID_Generic_Shift        BASEID_IconEditor+7
  115. #define        HOOKITEMID_TextItem            BASEID_IconEditor+8
  116. #define        HOOKID_ListBox_SelectCell       BASEID_IconEditor+9
  117. #define        HOOKID_Generic_SelectCell       BASEID_IconEditor+10
  118.  
  119. #define      DEFFILE_ID                    BASEID_IconEditor+1
  120. #define      DEFCREATEFILE_ID              BASEID_IconEditor+2
  121.  
  122. /*----------------------------------------------------------------------+
  123. |                                    |
  124. |                                       |
  125. |                                    |
  126. +----------------------------------------------------------------------*/
  127. #define        MSG_Position        0
  128. #define        MSG_IconSize        1
  129. #define        MSG_ResourceFileToOpen    2
  130. #define        MSG_SaveToFile        3
  131. #define        MSG_SaveToNewFile        4
  132. #define        MSG_IconEditor        5
  133. #define        MSG_Ustation        6
  134. #define        MSG_Writing            7
  135. #define        MSG_NoChange        8
  136. #define        MSG_BadFile            9
  137. #define        MSG_NewResourceFile         10
  138. #define        MSG_Overwrite        11
  139.  
  140. #define        PROMPT_CellLibrary          12
  141. #define        PROMPT_Reading            13
  142. #define        PROMPT_NoCells        14
  143.  
  144. #define        ERROR_CommandTable        0
  145. #define        ERROR_DialogBox        1
  146. #define        ERROR_OpenOutput        2
  147. #define        ERROR_OpenRsc        3
  148. #define        ERROR_LocateIcon        4
  149. #define        ERROR_NoFence           5
  150. #define        ERROR_NoLibrary           6
  151.  
  152. /*----------------------------------------------------------------------+
  153. |                                    |
  154. |                                       |
  155. |                                    |
  156. +----------------------------------------------------------------------*/
  157. #define        MENUSEARCHID_OpenFile    0
  158. #define        MENUSEARCHID_NewFile    1
  159. #define        MENUSEARCHID_OpenIcon    2
  160. #define        MENUSEARCHID_NewIcon    3
  161. #define        MENUSEARCHID_Save        4
  162. #define        MENUSEARCHID_SaveTo        5
  163. #define        MENUSEARCHID_Quit        6
  164.  
  165. #define        MENUSEARCHID_Fill        0
  166. #define        MENUSEARCHID_Clear        1
  167. #define        MENUSEARCHID_ShiftLeft    2
  168. #define        MENUSEARCHID_ShiftRight    3
  169. #define        MENUSEARCHID_ShiftUp    4
  170. #define        MENUSEARCHID_ShiftDown    5
  171.  
  172. #define        MENUSEARCHID_ImportGraphics    1
  173. #define        MENUSEARCHID_ImportCell    2
  174.  
  175. /*----------------------------------------------------------------------+
  176. |                                    |
  177. |                                       |
  178. |                                    |
  179. +----------------------------------------------------------------------*/
  180. #define        MODE_TOGGLE            0
  181. #define        MODE_SET            1
  182. #define        MODE_CLEAR            2
  183.  
  184. #define        TOOL_LINE            0
  185. #define        TOOL_BRUSH            1
  186. #define        TOOL_RECTANGLE        2
  187. #define        TOOL_CIRCLE            3
  188.  
  189. #define        FATBIT            4
  190. #define        MAXRECTS            250
  191.  
  192. #define        CLASS_LIST_WIDTH        4
  193. #define        RSCID_COL_WIDTH        10
  194. #define        ALIAS_COL_WIDTH            16
  195. #define        LISTWIDTHS (CLASS_LIST_WIDTH + RSCID_COL_WIDTH + ALIAS_COL_WIDTH)
  196. #define        LISTHEIGHT               10
  197. #define        FILE_UNUSED                -1
  198. #define        PREDEFINED_SIZES        2
  199.  
  200. #define        MAXICONSIZE            100
  201. #define        ICONSIZE            15
  202. #define        ICONBLOCKSIZE        (ICONSIZE + 2)
  203. #define        ICONBLOCKWIDTH        ((4 * ICONBLOCKSIZE) + 18)
  204.  
  205. #if defined (DATA_ALIGNMENT_FORCED)
  206. #   define        ICONRSC_SIZEOF  (sizeof (IconRsc) - 3)
  207. #else
  208. #   define        ICONRSC_SIZEOF  (sizeof (IconRsc))
  209. #endif
  210.  
  211. /*----------------------------------------------------------------------+
  212. |                                    |
  213. |                                       |
  214. |                                    |
  215. +----------------------------------------------------------------------*/
  216. typedef struct iconEditGlobals
  217.     {
  218.     int            width;
  219.     int            height;
  220.     int            onColorDescr;
  221.     int            offColorDescr;
  222.     int            onByteValue;
  223.     int            offByteValue;
  224.     int            hiliteColor;
  225.     int            lineColor;
  226.     int            dynamicsColor;
  227.     int            tool;
  228.     int            mode;
  229.     int            fillMode;
  230.     int            sizeIndex;
  231.     int            modeOverride;
  232.     int            anchorPixelValue;
  233.     int            saveToOriginal;
  234.     int            modified;
  235.     int            empty;
  236.     int            inRscId;
  237.     int            selectedType;
  238.     int            rscHandleFileToRead;
  239.     char        inFileName[MAXFILELENGTH];
  240.     char        iconName[16];
  241.     char        outFileName[MAXFILELENGTH];
  242.     char        cellName[16];
  243.     long        format;
  244.     long        colorIndex;
  245.     Point2d        anchorPixel;
  246.     Point2d        anchorPos;
  247.     Point2d        oldPixel;
  248.     Point2d        oldPos;
  249. #if defined (resource)
  250.     int            dialogBoxP;
  251.     int            downFunctionP;
  252.     int            upFunctionP;
  253.     int            resetFunctionP;
  254.     int            dynamicFuncP;
  255.     int            dataP;
  256.     int            stringListP;
  257.     int            listBoxHdrP;
  258. #else
  259.     void       *dialogBoxP;
  260.     int          (*downFunctionP)();
  261.     int          (*upFunctionP)();
  262.     int          (*resetFunctionP)();
  263.     int          (*dynamicFuncP)();
  264.     unsigned char  *dataP;
  265.     unsigned char  *stringListP;
  266.     void           *listBoxHdrP;
  267. #endif
  268.     } IconEditGlobals;
  269.  
  270.  
  271. #endif /* !defined (__iconeditH__) */
  272.