adsdlg.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // DESCRIPTION:
  13. // Definitions for ADS Programmable Dialogue Boxes
  14. #ifndef _adsdlg_h
  15. #define _adsdlg_h 1
  16. #include "ads.h"
  17. #include "AdAChar.h"
  18. #pragma pack (push, 8)
  19. /* Defined only for OS/2 DLL Version
  20. */
  21. #ifndef CALLB
  22. #define CALLB
  23. #endif
  24. /* There is a clash between the alignment required within structures for
  25. ADS and that required for members within Zortech structs and classes.
  26. ADS requires byte alignment (-a1) while 32-bit Zortech requires 4-byte
  27. alignment (-a4). To work around this clash the alignment is set to one
  28. at the top of this header file and restored to four at the bottom so
  29. that ADS structures are byte-aligned.
  30. */
  31. #ifdef __ZTC__
  32. #pragma ZTC align 1
  33. #endif
  34. /* Ensure that C++ modules use the right linking conventions when calling
  35. functions contained in C.
  36. */
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. typedef void *ads_hdlg;
  41. typedef void *ads_htile;
  42. typedef struct {
  43. ads_hdlg dialog;
  44. ads_htile tile;
  45. ACHAR* value;
  46. void* client_data;
  47. int reason;
  48. long x, y;
  49. } ads_callback_packet;
  50. /* The following are used in tile callback packets. Their meaning
  51. for each kind of tile can be found in the Programmable Dialogue
  52. Boxes documentation.
  53. */
  54. #define CBR_SELECT 1
  55. #define CBR_LOST_FOCUS 2
  56. #define CBR_DRAG 3
  57. #define CBR_DOUBLE_CLICK 4
  58. #ifndef _PROTEUS_H
  59. /* ADS user's function, passed to AutoCAD to be called later
  60. */
  61. typedef void (*CLIENTFUNC) (ads_callback_packet *cpkt);
  62. #endif /* _PROTEUS_H */
  63. #define NULLCB ((CLIENTFUNC)0)
  64. #define BAD_DIALOG NULL
  65. /* Return by reference integers for ads_start_dialog
  66. */
  67. #define DLGCANCEL 0 /* User pressed Cancel or equivalent */
  68. #define DLGOK 1 /* User pressed Ok */
  69. #define DLGALLDONE -1 /* All dialogs terminated with
  70. term_dialog */
  71. #define DLGSTATUS 2 /* start of user return codes */
  72. #ifndef _PROCONST_H
  73. /* Preventing redefined warnings.
  74. List argument type for ads_start_list();
  75. */
  76. #define LIST_CHANGE ((short) 1) /* Change selected listbox contents */
  77. #define LIST_APPEND ((short) 2) /* Append new listbox entry */
  78. #define LIST_NEW ((short) 3) /* Delete old list and create new list */
  79. /*
  80. Mode argument type for ads_mode_tile();
  81. */
  82. #define MODE_ENABLE ((short) 0) /* Enable tile */
  83. #define MODE_DISABLE ((short) 1) /* Disable tile */
  84. #define MODE_SETFOCUS ((short) 2) /* Set focus to tile */
  85. #define MODE_SETSEL ((short) 3) /* Set editbox selection--allows
  86. auto-clearing of old string */
  87. #define MODE_FLIP ((short) 4) /* Invert current state */
  88. #endif // _PROCONST_H
  89. /* For buffers that receive values for tiles. The number is
  90. arbitrary--it's just here to allow changing them all from
  91. one place.
  92. */
  93. #ifndef _PROTEUS_H
  94. #define MAX_TILE_STR 40
  95. #endif
  96. #define TILE_STR_LIMIT 2035 /* limit of DCL dialog strings */
  97. /* Dialog Functions
  98. */
  99. int ads_load_dialog (const ACHAR *dclfile, int *dcl_id);
  100. int ads_unload_dialog (int dcl_id);
  101. int ads_new_dialog (const ACHAR *dlgname, int dcl_id,
  102. CLIENTFUNC def_callback, ads_hdlg *hdlg);
  103. int ads_new_positioned_dialog (const ACHAR *dlgname, int dcl_id,
  104. CLIENTFUNC def_callback, int x, int y,
  105. ads_hdlg *hdlg);
  106. int ads_start_dialog (ads_hdlg hdlg, int *status);
  107. int ads_term_dialog (void);
  108. int ads_action_tile (ads_hdlg hdlg, const ACHAR *key, CLIENTFUNC tilefunc);
  109. int ads_done_dialog (ads_hdlg hdlg, int status);
  110. int ads_done_positioned_dialog (ads_hdlg hdlg, int status, int *x_result,
  111. int *y_result);
  112. int ads_set_tile (ads_hdlg hdlg, const ACHAR *key, const ACHAR *value);
  113. int ads_client_data_tile (ads_hdlg hdlg, const ACHAR *key, void *clientdata);
  114. int ads_get_tile (ads_hdlg hdlg, const ACHAR *key,
  115. ACHAR *value, int maxlen);
  116. int ads_get_attr (ads_hdlg hdlg, const ACHAR *key,
  117. ACHAR *attr, ACHAR *value, int len);
  118. int ads_get_attr_string (ads_htile tile, ACHAR *attr, ACHAR *value, int len);
  119. int ads_start_list (ads_hdlg hdlg, const ACHAR *key, short operation, short index);
  120. int ads_add_list (const ACHAR *item);
  121. int ads_end_list (void);
  122. int ads_mode_tile (ads_hdlg hdlg, const ACHAR *key, short mode);
  123. int ads_dimensions_tile (ads_hdlg hdlg, const ACHAR *key,
  124. short *cx, short *cy);
  125. int ads_start_image (ads_hdlg hdlg, const ACHAR *key);
  126. int ads_vector_image (short x1, short y1, short x2, short y2, short color);
  127. int ads_fill_image (short x1, short y1, short x2, short y2, short color);
  128. int ads_slide_image (short x1, short y1, short x2, short y2,
  129. const ACHAR *slnam);
  130. int ads_end_image (void);
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134. #pragma pack (pop)
  135. #endif