Subversion Repositories filter_foundry

Rev

Rev 536 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.     This file is part of a common library for Adobe(R) Photoshop(R) plugins
  3.     Copyright (C) 2002-2006 Toby Thain, toby@telegraphics.net
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18. */
  19.  
  20. #ifndef COMPAT_WIN_H_
  21. #define COMPAT_WIN_H_
  22.  
  23. #ifndef _MSC_VER
  24.         // probably MinGW gcc
  25.         #include <stdint.h> // for intptr_t req'd by CS4 SDK
  26. #endif
  27.  
  28. // Avoid loading FSSpec in PITypes.h !
  29. #define _FSSPEC_        1
  30. typedef struct
  31. {
  32.         TCHAR szName[MAX_PATH+1];
  33. } FSSpec;
  34.  
  35. #include "PITypes.h"
  36.  
  37. // Scripting system, see https://developer.apple.com/library/archive/documentation/mac/pdf/Text.pdf , PDF page 676
  38. // Not required for Windows
  39. typedef int16 ScriptCode;
  40. #define smSystemScript -1 // System script
  41. #define smCurrentScript -2 // Font script
  42. #define smRoman 0 // Roman
  43. #define smJapanese 1 // Japanese
  44. #define smTradChinese 2 // Traditional Chinese
  45. #define smKorean 3 // Korean
  46. #define smArabic 4 // Arabic
  47. #define smHebrew 5 // Hebrew
  48. #define smGreek 6 // Greek
  49. #define smCyrillic 7 // Cyrillic
  50. #define smRSymbol 8 // Right-to-left symbols
  51. #define smDevanagari 9 // Devanagari
  52. #define smGurmukhi 10 // Gurmukhi
  53. #define smGujarati 11 // Gujarati
  54. #define smOriya 12 // Oriya
  55. #define smBengali 13 // Bengali
  56. #define smTamil 14 // Tamil
  57. #define smTelugu 15 // Telugu
  58. #define smKannada 16 // Kannada / Kanarese
  59. #define smMalayalam 17 // Malayalam
  60. #define smSinhalese 18 // Sinhalese
  61. #define smBurmese 19 // Burmese
  62. #define smKhmer 20 // Khmer
  63. #define smThai 21 // Thai
  64. #define smLaotian 22 // Laotian
  65. #define smGeorgian 23 // Georgian
  66. #define smArmenian 24 // Armenian
  67. #define smSimpChinese 25 // Simplified Chinese
  68. #define smTibetan 26 // Tibetan
  69. #define smMongolian 27 // Mongolian
  70. #define smGeez 28 // Geez / Ethiopic
  71. #define smEthiopic 28 // = smGeez
  72. #define smEastEurRoman 29 // Extended Roman for Slavicand Baltic languages
  73. #define smVietnamese 30 // Extended Roman for Vietnamese
  74. #define smExtArabic 31 // Extended Arabic for Sindhi
  75. #define smUninterp 32 // Uninterpreted symbols
  76.  
  77. typedef struct StandardFileReply {
  78.         Boolean     sfGood;
  79.         Boolean     sfReplacing;
  80.         OSType      sfType;
  81.         FSSpec      sfFile;
  82.         ScriptCode  sfScript;
  83.  
  84. #ifdef WIN_ENV
  85.         WORD nFileExtension ;
  86.         /* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/CommonDialogBoxLibrary/CommonDialogBoxReference/CommonDialogBoxStructures/OPENFILENAME.asp
  87.            Specifies the zero-based offset, in TCHAR s, from the beginning of the path to the file name extension
  88.            in the string pointed to by lpstrFile . For the ANSI version, this is the number of bytes;
  89.            for the Unicode version, this is the number of characters. For example, if lpstrFile points to
  90.            the following string, "c:\dir1\dir2\file.ext", this member contains the value 18.
  91.            If the user did not type an extension and lpstrDefExt is NULL, this member specifies an offset
  92.            to the terminating NULL character. If the user typed "." as the last character in the file name,
  93.            this member specifies zero.  */
  94. #endif
  95. } StandardFileReply;
  96.  
  97. typedef unsigned char *StringPtr,**StringHandle;
  98. //typedef const unsigned char *ConstStr255Param;
  99.  
  100. typedef Ptr RgnHandle,GWorldPtr,ControlHandle,CGrafPtr,GDHandle,PixMapHandle;
  101. void NumToString(long n,StringPtr s);
  102. Ptr GetPixBaseAddr(PixMapHandle);
  103. PixMapHandle GetGWorldPixMap(GWorldPtr);
  104.  
  105. Ptr NewPtrClear(size_t size);
  106.  
  107. //#define NewPtr malloc
  108. Ptr NewPtr(size_t size);
  109.  
  110. #define DisposPtr DisposePtr
  111. //#define DisposePtr free
  112. void DisposePtr(Ptr ptr);
  113.  
  114. #define MemError() memFullErr /* FIXME */
  115. #define BlockMoveData(src,dst,len) memcpy(dst,src,len)
  116.  
  117. enum{ ok = 1,cancel = 2 };
  118.  
  119. Boolean Implements3264ResourceAPI(void);
  120.  
  121. ULONGLONG _GetTickCount64(void);
  122.  
  123. HANDLE _BeginUpdateResource(
  124.         LPCTSTR pFileName,
  125.         BOOL   bDeleteExistingResources
  126. );
  127.  
  128. BOOL _EndUpdateResource(
  129.         HANDLE hUpdate,
  130.         BOOL   fDiscard
  131. );
  132.  
  133. BOOL _UpdateResource(
  134.         HANDLE hUpdate,
  135.         LPCTSTR lpType,
  136.         LPCTSTR lpName,
  137.         WORD   wLanguage,
  138.         LPVOID lpData,
  139.         DWORD  cb
  140. );
  141.  
  142. void _GetNativeSystemInfo(
  143.         LPSYSTEM_INFO lpSystemInfo
  144. );
  145.  
  146. BOOL _ImageRemoveCertificate(HANDLE FileHandle, DWORD Index);
  147.  
  148. #endif
  149.