summaryrefslogtreecommitdiff
path: root/support/dktools/wxdkdraw.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
committerNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
commit1f457376b478257b88d4a857f5ec1b6155442dd7 (patch)
tree2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/wxdkdraw.h
parentac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff)
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/wxdkdraw.h')
-rw-r--r--support/dktools/wxdkdraw.h424
1 files changed, 424 insertions, 0 deletions
diff --git a/support/dktools/wxdkdraw.h b/support/dktools/wxdkdraw.h
new file mode 100644
index 0000000000..f7c1746719
--- /dev/null
+++ b/support/dktools/wxdkdraw.h
@@ -0,0 +1,424 @@
+/*
+Copyright 2020, Dirk Krause. All rights reserved.
+SPDX-License-Identifier: BSD-3-Clause
+*/
+
+#ifndef H_INCLUDED_wxdkdraw
+/** Include file only once.
+*/
+#define H_INCLUDED_wxdkdraw 1
+
+#ifndef DK4CONF_H_INCLUDED
+#include <dk4conf.h>
+#endif
+
+#ifndef DK4TYPES_H_INCLUDED
+#include <dk4types.h>
+#endif
+
+#ifndef DK4MEM_H_INCLUDED
+#include <dk4mem.h>
+#endif
+
+#ifndef DK4STR8_H_INCLUDED
+#include <dk4str8.h>
+#endif
+
+#ifndef DK4ENC_H_INCLUDED
+#include <dk4enc.h>
+#endif
+
+#ifndef DK4LOC_H_INCLUDED
+#include <dk4loc.h>
+#endif
+
+#ifndef DK4MATH_H_INCLUDED
+#include <dk4math.h>
+#endif
+
+#ifndef DK4MAAI_H_INCLUDED
+#include <dk4maai.h>
+#endif
+
+#ifndef DK4MAAI16_H_INCLUDED
+#include <dk4maai16.h>
+#endif
+
+#ifndef DK4MAAU16_H_INCLUDED
+#include <dk4maau16.h>
+#endif
+
+#ifndef DK4MAAI32_H_INCLUDED
+#include <dk4maai32.h>
+#endif
+
+#ifndef DK4MAAU32_H_INCLUDED
+#include <dk4maau32.h>
+#endif
+
+#ifndef DK4MAI8DI8_H_INCLUDED
+#include <dk4mai8di8.h>
+#endif
+
+#ifndef DK4MAI8DU8_H_INCLUDED
+#include <dk4mai8du8.h>
+#endif
+
+#ifndef DK4MAI8DI16_H_INCLUDED
+#include <dk4mai8di16.h>
+#endif
+
+#ifndef DK4MAI8DU16_H_INCLUDED
+#include <dk4mai8du16.h>
+#endif
+
+#ifndef DK4MAI8DI32_H_INCLUDED
+#include <dk4mai8di32.h>
+#endif
+
+#ifndef DK4MAI8DU32_H_INCLUDED
+#include <dk4mai8du32.h>
+#endif
+
+#ifndef DK4MAI8DBL_H_INCLUDED
+#include <dk4mai8dbl.h>
+#endif
+
+#ifndef DK4MAO8D_H_INCLUDED
+#include <dk4mao8d.h>
+#endif
+
+#ifndef DK4MAO8DBL_H_INCLUDED
+#include <dk4mao8dbl.h>
+#endif
+
+#ifndef DK4GRA_H_INCLUDED
+#include <dk4gra.h>
+#endif
+
+#ifndef DK4GRAT_H_INCLUDED
+#include <dk4grat.h>
+#endif
+
+#ifndef DK4XSP_H_INCLUDED
+#include <dk4xsp.h>
+#endif
+
+#ifndef DK4VERSWX_H_INCLUDED
+#include <dk4verswx.h>
+#endif
+
+#ifndef DK4UNUSED_H_INCLUDED
+#include <dk4unused.h>
+#endif
+
+#ifndef WX_WXPREC_H_INCLUDED
+#include <wx/wxprec.h>
+#define WX_WXPREC_H_INCLUDED 1
+#endif
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#ifndef WX_WX_H_INCLUDED
+#include <wx/wx.h>
+#define WX_WX_H_INCLUDED 1
+#endif
+#endif
+
+#ifndef WX_ARRSTR_H_INCLUDED
+#include <wx/arrstr.h>
+#define WX_ARRSTR_H_INCLUDED 1
+#endif
+
+#ifndef WX_CONFIG_H_INCLUDED
+#include <wx/config.h>
+#define WX_CONFIG_H_INCLUDED 1
+#endif
+
+#ifndef WX_FILENAME_H_INCLUDED
+#include <wx/filename.h>
+#define WX_FILENAME_H_INCLUDED 1
+#endif
+
+#ifndef WX_FFILE_H_INCLUDED
+#include <wx/ffile.h>
+#define WX_FFILE_H_INCLUDED 1
+#endif
+
+#ifndef WX_GBSIZER_H_INCLUDED
+#include <wx/gbsizer.h>
+#define WX_GBSIZER_H_INCLUDED 1
+#endif
+
+#ifndef WX_THREAD_H_INCLUDED
+#include <wx/thread.h>
+#define WX_THREAD_H_INCLUDED 1
+#endif
+
+#ifndef WX_GAUGE_H_INCLUDED
+#include <wx/gauge.h>
+#define WX_GAUGE_H_INCLUDED 1
+#endif
+
+#ifndef WX_SPINCTRL_H_INCLUDED
+#include <wx/spinctrl.h>
+#define WX_SPINCTRL_H_INCLUDED 1
+#endif
+
+#ifndef WX_DCBUFFER_H_INCLUDED
+#include <wx/dcbuffer.h>
+#endif
+
+#ifndef WX_HELP_H_INCLUDED
+#include <wx/help.h>
+#define WX_HELP_H_INCLUDED 1
+#endif
+
+#ifndef WX_FS_ZIP_H_INCLUDED
+#include <wx/fs_zip.h>
+#define WX_FS_ZIP_H_INCLUDED 1
+#endif
+
+#ifndef WX_CMDLINE_H_INCLUDED
+#include <wx/cmdline.h>
+#define WX_CMDLINE_H_INCLUDED 1
+#endif
+
+#ifndef WX_DIR_H_INCLUDED
+#include <wx/dir.h>
+#define WX_DIR_H_INCLUDED 1
+#endif
+
+#ifndef WX_GRAPHICS_H_INCLUDED
+#include <wx/graphics.h>
+#define WX_GRAPHICS_H_INCLUDED 1
+#endif
+
+#ifndef WX_COLORDLG_H_INCLUDED
+#include <wx/colordlg.h>
+#define WX_COLORDLG_H_INCLUDED 1
+#endif
+
+
+
+/* __CHANGE__ 018: Add further wxWidgets header files.
+*/
+
+#ifndef WXDKDRAWTYPES_H_INCLUDED
+#include "WxdkdrawTypes.h"
+#endif
+
+#ifndef WXDENUM_H_INCLUDED
+#include "wxdenum.h"
+#endif
+
+#ifndef WXDARC_H_INCLUDED
+#include "wxdarc.h"
+#endif
+
+#ifndef WXDKDRAWOBJ_H_INCLUDED
+#include "WxdkdrawObj.h"
+#endif
+
+#ifndef WXDKDRAWFONT_H_INCLUDED
+#include "WxdkdrawFont.h"
+#endif
+
+#ifndef WXDKDRAWCOMP_H_INCLUDED
+#include "WxdkdrawComp.h"
+#endif
+
+#ifndef WXDKDRAWREAD_H_INCLUDED
+#include "WxdkdrawRead.h"
+#endif
+
+#ifndef WXDKDRAWWRITE_H_INCLUDED
+#include "WxdkdrawWrite.h"
+#endif
+
+#ifndef DK4STRX_H_INCLUDED
+#include <dk4strx.h>
+#endif
+
+#ifndef DK4RECWX_H_INCLUDED
+#include <dk4recwx.h>
+#endif
+
+#ifndef DK4MPL_H_INCLUDED
+#include <dk4mpl.h>
+#endif
+
+#ifndef DK4WXAPPLICTIONHELPER_H_INCLUDED
+#include <Dk4WxApplicationHelper.h>
+#endif
+
+#ifndef DK4WXFRAME_H_INCLUDED
+#include <Dk4WxFrame.h>
+#endif
+
+#ifndef DK4WXPROGRESSDIALOG_H_INCLUDED
+#include <Dk4WxProgressDialog.h>
+#endif
+
+#ifndef DK4WXHELPCONTROLLER_H_INCLUDED
+#include <Dk4WxHelpController.h>
+#endif
+
+/* __CHANGE__ 018: Add header files for further classes and modules.
+*/
+
+
+/** Current operation or processing state, stored
+ in the m_iState member of the frame.
+*/
+enum {
+ S_NOOP = 0 , /**< No operation. */
+ S_DELETE , /**< Delete objects. */
+ S_REGION_DELETE , /**< Delete region. */
+ S_MOVE_SELECT , /**< Select objects to move. */
+ S_MOVE_PLACE , /**< Place objects when moving. */
+ S_COPY_SELECT , /**< Select objects to copy. */
+ S_COPY_PLACE , /**< Place objects when copying. */
+ S_POLY_FIRST , /**< Place first polygon/polyline point. */
+ S_POLY_FURTHER , /**< Place further polygon/polyline point. */
+ S_SPLINE_FIRST , /**< Place first spline point. */
+ S_SPLINE_FURTHER , /**< Place further spline point. */
+ S_BOX_FIRST , /**< Place first box corner. */
+ S_BOX_OPPOSITE , /**< Place opposite box corner. */
+ S_CIRCLE_CENTER , /**< Place circle center point. */
+ S_CIRCLE_RADIUS , /**< Place any circle point for radius. */
+ S_ELLIPSE_CENTER , /**< Place ellipse center point. */
+ S_ELLIPSE_CORNER , /**< Place ellipse bounding box corner point. */
+ S_ARC_1 , /**< Place arc start point. */
+ S_ARC_2 , /**< Place arc intermediate point. */
+ S_ARC_3 , /**< Place arc end point. */
+ S_DOT , /**< Place dot. */
+ S_TEXT , /**< Place text. */
+ S_IMG_1 , /**< Place first image point. */
+ S_IMG_2 , /**< Place opposite image point. */
+ S_LIBELEM_PLACE , /**< Place library element. */
+ S_MOVEPT_SELECT , /**< Move point, select point to move. */
+ S_MOVEPT_PLACE , /**< Move point, place at new position. */
+ S_DELPT , /**< Delete point from spline or polyline. */
+ S_ADDPT_SELECT , /**< Add point, select neightbour. */
+ S_ADDPT_PLACE , /**< Add point, place new point. */
+ S_DRWSZ_SELECT , /**< Change drawing size, select point. */
+ S_DRWSZ_PLACE , /**< Change drawing size, place point. */
+ S_FLIP , /**< File elements vertically or horizontally. */
+ S_GROUP_ONE , /**< Group elements one by one. */
+ S_GROUP_RECT_1 , /**< Group elements by bounding box rectangle. */
+ S_GROUP_RECT_2 , /**< Group elements by bounding box stage 2. */
+ S_UNGROUP , /**< Ungroup elements. */
+ S_DETAILS , /**< Edit object details. */
+ S_DETAILS_2 , /**< Edit object details, step 2. */
+ S_CONVERT , /**< Convert to other object types. */
+ S_ROTATE , /**< Rotate object 90 degree. */
+ S_MOD_SPLINE , /**< Modify spline s value. */
+};
+
+
+
+/** Error codes for wxdkdraw.
+*/
+enum {
+ /** Failed to read file (syntax or other).
+ */
+ WXD_E_FAILED_TO_READ_FILE = (DK4_E_HIGHEST_NUMBER + 1),
+
+ /** Failed to open file for reading.
+ */
+ WXD_E_FAILED_TO_OPEN_FILE ,
+
+ /** Mouse position not available.
+ */
+ WXD_E_MOUSE_POS_NOT_AVAILABLE ,
+
+ /** Missing export text.
+ */
+ WXD_E_NO_EXPORT_TEXT ,
+
+ /** No file name specified for image.
+ */
+ WXD_E_NO_FILENAME ,
+
+ /** Failed to retrieve coordinates from object.
+ */
+ WXD_E_GET_CONTROL_POINT ,
+
+ /** Failed to set coordinates on object.
+ */
+ WXD_E_SET_CONTROL_POINT ,
+
+ /** Numeric overflow in coordinates calculation.
+ */
+ WXD_E_OVERFLOW_COORDINATES ,
+
+ /** Failed to move an object to a group.
+ */
+ WXD_E_MOVE_TO_GROUP ,
+
+ /** Failed to ungroup an object.
+ */
+ WXD_E_UNGROUP_OBJECT ,
+
+ /** Box is too small to calculate corner radius.
+ */
+ WXD_E_BOX_TOO_SMALL ,
+
+ /** New point out of index range.
+ */
+ WXD_E_BUG_POINT_OOR ,
+
+ /** Too many points.
+ */
+ WXD_E_TOO_MANY_POINTS ,
+
+ /** Can not convert this object.
+ */
+ WXD_E_CANNOT_CONVERT ,
+
+ /** Current working directory too long.
+ */
+ WXD_E_CWD_TOO_LONG ,
+
+ /** Failed to find current working directory.
+ */
+ WXD_E_NO_CWD ,
+
+ /** Output file name too long.
+ */
+ WXD_E_OUTPUT_FN_TOO_LONG ,
+
+ /** Failed to find output directory name.
+ */
+ WXD_E_OUTPUT_DIRNAME ,
+
+
+};
+
+
+/** Resolution as double value.
+ 16256000 wxd units make up one inch.
+ 6400000 wxd units make up one centimeter.
+*/
+#define RESWXD 16256000.0
+#define CMWXD 6400000.0
+
+
+/** Layer manager checkbox structure.
+*/
+typedef struct {
+ Wxd_layer_t *lay; /**< Layer controlled by element. */
+ wxCheckBox *cb; /**< Checkbox for that layer. */
+ uint8_t oa; /**< Old active value. */
+} Wxd_layer_cb_t;
+
+
+
+#endif
+
+/* vim: set ai sw=4 ts=4 : */
+