lwserver.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * LWSDK Header File
  3. * Copyright 1999, NewTek, Inc.
  4. *
  5. * LWSERVER.H -- LightWave Plug-in Server
  6. *
  7. * This header contains the basic declarations need to define the
  8. * simplest LightWave plug-in server.
  9. */
  10. #ifndef LWSDK_SERVER_H
  11. #define LWSDK_SERVER_H
  12. /*
  13. * External Entry Points. All entry points which may be called from the
  14. * host must be declared as XCALL types. The obsolete XCALL_INIT is
  15. * still present but defined as nothing.
  16. */
  17. #ifdef _WIN32
  18. #define XCALL_(t) t
  19. #endif
  20. #ifdef _XGL
  21. #define XCALL_(t) t
  22. #endif
  23. #ifdef _MACOS
  24. #define XCALL_(t) t
  25. #endif
  26. #define XCALL_INIT
  27. /*
  28. * Global Function. The global function is a callback provided by the
  29. * host taking the floowing form. A pointer for the given service name
  30. * is returned for the given useage. The use codes are for services
  31. * that will be used once or that will be used many times.
  32. */
  33. typedef void * GlobalFunc (const char *serviceName, int useMode);
  34. #define GFUSE_TRANSIENT 0
  35. #define GFUSE_ACQUIRE 1
  36. #define GFUSE_RELEASE 2
  37. /*
  38. * Activation Function. The server entry points are all functions of
  39. * this kind, taking a version number, global function pointer, local
  40. * (class-specific) data and module data. The return value indicates
  41. * if the service could run and the reason for failure if it couldn't.
  42. */
  43. typedef int ActivateFunc (long version,
  44. GlobalFunc *global,
  45. void *local,
  46. void *serverData);
  47. #define AFUNC_OK 0
  48. #define AFUNC_BADVERSION 1
  49. #define AFUNC_BADGLOBAL 2
  50. #define AFUNC_BADLOCAL 3
  51. #define AFUNC_BADAPP 4
  52. /*
  53. * This is a selection of some of the more useful language ID's,
  54. * although this list is far from complete. Remaining codes can be
  55. * found by searching the Microsoft Windows documentation for OLE
  56. * LANGID codes. Japanese strings should be encoded as JIS on Windows
  57. * and EUC on Unix.
  58. */
  59. #define LANGID_GERMAN 0x0407
  60. #define LANGID_USENGLISH 0x0409
  61. #define LANGID_UKENGLISH 0x0809
  62. #define LANGID_SPANISH 0x040a
  63. #define LANGID_FRENCH 0x040c
  64. #define LANGID_ITALIAN 0x0410
  65. #define LANGID_JAPANESE 0x0411
  66. #define LANGID_KOREAN 0x0412
  67. #define LANGID_RUSSIAN 0x0419
  68. #define LANGID_SWEDISH 0x041D
  69. /*
  70. * The each server can contain a list of tagged strings which declare
  71. * some of the static information about that server. Tags are a bitwise
  72. * OR of a SRVTAG code which selects the type of information, and a
  73. * language ID word which selects the language for which the string is
  74. * valid.
  75. */
  76. #define SRVTAG_USERNAME 0x00000
  77. #define SRVTAG_BUTTONNAME 0x10000
  78. #define SRVTAG_CMDGROUP 0x20000
  79. #define SRVTAG_MENU 0x30000
  80. #define SRVTAG_DESCRIPTION 0x40000
  81. #define SRVTAG_ENABLE 0x50000
  82. typedef struct st_ServerTagInfo {
  83. const char *string;
  84. unsigned int tag;
  85. } ServerTagInfo;
  86. /*
  87. * Server Definition Record. Each server record describes a single
  88. * activation entry point in the plug-in module. Each has a class,
  89. * a name, an activation function, and an array of tag info structs
  90. * terminated with a zero tag code.
  91. */
  92. typedef struct st_ServerRecord {
  93. const char *className;
  94. const char *name;
  95. ActivateFunc *activate;
  96. ServerTagInfo *tagInfo;
  97. } ServerRecord;
  98. #define ServerUserName ServerTagInfo
  99. #endif