repo_name
stringclasses
10 values
file_path
stringlengths
29
222
content
stringlengths
24
926k
extention
stringclasses
5 values
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/colour.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/colour.h // Purpose: wxColour class // Author: Julian Smart, Robert Roebling // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart, Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_COLOUR_H_ #define _WX_COLOUR_H_ #include "wx/defs.h" #include "wx/object.h" #include "wx/string.h" #include "wx/gdiobj.h" #include "wx/palette.h" //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxPaintDC; class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxColour; //----------------------------------------------------------------------------- // wxColour //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxColour : public wxColourBase { public: // constructors // ------------ DEFINE_STD_WXCOLOUR_CONSTRUCTORS virtual ~wxColour(); bool operator==(const wxColour& col) const; bool operator!=(const wxColour& col) const { return !(*this == col); } unsigned char Red() const; unsigned char Green() const; unsigned char Blue() const; // Implementation part void CalcPixel( WXColormap cmap ); unsigned long GetPixel() const; WXColor *GetColor() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; virtual void InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); virtual bool FromString(const wxString& str); private: wxDECLARE_DYNAMIC_CLASS(wxColour); }; #endif // _WX_COLOUR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/private.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/private.h // Purpose: Private declarations for X11 port // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PRIVATE_H_ #define _WX_PRIVATE_H_ #include "wx/defs.h" #include "wx/hashmap.h" #include "wx/utils.h" #if defined( __cplusplus ) && defined( __VMS ) #pragma message disable nosimpint #endif #include "X11/Xlib.h" #include "X11/Xatom.h" #include "X11/Xutil.h" #if defined( __cplusplus ) && defined( __VMS ) #pragma message enable nosimpint #endif // Include common declarations #include "wx/x11/privx.h" #if wxUSE_PANGO #include <pango/pango.h> #endif class WXDLLIMPEXP_FWD_CORE wxMouseEvent; class WXDLLIMPEXP_FWD_CORE wxKeyEvent; class WXDLLIMPEXP_FWD_CORE wxWindow; // ---------------------------------------------------------------------------- // Some Unicode <-> UTF8 macros stolen from GTK // ---------------------------------------------------------------------------- #if wxUSE_UNICODE #define wxGTK_CONV(s) wxConvUTF8.cWX2MB(s) #define wxGTK_CONV_BACK(s) wxConvUTF8.cMB2WX(s) #else #define wxGTK_CONV(s) s.c_str() #define wxGTK_CONV_BACK(s) s #endif // ---------------------------------------------------------------------------- // we maintain a hash table which contains the mapping from Widget to wxWindow // corresponding to the window for this widget // ---------------------------------------------------------------------------- WX_DECLARE_HASH_MAP(Window, wxWindow *, wxIntegerHash, wxIntegerEqual, wxWindowHash); // these hashes are defined in app.cpp extern wxWindowHash *wxWidgetHashTable; extern wxWindowHash *wxClientWidgetHashTable; extern void wxDeleteWindowFromTable(Window w); extern wxWindow *wxGetWindowFromTable(Window w); extern bool wxAddWindowToTable(Window w, wxWindow *win); extern void wxDeleteClientWindowFromTable(Window w); extern wxWindow *wxGetClientWindowFromTable(Window w); extern bool wxAddClientWindowToTable(Window w, wxWindow *win); // ---------------------------------------------------------------------------- // TranslateXXXEvent() functions - translate X event to wxWindow one // ---------------------------------------------------------------------------- extern bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent); extern bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window window, XEvent *xevent, bool isAscii = FALSE); extern Window wxGetWindowParent(Window window); // Set the window manager decorations according to the // given wxWidgets style bool wxSetWMDecorations(Window w, long style); bool wxMWMIsRunning(Window w); #endif // _WX_PRIVATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/bitmap.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/bitmap.h // Purpose: wxBitmap class // Author: Julian Smart, Robert Roebling // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart, Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_BITMAP_H_ #define _WX_BITMAP_H_ #include "wx/defs.h" #include "wx/object.h" #include "wx/string.h" #include "wx/palette.h" #include "wx/gdiobj.h" //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxMask; class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxImage; //----------------------------------------------------------------------------- // wxMask //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMask: public wxObject { public: wxMask(); wxMask(const wxMask& mask); wxMask( const wxBitmap& bitmap, const wxColour& colour ); wxMask( const wxBitmap& bitmap, int paletteIndex ); wxMask( const wxBitmap& bitmap ); virtual ~wxMask(); bool Create( const wxBitmap& bitmap, const wxColour& colour ); bool Create( const wxBitmap& bitmap, int paletteIndex ); bool Create( const wxBitmap& bitmap ); // implementation WXPixmap GetBitmap() const { return m_bitmap; } void SetBitmap( WXPixmap bitmap ) { m_bitmap = bitmap; } WXDisplay *GetDisplay() const { return m_display; } void SetDisplay( WXDisplay *display ) { m_display = display; } private: WXPixmap m_bitmap; WXDisplay *m_display; wxSize m_size; private: wxDECLARE_DYNAMIC_CLASS(wxMask); }; //----------------------------------------------------------------------------- // wxBitmap //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase { public: wxBitmap() {} wxBitmap( int width, int height, int depth = -1 ) { Create( width, height, depth ); } wxBitmap( const wxSize& sz, int depth = -1 ) { Create( sz, depth ); } wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char* const* bits ); #ifdef wxNEEDS_CHARPP // needed for old GCC wxBitmap(char** data) { *this = wxBitmap(const_cast<const char* const*>(data)); } #endif wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); virtual ~wxBitmap(); static void InitStandardHandlers(); bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) { return Create(sz.GetWidth(), sz.GetHeight(), depth); } bool Create(int width, int height, const wxDC& WXUNUSED(dc)) { return Create(width,height); } bool Create(const void* data, wxBitmapType type, int width, int height, int depth = -1); // create the wxBitmap using a _copy_ of the pixmap bool Create(WXPixmap pixmap); int GetHeight() const; int GetWidth() const; int GetDepth() const; #if wxUSE_IMAGE wxBitmap( const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0 ) { (void)CreateFromImage(image, depth); } wxImage ConvertToImage() const; bool CreateFromImage(const wxImage& image, int depth = -1); #endif // wxUSE_IMAGE // copies the contents and mask of the given (colour) icon to the bitmap virtual bool CopyFromIcon(const wxIcon& icon); wxMask *GetMask() const; void SetMask( wxMask *mask ); wxBitmap GetSubBitmap( const wxRect& rect ) const; bool SaveFile( const wxString &name, wxBitmapType type, const wxPalette *palette = NULL ) const; bool LoadFile( const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); wxPalette *GetPalette() const; wxPalette *GetColourMap() const { return GetPalette(); } virtual void SetPalette(const wxPalette& palette); // implementation // -------------- #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED(void SetHeight( int height )); wxDEPRECATED(void SetWidth( int width )); wxDEPRECATED(void SetDepth( int depth )); #endif void SetPixmap( WXPixmap pixmap ); void SetBitmap( WXPixmap bitmap ); WXPixmap GetPixmap() const; WXPixmap GetBitmap() const; WXPixmap GetDrawable() const; WXDisplay *GetDisplay() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; private: wxDECLARE_DYNAMIC_CLASS(wxBitmap); }; #endif // _WX_BITMAP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/minifram.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/minifram.h // Purpose: wxMiniFrame class. A small frame for e.g. floating toolbars. // If there is no equivalent on your platform, just make it a // normal frame. // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MINIFRAM_H_ #define _WX_MINIFRAM_H_ #include "wx/frame.h" class WXDLLIMPEXP_CORE wxMiniFrame: public wxFrame { wxDECLARE_DYNAMIC_CLASS(wxMiniFrame); public: inline wxMiniFrame() {} inline wxMiniFrame(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION, const wxString& name = wxFrameNameStr) { // Use wxFrame constructor in absence of more specific code. Create(parent, id, title, pos, size, style, name); } virtual ~wxMiniFrame() {} protected: }; #endif // _WX_MINIFRAM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/pen.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/pen.h // Purpose: wxPen class // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PEN_H_ #define _WX_PEN_H_ #include "wx/gdicmn.h" #include "wx/gdiobj.h" //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxPen; class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_FWD_CORE wxBitmap; typedef char wxX11Dash; //----------------------------------------------------------------------------- // wxPen //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPen: public wxPenBase { public: wxPen() { } wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); wxPen( const wxBitmap &stipple, int width ); wxPen( const wxPenInfo& info ); virtual ~wxPen(); bool operator == ( const wxPen& pen ) const; bool operator != (const wxPen& pen) const { return !(*this == pen); } void SetColour( const wxColour &colour ); void SetColour( unsigned char red, unsigned char green, unsigned char blue ); void SetCap( wxPenCap capStyle ); void SetJoin( wxPenJoin joinStyle ); void SetStyle( wxPenStyle style ); void SetWidth( int width ); void SetDashes( int number_of_dashes, const wxDash *dash ); void SetStipple( const wxBitmap& stipple ); wxColour GetColour() const; wxPenCap GetCap() const; wxPenJoin GetJoin() const; wxPenStyle GetStyle() const; int GetWidth() const; int GetDashes(wxDash **ptr) const; int GetDashCount() const; wxDash* GetDash() const; wxBitmap* GetStipple() const; wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") wxPen(const wxColour& col, int width, int style); wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxPenStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; wxDECLARE_DYNAMIC_CLASS(wxPen); }; #endif // _WX_PEN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/dataobj2.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/x11/dataobj2.h // Purpose: declaration of standard wxDataObjectSimple-derived classes // Author: Robert Roebling // Created: 19.10.99 (extracted from gtk/dataobj.h) // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_X11_DATAOBJ2_H_ #define _WX_X11_DATAOBJ2_H_ // ---------------------------------------------------------------------------- // wxBitmapDataObject is a specialization of wxDataObject for bitmaps // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase { public: // ctors wxBitmapDataObject(); wxBitmapDataObject(const wxBitmap& bitmap); // destr virtual ~wxBitmapDataObject(); // override base class virtual to update PNG data too virtual void SetBitmap(const wxBitmap& bitmap); // implement base class pure virtuals // ---------------------------------- virtual size_t GetDataSize() const { return m_pngSize; } virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); // Must provide overloads to avoid hiding them (and warnings about it) virtual size_t GetDataSize(const wxDataFormat&) const { return GetDataSize(); } virtual bool GetDataHere(const wxDataFormat&, void *buf) const { return GetDataHere(buf); } virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) { return SetData(len, buf); } protected: void Init() { m_pngData = NULL; m_pngSize = 0; } void Clear() { free(m_pngData); } void ClearAll() { Clear(); Init(); } size_t m_pngSize; void *m_pngData; void DoConvertToPng(); }; // ---------------------------------------------------------------------------- // wxFileDataObject is a specialization of wxDataObject for file names // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase { public: // implement base class pure virtuals // ---------------------------------- void AddFile( const wxString &filename ); virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); // Must provide overloads to avoid hiding them (and warnings about it) virtual size_t GetDataSize(const wxDataFormat&) const { return GetDataSize(); } virtual bool GetDataHere(const wxDataFormat&, void *buf) const { return GetDataHere(buf); } virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) { return SetData(len, buf); } }; #endif // _WX_X11_DATAOBJ2_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/cursor.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/cursor.h // Purpose: wxCursor class // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CURSOR_H_ #define _WX_CURSOR_H_ #include "wx/colour.h" class WXDLLIMPEXP_FWD_CORE wxImage; //----------------------------------------------------------------------------- // wxCursor //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor(); wxCursor(wxStockCursor id) { InitFromStock(id); } #if WXWIN_COMPATIBILITY_2_8 wxCursor(int id) { InitFromStock((wxStockCursor)id); } #endif #if wxUSE_IMAGE wxCursor( const wxImage & image ); #endif wxCursor(const wxString& name, wxBitmapType type = wxCURSOR_DEFAULT_TYPE, int hotSpotX = 0, int hotSpotY = 0); virtual ~wxCursor(); // implementation WXCursor GetCursor() const; protected: void InitFromStock(wxStockCursor); virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; private: wxDECLARE_DYNAMIC_CLASS(wxCursor); }; #endif // _WX_CURSOR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/dnd.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/x11/dnd.h // Purpose: declaration of wxDropTarget, wxDropSource classes // Author: Julian Smart // Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling, Julian Smart // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DND_H_ #define _WX_DND_H_ #include "wx/defs.h" #if wxUSE_DRAG_AND_DROP #include "wx/object.h" #include "wx/string.h" #include "wx/dataobj.h" #include "wx/cursor.h" //------------------------------------------------------------------------- // classes //------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxDropTarget; class WXDLLIMPEXP_FWD_CORE wxTextDropTarget; class WXDLLIMPEXP_FWD_CORE wxFileDropTarget; class WXDLLIMPEXP_FWD_CORE wxPrivateDropTarget; class WXDLLIMPEXP_FWD_CORE wxDropSource; //------------------------------------------------------------------------- // wxDropTarget //------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDropTarget: public wxObject { public: wxDropTarget(); virtual ~wxDropTarget(); virtual void OnEnter() { } virtual void OnLeave() { } virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0; // Override these to indicate what kind of data you support: virtual size_t GetFormatCount() const = 0; virtual wxDataFormat GetFormat(size_t n) const = 0; // implementation }; //------------------------------------------------------------------------- // wxTextDropTarget //------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextDropTarget: public wxDropTarget { public: wxTextDropTarget() {} virtual bool OnDrop( long x, long y, const void *data, size_t size ); virtual bool OnDropText( long x, long y, const char *psz ); protected: virtual size_t GetFormatCount() const; virtual wxDataFormat GetFormat(size_t n) const; }; //------------------------------------------------------------------------- // wxPrivateDropTarget //------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrivateDropTarget: public wxDropTarget { public: wxPrivateDropTarget(); // you have to override OnDrop to get at the data // the string ID identifies the format of clipboard or DnD data. a word // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject // to the clipboard - the latter with the Id "WXWORD_FORMAT". void SetId( const wxString& id ) { m_id = id; } wxString GetId() { return m_id; } private: virtual size_t GetFormatCount() const; virtual wxDataFormat GetFormat(size_t n) const; wxString m_id; }; // ---------------------------------------------------------------------------- // A drop target which accepts files (dragged from File Manager or Explorer) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFileDropTarget: public wxDropTarget { public: wxFileDropTarget() {} virtual bool OnDrop( long x, long y, const void *data, size_t size ); virtual bool OnDropFiles( long x, long y, size_t nFiles, const char * const aszFiles[] ); protected: virtual size_t GetFormatCount() const; virtual wxDataFormat GetFormat(size_t n) const; }; //------------------------------------------------------------------------- // wxDropSource //------------------------------------------------------------------------- enum wxDragResult { wxDragError, // error prevented the d&d operation from completing wxDragNone, // drag target didn't accept the data wxDragCopy, // the data was successfully copied wxDragMove, // the data was successfully moved wxDragCancel // the operation was cancelled by user (not an error) }; class WXDLLIMPEXP_CORE wxDropSource: public wxObject { public: wxDropSource( wxWindow *win ); wxDropSource( wxDataObject &data, wxWindow *win ); virtual ~wxDropSource(void); void SetData( wxDataObject &data ); wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; } // implementation #if 0 void RegisterWindow(void); void UnregisterWindow(void); wxWindow *m_window; wxDragResult m_retValue; wxDataObject *m_data; wxCursor m_defaultCursor; wxCursor m_goaheadCursor; #endif }; #endif // wxUSE_DRAG_AND_DROP #endif //_WX_DND_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/popupwin.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/popupwin.h // Purpose: // Author: Robert Roebling // Created: // Copyright: (c) 2001 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GTKPOPUPWINH__ #define __GTKPOPUPWINH__ #include "wx/defs.h" #include "wx/panel.h" #include "wx/icon.h" //----------------------------------------------------------------------------- // wxPopUpWindow //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPopupWindow: public wxPopupWindowBase { public: wxPopupWindow() { } virtual ~wxPopupWindow() ; wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE) { (void)Create(parent, flags); } bool Create(wxWindow *parent, int flags = wxBORDER_NONE); virtual bool Show( bool show = TRUE ); protected: virtual void DoMoveWindow(int x, int y, int width, int height); virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); private: wxDECLARE_EVENT_TABLE(); wxDECLARE_DYNAMIC_CLASS(wxPopupWindow); }; #endif // __GTKPOPUPWINDOWH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/dataform.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/x11/dataform.h // Purpose: declaration of the wxDataFormat class // Author: Robert Roebling // Modified by: // Created: 19.10.99 (extracted from motif/dataobj.h) // Copyright: (c) 1999 Robert Roebling // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_X11_DATAFORM_H #define _WX_X11_DATAFORM_H class WXDLLIMPEXP_CORE wxDataFormat { public: // the clipboard formats under Xt are Atoms typedef Atom NativeFormat; wxDataFormat(); wxDataFormat( wxDataFormatId type ); wxDataFormat( const wxString &id ); wxDataFormat( NativeFormat format ); wxDataFormat& operator=(NativeFormat format) { SetId(format); return *this; } // comparison (must have both versions) bool operator==(NativeFormat format) const { return m_format == (NativeFormat)format; } bool operator!=(NativeFormat format) const { return m_format != (NativeFormat)format; } bool operator==(wxDataFormatId format) const { return m_type == (wxDataFormatId)format; } bool operator!=(wxDataFormatId format) const { return m_type != (wxDataFormatId)format; } // explicit and implicit conversions to NativeFormat which is one of // standard data types (implicit conversion is useful for preserving the // compatibility with old code) NativeFormat GetFormatId() const { return m_format; } operator NativeFormat() const { return m_format; } void SetId( NativeFormat format ); // string ids are used for custom types - this SetId() must be used for // application-specific formats wxString GetId() const; void SetId( const wxString& id ); // implementation wxDataFormatId GetType() const; private: wxDataFormatId m_type; NativeFormat m_format; void PrepareFormats(); void SetType( wxDataFormatId type ); }; #endif // _WX_X11_DATAFORM_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/joystick.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/joystick.h // Purpose: wxJoystick class // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_JOYSTICK_H_ #define _WX_JOYSTICK_H_ #include "wx/event.h" class WXDLLIMPEXP_ADV wxJoystick: public wxObject { wxDECLARE_DYNAMIC_CLASS(wxJoystick); public: /* * Public interface */ wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; } // Attributes //////////////////////////////////////////////////////////////////////////// wxPoint GetPosition() const; int GetZPosition() const; int GetButtonState() const; int GetPOVPosition() const; int GetPOVCTSPosition() const; int GetRudderPosition() const; int GetUPosition() const; int GetVPosition() const; int GetMovementThreshold() const; void SetMovementThreshold(int threshold) ; // Capabilities //////////////////////////////////////////////////////////////////////////// bool IsOk() const; // Checks that the joystick is functioning static int GetNumberJoysticks() ; int GetManufacturerId() const ; int GetProductId() const ; wxString GetProductName() const ; int GetXMin() const; int GetYMin() const; int GetZMin() const; int GetXMax() const; int GetYMax() const; int GetZMax() const; int GetNumberButtons() const; int GetNumberAxes() const; int GetMaxButtons() const; int GetMaxAxes() const; int GetPollingMin() const; int GetPollingMax() const; int GetRudderMin() const; int GetRudderMax() const; int GetUMin() const; int GetUMax() const; int GetVMin() const; int GetVMax() const; bool HasRudder() const; bool HasZ() const; bool HasU() const; bool HasV() const; bool HasPOV() const; bool HasPOV4Dir() const; bool HasPOVCTS() const; // Operations //////////////////////////////////////////////////////////////////////////// // pollingFreq = 0 means that movement events are sent when above the threshold. // If pollingFreq > 0, events are received every this many milliseconds. bool SetCapture(wxWindow* win, int pollingFreq = 0); bool ReleaseCapture(); protected: int m_joystick; }; #endif // _WX_JOYSTICK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/brush.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/brush.h // Purpose: wxBrush class // Author: Julian Smart, Robert Roebling // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart, Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_BRUSH_H_ #define _WX_BRUSH_H_ #include "wx/gdiobj.h" //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxBrush; class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_FWD_CORE wxBitmap; //----------------------------------------------------------------------------- // wxBrush //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase { public: wxBrush() { } wxBrush( const wxColour &colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID ); wxBrush( const wxBitmap &stippleBitmap ); virtual ~wxBrush(); bool operator==(const wxBrush& brush) const; bool operator!=(const wxBrush& brush) const { return !(*this == brush); } wxBrushStyle GetStyle() const; wxColour GetColour() const; wxBitmap *GetStipple() const; void SetColour( const wxColour& col ); void SetColour( unsigned char r, unsigned char g, unsigned char b ); void SetStyle( wxBrushStyle style ); void SetStipple( const wxBitmap& stipple ); wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") wxBrush(const wxColour& col, int style); wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxBrushStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; wxDECLARE_DYNAMIC_CLASS(wxBrush); }; #endif // _WX_BRUSH_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/clipbrd.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/clipbrd.h // Purpose: Clipboard functionality. // Author: Robert Roebling // Created: 17/09/98 // Copyright: (c) Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_X11_CLIPBRD_H_ #define _WX_X11_CLIPBRD_H_ #if wxUSE_CLIPBOARD #include "wx/object.h" #include "wx/list.h" #include "wx/dataobj.h" #include "wx/control.h" #include "wx/module.h" // ---------------------------------------------------------------------------- // wxClipboard // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase { public: wxClipboard(); virtual ~wxClipboard(); // open the clipboard before SetData() and GetData() virtual bool Open(); // close the clipboard after SetData() and GetData() virtual void Close(); // query whether the clipboard is opened virtual bool IsOpened() const; // set the clipboard data. all other formats will be deleted. virtual bool SetData( wxDataObject *data ); // add to the clipboard data. virtual bool AddData( wxDataObject *data ); // ask if data in correct format is available virtual bool IsSupported( const wxDataFormat& format ); // fill data with data on the clipboard (if available) virtual bool GetData( wxDataObject& data ); // clears wxTheClipboard and the system's clipboard if possible virtual void Clear(); // implementation from now on bool m_open; bool m_ownsClipboard; bool m_ownsPrimarySelection; wxDataObject *m_data; WXWindow m_clipboardWidget; /* for getting and offering data */ WXWindow m_targetsWidget; /* for getting list of supported formats */ bool m_waiting; /* querying data or formats is asynchronous */ bool m_formatSupported; Atom m_targetRequested; wxDataObject *m_receivedData; private: wxDECLARE_DYNAMIC_CLASS(wxClipboard); }; #endif // wxUSE_CLIPBOARD #endif // _WX_X11_CLIPBRD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/dcscreen.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/dcscreen.h // Purpose: wxScreenDC class // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DCSCREEN_H_ #define _WX_DCSCREEN_H_ #include "wx/dcclient.h" #include "wx/x11/dcclient.h" //----------------------------------------------------------------------------- // wxScreenDC //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxPaintDCImpl { public: wxScreenDCImpl( wxDC *owner); virtual ~wxScreenDCImpl(); protected: virtual void DoGetSize(int *width, int *height) const; private: wxDECLARE_CLASS(wxScreenDCImpl); }; #endif // _WX_DCSCREEN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/glcanvas.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/glcanvas.h // Purpose: wxGLCanvas, for using OpenGL with wxWidgets 2.0 for Motif. // Uses the GLX extension. // Author: Julian Smart and Wolfram Gloger // Modified by: // Created: 1995, 1999 // Copyright: (c) Julian Smart, Wolfram Gloger // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GLCANVAS_H_ #define _WX_GLCANVAS_H_ #include "wx/unix/glx11.h" class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasX11 { public: wxGLCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); explicit // avoid implicitly converting a wxWindow* to wxGLCanvas wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); bool Create(wxWindow *parent, const wxGLAttributes& dispAttrs, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxGLCanvasName, const int *attribList = NULL, const wxPalette& palette = wxNullPalette); // implement wxGLCanvasX11 methods // -------------------------------- virtual Window GetXWindow() const; protected: virtual int GetColourIndex(const wxColour& col); wxDECLARE_CLASS(wxGLCanvas); }; #endif // _WX_GLCANVAS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/window.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/window.h // Purpose: wxWindow class // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WINDOW_H_ #define _WX_WINDOW_H_ #include "wx/region.h" // ---------------------------------------------------------------------------- // wxWindow class for Motif - see also wxWindowBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxWindowX11 : public wxWindowBase { friend class WXDLLIMPEXP_FWD_CORE wxDC; friend class WXDLLIMPEXP_FWD_CORE wxWindowDC; public: wxWindowX11() { Init(); } wxWindowX11(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) { Init(); Create(parent, id, pos, size, style, name); } virtual ~wxWindowX11(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr); virtual void Raise(); virtual void Lower(); // SetLabel(), which does nothing in wxWindow virtual void SetLabel(const wxString& label) wxOVERRIDE { m_Label = label; } virtual wxString GetLabel() const wxOVERRIDE { return m_Label; } virtual bool Show( bool show = true ); virtual bool Enable( bool enable = true ); virtual void SetFocus(); virtual void WarpPointer(int x, int y); virtual void Refresh( bool eraseBackground = true, const wxRect *rect = (const wxRect *) NULL ); virtual void Update(); virtual bool SetBackgroundColour( const wxColour &colour ); virtual bool SetForegroundColour( const wxColour &colour ); virtual bool SetCursor( const wxCursor &cursor ); virtual bool SetFont( const wxFont &font ); virtual int GetCharHeight() const; virtual int GetCharWidth() const; virtual void ScrollWindow( int dx, int dy, const wxRect* rect = NULL ); #if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ); #endif // wxUSE_DRAG_AND_DROP // Accept files for dragging virtual void DragAcceptFiles(bool accept); // Get the unique identifier of a window virtual WXWindow GetHandle() const { return X11GetMainWindow(); } // implementation from now on // -------------------------- // accessors // --------- // Get main X11 window virtual WXWindow X11GetMainWindow() const; // Get X11 window representing the client area virtual WXWindow GetClientAreaWindow() const; void SetLastClick(int button, long timestamp) { m_lastButton = button; m_lastTS = timestamp; } int GetLastClickedButton() const { return m_lastButton; } long GetLastClickTime() const { return m_lastTS; } // Gives window a chance to do something in response to a size message, e.g. // arrange status bar, toolbar etc. virtual bool PreResize(); // Generates paint events from m_updateRegion void SendPaintEvents(); // Generates paint events from flag void SendNcPaintEvents(); // Generates erase events from m_clearRegion void SendEraseEvents(); // Clip to paint region? bool GetClipPaintRegion() { return m_clipPaintRegion; } // Return clear region wxRegion &GetClearRegion() { return m_clearRegion; } void NeedUpdateNcAreaInIdle( bool update = true ) { m_updateNcArea = update; } // Inserting into main window instead of client // window. This is mostly for a wxWindow's own // scrollbars. void SetInsertIntoMain( bool insert = true ) { m_insertIntoMain = insert; } bool GetInsertIntoMain() { return m_insertIntoMain; } // sets the fore/background colour for the given widget static void DoChangeForegroundColour(WXWindow widget, wxColour& foregroundColour); static void DoChangeBackgroundColour(WXWindow widget, wxColour& backgroundColour, bool changeArmColour = false); // I don't want users to override what's done in idle so everything that // has to be done in idle time in order for wxX11 to work is done in // OnInternalIdle virtual void OnInternalIdle(); protected: // Responds to colour changes: passes event on to children. void OnSysColourChanged(wxSysColourChangedEvent& event); // For double-click detection long m_lastTS; // last timestamp int m_lastButton; // last pressed button protected: WXWindow m_mainWindow; WXWindow m_clientWindow; bool m_insertIntoMain; bool m_winCaptured; wxRegion m_clearRegion; bool m_clipPaintRegion; bool m_updateNcArea; bool m_needsInputFocus; // Input focus set in OnIdle // implement the base class pure virtuals virtual void DoGetTextExtent(const wxString& string, int *x, int *y, int *descent = NULL, int *externalLeading = NULL, const wxFont *font = NULL) const; virtual void DoClientToScreen( int *x, int *y ) const; virtual void DoScreenToClient( int *x, int *y ) const; virtual void DoGetPosition( int *x, int *y ) const; virtual void DoGetSize( int *width, int *height ) const; virtual void DoGetClientSize( int *width, int *height ) const; virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); virtual void DoSetClientSize(int width, int height); virtual void DoMoveWindow(int x, int y, int width, int height); virtual void DoSetSizeHints(int minW, int minH, int maxW, int maxH, int incW, int incH); virtual void DoCaptureMouse(); virtual void DoReleaseMouse(); virtual void KillFocus(); #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ); #endif // wxUSE_TOOLTIPS private: // common part of all ctors void Init(); wxString m_Label; wxDECLARE_DYNAMIC_CLASS(wxWindowX11); wxDECLARE_NO_COPY_CLASS(wxWindowX11); wxDECLARE_EVENT_TABLE(); }; // ---------------------------------------------------------------------------- // A little class to switch off `size optimization' while an instance of the // object exists: this may be useful to temporarily disable the optimisation // which consists to do nothing when the new size is equal to the old size - // although quite useful usually to avoid flicker, sometimes it leads to // undesired effects. // // Usage: create an instance of this class on the stack to disable the size // optimisation, it will be reenabled as soon as the object goes out from scope. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxNoOptimize { public: wxNoOptimize() { ms_count++; } ~wxNoOptimize() { ms_count--; } static bool CanOptimize() { return ms_count == 0; } protected: static int ms_count; }; #endif // _WX_WINDOW_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/dc.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/dc.h // Purpose: wxDC class // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DC_H_ #define _WX_DC_H_ #include "wx/pen.h" #include "wx/brush.h" #include "wx/icon.h" #include "wx/font.h" #include "wx/gdicmn.h" //----------------------------------------------------------------------------- // wxDC //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxX11DCImpl : public wxDCImpl { public: wxX11DCImpl( wxDC *owner ); virtual ~wxX11DCImpl() { } virtual wxSize GetPPI() const; protected: virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); virtual void DoGetSizeMM(int* width, int* height) const; // implementation wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); } wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); } wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); } wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); } wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); } wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); } wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); } wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); } private: wxDECLARE_CLASS(wxX11DCImpl); }; #endif // _WX_DC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/print.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/print.h // Purpose: wxPrinter, wxPrintPreview classes // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PRINT_H_ #define _WX_PRINT_H_ #include "wx/prntbase.h" /* * Represents the printer: manages printing a wxPrintout object */ class WXDLLIMPEXP_CORE wxPrinter: public wxPrinterBase { wxDECLARE_DYNAMIC_CLASS(wxPrinter); public: wxPrinter(wxPrintData *data = NULL); virtual ~wxPrinter(); virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE); virtual bool PrintDialog(wxWindow *parent); virtual bool Setup(wxWindow *parent); }; /* * wxPrintPreview * Programmer creates an object of this class to preview a wxPrintout. */ class WXDLLIMPEXP_CORE wxPrintPreview: public wxPrintPreviewBase { wxDECLARE_CLASS(wxPrintPreview); public: wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL); virtual ~wxPrintPreview(); virtual bool Print(bool interactive); virtual void DetermineScaling(); }; #endif // _WX_PRINT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/dataobj.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/x11/dataobj.h // Purpose: declaration of the wxDataObject class for Motif // Author: Julian Smart // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_X11_DATAOBJ_H_ #define _WX_X11_DATAOBJ_H_ // ---------------------------------------------------------------------------- // wxDataObject is the same as wxDataObjectBase under wxMotif // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase { public: wxDataObject(); #ifdef __DARWIN__ virtual ~wxDataObject() { } #endif virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const; }; #endif //_WX_X11_DATAOBJ_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/privx.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/privx.h // Purpose: Private declarations common to X11 and Motif ports // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PRIVX_H_ #define _WX_PRIVX_H_ #include "wx/defs.h" #include "wx/utils.h" #include "wx/colour.h" #if defined( __cplusplus ) && defined( __VMS ) #pragma message disable nosimpint #endif #include "X11/Xlib.h" #include "X11/Xatom.h" #include "X11/Xutil.h" #if defined( __cplusplus ) && defined( __VMS ) #pragma message enable nosimpint #endif class WXDLLIMPEXP_FWD_CORE wxMouseEvent; class WXDLLIMPEXP_FWD_CORE wxKeyEvent; class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxRegion; // ---------------------------------------------------------------------------- // key events related functions // ---------------------------------------------------------------------------- WXPixel wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap); Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap ); extern XColor g_itemColors[]; extern int wxComputeColours (Display *display, const wxColour * back, const wxColour * fore); // For convenience inline Display* wxGlobalDisplay() { return (Display*) wxGetDisplay(); } #define wxMAX_RGB 0xff #define wxMAX_SV 1000 #define wxSIGN(x) ((x < 0) ? -x : x) #define wxH_WEIGHT 4 #define wxS_WEIGHT 1 #define wxV_WEIGHT 2 typedef struct wx_hsv { int h,s,v; } wxHSV; #define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z)) #define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z)) void wxHSVToXColor(wxHSV *hsv,XColor *xcolor); void wxXColorToHSV(wxHSV *hsv,XColor *xcolor); void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor); void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor); // For debugging wxString wxGetXEventName(XEvent& event); #if wxUSE_NANOX #define XEventGetWindow(event) event->general.wid #define XEventGetType(event) event->general.type #define XConfigureEventGetX(event) ((int) event->update.x) #define XConfigureEventGetY(event) ((int) event->update.y) #define XConfigureEventGetWidth(event) ((int) event->update.width) #define XConfigureEventGetHeight(event) ((int) event->update.height) #define XExposeEventGetX(event) event->exposure.x #define XExposeEventGetY(event) event->exposure.y #define XExposeEventGetWidth(event) event->exposure.width #define XExposeEventGetHeight(event) event->exposure.height #define XButtonEventGetTime(event) (wxGetLocalTime()) #define XButtonEventLChanged(event) (event->button.changebuttons & GR_BUTTON_L) #define XButtonEventMChanged(event) (event->button.changebuttons & GR_BUTTON_M) #define XButtonEventRChanged(event) (event->button.changebuttons & GR_BUTTON_R) #define XButtonEventLIsDown(x) ((x)->button.buttons & GR_BUTTON_L) #define XButtonEventMIsDown(x) ((x)->button.buttons & GR_BUTTON_M) #define XButtonEventRIsDown(x) ((x)->button.buttons & GR_BUTTON_R) #define XButtonEventShiftIsDown(x) (x->button.modifiers & MWKMOD_SHIFT) #define XButtonEventCtrlIsDown(x) (x->button.modifiers & MWKMOD_CTRL) #define XButtonEventAltIsDown(x) (x->button.modifiers & MWKMOD_ALT) #define XButtonEventMetaIsDown(x) (x->button.modifiers & MWKMOD_META) #define XButtonEventGetX(event) (event->button.x) #define XButtonEventGetY(event) (event->button.y) #define XKeyEventGetTime(event) (wxGetLocalTime()) #define XKeyEventGetX(event) (event->keystroke.x) #define XKeyEventGetY(event) (event->keystroke.y) #define XKeyEventShiftIsDown(x) (x->keystroke.modifiers & MWKMOD_SHIFT) #define XKeyEventCtrlIsDown(x) (x->keystroke.modifiers & MWKMOD_CTRL) #define XKeyEventAltIsDown(x) (x->keystroke.modifiers & MWKMOD_ALT) #define XKeyEventMetaIsDown(x) (x->keystroke.modifiers & MWKMOD_META) #define XFontStructGetAscent(f) f->info.baseline #else #define XEventGetWindow(event) event->xany.window #define XEventGetType(event) event->xany.type #define XConfigureEventGetX(event) event->xconfigure.x #define XConfigureEventGetY(event) event->xconfigure.y #define XConfigureEventGetWidth(event) event->xconfigure.width #define XConfigureEventGetHeight(event) event->xconfigure.height #define XExposeEventGetX(event) event->xexpose.x #define XExposeEventGetY(event) event->xexpose.y #define XExposeEventGetWidth(event) event->xexpose.width #define XExposeEventGetHeight(event) event->xexpose.height #define XButtonEventGetTime(event) (event->xbutton.time) #define XButtonEventLChanged(event) (event->xbutton.button == Button1) #define XButtonEventMChanged(event) (event->xbutton.button == Button2) #define XButtonEventRChanged(event) (event->xbutton.button == Button3) #define XButtonEventLIsDown(x) ((x)->xbutton.state & Button1Mask) #define XButtonEventMIsDown(x) ((x)->xbutton.state & Button2Mask) #define XButtonEventRIsDown(x) ((x)->xbutton.state & Button3Mask) #define XButtonEventShiftIsDown(x) (x->xbutton.state & ShiftMask) #define XButtonEventCtrlIsDown(x) (x->xbutton.state & ControlMask) #define XButtonEventAltIsDown(x) (x->xbutton.state & Mod3Mask) #define XButtonEventMetaIsDown(x) (x->xbutton.state & Mod1Mask) #define XButtonEventGetX(event) (event->xbutton.x) #define XButtonEventGetY(event) (event->xbutton.y) #define XKeyEventGetTime(event) (event->xkey.time) #define XKeyEventShiftIsDown(x) (x->xkey.state & ShiftMask) #define XKeyEventCtrlIsDown(x) (x->xkey.state & ControlMask) #define XKeyEventAltIsDown(x) (x->xkey.state & Mod3Mask) #define XKeyEventMetaIsDown(x) (x->xkey.state & Mod1Mask) #define XKeyEventGetX(event) (event->xkey.x) #define XKeyEventGetY(event) (event->xkey.y) #define XFontStructGetAscent(f) f->ascent #endif // ---------------------------------------------------------------------------- // Misc functions // ---------------------------------------------------------------------------- bool wxDoSetShape( Display* xdisplay, Window xwindow, const wxRegion& region ); class WXDLLIMPEXP_CORE wxXVisualInfo { public: wxXVisualInfo(); ~wxXVisualInfo(); void Init( Display* dpy, XVisualInfo* visualInfo ); int m_visualType; // TrueColor, DirectColor etc. int m_visualDepth; int m_visualColormapSize; void *m_visualColormap; int m_visualScreen; unsigned long m_visualRedMask; unsigned long m_visualGreenMask; unsigned long m_visualBlueMask; int m_visualRedShift; int m_visualGreenShift; int m_visualBlueShift; int m_visualRedPrec; int m_visualGreenPrec; int m_visualBluePrec; unsigned char *m_colorCube; }; bool wxFillXVisualInfo( wxXVisualInfo* vi, Display* dpy ); #endif // _WX_PRIVX_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/chkconf.h
/* * Name: wx/x11/chkconf.h * Purpose: Compiler-specific configuration checking * Author: Julian Smart * Modified by: * Created: 01/02/97 * Copyright: (c) Julian Smart * Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ #ifndef _WX_X11_CHKCONF_H_ #define _WX_X11_CHKCONF_H_ /* wxPalette is always needed */ #if !wxUSE_PALETTE # error "wxX11 requires wxUSE_PALETTE=1" #endif #if wxUSE_SOCKETS && !wxUSE_SELECT_DISPATCHER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxSocket requires wxSelectDispatcher in wxX11" # else # undef wxUSE_SELECT_DISPATCHER # define wxUSE_SELECT_DISPATCHER 1 # endif #endif #endif /* _WX_X11_CHKCONF_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/dcprint.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/dcprint.h // Purpose: wxPrinterDC class // Author: Julian Smart // Modified by: // Created: 17/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DCPRINT_H_ #define _WX_DCPRINT_H_ #include "wx/dc.h" class WXDLLIMPEXP_CORE wxPrinterDC: public wxDC { public: wxDECLARE_CLASS(wxPrinterDC); // Create a printer DC wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, wxPrintOrientation orientation = wxPORTRAIT); virtual ~wxPrinterDC(); }; #endif // _WX_DCPRINT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/textctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/x11/textctrl.h // Purpose: // Author: Robert Roebling // Created: 01/02/97 // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __X11TEXTCTRLH__ #define __X11TEXTCTRLH__ // Set to 1 to use wxUniv's implementation, 0 // to use wxX11's. #define wxUSE_UNIV_TEXTCTRL 1 #if wxUSE_UNIV_TEXTCTRL #include "wx/univ/textctrl.h" #else #include "wx/scrolwin.h" #include "wx/arrstr.h" //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxTextCtrl; //----------------------------------------------------------------------------- // helpers //----------------------------------------------------------------------------- enum wxSourceUndo { wxSOURCE_UNDO_LINE, wxSOURCE_UNDO_ENTER, wxSOURCE_UNDO_BACK, wxSOURCE_UNDO_INSERT_LINE, wxSOURCE_UNDO_DELETE, wxSOURCE_UNDO_PASTE }; class wxSourceUndoStep: public wxObject { public: wxSourceUndoStep( wxSourceUndo type, int y1, int y2, wxTextCtrl *owner ); void Undo(); wxSourceUndo m_type; int m_y1; int m_y2; int m_cursorX; int m_cursorY; wxTextCtrl *m_owner; wxString m_text; wxArrayString m_lines; }; class wxSourceLine { public: wxSourceLine( const wxString &text = wxEmptyString ) { m_text = text; } wxString m_text; }; WX_DECLARE_OBJARRAY(wxSourceLine, wxSourceLineArray); enum wxSourceLanguage { wxSOURCE_LANG_NONE, wxSOURCE_LANG_CPP, wxSOURCE_LANG_PERL, wxSOURCE_LANG_PYTHON }; //----------------------------------------------------------------------------- // wxTextCtrl //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextCtrl: public wxTextCtrlBase, public wxScrollHelper { public: wxTextCtrl() { Init(); } wxTextCtrl(wxWindow *parent, wxWindowID id, const wxString &value = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString &name = wxTextCtrlNameStr); virtual ~wxTextCtrl(); bool Create(wxWindow *parent, wxWindowID id, const wxString &value = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString &name = wxTextCtrlNameStr); // required for scrolling with wxScrollHelper // ------------------------------------------ virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } // implement base class pure virtuals // ---------------------------------- virtual void ChangeValue(const wxString &value); virtual int GetLineLength(long lineNo) const; virtual wxString GetLineText(long lineNo) const; virtual int GetNumberOfLines() const; virtual bool IsModified() const; virtual bool IsEditable() const; // more readable flag testing methods // ---------------------------------- bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; } bool WrapLines() const { return false; } // If the return values from and to are the same, there is no selection. virtual void GetSelection(long* from, long* to) const; // operations // ---------- // editing virtual void Clear(); virtual void Replace(long from, long to, const wxString& value); virtual void Remove(long from, long to); // clears the dirty flag virtual void DiscardEdits(); virtual void SetMaxLength(unsigned long len); // writing text inserts it at the current position, appending always // inserts it at the end virtual void WriteText(const wxString& text); virtual void AppendText(const wxString& text); // apply text attribute to the range of text (only works with richedit // controls) virtual bool SetStyle(long start, long end, const wxTextAttr& style); // translate between the position (which is just an index in the text ctrl // considering all its contents as a single strings) and (x, y) coordinates // which represent column and line. virtual long XYToPosition(long x, long y) const; virtual bool PositionToXY(long pos, long *x, long *y) const; virtual void ShowPosition(long pos); // Clipboard operations virtual void Copy(); virtual void Cut(); virtual void Paste(); // Undo/redo virtual void Undo(); virtual void Redo() {} virtual bool CanUndo() const { return (m_undos.GetCount() > 0); } virtual bool CanRedo() const { return false; } // Insertion point virtual void SetInsertionPoint(long pos); virtual void SetInsertionPointEnd(); virtual long GetInsertionPoint() const; virtual wxTextPos GetLastPosition() const; virtual void SetSelection(long from, long to); virtual void SetEditable(bool editable); virtual bool Enable( bool enable = true ); void OnCut(wxCommandEvent& event); void OnCopy(wxCommandEvent& event); void OnPaste(wxCommandEvent& event); void OnUndo(wxCommandEvent& event); void OnRedo(wxCommandEvent& event); void OnUpdateCut(wxUpdateUIEvent& event); void OnUpdateCopy(wxUpdateUIEvent& event); void OnUpdatePaste(wxUpdateUIEvent& event); void OnUpdateUndo(wxUpdateUIEvent& event); void OnUpdateRedo(wxUpdateUIEvent& event); bool SetFont(const wxFont& font); bool SetForegroundColour(const wxColour& colour); bool SetBackgroundColour(const wxColour& colour); void SetModified() { m_modified = true; } // textctrl specific scrolling virtual bool ScrollLines(int lines); virtual bool ScrollPages(int pages); // not part of the wxTextCtrl API from now on.. void SetLanguage( wxSourceLanguage lang = wxSOURCE_LANG_NONE ); void Delete(); void DeleteLine(); void Indent(); void Unindent(); bool HasSelection(); void ClearSelection(); int GetCursorX() { return m_cursorX; } int GetCursorY() { return m_cursorY; } bool IsModified() { return m_modified; } bool OverwriteMode() { return m_overwrite; } // implementation from now on... int PosToPixel( int line, int pos ); int PixelToPos( int line, int pixel ); void SearchForBrackets(); void DoChar( char c ); void DoBack(); void DoDelete(); void DoReturn(); void DoDClick(); wxString GetNextToken( wxString &line, size_t &pos ); void DrawLinePart( wxDC &dc, int x, int y, const wxString &toDraw, const wxString &origin, const wxColour &colour); void DrawLine( wxDC &dc, int x, int y, const wxString &line, int lineNum ); void OnPaint( wxPaintEvent &event ); void OnEraseBackground( wxEraseEvent &event ); void OnMouse( wxMouseEvent &event ); void OnChar( wxKeyEvent &event ); void OnSetFocus( wxFocusEvent& event ); void OnKillFocus( wxFocusEvent& event ); void OnInternalIdle(); void RefreshLine( int n ); void RefreshDown( int n ); void MoveCursor( int new_x, int new_y, bool shift = false, bool centre = false ); void MyAdjustScrollbars(); protected: // common part of all ctors void Init(); virtual wxSize DoGetBestSize() const; virtual void DoSetValue(const wxString& value, int flags = 0); friend class wxSourceUndoStep; wxSourceLineArray m_lines; wxFont m_sourceFont; wxColour m_sourceColour; wxColour m_commentColour; wxColour m_stringColour; int m_cursorX; int m_cursorY; int m_selStartX,m_selStartY; int m_selEndX,m_selEndY; int m_lineHeight; int m_charWidth; int m_longestLine; bool m_overwrite; bool m_modified; bool m_editable; bool m_ignoreInput; wxArrayString m_keywords; wxColour m_keywordColour; wxArrayString m_defines; wxColour m_defineColour; wxArrayString m_variables; wxColour m_variableColour; wxSourceLanguage m_lang; wxList m_undos; bool m_capturing; int m_bracketX; int m_bracketY; private: wxDECLARE_EVENT_TABLE(); wxDECLARE_DYNAMIC_CLASS(wxTextCtrl); }; //----------------------------------------------------------------------------- // this is superfluous here but helps to compile //----------------------------------------------------------------------------- // cursor movement and also selection and delete operations #define wxACTION_TEXT_GOTO wxT("goto") // to pos in numArg #define wxACTION_TEXT_FIRST wxT("first") // go to pos 0 #define wxACTION_TEXT_LAST wxT("last") // go to last pos #define wxACTION_TEXT_HOME wxT("home") #define wxACTION_TEXT_END wxT("end") #define wxACTION_TEXT_LEFT wxT("left") #define wxACTION_TEXT_RIGHT wxT("right") #define wxACTION_TEXT_UP wxT("up") #define wxACTION_TEXT_DOWN wxT("down") #define wxACTION_TEXT_WORD_LEFT wxT("wordleft") #define wxACTION_TEXT_WORD_RIGHT wxT("wordright") #define wxACTION_TEXT_PAGE_UP wxT("pageup") #define wxACTION_TEXT_PAGE_DOWN wxT("pagedown") // clipboard operations #define wxACTION_TEXT_COPY wxT("copy") #define wxACTION_TEXT_CUT wxT("cut") #define wxACTION_TEXT_PASTE wxT("paste") // insert text at the cursor position: the text is in strArg of PerformAction #define wxACTION_TEXT_INSERT wxT("insert") // if the action starts with either of these prefixes and the rest of the // string is one of the movement commands, it means to select/delete text from // the current cursor position to the new one #define wxACTION_TEXT_PREFIX_SEL wxT("sel") #define wxACTION_TEXT_PREFIX_DEL wxT("del") // mouse selection #define wxACTION_TEXT_ANCHOR_SEL wxT("anchorsel") #define wxACTION_TEXT_EXTEND_SEL wxT("extendsel") #define wxACTION_TEXT_SEL_WORD wxT("wordsel") #define wxACTION_TEXT_SEL_LINE wxT("linesel") // undo or redo #define wxACTION_TEXT_UNDO wxT("undo") #define wxACTION_TEXT_REDO wxT("redo") // ---------------------------------------------------------------------------- // wxTextCtrl types // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStdTextCtrlInputHandler : public wxStdInputHandler { public: wxStdTextCtrlInputHandler(wxInputHandler *inphand) : wxStdInputHandler(inphand) {} virtual bool HandleKey(wxInputConsumer *consumer, const wxKeyEvent& event, bool pressed) { return false; } virtual bool HandleMouse(wxInputConsumer *consumer, const wxMouseEvent& event) { return false; } virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event) { return false; } virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event) { return false; } protected: // get the position of the mouse click static wxTextPos HitTest(const wxTextCtrl *text, const wxPoint& pos) { return 0; } // capture data wxTextCtrl *m_winCapture; }; #endif // wxUSE_UNIV_TEXTCTRL #endif // __X11TEXTCTRLH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/nanox/X11/Xatom.h
/* * Xlib compatibility */ /* Nothing yet */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/nanox/X11/Xutil.h
/* * Xlib compatibility */ /* Nothing yet */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/nanox/X11/Xlib.h
/* * Xlib compatibility */ #ifndef _DUMMY_XLIBH_ #define _DUMMY_XLIBH_ /* Move away the typedef in XtoNX.h */ #define XFontStruct XFontStruct1 #include <XtoNX.h> #undef XFontStruct #undef XCharStruct /* Data types */ typedef GR_PALETTE* Colormap; typedef GR_DRAW_ID Drawable ; typedef int Status; typedef unsigned long VisualID; typedef int Bool; typedef long XID; typedef GR_SCANCODE KeySym; typedef GR_EVENT_KEYSTROKE XKeyEvent; typedef struct { GR_FONT_INFO info; GR_FONT_ID fid; } XFontStruct; typedef struct { short lbearing; /* origin to left edge of raster */ short rbearing; /* origin to right edge of raster */ short width; /* advance to next char's origin */ short ascent; /* baseline to top edge of raster */ short descent; /* baseline to bottom edge of raster */ unsigned short attributes; /* per char flags (not predefined) */ } XCharStruct; /* Configure window value mask bits */ #define CWX (1<<0) #define CWY (1<<1) #define CWWidth (1<<2) #define CWHeight (1<<3) #define CWBorderWidth (1<<4) #define CWSibling (1<<5) #define CWStackMode (1<<6) /* Values */ typedef struct { int x, y; int width, height; int border_width; Window sibling; int stack_mode; } XWindowChanges; /* typedef unsigned long Time; */ #define Success 0 #define GrabSuccess Success #define GrabNotViewable (Success+1) #define InputOutput 1 #define InputOnly 2 #define IsUnmapped 0 #define IsUnviewable 1 #define IsViewable 2 /* Is this right? */ #define PropertyChangeMask GR_EVENT_MASK_SELECTION_CHANGED #define GraphicsExpose GR_EVENT_TYPE_EXPOSURE #define GraphicsExposeMask GR_EVENT_MASK_EXPOSURE #define ColormapChangeMask 0 #define FillSolid 0 #define LineSolid 0 #define LineOnOffDash 0 #define CapNotLast 0 #define CapRound 0 #define CapProjecting 0 #define CapButt 0 #define JoinRound 0 #define JoinBevel 0 #define JoinMiter 0 #define IncludeInferiors 0 #define ClipByChildren 0 #define DoRed 0 #define DoGreen 0 #define DoBlue 0 #define NoEventMask GR_EVENT_MASK_NONE #define RevertToParent 0 #define CurrentTime 0 #define GrabModeAsync 0 #define GXcopy GR_MODE_COPY #define GXclear GR_MODE_CLEAR #ifndef GXxor #define GXxor GR_MODE_OR #endif #define GXinvert GR_MODE_INVERT #define GXorReverse GR_MODE_ORREVERSE #define GXandReverse GR_MODE_ANDREVERSE #define GXand GR_MODE_AND #define GXor GR_MODE_OR #define GXandInverted GR_MODE_ANDINVERTED #define GXnoop GR_MODE_NOOP #define GXnor GR_MODE_NOR #define GXequiv GR_MODE_EQUIV #define GXcopyInverted GR_MODE_COPYINVERTED #define GXorInverted GR_MODE_ORINVERTED #define GXnand GR_MODE_NAND #define GXset GR_MODE_SET #define XSynchronize(display,sync) #define XDefaultRootWindow(d) GR_ROOT_WINDOW_ID #define RootWindowOfScreen(s) GR_ROOT_WINDOW_ID #define XFreePixmap(d, p) GrDestroyWindow(p) #define XFreeCursor(d, c) GrDestroyCursor(c) #define XFreeGC(d, gc) GrDestroyGC(gc) #define XSetBackground(d, gc, c) GrSetGCBackground(gc, c) #define DefaultVisual(d, s) (NULL) #define DefaultColormap(d, s) DefaultColormapOfScreen(NULL) #define DefaultScreenOfDisplay(d) 0 #define XSetFillStyle(d, gc, s) wxNoop() #define XSetLineAttributes(d, gc, a, b, c, e) wxNoop() #define XSetClipMask(d, gc, m) wxNoop() #define XSetTSOrigin(d, gc, x, y) wxNoop() #define XFillArc(d, w, gc, x, y, rx, ry, a1, a2) GrArcAngle(w, gc, x, y, rx, ry, a1, a2, GR_PIE) #define XDrawArc(d, w, gc, x, y, rx, ry, a1, a2) GrArcAngle(w, gc, x, y, rx, ry, a1, a2, GR_ARC) #define XDrawPoint(d, w, gc, x, y) GrPoint(w, gc, x, y) #define XFillPolygon(d, w, gc, p, n, s, m) GrFillPoly(w, gc, n, p) #define XDrawRectangle(d, w, gc, x, y, width, height) GrRect(w, gc, x, y, width, height) #define XSetClipOrigin(d, gc, x, y) GrSetGCClipOrigin(gc, x, y) #define XSetRegion(d, gc, r) GrSetGCRegion(gc, r) #define XSetTile(d, gc, p) wxNoop() #define XSetStipple(d, gc, p) wxNoop() #define XSetSubwindowMode(d, gc, mode) wxNoop() #define XFreeColormap(d, cmap) wxNoop() #define XSetTransientForHint(d, w, p) wxNoop() #define XUnionRegion(sr1,sr2,r) GrUnionRegion(r,sr1,sr2) #define XIntersectRegion(sr1,sr2,r) GrIntersectRegion(r,sr1,sr2) #define XEqualRegion(r1, r2) GrEqualRegion(r1, r2) #define XEmptyRegion(r) GrEmptyRegion(r) #define XOffsetRegion(r, x, y) GrOffsetRegion(r, x, y) #define XClipBox(r, rect) GrGetRegionBox(r, rect) #define XPointInRegion(r, x, y) GrPointInRegion(r, x, y) #define XXorRegion(sr1, sr2, r) GrXorRegion(r, sr1, sr2) /* TODO: Cannot find equivalent for this. */ #define XIconifyWindow(d, w, s) 0 #define XCreateWindowWithColor(d,p,x,y,w,h,bw,depth,cl,vis,backColor,foreColor) \ GrNewWindow(p,x,y,w,h,bw,backColor,foreColor) #define XLookupString(event, buf, len, sym, status) (*sym = (event)->scancode) #define XBell(a, b) GrBell() #define DisplayWidthMM(d, s) 100 #define DisplayHeightMM(d, s) 100 /* These defines are wrongly defined in XtoNX.h, IMHO, * since they reference a static global. * Redefined as functions, below. */ #undef DisplayWidth #undef DisplayHeight #undef DefaultDepth /* * Data structure used by color operations */ typedef struct { unsigned long pixel; unsigned short red, green, blue; char flags; /* do_red, do_green, do_blue */ char pad; } XColor; typedef struct { int type; Display *display; /* Display the event was read from */ XID resourceid; /* resource id */ unsigned long serial; /* serial number of failed request */ unsigned char error_code; /* error code of failed request */ unsigned char request_code; /* Major op-code of failed request */ unsigned char minor_code; /* Minor op-code of failed request */ } XErrorEvent; /* * Visual structure; contains information about colormapping possible. */ typedef struct { void *ext_data; /* hook for extension to hang data */ VisualID visualid; /* visual id of this visual */ #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ class of screen (monochrome, etc.) */ #else int class; /* class of screen (monochrome, etc.) */ #endif unsigned long red_mask, green_mask, blue_mask; /* mask values */ int bits_per_rgb; /* log base 2 of distinct color values */ int map_entries; /* color map entries */ } Visual; /* * Depth structure; contains information for each possible depth. */ typedef struct { int depth; /* this depth (Z) of the depth */ int nvisuals; /* number of Visual types at this depth */ Visual *visuals; /* list of visuals possible at this depth */ } Depth; /* * Information about the screen. The contents of this structure are * implementation dependent. A Screen should be treated as opaque * by application code. */ struct _XDisplay; /* Forward declare before use for C++ */ typedef struct { void *ext_data; /* hook for extension to hang data */ struct _XDisplay *display;/* back pointer to display structure */ Window root; /* Root window id. */ int width, height; /* width and height of screen */ int mwidth, mheight; /* width and height of in millimeters */ int ndepths; /* number of depths possible */ Depth *depths; /* list of allowable depths on the screen */ int root_depth; /* bits per pixel */ Visual *root_visual; /* root visual */ GC default_gc; /* GC for the root root visual */ Colormap cmap; /* default color map */ unsigned long white_pixel; unsigned long black_pixel; /* White and Black pixel values */ int max_maps, min_maps; /* max and min color maps */ int backing_store; /* Never, WhenMapped, Always */ Bool save_unders; long root_input_mask; /* initial root input mask */ } Screen; typedef struct { int x, y; /* location of window */ int width, height; /* width and height of window */ int border_width; /* border width of window */ int depth; /* depth of window */ Visual *visual; /* the associated visual structure */ Window root; /* root of screen containing window */ int _class; /* InputOutput, InputOnly*/ int bit_gravity; /* one of the bit gravity values */ int win_gravity; /* one of the window gravity values */ int backing_store; /* NotUseful, WhenMapped, Always */ unsigned long backing_planes;/* planes to be preserved if possible */ unsigned long backing_pixel;/* value to be used when restoring planes */ Bool save_under; /* boolean, should bits under be saved? */ Colormap colormap; /* color map to be associated with window */ Bool map_installed; /* boolean, is color map currently installed*/ int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ long all_event_masks; /* set of events all people have interest in*/ long your_event_mask; /* my event mask */ long do_not_propagate_mask;/* set of events that should not propagate */ Bool override_redirect; /* boolean value for override-redirect */ Screen *screen; /* back pointer to correct screen */ } XWindowAttributes; typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ Display* /* display */, XErrorEvent* /* error_event */ ); /* events*/ /* What should this be? */ #if 0 #ifndef ResizeRequest #define ResizeRequest ?? #endif #endif #ifndef MotionNotify #define MotionNotify GR_EVENT_TYPE_MOUSE_POSITION #define PointerMotionMask GR_EVENT_MASK_MOUSE_POSITION #endif #define ButtonMotionMask GR_EVENT_MASK_MOUSE_POSITION #define KeymapStateMask 0 #define StructureNotifyMask GR_EVENT_MASK_UPDATE #ifdef ConfigureNotify /* XtoNX.h gets it wrong */ #undef ConfigureNotify #endif #define ConfigureNotify GR_EVENT_TYPE_UPDATE #ifndef FocusIn #define FocusIn GR_EVENT_TYPE_FOCUS_IN #define FocusOut GR_EVENT_TYPE_FOCUS_OUT #define FocusChangeMask GR_EVENT_MASK_FOCUS_IN|GR_EVENT_MASK_FOCUS_OUT #endif /* Fuunctions */ #ifdef __cplusplus extern "C" { #endif Display *XOpenDisplay(char *name); Colormap DefaultColormapOfScreen(Screen* /* screen */) ; int XSetGraphicsExposures( Display* /* display */, GC /* gc */, Bool /* graphics_exposures */) ; int XWarpPointer( Display* /* display */, Window /* srcW */, Window /* destW */, int /* srcX */, int /* srcY */, unsigned int /* srcWidth */, unsigned int /* srcHeight */, int destX, int destY); int XSetInputFocus(Display* /* display */, Window focus, int /* revert_to */, Time /* time */) ; int XGetInputFocus(Display* /* display */, Window* /* focus_return */, int* /* revert_to_return */) ; int XGrabPointer(Display* /* display */, Window /* grab_window */, Bool /* owner_events */, unsigned int /* event_mask */, int /* pointer_mode */, int /* keyboard_mode */, Window /* confine_to */, Cursor /* cursor */, Time /* time */) ; int XUngrabPointer(Display* /* display */, Time /* time */) ; int XCopyArea(Display* /* display */, Drawable src, Drawable dest, GC gc, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y) ; int XCopyPlane(Display* /* display */, Drawable src, Drawable dest, GC gc, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y, unsigned long /* plane */) ; XErrorHandler XSetErrorHandler (XErrorHandler /* handler */); Screen *XScreenOfDisplay(Display* /* display */, int /* screen_number */); int DisplayWidth(Display* /* display */, int /* screen */); int DisplayHeight(Display* /* display */, int /* screen */); int DefaultDepth(Display* /* display */, int /* screen */); int XAllocColor(Display* /* display */, Colormap /* cmap */, XColor* color); int XParseColor(Display* display, Colormap cmap, const char* cname, XColor* color); int XDrawLine(Display* display, Window win, GC gc, int x1, int y1, int x2, int y2); int XTextExtents( XFontStruct* font, char* s, int len, int* direction, int* ascent, int* descent2, XCharStruct* overall); int XPending(Display *d); XFontStruct* XLoadQueryFont(Display* display, const char* fontSpec); int XFreeFont(Display* display, XFontStruct* fontStruct); int XQueryColor(Display* display, Colormap cmap, XColor* color); Status XGetWindowAttributes(Display* display, Window w, XWindowAttributes* window_attributes); int XConfigureWindow(Display* display, Window w, int mask, XWindowChanges* changes); int XTranslateCoordinates(Display* display, Window srcWindow, Window destWindow, int srcX, int srcY, int* destX, int* destY, Window* childReturn); void wxNoop(); #ifdef __cplusplus } #endif #define XMaxRequestSize(display) 16384 #endif /* _DUMMY_XLIBH_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/x11/private/wrapxkb.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/x11/private/wrapxkb.h // Purpose: Private header wrapping X11/XKBlib.h inclusion. // Author: Vadim Zeitlin // Created: 2012-05-07 // Copyright: (c) 2012 Vadim Zeitlin <vadim@wxwidgets.org> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _X11_PRIVATE_WRAPXKB_H_ #define _X11_PRIVATE_WRAPXKB_H_ #ifdef HAVE_X11_XKBLIB_H /* under HP-UX and Solaris 2.6, at least, XKBlib.h defines structures with * field named "explicit" - which is, of course, an error for a C++ * compiler. To be on the safe side, just redefine it everywhere. */ #define explicit __wx_explicit #include <X11/XKBlib.h> #undef explicit #endif // HAVE_X11_XKBLIB_H #endif // _X11_PRIVATE_WRAPXKB_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/styleparams.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/styleparams.h // Purpose: wxHtml helper code for extracting style parameters // Author: Nigel Paton // Copyright: wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTML_STYLEPARAMS_H_ #define _WX_HTML_STYLEPARAMS_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/arrstr.h" class WXDLLIMPEXP_FWD_HTML wxHtmlTag; // This is a private class used by wxHTML to parse "style" attributes of HTML // elements. Currently both parsing and support for the parsed values is pretty // trivial. class WXDLLIMPEXP_HTML wxHtmlStyleParams { public: // Construct a style parameters object corresponding to the style attribute // of the given HTML tag. wxHtmlStyleParams(const wxHtmlTag& tag); // Check whether the named parameter is present or not. bool HasParam(const wxString& par) const { return m_names.Index(par, false /* ignore case */) != wxNOT_FOUND; } // Get the value of the named parameter, return empty string if none. wxString GetParam(const wxString& par) const { int index = m_names.Index(par, false); return index == wxNOT_FOUND ? wxString() : m_values[index]; } private: // Arrays if names and values of the parameters wxArrayString m_names, m_values; }; #endif // wxUSE_HTML #endif // _WX_HTML_STYLEPARAMS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/forcelnk.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/forcelnk.h // Purpose: macros which force the linker to link apparently unused code // Author: Vaclav Slavik // Copyright: (c) Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* DESCRPITON: mod_*.cpp files contain handlers for tags. These files are modules - they contain one wxTagModule class and it's OnInit() method is called from wxApp's init method. The module is called even if you only link it into the executable, so everything seems wonderful. The problem is that we have these modules in LIBRARY and mod_*.cpp files contain no method nor class which is known out of the module. So the linker won't link these .o/.obj files into executable because it detected that it is not used by the program. To workaround this I introduced set of macros FORCE_LINK_ME and FORCE_LINK. These macros are generic and are not limited to mod_*.cpp files. You may find them quite useful somewhere else... How to use them: let's suppose you want to always link file foo.cpp and that you have module always.cpp that is certainly always linked (e.g. the one with main() function or htmlwin.cpp in wxHtml library). Place FORCE_LINK_ME(foo) somewhere in foo.cpp and FORCE_LINK(foo) somewhere in always.cpp See mod_*.cpp and htmlwin.cpp for example :-) */ #ifndef _WX_FORCELNK_H_ #define _WX_FORCELNK_H_ #include "wx/link.h" // compatibility defines #define FORCE_LINK wxFORCE_LINK_MODULE #define FORCE_LINK_ME wxFORCE_LINK_THIS_MODULE #define FORCE_WXHTML_MODULES() \ FORCE_LINK(m_layout) \ FORCE_LINK(m_fonts) \ FORCE_LINK(m_image) \ FORCE_LINK(m_list) \ FORCE_LINK(m_dflist) \ FORCE_LINK(m_pre) \ FORCE_LINK(m_hline) \ FORCE_LINK(m_links) \ FORCE_LINK(m_tables) \ FORCE_LINK(m_span) \ FORCE_LINK(m_style) #endif // _WX_FORCELNK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmlfilt.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmlfilt.h // Purpose: filters // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMLFILT_H_ #define _WX_HTMLFILT_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/filesys.h" //-------------------------------------------------------------------------------- // wxHtmlFilter // This class is input filter. It can "translate" files // in non-HTML format to HTML format // interface to access certain // kinds of files (HTPP, FTP, local, tar.gz etc..) //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlFilter : public wxObject { wxDECLARE_ABSTRACT_CLASS(wxHtmlFilter); public: wxHtmlFilter() : wxObject() {} virtual ~wxHtmlFilter() {} // returns true if this filter is able to open&read given file virtual bool CanRead(const wxFSFile& file) const = 0; // Reads given file and returns HTML document. // Returns empty string if opening failed virtual wxString ReadFile(const wxFSFile& file) const = 0; }; //-------------------------------------------------------------------------------- // wxHtmlFilterPlainText // This filter is used as default filter if no other can // be used (= uknown type of file). It is used by // wxHtmlWindow itself. //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlFilterPlainText : public wxHtmlFilter { wxDECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText); public: virtual bool CanRead(const wxFSFile& file) const wxOVERRIDE; virtual wxString ReadFile(const wxFSFile& file) const wxOVERRIDE; }; //-------------------------------------------------------------------------------- // wxHtmlFilterHTML // filter for text/html //-------------------------------------------------------------------------------- class wxHtmlFilterHTML : public wxHtmlFilter { wxDECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML); public: virtual bool CanRead(const wxFSFile& file) const wxOVERRIDE; virtual wxString ReadFile(const wxFSFile& file) const wxOVERRIDE; }; #endif // wxUSE_HTML #endif // _WX_HTMLFILT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/winpars.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/winpars.h // Purpose: wxHtmlWinParser class (parser to be used with wxHtmlWindow) // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WINPARS_H_ #define _WX_WINPARS_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/module.h" #include "wx/font.h" #include "wx/html/htmlpars.h" #include "wx/html/htmlcell.h" #include "wx/encconv.h" class WXDLLIMPEXP_FWD_HTML wxHtmlWindow; class WXDLLIMPEXP_FWD_HTML wxHtmlWindowInterface; class WXDLLIMPEXP_FWD_HTML wxHtmlWinParser; class WXDLLIMPEXP_FWD_HTML wxHtmlWinTagHandler; class WXDLLIMPEXP_FWD_HTML wxHtmlTagsModule; //-------------------------------------------------------------------------------- // wxHtmlWinParser // This class is derived from wxHtmlParser and its mail goal // is to parse HTML input so that it can be displayed in // wxHtmlWindow. It uses special wxHtmlWinTagHandler. //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlWinParser : public wxHtmlParser { wxDECLARE_ABSTRACT_CLASS(wxHtmlWinParser); friend class wxHtmlWindow; public: wxHtmlWinParser(wxHtmlWindowInterface *wndIface = NULL); virtual ~wxHtmlWinParser(); virtual void InitParser(const wxString& source) wxOVERRIDE; virtual void DoneParser() wxOVERRIDE; virtual wxObject* GetProduct() wxOVERRIDE; virtual wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const wxOVERRIDE; // Set's the DC used for parsing. If SetDC() is not called, // parsing won't proceed virtual void SetDC(wxDC *dc, double pixel_scale = 1.0) { SetDC(dc, pixel_scale, pixel_scale); } void SetDC(wxDC *dc, double pixel_scale, double font_scale); wxDC *GetDC() {return m_DC;} double GetPixelScale() {return m_PixelScale;} int GetCharHeight() const {return m_CharHeight;} int GetCharWidth() const {return m_CharWidth;} // NOTE : these functions do _not_ return _actual_ // height/width. They return h/w of default font // for this DC. If you want actual values, call // GetDC()->GetChar...() // returns interface to the rendering window wxHtmlWindowInterface *GetWindowInterface() {return m_windowInterface;} // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font void SetStandardFonts(int size = -1, const wxString& normal_face = wxEmptyString, const wxString& fixed_face = wxEmptyString); // Adds tags module. see wxHtmlTagsModule for details. static void AddModule(wxHtmlTagsModule *module); static void RemoveModule(wxHtmlTagsModule *module); // parsing-related methods. These methods are called by tag handlers: // Returns pointer to actual container. Common use in tag handler is : // m_WParser->GetContainer()->InsertCell(new ...); wxHtmlContainerCell *GetContainer() const {return m_Container;} // opens new container. This container is sub-container of opened // container. Sets GetContainer to newly created container // and returns it. wxHtmlContainerCell *OpenContainer(); // works like OpenContainer except that new container is not created // but c is used. You can use this to directly set actual container wxHtmlContainerCell *SetContainer(wxHtmlContainerCell *c); // closes the container and sets actual Container to upper-level // container wxHtmlContainerCell *CloseContainer(); int GetFontSize() const {return m_FontSize;} void SetFontSize(int s); // Try to map a font size in points to the HTML 1-7 font size range. void SetFontPointSize(int pt); int GetFontBold() const {return m_FontBold;} void SetFontBold(int x) {m_FontBold = x;} int GetFontItalic() const {return m_FontItalic;} void SetFontItalic(int x) {m_FontItalic = x;} int GetFontUnderlined() const {return m_FontUnderlined;} void SetFontUnderlined(int x) {m_FontUnderlined = x;} int GetFontFixed() const {return m_FontFixed;} void SetFontFixed(int x) {m_FontFixed = x;} wxString GetFontFace() const {return GetFontFixed() ? m_FontFaceFixed : m_FontFaceNormal;} void SetFontFace(const wxString& face); int GetAlign() const {return m_Align;} void SetAlign(int a) {m_Align = a;} wxHtmlScriptMode GetScriptMode() const { return m_ScriptMode; } void SetScriptMode(wxHtmlScriptMode mode) { m_ScriptMode = mode; } long GetScriptBaseline() const { return m_ScriptBaseline; } void SetScriptBaseline(long base) { m_ScriptBaseline = base; } const wxColour& GetLinkColor() const { return m_LinkColor; } void SetLinkColor(const wxColour& clr) { m_LinkColor = clr; } const wxColour& GetActualColor() const { return m_ActualColor; } void SetActualColor(const wxColour& clr) { m_ActualColor = clr ;} const wxColour& GetActualBackgroundColor() const { return m_ActualBackgroundColor; } void SetActualBackgroundColor(const wxColour& clr) { m_ActualBackgroundColor = clr;} int GetActualBackgroundMode() const { return m_ActualBackgroundMode; } void SetActualBackgroundMode(int mode) { m_ActualBackgroundMode = mode;} const wxHtmlLinkInfo& GetLink() const { return m_Link; } void SetLink(const wxHtmlLinkInfo& link); // applies current parser state (link, sub/supscript, ...) to given cell void ApplyStateToCell(wxHtmlCell *cell); // Needs to be called after inserting a cell that interrupts the flow of // the text like e.g. <img> and tells us to not consider any of the // following space as being part of the same space run as before. void StopCollapsingSpaces() { m_tmpLastWasSpace = false; } #if !wxUSE_UNICODE void SetInputEncoding(wxFontEncoding enc); wxFontEncoding GetInputEncoding() const { return m_InputEnc; } wxFontEncoding GetOutputEncoding() const { return m_OutputEnc; } wxEncodingConverter *GetEncodingConverter() const { return m_EncConv; } #endif // creates font depending on m_Font* members. virtual wxFont* CreateCurrentFont(); enum WhitespaceMode { Whitespace_Normal, // normal mode, collapse whitespace Whitespace_Pre // inside <pre>, keep whitespace as-is }; // change the current whitespace handling mode void SetWhitespaceMode(WhitespaceMode mode) { m_whitespaceMode = mode; } WhitespaceMode GetWhitespaceMode() const { return m_whitespaceMode; } protected: virtual void AddText(const wxString& txt) wxOVERRIDE; private: void FlushWordBuf(wxChar *temp, int& len); void AddWord(wxHtmlWordCell *word); void AddWord(const wxString& word) { AddWord(new wxHtmlWordCell(word, *(GetDC()))); } void AddPreBlock(const wxString& text); bool m_tmpLastWasSpace; wxChar *m_tmpStrBuf; size_t m_tmpStrBufSize; // temporary variables used by AddText wxHtmlWindowInterface *m_windowInterface; // window we're parsing for double m_PixelScale, m_FontScale; wxDC *m_DC; // Device Context we're parsing for static wxList m_Modules; // list of tags modules (see wxHtmlTagsModule for details) // This list is used to initialize m_Handlers member. wxHtmlContainerCell *m_Container; // current container. See Open/CloseContainer for details. int m_FontBold, m_FontItalic, m_FontUnderlined, m_FontFixed; // this is not true,false but 1,0, we need it for indexing int m_FontSize; // From 1 (smallest) to 7, default is 3. wxColour m_LinkColor; wxColour m_ActualColor; wxColour m_ActualBackgroundColor; int m_ActualBackgroundMode; // basic font parameters. wxHtmlLinkInfo m_Link; // actual hypertext link or empty string bool m_UseLink; // true if m_Link is not empty int m_CharHeight, m_CharWidth; // average height of normal-sized text int m_Align; // actual alignment wxHtmlScriptMode m_ScriptMode; // current script mode (sub/sup/normal) long m_ScriptBaseline; // current sub/supscript base wxFont* m_FontsTable[2][2][2][2][7]; wxString m_FontsFacesTable[2][2][2][2][7]; #if !wxUSE_UNICODE wxFontEncoding m_FontsEncTable[2][2][2][2][7]; #endif // table of loaded fonts. 1st four indexes are 0 or 1, depending on on/off // state of these flags (from left to right): // [bold][italic][underlined][fixed_size] // last index is font size : from 0 to 6 (remapped from html sizes 1 to 7) // Note : this table covers all possible combinations of fonts, but not // all of them are used, so many items in table are usually NULL. int m_FontsSizes[7]; wxString m_FontFaceFixed, m_FontFaceNormal; // html font sizes and faces of fixed and proportional fonts #if !wxUSE_UNICODE wxChar m_nbsp; wxFontEncoding m_InputEnc, m_OutputEnc; // I/O font encodings wxEncodingConverter *m_EncConv; #endif // current whitespace handling mode WhitespaceMode m_whitespaceMode; wxHtmlWordCell *m_lastWordCell; // current position on line, in num. of characters; used to properly // expand TABs; only updated while inside <pre> int m_posColumn; wxDECLARE_NO_COPY_CLASS(wxHtmlWinParser); }; //----------------------------------------------------------------------------- // wxHtmlWinTagHandler // This is basicly wxHtmlTagHandler except // it is extended with protected member m_Parser pointing to // the wxHtmlWinParser object //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_HTML wxHtmlStyleParams; class WXDLLIMPEXP_HTML wxHtmlWinTagHandler : public wxHtmlTagHandler { wxDECLARE_ABSTRACT_CLASS(wxHtmlWinTagHandler); public: wxHtmlWinTagHandler() : wxHtmlTagHandler() {} virtual void SetParser(wxHtmlParser *parser) wxOVERRIDE {wxHtmlTagHandler::SetParser(parser); m_WParser = (wxHtmlWinParser*) parser;} protected: wxHtmlWinParser *m_WParser; // same as m_Parser, but overcasted void ApplyStyle(const wxHtmlStyleParams &styleParams); wxDECLARE_NO_COPY_CLASS(wxHtmlWinTagHandler); }; //---------------------------------------------------------------------------- // wxHtmlTagsModule // This is basic of dynamic tag handlers binding. // The class provides methods for filling parser's handlers // hash table. // (See documentation for details) //---------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlTagsModule : public wxModule { wxDECLARE_DYNAMIC_CLASS(wxHtmlTagsModule); public: wxHtmlTagsModule() : wxModule() {} virtual bool OnInit() wxOVERRIDE; virtual void OnExit() wxOVERRIDE; // This is called by wxHtmlWinParser. // The method must simply call parser->AddTagHandler(new // <handler_class_name>); for each handler virtual void FillHandlersTable(wxHtmlWinParser * WXUNUSED(parser)) { } }; #endif #endif // _WX_WINPARS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmltag.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmltag.h // Purpose: wxHtmlTag class (represents single tag) // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMLTAG_H_ #define _WX_HTMLTAG_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/object.h" #include "wx/arrstr.h" class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_FWD_HTML wxHtmlEntitiesParser; //----------------------------------------------------------------------------- // wxHtmlTagsCache // - internal wxHTML class, do not use! //----------------------------------------------------------------------------- class wxHtmlTagsCacheData; class WXDLLIMPEXP_HTML wxHtmlTagsCache { private: wxHtmlTagsCacheData *m_Cache; int m_CachePos; wxHtmlTagsCacheData& Cache() { return *m_Cache; } public: wxHtmlTagsCache() {m_Cache = NULL;} wxHtmlTagsCache(const wxString& source); virtual ~wxHtmlTagsCache(); // Finds parameters for tag starting at at and fills the variables void QueryTag(const wxString::const_iterator& at, const wxString::const_iterator& inputEnd, wxString::const_iterator *end1, wxString::const_iterator *end2, bool *hasEnding); wxDECLARE_NO_COPY_CLASS(wxHtmlTagsCache); }; //-------------------------------------------------------------------------------- // wxHtmlTag // This represents single tag. It is used as internal structure // by wxHtmlParser. //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlTag { protected: // constructs wxHtmlTag object based on HTML tag. // The tag begins (with '<' character) at position pos in source // end_pos is position where parsing ends (usually end of document) wxHtmlTag(wxHtmlTag *parent, const wxString *source, const wxString::const_iterator& pos, const wxString::const_iterator& end_pos, wxHtmlTagsCache *cache, wxHtmlEntitiesParser *entParser); friend class wxHtmlParser; public: ~wxHtmlTag(); wxHtmlTag *GetParent() const {return m_Parent;} wxHtmlTag *GetFirstSibling() const; wxHtmlTag *GetLastSibling() const; wxHtmlTag *GetChildren() const { return m_FirstChild; } wxHtmlTag *GetPreviousSibling() const { return m_Prev; } wxHtmlTag *GetNextSibling() const {return m_Next; } // Return next tag, as if tree had been flattened wxHtmlTag *GetNextTag() const; // Returns tag's name in uppercase. inline wxString GetName() const {return m_Name;} // Returns true if the tag has given parameter. Parameter // should always be in uppercase. // Example : <IMG SRC="test.jpg"> HasParam("SRC") returns true bool HasParam(const wxString& par) const; // Returns value of the param. Value is in uppercase unless it is // enclosed with " // Example : <P align=right> GetParam("ALIGN") returns (RIGHT) // <P IMG SRC="WhaT.jpg"> GetParam("SRC") returns (WhaT.jpg) // (or ("WhaT.jpg") if with_quotes == true) wxString GetParam(const wxString& par, bool with_quotes = false) const; // Return true if the string could be parsed as an HTML colour and false // otherwise. static bool ParseAsColour(const wxString& str, wxColour *clr); // Convenience functions: bool GetParamAsString(const wxString& par, wxString *str) const; bool GetParamAsColour(const wxString& par, wxColour *clr) const; bool GetParamAsInt(const wxString& par, int *clr) const; bool GetParamAsIntOrPercent(const wxString& param, int* value, bool& isPercent) const; // Scans param like scanf() functions family does. // Example : ScanParam("COLOR", "\"#%X\"", &clr); // This is always with with_quotes=false // Returns number of scanned values // (like sscanf() does) // NOTE: unlike scanf family, this function only accepts // *one* parameter ! int ScanParam(const wxString& par, const char *format, void *param) const; int ScanParam(const wxString& par, const wchar_t *format, void *param) const; // Returns string containing all params. wxString GetAllParams() const; // return true if there is matching ending tag inline bool HasEnding() const {return m_hasEnding;} // returns beginning position of _internal_ block of text as iterator // into parser's source string (see wxHtmlParser::GetSource()) // See explanation (returned value is marked with *): // bla bla bla <MYTAG>* bla bla intenal text</MYTAG> bla bla wxString::const_iterator GetBeginIter() const { return m_Begin; } // returns ending position of _internal_ block of text as iterator // into parser's source string (see wxHtmlParser::GetSource()): // bla bla bla <MYTAG> bla bla intenal text*</MYTAG> bla bla wxString::const_iterator GetEndIter1() const { return m_End1; } // returns end position 2 as iterator // into parser's source string (see wxHtmlParser::GetSource()): // bla bla bla <MYTAG> bla bla internal text</MYTAG>* bla bla wxString::const_iterator GetEndIter2() const { return m_End2; } #if WXWIN_COMPATIBILITY_2_8 // use GetBeginIter(), GetEndIter1() and GetEndIter2() instead wxDEPRECATED( inline int GetBeginPos() const ); wxDEPRECATED( inline int GetEndPos1() const ); wxDEPRECATED( inline int GetEndPos2() const ); #endif // WXWIN_COMPATIBILITY_2_8 private: wxString m_Name; bool m_hasEnding; wxString::const_iterator m_Begin, m_End1, m_End2; wxArrayString m_ParamNames, m_ParamValues; #if WXWIN_COMPATIBILITY_2_8 wxString::const_iterator m_sourceStart; #endif // DOM tree relations: wxHtmlTag *m_Next; wxHtmlTag *m_Prev; wxHtmlTag *m_FirstChild, *m_LastChild; wxHtmlTag *m_Parent; wxDECLARE_NO_COPY_CLASS(wxHtmlTag); }; #if WXWIN_COMPATIBILITY_2_8 inline int wxHtmlTag::GetBeginPos() const { return int(m_Begin - m_sourceStart); } inline int wxHtmlTag::GetEndPos1() const { return int(m_End1 - m_sourceStart); } inline int wxHtmlTag::GetEndPos2() const { return int(m_End2 - m_sourceStart); } #endif // WXWIN_COMPATIBILITY_2_8 #endif // wxUSE_HTML #endif // _WX_HTMLTAG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/helpwnd.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/helpwnd.h // Purpose: wxHtmlHelpWindow // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik // Author: Harm van der Heijden and Vaclav Slavik // Copyright: (c) Harm van der Heijden and Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELPWND_H_ #define _WX_HELPWND_H_ #include "wx/defs.h" #if wxUSE_WXHTML_HELP #include "wx/helpbase.h" #include "wx/html/helpdata.h" #include "wx/window.h" #include "wx/frame.h" #include "wx/config.h" #include "wx/splitter.h" #include "wx/notebook.h" #include "wx/listbox.h" #include "wx/choice.h" #include "wx/combobox.h" #include "wx/checkbox.h" #include "wx/stattext.h" #include "wx/hash.h" #include "wx/html/htmlwin.h" #include "wx/html/htmprint.h" class WXDLLIMPEXP_FWD_CORE wxButton; class WXDLLIMPEXP_FWD_CORE wxTextCtrl; class WXDLLIMPEXP_FWD_CORE wxTreeEvent; class WXDLLIMPEXP_FWD_CORE wxTreeCtrl; // style flags for the Help Frame #define wxHF_TOOLBAR 0x0001 #define wxHF_CONTENTS 0x0002 #define wxHF_INDEX 0x0004 #define wxHF_SEARCH 0x0008 #define wxHF_BOOKMARKS 0x0010 #define wxHF_OPEN_FILES 0x0020 #define wxHF_PRINT 0x0040 #define wxHF_FLAT_TOOLBAR 0x0080 #define wxHF_MERGE_BOOKS 0x0100 #define wxHF_ICONS_BOOK 0x0200 #define wxHF_ICONS_BOOK_CHAPTER 0x0400 #define wxHF_ICONS_FOLDER 0x0000 // this is 0 since it is default #define wxHF_DEFAULT_STYLE (wxHF_TOOLBAR | wxHF_CONTENTS | \ wxHF_INDEX | wxHF_SEARCH | \ wxHF_BOOKMARKS | wxHF_PRINT) //compatibility: #define wxHF_OPENFILES wxHF_OPEN_FILES #define wxHF_FLATTOOLBAR wxHF_FLAT_TOOLBAR #define wxHF_DEFAULTSTYLE wxHF_DEFAULT_STYLE struct wxHtmlHelpFrameCfg { int x, y, w, h; long sashpos; bool navig_on; }; struct wxHtmlHelpMergedIndexItem; class wxHtmlHelpMergedIndex; class WXDLLIMPEXP_FWD_CORE wxHelpControllerBase; class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController; /*! * Help window */ class WXDLLIMPEXP_HTML wxHtmlHelpWindow : public wxWindow { wxDECLARE_DYNAMIC_CLASS(wxHtmlHelpWindow); public: wxHtmlHelpWindow(wxHtmlHelpData* data = NULL) { Init(data); } wxHtmlHelpWindow(wxWindow* parent, wxWindowID wxWindowID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int style = wxTAB_TRAVERSAL|wxNO_BORDER, int helpStyle = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL); bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int style = wxTAB_TRAVERSAL|wxNO_BORDER, int helpStyle = wxHF_DEFAULT_STYLE); virtual ~wxHtmlHelpWindow(); wxHtmlHelpData* GetData() { return m_Data; } wxHtmlHelpController* GetController() const { return m_helpController; } void SetController(wxHtmlHelpController* controller); // Displays page x. If not found it will offect the user a choice of // searching books. // Looking for the page runs in these steps: // 1. try to locate file named x (if x is for example "doc/howto.htm") // 2. try to open starting page of book x // 3. try to find x in contents (if x is for example "How To ...") // 4. try to find x in index (if x is for example "How To ...") bool Display(const wxString& x); // Alternative version that works with numeric ID. // (uses extension to MS format, <param name="ID" value=id>, see docs) bool Display(int id); // Displays help window and focuses contents. bool DisplayContents(); // Displays help window and focuses index. bool DisplayIndex(); // Searches for keyword. Returns true and display page if found, return // false otherwise // Syntax of keyword is Altavista-like: // * words are separated by spaces // (but "\"hello world\"" is only one world "hello world") // * word may be pretended by + or - // (+ : page must contain the word ; - : page can't contain the word) // * if there is no + or - before the word, + is default bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL); #if wxUSE_CONFIG void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString) { m_Config = config; m_ConfigRoot = rootpath; ReadCustomization(config, rootpath); } // Saves custom settings into cfg config. it will use the path 'path' // if given, otherwise it will save info into currently selected path. // saved values : things set by SetFonts, SetBorders. void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); #endif // wxUSE_CONFIG // call this to let wxHtmlHelpWindow know page changed void NotifyPageChanged(); // Refreshes Contents and Index tabs void RefreshLists(); // Gets the HTML window wxHtmlWindow* GetHtmlWindow() const { return m_HtmlWin; } // Gets the splitter window wxSplitterWindow* GetSplitterWindow() const { return m_Splitter; } // Gets the toolbar wxToolBar* GetToolBar() const { return m_toolBar; } // Gets the configuration data wxHtmlHelpFrameCfg& GetCfgData() { return m_Cfg; } // Gets the tree control wxTreeCtrl *GetTreeCtrl() const { return m_ContentsBox; } protected: void Init(wxHtmlHelpData* data = NULL); // Adds items to m_Contents tree control void CreateContents(); // Adds items to m_IndexList void CreateIndex(); // Add books to search choice panel void CreateSearch(); // Updates "merged index" structure that combines indexes of all books // into better searchable structure void UpdateMergedIndex(); // Add custom buttons to toolbar virtual void AddToolbarButtons(wxToolBar *toolBar, int style); // Displays options dialog (fonts etc.) virtual void OptionsDialog(); void OnToolbar(wxCommandEvent& event); void OnContentsSel(wxTreeEvent& event); void OnIndexSel(wxCommandEvent& event); void OnIndexFind(wxCommandEvent& event); void OnIndexAll(wxCommandEvent& event); void OnSearchSel(wxCommandEvent& event); void OnSearch(wxCommandEvent& event); void OnBookmarksSel(wxCommandEvent& event); void OnSize(wxSizeEvent& event); // Images: enum { IMG_Book = 0, IMG_Folder, IMG_Page }; protected: wxHtmlHelpData* m_Data; bool m_DataCreated; // m_Data created by frame, or supplied? wxString m_TitleFormat; // title of the help frame // below are various pointers to GUI components wxHtmlWindow *m_HtmlWin; wxSplitterWindow *m_Splitter; wxPanel *m_NavigPan; wxNotebook *m_NavigNotebook; wxTreeCtrl *m_ContentsBox; wxTextCtrl *m_IndexText; wxButton *m_IndexButton; wxButton *m_IndexButtonAll; wxListBox *m_IndexList; wxTextCtrl *m_SearchText; wxButton *m_SearchButton; wxListBox *m_SearchList; wxChoice *m_SearchChoice; wxStaticText *m_IndexCountInfo; wxCheckBox *m_SearchCaseSensitive; wxCheckBox *m_SearchWholeWords; wxToolBar* m_toolBar; wxComboBox *m_Bookmarks; wxArrayString m_BookmarksNames, m_BookmarksPages; wxHtmlHelpFrameCfg m_Cfg; #if wxUSE_CONFIG wxConfigBase *m_Config; wxString m_ConfigRoot; #endif // wxUSE_CONFIG // pagenumbers of controls in notebook (usually 0,1,2) int m_ContentsPage; int m_IndexPage; int m_SearchPage; // lists of available fonts (used in options dialog) wxArrayString *m_NormalFonts, *m_FixedFonts; int m_FontSize; // 0,1,2 = small,medium,big wxString m_NormalFace, m_FixedFace; bool m_UpdateContents; #if wxUSE_PRINTING_ARCHITECTURE wxHtmlEasyPrinting *m_Printer; #endif wxHashTable *m_PagesHash; wxHtmlHelpController* m_helpController; int m_hfStyle; private: void DoIndexFind(); void DoIndexAll(); void DisplayIndexItem(const wxHtmlHelpMergedIndexItem *it); wxHtmlHelpMergedIndex *m_mergedIndex; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxHtmlHelpWindow); }; /*! * Command IDs */ enum { //wxID_HTML_HELPFRAME = wxID_HIGHEST + 1, wxID_HTML_PANEL = wxID_HIGHEST + 10, wxID_HTML_BACK, wxID_HTML_FORWARD, wxID_HTML_UPNODE, wxID_HTML_UP, wxID_HTML_DOWN, wxID_HTML_PRINT, wxID_HTML_OPENFILE, wxID_HTML_OPTIONS, wxID_HTML_BOOKMARKSLIST, wxID_HTML_BOOKMARKSADD, wxID_HTML_BOOKMARKSREMOVE, wxID_HTML_TREECTRL, wxID_HTML_INDEXPAGE, wxID_HTML_INDEXLIST, wxID_HTML_INDEXTEXT, wxID_HTML_INDEXBUTTON, wxID_HTML_INDEXBUTTONALL, wxID_HTML_NOTEBOOK, wxID_HTML_SEARCHPAGE, wxID_HTML_SEARCHTEXT, wxID_HTML_SEARCHLIST, wxID_HTML_SEARCHBUTTON, wxID_HTML_SEARCHCHOICE, wxID_HTML_COUNTINFO }; #endif // wxUSE_WXHTML_HELP #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmldefs.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmldefs.h // Purpose: constants for wxhtml library // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMLDEFS_H_ #define _WX_HTMLDEFS_H_ #include "wx/defs.h" #if wxUSE_HTML //-------------------------------------------------------------------------------- // ALIGNMENTS // Describes alignment of text etc. in containers //-------------------------------------------------------------------------------- #define wxHTML_ALIGN_LEFT 0x0000 #define wxHTML_ALIGN_RIGHT 0x0002 #define wxHTML_ALIGN_JUSTIFY 0x0010 #define wxHTML_ALIGN_TOP 0x0004 #define wxHTML_ALIGN_BOTTOM 0x0008 #define wxHTML_ALIGN_CENTER 0x0001 //-------------------------------------------------------------------------------- // COLOR MODES // Used by wxHtmlColourCell to determine clr of what is changing //-------------------------------------------------------------------------------- #define wxHTML_CLR_FOREGROUND 0x0001 #define wxHTML_CLR_BACKGROUND 0x0002 #define wxHTML_CLR_TRANSPARENT_BACKGROUND 0x0004 //-------------------------------------------------------------------------------- // UNITS // Used to specify units //-------------------------------------------------------------------------------- #define wxHTML_UNITS_PIXELS 0x0001 #define wxHTML_UNITS_PERCENT 0x0002 //-------------------------------------------------------------------------------- // INDENTS // Used to specify indetation relatives //-------------------------------------------------------------------------------- #define wxHTML_INDENT_LEFT 0x0010 #define wxHTML_INDENT_RIGHT 0x0020 #define wxHTML_INDENT_TOP 0x0040 #define wxHTML_INDENT_BOTTOM 0x0080 #define wxHTML_INDENT_HORIZONTAL (wxHTML_INDENT_LEFT | wxHTML_INDENT_RIGHT) #define wxHTML_INDENT_VERTICAL (wxHTML_INDENT_TOP | wxHTML_INDENT_BOTTOM) #define wxHTML_INDENT_ALL (wxHTML_INDENT_VERTICAL | wxHTML_INDENT_HORIZONTAL) //-------------------------------------------------------------------------------- // FIND CONDITIONS // Identifiers of wxHtmlCell's Find() conditions //-------------------------------------------------------------------------------- #define wxHTML_COND_ISANCHOR 1 // Finds the anchor of 'param' name (pointer to wxString). #define wxHTML_COND_ISIMAGEMAP 2 // Finds imagemap of 'param' name (pointer to wxString). // (used exclusively by m_image.cpp) #define wxHTML_COND_USER 10000 // User-defined conditions should start from this number //-------------------------------------------------------------------------------- // INTERNALS // wxHTML internal constants //-------------------------------------------------------------------------------- /* size of one scroll step of wxHtmlWindow in pixels */ #define wxHTML_SCROLL_STEP 16 /* size of temporary buffer used during parsing */ #define wxHTML_BUFLEN 1024 #endif // wxUSE_HTML #endif // _WX_HTMLDEFS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/webkit.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/webkit.h // Purpose: wxWebKitCtrl - embeddable web kit control // Author: Jethro Grassie / Kevin Ollivier // Modified by: // Created: 2004-4-16 // Copyright: (c) Jethro Grassie / Kevin Ollivier // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WEBKIT_H #define _WX_WEBKIT_H #if wxUSE_WEBKIT #if !defined(__WXMAC__) #error "wxWebKitCtrl not implemented for this platform" #endif #include "wx/control.h" // ---------------------------------------------------------------------------- // Web Kit Control // ---------------------------------------------------------------------------- extern WXDLLIMPEXP_DATA_CORE(const char) wxWebKitCtrlNameStr[]; class WXDLLIMPEXP_CORE wxWebKitCtrl : public wxControl { public: wxDECLARE_DYNAMIC_CLASS(wxWebKitCtrl); wxWebKitCtrl() {} wxWebKitCtrl(wxWindow *parent, wxWindowID winID, const wxString& strURL, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxWebKitCtrlNameStr) { Create(parent, winID, strURL, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID winID, const wxString& strURL, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxWebKitCtrlNameStr); virtual ~wxWebKitCtrl(); void LoadURL(const wxString &url); bool CanGoBack(); bool CanGoForward(); bool GoBack(); bool GoForward(); void Reload(); void Stop(); bool CanGetPageSource(); wxString GetPageSource(); void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString); wxString GetPageURL(){ return m_currentURL; } void SetPageTitle(const wxString& title) { m_pageTitle = title; } wxString GetPageTitle(){ return m_pageTitle; } // since these worked in 2.6, add wrappers void SetTitle(const wxString& title) { SetPageTitle(title); } wxString GetTitle() { return GetPageTitle(); } wxString GetSelection(); bool CanIncreaseTextSize(); void IncreaseTextSize(); bool CanDecreaseTextSize(); void DecreaseTextSize(); void Print(bool showPrompt = false); void MakeEditable(bool enable = true); bool IsEditable(); wxString RunScript(const wxString& javascript); void SetScrollPos(int pos); int GetScrollPos(); // don't hide base class virtuals virtual void SetScrollPos( int orient, int pos, bool refresh = true ) wxOVERRIDE { return wxControl::SetScrollPos(orient, pos, refresh); } virtual int GetScrollPos( int orient ) const wxOVERRIDE { return wxControl::GetScrollPos(orient); } //we need to resize the webview when the control size changes void OnSize(wxSizeEvent &event); void OnMove(wxMoveEvent &event); void OnMouseEvents(wxMouseEvent &event); protected: wxDECLARE_EVENT_TABLE(); void MacVisibilityChanged() wxOVERRIDE; private: wxWindow *m_parent; wxWindowID m_windowID; wxString m_currentURL; wxString m_pageTitle; OSXWebViewPtr m_webView; WX_NSObject m_frameLoadMonitor; WX_NSObject m_policyDelegate; WX_NSObject m_UIDelegate; // we may use this later to setup our own mouse events, // so leave it in for now. void* m_webKitCtrlEventHandler; }; // ---------------------------------------------------------------------------- // Web Kit Events // ---------------------------------------------------------------------------- enum { wxWEBKIT_STATE_START = 1, wxWEBKIT_STATE_NEGOTIATING = 2, wxWEBKIT_STATE_REDIRECTING = 4, wxWEBKIT_STATE_TRANSFERRING = 8, wxWEBKIT_STATE_STOP = 16, wxWEBKIT_STATE_FAILED = 32 }; enum { wxWEBKIT_NAV_LINK_CLICKED = 1, wxWEBKIT_NAV_BACK_NEXT = 2, wxWEBKIT_NAV_FORM_SUBMITTED = 4, wxWEBKIT_NAV_RELOAD = 8, wxWEBKIT_NAV_FORM_RESUBMITTED = 16, wxWEBKIT_NAV_OTHER = 32 }; class WXDLLIMPEXP_CORE wxWebKitBeforeLoadEvent : public wxCommandEvent { wxDECLARE_DYNAMIC_CLASS(wxWebKitBeforeLoadEvent); public: bool IsCancelled() { return m_cancelled; } void Cancel(bool cancel = true) { m_cancelled = cancel; } wxString GetURL() { return m_url; } void SetURL(const wxString& url) { m_url = url; } void SetNavigationType(int navType) { m_navType = navType; } int GetNavigationType() { return m_navType; } wxWebKitBeforeLoadEvent( wxWindow* win = NULL ); wxEvent *Clone(void) const { return new wxWebKitBeforeLoadEvent(*this); } protected: bool m_cancelled; wxString m_url; int m_navType; }; class WXDLLIMPEXP_CORE wxWebKitStateChangedEvent : public wxCommandEvent { wxDECLARE_DYNAMIC_CLASS(wxWebKitStateChangedEvent); public: int GetState() { return m_state; } void SetState(int state) { m_state = state; } wxString GetURL() { return m_url; } void SetURL(const wxString& url) { m_url = url; } wxWebKitStateChangedEvent( wxWindow* win = NULL ); wxEvent *Clone(void) const { return new wxWebKitStateChangedEvent(*this); } protected: int m_state; wxString m_url; }; class WXDLLIMPEXP_CORE wxWebKitNewWindowEvent : public wxCommandEvent { wxDECLARE_DYNAMIC_CLASS(wxWebKitNewWindowEvent); public: wxString GetURL() const { return m_url; } void SetURL(const wxString& url) { m_url = url; } wxString GetTargetName() const { return m_targetName; } void SetTargetName(const wxString& name) { m_targetName = name; } wxWebKitNewWindowEvent( wxWindow* win = (wxWindow*)(NULL)); wxEvent *Clone(void) const { return new wxWebKitNewWindowEvent(*this); } private: wxString m_url; wxString m_targetName; }; typedef void (wxEvtHandler::*wxWebKitStateChangedEventFunction)(wxWebKitStateChangedEvent&); typedef void (wxEvtHandler::*wxWebKitBeforeLoadEventFunction)(wxWebKitBeforeLoadEvent&); typedef void (wxEvtHandler::*wxWebKitNewWindowEventFunction)(wxWebKitNewWindowEvent&); #define wxWebKitStateChangedEventHandler( func ) \ wxEVENT_HANDLER_CAST( wxWebKitStateChangedEventFunction, func ) #define wxWebKitBeforeLoadEventHandler( func ) \ wxEVENT_HANDLER_CAST( wxWebKitBeforeLoadEventFunction, func ) #define wxWebKitNewWindowEventHandler( func ) \ wxEVENT_HANDLER_CAST( wxWebKitNewWindowEventFunction, func ) wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WEBKIT_STATE_CHANGED, wxWebKitStateChangedEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WEBKIT_BEFORE_LOAD, wxWebKitBeforeLoadEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WEBKIT_NEW_WINDOW, wxWebKitNewWindowEvent ); #define EVT_WEBKIT_STATE_CHANGED(func) \ wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_STATE_CHANGED, \ wxID_ANY, \ wxID_ANY, \ wxWebKitStateChangedEventHandler( func ), \ NULL ), #define EVT_WEBKIT_BEFORE_LOAD(func) \ wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_BEFORE_LOAD, \ wxID_ANY, \ wxID_ANY, \ wxWebKitBeforeLoadEventHandler( func ), \ NULL ), #define EVT_WEBKIT_NEW_WINDOW(func) \ wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_NEW_WINDOW, \ wxID_ANY, \ wxID_ANY, \ wxWebKitNewWindowEventHandler( func ), \ NULL ), #endif // wxUSE_WEBKIT #endif // _WX_WEBKIT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/m_templ.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/m_templ.h // Purpose: Modules template file // Author: Vaclav Slavik // Copyright: (c) Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* DESCRIPTION: This is set of macros for easier writing of tag handlers. How to use it? See mod_fonts.cpp for example... Attention! This is quite strange C++ bastard. Before using it, I STRONGLY recommend reading and understanding these macros!! */ #ifndef _WX_M_TEMPL_H_ #define _WX_M_TEMPL_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/html/winpars.h" #define TAG_HANDLER_BEGIN(name,tags) \ class wxHTML_Handler_##name : public wxHtmlWinTagHandler \ { \ public: \ wxString GetSupportedTags() wxOVERRIDE {return wxT(tags);} #define TAG_HANDLER_VARS \ private: #define TAG_HANDLER_CONSTR(name) \ public: \ wxHTML_Handler_##name () : wxHtmlWinTagHandler() #define TAG_HANDLER_PROC(varib) \ public: \ bool HandleTag(const wxHtmlTag& varib) wxOVERRIDE #define TAG_HANDLER_END(name) \ }; #define TAGS_MODULE_BEGIN(name) \ class wxHTML_Module##name : public wxHtmlTagsModule \ { \ wxDECLARE_DYNAMIC_CLASS(wxHTML_Module##name ); \ public: \ void FillHandlersTable(wxHtmlWinParser *parser) wxOVERRIDE \ { #define TAGS_MODULE_ADD(handler) \ parser->AddTagHandler(new wxHTML_Handler_##handler); #define TAGS_MODULE_END(name) \ } \ }; \ wxIMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule) #endif #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/helpdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/helpdlg.h // Purpose: wxHtmlHelpDialog // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik // Author: Harm van der Heijden, Vaclav Slavik, Julian Smart // Copyright: (c) Harm van der Heijden, Vaclav Slavik, Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELPDLG_H_ #define _WX_HELPDLG_H_ #include "wx/defs.h" #if wxUSE_WXHTML_HELP #include "wx/html/helpdata.h" #include "wx/window.h" #include "wx/dialog.h" #include "wx/frame.h" #include "wx/config.h" #include "wx/splitter.h" #include "wx/notebook.h" #include "wx/listbox.h" #include "wx/choice.h" #include "wx/combobox.h" #include "wx/checkbox.h" #include "wx/stattext.h" #include "wx/html/htmlwin.h" #include "wx/html/helpwnd.h" #include "wx/html/htmprint.h" class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController; class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow; class WXDLLIMPEXP_HTML wxHtmlHelpDialog : public wxDialog { wxDECLARE_DYNAMIC_CLASS(wxHtmlHelpDialog); public: wxHtmlHelpDialog(wxHtmlHelpData* data = NULL) { Init(data); } wxHtmlHelpDialog(wxWindow* parent, wxWindowID wxWindowID, const wxString& title = wxEmptyString, int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL); virtual ~wxHtmlHelpDialog(); bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString, int style = wxHF_DEFAULT_STYLE); /// Returns the data associated with this dialog. wxHtmlHelpData* GetData() { return m_Data; } /// Returns the controller that created this dialog. wxHtmlHelpController* GetController() const { return m_helpController; } /// Sets the controller associated with this dialog. void SetController(wxHtmlHelpController* controller) { m_helpController = controller; } /// Returns the help window. wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; } // Sets format of title of the frame. Must contain exactly one "%s" // (for title of displayed HTML page) void SetTitleFormat(const wxString& format); // Override to add custom buttons to the toolbar virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {} protected: void Init(wxHtmlHelpData* data = NULL); void OnCloseWindow(wxCloseEvent& event); protected: // Temporary pointer to pass to window wxHtmlHelpData* m_Data; wxString m_TitleFormat; // title of the help frame wxHtmlHelpWindow *m_HtmlHelpWin; wxHtmlHelpController* m_helpController; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxHtmlHelpDialog); }; #endif // wxUSE_WXHTML_HELP #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmprint.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmprint.h // Purpose: html printing classes // Author: Vaclav Slavik // Created: 25/09/99 // Copyright: (c) Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMPRINT_H_ #define _WX_HTMPRINT_H_ #include "wx/defs.h" #if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE #include "wx/html/htmlcell.h" #include "wx/html/winpars.h" #include "wx/html/htmlfilt.h" #include "wx/print.h" #include "wx/printdlg.h" #include "wx/vector.h" #include <limits.h> // INT_MAX //-------------------------------------------------------------------------------- // wxHtmlDCRenderer // This class is capable of rendering HTML into specified // portion of DC //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlDCRenderer : public wxObject { public: wxHtmlDCRenderer(); virtual ~wxHtmlDCRenderer(); // Following 3 methods *must* be called before any call to Render: // Assign DC to this render void SetDC(wxDC *dc, double pixel_scale = 1.0) { SetDC(dc, pixel_scale, pixel_scale); } void SetDC(wxDC *dc, double pixel_scale, double font_scale); // Sets size of output rectangle, in pixels. Note that you *can't* change // width of the rectangle between calls to Render! (You can freely change height.) void SetSize(int width, int height); // Sets the text to be displayed. // Basepath is base directory (html string would be stored there if it was in // file). It is used to determine path for loading images, for example. // isdir is false if basepath is filename, true if it is directory name // (see wxFileSystem for detailed explanation) void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = true); // Sets the HTML cell that will be rendered: this is more efficient than // using text as it allows to parse it only once. Note that the cell will // be modified by this call. void SetHtmlCell(wxHtmlContainerCell& cell); // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font void SetStandardFonts(int size = -1, const wxString& normal_face = wxEmptyString, const wxString& fixed_face = wxEmptyString); // Finds the next page break after the specified (vertical) position. // Returns wxNOT_FOUND if passed in position is the last page break. int FindNextPageBreak(int pos) const; // [x,y] is position of upper-left corner of printing rectangle (see SetSize) // from is y-coordinate of the very first visible cell // to is y-coordinate of the next following page break, if any void Render(int x, int y, int from = 0, int to = INT_MAX); // returns total width of the html document int GetTotalWidth() const; // returns total height of the html document int GetTotalHeight() const; private: void DoSetHtmlCell(wxHtmlContainerCell* cell); wxDC *m_DC; wxFileSystem m_FS; wxHtmlWinParser m_Parser; wxHtmlContainerCell *m_Cells; int m_Width, m_Height; bool m_ownsCells; wxDECLARE_NO_COPY_CLASS(wxHtmlDCRenderer); }; enum { wxPAGE_ODD, wxPAGE_EVEN, wxPAGE_ALL }; //-------------------------------------------------------------------------------- // wxHtmlPrintout // This class is derived from standard wxWidgets printout class // and is used to print HTML documents. //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlPrintout : public wxPrintout { public: wxHtmlPrintout(const wxString& title = wxT("Printout")); void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = true); // prepares the class for printing this html document. // Must be called before using the class, in fact just after constructor // // basepath is base directory (html string would be stored there if it was in // file). It is used to determine path for loading images, for example. // isdir is false if basepath is filename, true if it is directory name // (see wxFileSystem for detailed explanation) void SetHtmlFile(const wxString &htmlfile); // same as SetHtmlText except that it takes regular file as the parameter void SetHeader(const wxString& header, int pg = wxPAGE_ALL); void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); // sets header/footer for the document. The argument is interpreted as HTML document. // You can use macros in it: // @PAGENUM@ is replaced by page number // @PAGESCNT@ is replaced by total number of pages // // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants. // You can set different header/footer for odd and even pages // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font void SetStandardFonts(int size = -1, const wxString& normal_face = wxEmptyString, const wxString& fixed_face = wxEmptyString); void SetMargins(float top = 25.2f, float bottom = 25.2f, float left = 25.2f, float right = 25.2f, float spaces = 5); // sets margins in millimeters. Defaults to 1 inch for margins and 0.5cm for space // between text and header and/or footer void SetMargins(const wxPageSetupDialogData& pageSetupData); // wxPrintout stuff: bool OnPrintPage(int page) wxOVERRIDE; bool HasPage(int page) wxOVERRIDE; void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) wxOVERRIDE; bool OnBeginDocument(int startPage, int endPage) wxOVERRIDE; void OnPreparePrinting() wxOVERRIDE; // Adds input filter static void AddFilter(wxHtmlFilter *filter); // Cleanup static void CleanUpStatics(); private: // this function is called by the base class OnPreparePrinting() // implementation and by default checks whether the document fits into // pageArea horizontally and warns the user if it does not and, if we're // going to print and not just to preview the document, giving him the // possibility to cancel printing // // you may override it to either suppress this check if truncation of the // HTML being printed is acceptable or, on the contrary, add more checks to // it, e.g. for the fit in the vertical direction if the document should // always appear on a single page // // return true if printing should go ahead or false to cancel it (the // return value is ignored when previewing) virtual bool CheckFit(const wxSize& pageArea, const wxSize& docArea) const; void RenderPage(wxDC *dc, int page); // renders one page into dc wxString TranslateHeader(const wxString& instr, int page); // substitute @PAGENUM@ and @PAGESCNT@ by real values void CountPages(); // fills m_PageBreaks, which indirectly gives the number of pages private: wxVector<int> m_PageBreaks; wxString m_Document, m_BasePath; bool m_BasePathIsDir; wxString m_Headers[2], m_Footers[2]; int m_HeaderHeight, m_FooterHeight; wxHtmlDCRenderer m_Renderer, m_RendererHdr; float m_MarginTop, m_MarginBottom, m_MarginLeft, m_MarginRight, m_MarginSpace; // list of HTML filters static wxVector<wxHtmlFilter*> m_Filters; wxDECLARE_NO_COPY_CLASS(wxHtmlPrintout); }; //-------------------------------------------------------------------------------- // wxHtmlEasyPrinting // This class provides very simple interface to printing // architecture. It allows you to print HTML documents only // with very few commands. // // Note : do not create this class on stack only. // You should create an instance on app startup and // use this instance for all printing. Why? The class // stores page&printer settings in it. //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlEasyPrinting : public wxObject { public: wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxWindow *parentWindow = NULL); virtual ~wxHtmlEasyPrinting(); bool PreviewFile(const wxString &htmlfile); bool PreviewText(const wxString &htmltext, const wxString& basepath = wxEmptyString); // Preview file / html-text for printing // (and offers printing) // basepath is base directory for opening subsequent files (e.g. from <img> tag) bool PrintFile(const wxString &htmlfile); bool PrintText(const wxString &htmltext, const wxString& basepath = wxEmptyString); // Print file / html-text w/o preview void PageSetup(); // pop up printer or page setup dialog void SetHeader(const wxString& header, int pg = wxPAGE_ALL); void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); // sets header/footer for the document. The argument is interpreted as HTML document. // You can use macros in it: // @PAGENUM@ is replaced by page number // @PAGESCNT@ is replaced by total number of pages // // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants. // You can set different header/footer for odd and even pages void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = 0); // Sets fonts to be used when displaying HTML page. (if size null then default sizes used) // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font void SetStandardFonts(int size = -1, const wxString& normal_face = wxEmptyString, const wxString& fixed_face = wxEmptyString); wxPrintData *GetPrintData(); wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;} // return page setting data objects. // (You can set their parameters.) wxWindow* GetParentWindow() const { return m_ParentWindow; } // get the parent window void SetParentWindow(wxWindow* window) { m_ParentWindow = window; } // set the parent window const wxString& GetName() const { return m_Name; } // get the printout name void SetName(const wxString& name) { m_Name = name; } // set the printout name // Controls showing the dialog when printing: by default, always shown. enum PromptMode { Prompt_Never, Prompt_Once, Prompt_Always }; void SetPromptMode(PromptMode promptMode) { m_promptMode = promptMode; } protected: virtual wxHtmlPrintout *CreatePrintout(); virtual bool DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *printout2); virtual bool DoPrint(wxHtmlPrintout *printout); private: wxPrintData *m_PrintData; wxPageSetupDialogData *m_PageSetupData; wxString m_Name; int m_FontsSizesArr[7]; int *m_FontsSizes; wxString m_FontFaceFixed, m_FontFaceNormal; enum FontMode { FontMode_Explicit, FontMode_Standard }; FontMode m_fontMode; wxString m_Headers[2], m_Footers[2]; wxWindow *m_ParentWindow; PromptMode m_promptMode; wxDECLARE_NO_COPY_CLASS(wxHtmlEasyPrinting); }; #endif // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE #endif // _WX_HTMPRINT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/helpfrm.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/helpfrm.h // Purpose: wxHtmlHelpFrame // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik // Author: Harm van der Heijden and Vaclav Slavik // Copyright: (c) Harm van der Heijden and Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELPFRM_H_ #define _WX_HELPFRM_H_ #include "wx/defs.h" #if wxUSE_WXHTML_HELP #include "wx/helpbase.h" #include "wx/html/helpdata.h" #include "wx/window.h" #include "wx/frame.h" #include "wx/config.h" #include "wx/splitter.h" #include "wx/notebook.h" #include "wx/listbox.h" #include "wx/choice.h" #include "wx/combobox.h" #include "wx/checkbox.h" #include "wx/stattext.h" #include "wx/html/htmlwin.h" #include "wx/html/helpwnd.h" #include "wx/html/htmprint.h" class WXDLLIMPEXP_FWD_CORE wxButton; class WXDLLIMPEXP_FWD_CORE wxTextCtrl; class WXDLLIMPEXP_FWD_CORE wxTreeEvent; class WXDLLIMPEXP_FWD_CORE wxTreeCtrl; // style flags for the Help Frame #define wxHF_TOOLBAR 0x0001 #define wxHF_CONTENTS 0x0002 #define wxHF_INDEX 0x0004 #define wxHF_SEARCH 0x0008 #define wxHF_BOOKMARKS 0x0010 #define wxHF_OPEN_FILES 0x0020 #define wxHF_PRINT 0x0040 #define wxHF_FLAT_TOOLBAR 0x0080 #define wxHF_MERGE_BOOKS 0x0100 #define wxHF_ICONS_BOOK 0x0200 #define wxHF_ICONS_BOOK_CHAPTER 0x0400 #define wxHF_ICONS_FOLDER 0x0000 // this is 0 since it is default #define wxHF_DEFAULT_STYLE (wxHF_TOOLBAR | wxHF_CONTENTS | \ wxHF_INDEX | wxHF_SEARCH | \ wxHF_BOOKMARKS | wxHF_PRINT) //compatibility: #define wxHF_OPENFILES wxHF_OPEN_FILES #define wxHF_FLATTOOLBAR wxHF_FLAT_TOOLBAR #define wxHF_DEFAULTSTYLE wxHF_DEFAULT_STYLE struct wxHtmlHelpMergedIndexItem; class wxHtmlHelpMergedIndex; class WXDLLIMPEXP_FWD_CORE wxHelpControllerBase; class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController; class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow; class WXDLLIMPEXP_HTML wxHtmlHelpFrame : public wxFrame { wxDECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame); public: wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); } wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID, const wxString& title = wxEmptyString, int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL #if wxUSE_CONFIG , wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString #endif // wxUSE_CONFIG ); bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString, int style = wxHF_DEFAULT_STYLE #if wxUSE_CONFIG , wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString #endif // wxUSE_CONFIG ); virtual ~wxHtmlHelpFrame(); /// Returns the data associated with the window. wxHtmlHelpData* GetData() { return m_Data; } /// Returns the help controller associated with the window. wxHtmlHelpController* GetController() const { return m_helpController; } /// Sets the help controller associated with the window. void SetController(wxHtmlHelpController* controller); /// Returns the help window. wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; } // Sets format of title of the frame. Must contain exactly one "%s" // (for title of displayed HTML page) void SetTitleFormat(const wxString& format); #if wxUSE_CONFIG // For compatibility void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); #endif // wxUSE_CONFIG // Make the help controller's frame 'modal' if // needed void AddGrabIfNeeded(); // Override to add custom buttons to the toolbar virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {} void SetShouldPreventAppExit(bool enable); // we don't want to prevent the app from closing just because a help window // remains opened virtual bool ShouldPreventAppExit() const wxOVERRIDE { return m_shouldPreventAppExit; } protected: void Init(wxHtmlHelpData* data = NULL); void OnCloseWindow(wxCloseEvent& event); void OnActivate(wxActivateEvent& event); // Images: enum { IMG_Book = 0, IMG_Folder, IMG_Page }; protected: wxHtmlHelpData* m_Data; bool m_DataCreated; // m_Data created by frame, or supplied? wxString m_TitleFormat; // title of the help frame wxHtmlHelpWindow *m_HtmlHelpWin; wxHtmlHelpController* m_helpController; bool m_shouldPreventAppExit; private: wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxHtmlHelpFrame); }; #endif // wxUSE_WXHTML_HELP #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmlwin.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmlwin.h // Purpose: wxHtmlWindow class for parsing & displaying HTML // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMLWIN_H_ #define _WX_HTMLWIN_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/window.h" #include "wx/scrolwin.h" #include "wx/config.h" #include "wx/stopwatch.h" #include "wx/html/winpars.h" #include "wx/html/htmlcell.h" #include "wx/filesys.h" #include "wx/html/htmlfilt.h" #include "wx/filename.h" #include "wx/bitmap.h" class wxHtmlProcessor; class wxHtmlWinModule; class wxHtmlHistoryArray; class wxHtmlProcessorList; class WXDLLIMPEXP_FWD_HTML wxHtmlWinAutoScrollTimer; class WXDLLIMPEXP_FWD_HTML wxHtmlCellEvent; class WXDLLIMPEXP_FWD_HTML wxHtmlLinkEvent; class WXDLLIMPEXP_FWD_CORE wxStatusBar; // wxHtmlWindow flags: #define wxHW_SCROLLBAR_NEVER 0x0002 #define wxHW_SCROLLBAR_AUTO 0x0004 #define wxHW_NO_SELECTION 0x0008 #define wxHW_DEFAULT_STYLE wxHW_SCROLLBAR_AUTO /// Enum for wxHtmlWindow::OnOpeningURL and wxHtmlWindowInterface::OnOpeningURL enum wxHtmlOpeningStatus { /// Open the requested URL wxHTML_OPEN, /// Do not open the URL wxHTML_BLOCK, /// Redirect to another URL (returned from OnOpeningURL) wxHTML_REDIRECT }; /** Abstract interface to a HTML rendering window (such as wxHtmlWindow or wxHtmlListBox) that is passed to wxHtmlWinParser. It encapsulates all communication from the parser to the window. */ class WXDLLIMPEXP_HTML wxHtmlWindowInterface { public: /// Ctor wxHtmlWindowInterface() {} virtual ~wxHtmlWindowInterface() {} /** Called by the parser to set window's title to given text. */ virtual void SetHTMLWindowTitle(const wxString& title) = 0; /** Called when a link is clicked. @param link information about the clicked link */ virtual void OnHTMLLinkClicked(const wxHtmlLinkInfo& link) = 0; /** Called when the parser needs to open another URL (e.g. an image). @param type Type of the URL request (e.g. image) @param url URL the parser wants to open @param redirect If the return value is wxHTML_REDIRECT, then the URL to redirect to will be stored in this variable (the pointer must never be NULL) @return indicator of how to treat the request */ virtual wxHtmlOpeningStatus OnHTMLOpeningURL(wxHtmlURLType type, const wxString& url, wxString *redirect) const = 0; /** Converts coordinates @a pos relative to given @a cell to physical coordinates in the window. */ virtual wxPoint HTMLCoordsToWindow(wxHtmlCell *cell, const wxPoint& pos) const = 0; /// Returns the window used for rendering (may be NULL). virtual wxWindow* GetHTMLWindow() = 0; /// Returns background colour to use by default. virtual wxColour GetHTMLBackgroundColour() const = 0; /// Sets window's background to colour @a clr. virtual void SetHTMLBackgroundColour(const wxColour& clr) = 0; /// Sets window's background to given bitmap. virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg) = 0; /// Sets status bar text. virtual void SetHTMLStatusText(const wxString& text) = 0; /// Type of mouse cursor enum HTMLCursor { /// Standard mouse cursor (typically an arrow) HTMLCursor_Default, /// Cursor shown over links HTMLCursor_Link, /// Cursor shown over selectable text HTMLCursor_Text }; /** Returns mouse cursor of given @a type. */ virtual wxCursor GetHTMLCursor(HTMLCursor type) const = 0; }; /** Helper class that implements part of mouse handling for wxHtmlWindow and wxHtmlListBox. Cursor changes and clicking on links are handled, text selection is not. */ class WXDLLIMPEXP_HTML wxHtmlWindowMouseHelper { protected: /** Ctor. @param iface Interface to the owner window. */ wxHtmlWindowMouseHelper(wxHtmlWindowInterface *iface); /** Virtual dtor. It is not really needed in this case, but at least it prevents gcc from complaining about its absence. */ virtual ~wxHtmlWindowMouseHelper() { } /// Returns true if the mouse moved since the last call to HandleIdle bool DidMouseMove() const { return m_tmpMouseMoved; } /// Call this from EVT_MOTION event handler void HandleMouseMoved(); /** Call this from EVT_LEFT_UP handler (or, alternatively, EVT_LEFT_DOWN). @param rootCell HTML cell inside which the click occurred. This doesn't have to be the leaf cell, it can be e.g. toplevel container, but the mouse must be inside the container's area, otherwise the event would be ignored. @param pos Mouse position in coordinates relative to @a cell @param event The event that triggered the call */ bool HandleMouseClick(wxHtmlCell *rootCell, const wxPoint& pos, const wxMouseEvent& event); /** Call this from OnInternalIdle of the HTML displaying window. Handles mouse movements and must be used together with HandleMouseMoved. @param rootCell HTML cell inside which the click occurred. This doesn't have to be the leaf cell, it can be e.g. toplevel container, but the mouse must be inside the container's area, otherwise the event would be ignored. @param pos Current mouse position in coordinates relative to @a cell */ void HandleIdle(wxHtmlCell *rootCell, const wxPoint& pos); /** Called by HandleIdle when the mouse hovers over a cell. Default behaviour is to do nothing. @param cell the cell the mouse is over @param x, y coordinates of mouse relative to the cell */ virtual void OnCellMouseHover(wxHtmlCell *cell, wxCoord x, wxCoord y); /** Called by HandleMouseClick when the user clicks on a cell. Default behaviour is to call wxHtmlWindowInterface::OnLinkClicked() if this cell corresponds to a hypertext link. @param cell the cell the mouse is over @param x, y coordinates of mouse relative to the cell @param event The event that triggered the call @return true if a link was clicked, false otherwise. */ virtual bool OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& event); protected: // this flag indicates if the mouse moved (used by HandleIdle) bool m_tmpMouseMoved; // contains last link name wxHtmlLinkInfo *m_tmpLastLink; // contains the last (terminal) cell which contained the mouse wxHtmlCell *m_tmpLastCell; private: wxHtmlWindowInterface *m_interface; }; // ---------------------------------------------------------------------------- // wxHtmlWindow // (This is probably the only class you will directly use.) // Purpose of this class is to display HTML page (either local // file or downloaded via HTTP protocol) in a window. Width of // window is constant - given in constructor - virtual height // is changed dynamically depending on page size. Once the // window is created you can set its content by calling // SetPage(text) or LoadPage(filename). // ---------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlWindow : public wxScrolledWindow, public wxHtmlWindowInterface, public wxHtmlWindowMouseHelper { wxDECLARE_DYNAMIC_CLASS(wxHtmlWindow); friend class wxHtmlWinModule; public: wxHtmlWindow() : wxHtmlWindowMouseHelper(this) { Init(); } wxHtmlWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHW_DEFAULT_STYLE, const wxString& name = wxT("htmlWindow")) : wxHtmlWindowMouseHelper(this) { Init(); Create(parent, id, pos, size, style, name); } virtual ~wxHtmlWindow(); bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHW_SCROLLBAR_AUTO, const wxString& name = wxT("htmlWindow")); // Set HTML page and display it. !! source is HTML document itself, // it is NOT address/filename of HTML document. If you want to // specify document location, use LoadPage() istead // Return value : false if an error occurred, true otherwise virtual bool SetPage(const wxString& source); // Append to current page bool AppendToPage(const wxString& source); // Load HTML page from given location. Location can be either // a) /usr/wxGTK2/docs/html/wx.htm // b) http://www.somewhere.uk/document.htm // c) ftp://ftp.somesite.cz/pub/something.htm // In case there is no prefix (http:,ftp:), the method // will try to find it itself (1. local file, then http or ftp) // After the page is loaded, the method calls SetPage() to display it. // Note : you can also use path relative to previously loaded page // Return value : same as SetPage virtual bool LoadPage(const wxString& location); // Loads HTML page from file bool LoadFile(const wxFileName& filename); // Returns full location of opened page wxString GetOpenedPage() const {return m_OpenedPage;} // Returns anchor within opened page wxString GetOpenedAnchor() const {return m_OpenedAnchor;} // Returns <TITLE> of opened page or empty string otherwise wxString GetOpenedPageTitle() const {return m_OpenedPageTitle;} // Sets frame in which page title will be displayed. Format is format of // frame title, e.g. "HtmlHelp : %s". It must contain exactly one %s void SetRelatedFrame(wxFrame* frame, const wxString& format); wxFrame* GetRelatedFrame() const {return m_RelatedFrame;} #if wxUSE_STATUSBAR // After(!) calling SetRelatedFrame, this sets statusbar slot where messages // will be displayed. Default is -1 = no messages. void SetRelatedStatusBar(int index); void SetRelatedStatusBar(wxStatusBar*, int index = 0); #endif // wxUSE_STATUSBAR // Sets fonts to be used when displaying HTML page. void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font void SetStandardFonts(int size = -1, const wxString& normal_face = wxEmptyString, const wxString& fixed_face = wxEmptyString); // Sets space between text and window borders. void SetBorders(int b) {m_Borders = b;} // Sets the bitmap to use for background (currnetly it will be tiled, // when/if we have CSS support we could add other possibilities...) void SetBackgroundImage(const wxBitmap& bmpBg) { m_bmpBg = bmpBg; } #if wxUSE_CONFIG // Saves custom settings into cfg config. it will use the path 'path' // if given, otherwise it will save info into currently selected path. // saved values : things set by SetFonts, SetBorders. virtual void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); // ... virtual void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); #endif // wxUSE_CONFIG // Goes to previous/next page (in browsing history) // Returns true if successful, false otherwise bool HistoryBack(); bool HistoryForward(); bool HistoryCanBack(); bool HistoryCanForward(); // Resets history void HistoryClear(); // Returns pointer to conteiners/cells structure. // It should be used ONLY when printing wxHtmlContainerCell* GetInternalRepresentation() const {return m_Cell;} // Adds input filter static void AddFilter(wxHtmlFilter *filter); // Returns a pointer to the parser. wxHtmlWinParser *GetParser() const { return m_Parser; } // Adds HTML processor to this instance of wxHtmlWindow: void AddProcessor(wxHtmlProcessor *processor); // Adds HTML processor to wxHtmlWindow class as whole: static void AddGlobalProcessor(wxHtmlProcessor *processor); // -- Callbacks -- // Sets the title of the window // (depending on the information passed to SetRelatedFrame() method) virtual void OnSetTitle(const wxString& title); // Called when user clicked on hypertext link. Default behaviour is to // call LoadPage(loc) virtual void OnLinkClicked(const wxHtmlLinkInfo& link); // Called when wxHtmlWindow wants to fetch data from an URL (e.g. when // loading a page or loading an image). The data are downloaded if and only if // OnOpeningURL returns true. If OnOpeningURL returns wxHTML_REDIRECT, // it must set *redirect to the new URL virtual wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType WXUNUSED(type), const wxString& WXUNUSED(url), wxString *WXUNUSED(redirect)) const { return wxHTML_OPEN; } #if wxUSE_CLIPBOARD // Helper functions to select parts of page: void SelectWord(const wxPoint& pos); void SelectLine(const wxPoint& pos); void SelectAll(); // Convert selection to text: wxString SelectionToText() { return DoSelectionToText(m_selection); } // Converts current page to text: wxString ToText(); #endif // wxUSE_CLIPBOARD virtual void OnInternalIdle() wxOVERRIDE; /// Returns standard HTML cursor as used by wxHtmlWindow static wxCursor GetDefaultHTMLCursor(HTMLCursor type); static void SetDefaultHTMLCursor(HTMLCursor type, const wxCursor& cursor); protected: void Init(); // Scrolls to anchor of this name. (Anchor is #news // or #features etc. it is part of address sometimes: // http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/index.html#news) // Return value : true if anchor exists, false otherwise bool ScrollToAnchor(const wxString& anchor); // Prepares layout (= fill m_PosX, m_PosY for fragments) based on // actual size of window. This method also setup scrollbars void CreateLayout(); void OnPaint(wxPaintEvent& event); void OnEraseBackground(wxEraseEvent& event); void OnSize(wxSizeEvent& event); void OnMouseMove(wxMouseEvent& event); void OnMouseDown(wxMouseEvent& event); void OnMouseUp(wxMouseEvent& event); #if wxUSE_CLIPBOARD void OnKeyUp(wxKeyEvent& event); void OnDoubleClick(wxMouseEvent& event); void OnCopy(wxCommandEvent& event); void OnClipboardEvent(wxClipboardTextEvent& event); void OnMouseEnter(wxMouseEvent& event); void OnMouseLeave(wxMouseEvent& event); void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); #endif // wxUSE_CLIPBOARD // Returns new filter (will be stored into m_DefaultFilter variable) virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;} // cleans static variables static void CleanUpStatics(); // Returns true if text selection is enabled (wxClipboard must be available // and wxHW_NO_SELECTION not used) bool IsSelectionEnabled() const; enum ClipboardType { Primary, Secondary }; // Copies selection to clipboard if the clipboard support is available // // returns true if anything was copied to clipboard, false otherwise bool CopySelection(ClipboardType t = Secondary); #if wxUSE_CLIPBOARD // Automatic scrolling during selection: void StopAutoScrolling(); #endif // wxUSE_CLIPBOARD wxString DoSelectionToText(wxHtmlSelection *sel); public: // wxHtmlWindowInterface methods: virtual void SetHTMLWindowTitle(const wxString& title) wxOVERRIDE; virtual void OnHTMLLinkClicked(const wxHtmlLinkInfo& link) wxOVERRIDE; virtual wxHtmlOpeningStatus OnHTMLOpeningURL(wxHtmlURLType type, const wxString& url, wxString *redirect) const wxOVERRIDE; virtual wxPoint HTMLCoordsToWindow(wxHtmlCell *cell, const wxPoint& pos) const wxOVERRIDE; virtual wxWindow* GetHTMLWindow() wxOVERRIDE; virtual wxColour GetHTMLBackgroundColour() const wxOVERRIDE; virtual void SetHTMLBackgroundColour(const wxColour& clr) wxOVERRIDE; virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg) wxOVERRIDE; virtual void SetHTMLStatusText(const wxString& text) wxOVERRIDE; virtual wxCursor GetHTMLCursor(HTMLCursor type) const wxOVERRIDE; // implementation of SetPage() bool DoSetPage(const wxString& source); protected: // This is pointer to the first cell in parsed data. (Note: the first cell // is usually top one = all other cells are sub-cells of this one) wxHtmlContainerCell *m_Cell; // parser which is used to parse HTML input. // Each wxHtmlWindow has its own parser because sharing one global // parser would be problematic (because of reentrancy) wxHtmlWinParser *m_Parser; // contains name of actually opened page or empty string if no page opened wxString m_OpenedPage; // contains name of current anchor within m_OpenedPage wxString m_OpenedAnchor; // contains title of actually opened page or empty string if no <TITLE> tag wxString m_OpenedPageTitle; // class for opening files (file system) wxFileSystem* m_FS; // frame in which page title should be displayed & number of its statusbar // reserved for usage with this html window wxFrame *m_RelatedFrame; #if wxUSE_STATUSBAR int m_RelatedStatusBarIndex; wxStatusBar* m_RelatedStatusBar; #endif // wxUSE_STATUSBAR wxString m_TitleFormat; // borders (free space between text and window borders) // defaults to 10 pixels. int m_Borders; // current text selection or NULL wxHtmlSelection *m_selection; // true if the user is dragging mouse to select text bool m_makingSelection; #if wxUSE_CLIPBOARD // time of the last doubleclick event, used to detect tripleclicks // (tripleclicks are used to select whole line): wxMilliClock_t m_lastDoubleClick; // helper class to automatically scroll the window if the user is selecting // text and the mouse leaves wxHtmlWindow: wxHtmlWinAutoScrollTimer *m_timerAutoScroll; #endif // wxUSE_CLIPBOARD private: // erase the window background using m_bmpBg or just solid colour if we // don't have any background image void DoEraseBackground(wxDC& dc); // window content for double buffered rendering, may be invalid until it is // really initialized in OnPaint() wxBitmap m_backBuffer; // background image, may be invalid wxBitmap m_bmpBg; // variables used when user is selecting text wxPoint m_tmpSelFromPos; wxHtmlCell *m_tmpSelFromCell; // if >0 contents of the window is not redrawn // (in order to avoid ugly blinking) int m_tmpCanDrawLocks; // list of HTML filters static wxList m_Filters; // this filter is used when no filter is able to read some file static wxHtmlFilter *m_DefaultFilter; // html processors array: wxHtmlProcessorList *m_Processors; static wxHtmlProcessorList *m_GlobalProcessors; // browser history wxHtmlHistoryArray *m_History; int m_HistoryPos; // if this FLAG is false, items are not added to history bool m_HistoryOn; // Flag used to communicate between OnPaint() and OnEraseBackground(), see // the comments near its use. bool m_isBgReallyErased; // standard mouse cursors static wxCursor *ms_cursorLink; static wxCursor *ms_cursorText; static wxCursor *ms_cursorDefault; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxHtmlWindow); }; class WXDLLIMPEXP_FWD_HTML wxHtmlCellEvent; wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_HTML, wxEVT_HTML_CELL_CLICKED, wxHtmlCellEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_HTML, wxEVT_HTML_CELL_HOVER, wxHtmlCellEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_HTML, wxEVT_HTML_LINK_CLICKED, wxHtmlLinkEvent ); /*! * Html cell window event */ class WXDLLIMPEXP_HTML wxHtmlCellEvent : public wxCommandEvent { public: wxHtmlCellEvent() {} wxHtmlCellEvent(wxEventType commandType, int id, wxHtmlCell *cell, const wxPoint &pt, const wxMouseEvent &ev) : wxCommandEvent(commandType, id) { m_cell = cell; m_pt = pt; m_mouseEvent = ev; m_bLinkWasClicked = false; } wxHtmlCell* GetCell() const { return m_cell; } wxPoint GetPoint() const { return m_pt; } wxMouseEvent GetMouseEvent() const { return m_mouseEvent; } void SetLinkClicked(bool linkclicked) { m_bLinkWasClicked=linkclicked; } bool GetLinkClicked() const { return m_bLinkWasClicked; } // default copy ctor, assignment operator and dtor are ok virtual wxEvent *Clone() const wxOVERRIDE { return new wxHtmlCellEvent(*this); } private: wxHtmlCell *m_cell; wxMouseEvent m_mouseEvent; wxPoint m_pt; bool m_bLinkWasClicked; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHtmlCellEvent); }; /*! * Html link event */ class WXDLLIMPEXP_HTML wxHtmlLinkEvent : public wxCommandEvent { public: wxHtmlLinkEvent() {} wxHtmlLinkEvent(int id, const wxHtmlLinkInfo &linkinfo) : wxCommandEvent(wxEVT_HTML_LINK_CLICKED, id) , m_linkInfo(linkinfo) { } const wxHtmlLinkInfo &GetLinkInfo() const { return m_linkInfo; } // default copy ctor, assignment operator and dtor are ok virtual wxEvent *Clone() const wxOVERRIDE { return new wxHtmlLinkEvent(*this); } private: wxHtmlLinkInfo m_linkInfo; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHtmlLinkEvent); }; typedef void (wxEvtHandler::*wxHtmlCellEventFunction)(wxHtmlCellEvent&); typedef void (wxEvtHandler::*wxHtmlLinkEventFunction)(wxHtmlLinkEvent&); #define wxHtmlCellEventHandler(func) \ wxEVENT_HANDLER_CAST(wxHtmlCellEventFunction, func) #define wxHtmlLinkEventHandler(func) \ wxEVENT_HANDLER_CAST(wxHtmlLinkEventFunction, func) #define EVT_HTML_CELL_CLICKED(id, fn) \ wx__DECLARE_EVT1(wxEVT_HTML_CELL_CLICKED, id, wxHtmlCellEventHandler(fn)) #define EVT_HTML_CELL_HOVER(id, fn) \ wx__DECLARE_EVT1(wxEVT_HTML_CELL_HOVER, id, wxHtmlCellEventHandler(fn)) #define EVT_HTML_LINK_CLICKED(id, fn) \ wx__DECLARE_EVT1(wxEVT_HTML_LINK_CLICKED, id, wxHtmlLinkEventHandler(fn)) // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_HTML_CELL_CLICKED wxEVT_HTML_CELL_CLICKED #define wxEVT_COMMAND_HTML_CELL_HOVER wxEVT_HTML_CELL_HOVER #define wxEVT_COMMAND_HTML_LINK_CLICKED wxEVT_HTML_LINK_CLICKED #endif // wxUSE_HTML #endif // _WX_HTMLWIN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/helpctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/helpctrl.h // Purpose: wxHtmlHelpController // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik // Author: Harm van der Heijden and Vaclav Slavik // Copyright: (c) Harm van der Heijden and Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELPCTRL_H_ #define _WX_HELPCTRL_H_ #include "wx/defs.h" #if wxUSE_WXHTML_HELP #include "wx/helpbase.h" #include "wx/html/helpfrm.h" #define wxID_HTML_HELPFRAME (wxID_HIGHEST + 1) // This style indicates that the window is // embedded in the application and must not be // destroyed by the help controller. #define wxHF_EMBEDDED 0x00008000 // Create a dialog for the help window. #define wxHF_DIALOG 0x00010000 // Create a frame for the help window. #define wxHF_FRAME 0x00020000 // Make the dialog modal when displaying help. #define wxHF_MODAL 0x00040000 class WXDLLIMPEXP_FWD_HTML wxHtmlHelpDialog; class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow; class WXDLLIMPEXP_FWD_HTML wxHtmlHelpFrame; class WXDLLIMPEXP_FWD_HTML wxHtmlHelpDialog; class WXDLLIMPEXP_HTML wxHtmlHelpController : public wxHelpControllerBase // wxEvtHandler { wxDECLARE_DYNAMIC_CLASS(wxHtmlHelpController); public: wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE, wxWindow* parentWindow = NULL); wxHtmlHelpController(wxWindow* parentWindow, int style = wxHF_DEFAULT_STYLE); virtual ~wxHtmlHelpController(); void SetShouldPreventAppExit(bool enable); void SetTitleFormat(const wxString& format); void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); } bool AddBook(const wxString& book_url, bool show_wait_msg = false); bool AddBook(const wxFileName& book_file, bool show_wait_msg = false); bool Display(const wxString& x); bool Display(int id); bool DisplayContents() wxOVERRIDE; bool DisplayIndex(); bool KeywordSearch(const wxString& keyword, wxHelpSearchMode mode = wxHELP_SEARCH_ALL) wxOVERRIDE; wxHtmlHelpWindow* GetHelpWindow() { return m_helpWindow; } void SetHelpWindow(wxHtmlHelpWindow* helpWindow); wxHtmlHelpFrame* GetFrame() { return m_helpFrame; } wxHtmlHelpDialog* GetDialog() { return m_helpDialog; } #if wxUSE_CONFIG void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); // Assigns config object to the Ctrl. This config is then // used in subsequent calls to Read/WriteCustomization of both help // Ctrl and it's wxHtmlWindow virtual void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); virtual void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); #endif // wxUSE_CONFIG //// Backward compatibility with wxHelpController API virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) wxOVERRIDE { return Initialize(file); } virtual bool Initialize(const wxString& file) wxOVERRIDE; virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) wxOVERRIDE {} virtual bool LoadFile(const wxString& file = wxT("")) wxOVERRIDE; virtual bool DisplaySection(int sectionNo) wxOVERRIDE; virtual bool DisplaySection(const wxString& section) wxOVERRIDE { return Display(section); } virtual bool DisplayBlock(long blockNo) wxOVERRIDE { return DisplaySection(blockNo); } virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos) wxOVERRIDE; virtual void SetFrameParameters(const wxString& titleFormat, const wxSize& size, const wxPoint& pos = wxDefaultPosition, bool newFrameEachTime = false) wxOVERRIDE; /// Obtains the latest settings used by the help frame and the help /// frame. virtual wxFrame *GetFrameParameters(wxSize *size = NULL, wxPoint *pos = NULL, bool *newFrameEachTime = NULL) wxOVERRIDE; // Get direct access to help data: wxHtmlHelpData *GetHelpData() { return &m_helpData; } virtual bool Quit() wxOVERRIDE ; virtual void OnQuit() wxOVERRIDE {} void OnCloseFrame(wxCloseEvent& evt); // Make the help controller's frame 'modal' if // needed void MakeModalIfNeeded(); // Find the top-most parent window wxWindow* FindTopLevelWindow(); protected: void Init(int style); virtual wxWindow* CreateHelpWindow(); virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data); virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData *data); virtual void DestroyHelpWindow(); wxHtmlHelpData m_helpData; wxHtmlHelpWindow* m_helpWindow; #if wxUSE_CONFIG wxConfigBase * m_Config; wxString m_ConfigRoot; #endif // wxUSE_CONFIG wxString m_titleFormat; int m_FrameStyle; wxHtmlHelpFrame* m_helpFrame; wxHtmlHelpDialog* m_helpDialog; bool m_shouldPreventAppExit; wxDECLARE_NO_COPY_CLASS(wxHtmlHelpController); }; /* * wxHtmlModalHelp * A convenience class particularly for use on wxMac, * where you can only show modal dialogs from a modal * dialog. * * Use like this: * * wxHtmlModalHelp help(parent, filename, topic); * * If topic is empty, the help contents is displayed. */ class WXDLLIMPEXP_HTML wxHtmlModalHelp { public: wxHtmlModalHelp(wxWindow* parent, const wxString& helpFile, const wxString& topic = wxEmptyString, int style = wxHF_DEFAULT_STYLE | wxHF_DIALOG | wxHF_MODAL); }; #endif // wxUSE_WXHTML_HELP #endif // _WX_HELPCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmlcell.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmlcell.h // Purpose: wxHtmlCell class is used by wxHtmlWindow/wxHtmlWinParser // as a basic visual element of HTML page // Author: Vaclav Slavik // Copyright: (c) 1999-2003 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMLCELL_H_ #define _WX_HTMLCELL_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/html/htmltag.h" #include "wx/html/htmldefs.h" #include "wx/window.h" #include "wx/brush.h" class WXDLLIMPEXP_FWD_HTML wxHtmlWindowInterface; class WXDLLIMPEXP_FWD_HTML wxHtmlLinkInfo; class WXDLLIMPEXP_FWD_HTML wxHtmlCell; class WXDLLIMPEXP_FWD_HTML wxHtmlContainerCell; // wxHtmlSelection is data holder with information about text selection. // Selection is defined by two positions (beginning and end of the selection) // and two leaf(!) cells at these positions. class WXDLLIMPEXP_HTML wxHtmlSelection { public: wxHtmlSelection() : m_fromPos(wxDefaultPosition), m_toPos(wxDefaultPosition), m_fromCharacterPos(-1), m_toCharacterPos(-1), m_fromCell(NULL), m_toCell(NULL) {} // this version is used for the user selection defined with the mouse void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell, const wxPoint& toPos, const wxHtmlCell *toCell); void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell); const wxHtmlCell *GetFromCell() const { return m_fromCell; } const wxHtmlCell *GetToCell() const { return m_toCell; } // these values are in absolute coordinates: const wxPoint& GetFromPos() const { return m_fromPos; } const wxPoint& GetToPos() const { return m_toPos; } // these are From/ToCell's private data void ClearFromToCharacterPos() { m_toCharacterPos = m_fromCharacterPos = -1; } bool AreFromToCharacterPosSet() const { return m_toCharacterPos != -1 && m_fromCharacterPos != -1; } void SetFromCharacterPos (wxCoord pos) { m_fromCharacterPos = pos; } void SetToCharacterPos (wxCoord pos) { m_toCharacterPos = pos; } wxCoord GetFromCharacterPos () const { return m_fromCharacterPos; } wxCoord GetToCharacterPos () const { return m_toCharacterPos; } bool IsEmpty() const { return m_fromPos == wxDefaultPosition && m_toPos == wxDefaultPosition; } private: wxPoint m_fromPos, m_toPos; wxCoord m_fromCharacterPos, m_toCharacterPos; const wxHtmlCell *m_fromCell, *m_toCell; }; enum wxHtmlSelectionState { wxHTML_SEL_OUT, // currently rendered cell is outside the selection wxHTML_SEL_IN, // ... is inside selection wxHTML_SEL_CHANGING // ... is the cell on which selection state changes }; // Selection state is passed to wxHtmlCell::Draw so that it can render itself // differently e.g. when inside text selection or outside it. class WXDLLIMPEXP_HTML wxHtmlRenderingState { public: wxHtmlRenderingState() : m_selState(wxHTML_SEL_OUT) { m_bgMode = wxBRUSHSTYLE_SOLID; } void SetSelectionState(wxHtmlSelectionState s) { m_selState = s; } wxHtmlSelectionState GetSelectionState() const { return m_selState; } void SetFgColour(const wxColour& c) { m_fgColour = c; } const wxColour& GetFgColour() const { return m_fgColour; } void SetBgColour(const wxColour& c) { m_bgColour = c; } const wxColour& GetBgColour() const { return m_bgColour; } void SetBgMode(int m) { m_bgMode = m; } int GetBgMode() const { return m_bgMode; } private: wxHtmlSelectionState m_selState; wxColour m_fgColour, m_bgColour; int m_bgMode; }; // HTML rendering customization. This class is used when rendering wxHtmlCells // as a callback: class WXDLLIMPEXP_HTML wxHtmlRenderingStyle { public: virtual ~wxHtmlRenderingStyle() {} virtual wxColour GetSelectedTextColour(const wxColour& clr) = 0; virtual wxColour GetSelectedTextBgColour(const wxColour& clr) = 0; }; // Standard style: class WXDLLIMPEXP_HTML wxDefaultHtmlRenderingStyle : public wxHtmlRenderingStyle { public: virtual wxColour GetSelectedTextColour(const wxColour& clr) wxOVERRIDE; virtual wxColour GetSelectedTextBgColour(const wxColour& clr) wxOVERRIDE; }; // Information given to cells when drawing them. Contains rendering state, // selection information and rendering style object that can be used to // customize the output. class WXDLLIMPEXP_HTML wxHtmlRenderingInfo { public: wxHtmlRenderingInfo() : m_selection(NULL), m_style(NULL), m_prevUnderlined(false) { } void SetSelection(wxHtmlSelection *s) { m_selection = s; } wxHtmlSelection *GetSelection() const { return m_selection; } void SetStyle(wxHtmlRenderingStyle *style) { m_style = style; } wxHtmlRenderingStyle& GetStyle() { return *m_style; } void SetCurrentUnderlined(bool u) { m_prevUnderlined = u; } bool WasPreviousUnderlined() const { return m_prevUnderlined; } wxHtmlRenderingState& GetState() { return m_state; } protected: wxHtmlSelection *m_selection; wxHtmlRenderingStyle *m_style; wxHtmlRenderingState m_state; bool m_prevUnderlined; }; // Flags for wxHtmlCell::FindCellByPos enum { wxHTML_FIND_EXACT = 1, wxHTML_FIND_NEAREST_BEFORE = 2, wxHTML_FIND_NEAREST_AFTER = 4 }; // Superscript/subscript/normal script mode of a cell enum wxHtmlScriptMode { wxHTML_SCRIPT_NORMAL, wxHTML_SCRIPT_SUB, wxHTML_SCRIPT_SUP }; // --------------------------------------------------------------------------- // wxHtmlCell // Internal data structure. It represents fragments of parsed // HTML page - a word, picture, table, horizontal line and so // on. It is used by wxHtmlWindow to represent HTML page in // memory. // --------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlCell : public wxObject { public: wxHtmlCell(); virtual ~wxHtmlCell(); void SetParent(wxHtmlContainerCell *p) {m_Parent = p;} wxHtmlContainerCell *GetParent() const {return m_Parent;} int GetPosX() const {return m_PosX;} int GetPosY() const {return m_PosY;} int GetWidth() const {return m_Width;} // Returns the maximum possible length of the cell. // Call Layout at least once before using GetMaxTotalWidth() virtual int GetMaxTotalWidth() const { return m_Width; } int GetHeight() const {return m_Height;} int GetDescent() const {return m_Descent;} void SetScriptMode(wxHtmlScriptMode mode, long previousBase); wxHtmlScriptMode GetScriptMode() const { return m_ScriptMode; } long GetScriptBaseline() { return m_ScriptBaseline; } // Formatting cells are not visible on the screen, they only alter // renderer's state. bool IsFormattingCell() const { return m_Width == 0 && m_Height == 0; } const wxString& GetId() const { return m_id; } void SetId(const wxString& id) { m_id = id; } // returns the link associated with this cell. The position is position // within the cell so it varies from 0 to m_Width, from 0 to m_Height virtual wxHtmlLinkInfo* GetLink(int WXUNUSED(x) = 0, int WXUNUSED(y) = 0) const { return m_Link; } // Returns cursor to be used when mouse is over the cell, can be // overridden by the derived classes to use a different cursor whenever the // mouse is over this cell. virtual wxCursor GetMouseCursor(wxHtmlWindowInterface *window) const; // Returns cursor to be used when mouse is over the given point, can be // overridden if the cursor should change depending on where exactly inside // the cell the mouse is. virtual wxCursor GetMouseCursorAt(wxHtmlWindowInterface *window, const wxPoint& relPos) const; // return next cell among parent's cells wxHtmlCell *GetNext() const {return m_Next;} // returns first child cell (if there are any, i.e. if this is container): virtual wxHtmlCell* GetFirstChild() const { return NULL; } // members writing methods virtual void SetPos(int x, int y) {m_PosX = x; m_PosY = y;} void SetLink(const wxHtmlLinkInfo& link); void SetNext(wxHtmlCell *cell) {m_Next = cell;} // 1. adjust cell's width according to the fact that maximal possible width // is w. (this has sense when working with horizontal lines, tables // etc.) // 2. prepare layout (=fill-in m_PosX, m_PosY (and sometime m_Height) // members) = place items to fit window, according to the width w virtual void Layout(int w); // renders the cell virtual void Draw(wxDC& WXUNUSED(dc), int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(view_y1), int WXUNUSED(view_y2), wxHtmlRenderingInfo& WXUNUSED(info)) {} // proceed drawing actions in case the cell is not visible (scrolled out of // screen). This is needed to change fonts, colors and so on. virtual void DrawInvisible(wxDC& WXUNUSED(dc), int WXUNUSED(x), int WXUNUSED(y), wxHtmlRenderingInfo& WXUNUSED(info)) {} // This method returns pointer to the FIRST cell for that // the condition // is true. It first checks if the condition is true for this // cell and then calls m_Next->Find(). (Note: it checks // all subcells if the cell is container) // Condition is unique condition identifier (see htmldefs.h) // (user-defined condition IDs should start from 10000) // and param is optional parameter // Example : m_Cell->Find(wxHTML_COND_ISANCHOR, "news"); // returns pointer to anchor news virtual const wxHtmlCell* Find(int condition, const void* param) const; // This function is called when mouse button is clicked over the cell. // Returns true if a link is clicked, false otherwise. // // 'window' is pointer to wxHtmlWindowInterface of the window which // generated the event. // HINT: if this handling is not enough for you you should use // wxHtmlWidgetCell virtual bool ProcessMouseClick(wxHtmlWindowInterface *window, const wxPoint& pos, const wxMouseEvent& event); // This method is called when paginating HTML, e.g. when printing. // // On input, pagebreak contains y-coordinate of page break (i.e. the // horizontal line that should not be crossed by words, images etc.) // relative to the parent cell on entry and may be modified to request a // page break at a position before it if this cell cannot be divided into // two pieces (each one on its own page). // // Note that page break must still happen on the current page, i.e. the // returned value must be strictly greater than "*pagebreak - pageHeight" // and less or equal to "*pagebreak" for the value of pagebreak on input. // // Returned value : true if pagebreak was modified, false otherwise virtual bool AdjustPagebreak(int *pagebreak, int pageHeight) const; // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default // is true - the cell can be split on two pages // If there is no way to fit a cell in the current page size, the cell // is always split, ignoring this setting. void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; } // Can the line be broken before this cell? virtual bool IsLinebreakAllowed() const { return !IsFormattingCell(); } // Returns true for simple == terminal cells, i.e. not composite ones. // This if for internal usage only and may disappear in future versions! virtual bool IsTerminalCell() const { return true; } // Find a cell inside this cell positioned at the given coordinates // (relative to this's positions). Returns NULL if no such cell exists. // The flag can be used to specify whether to look for terminal or // nonterminal cells or both. In either case, returned cell is deepest // cell in cells tree that contains [x,y]. virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y, unsigned flags = wxHTML_FIND_EXACT) const; // Returns absolute position of the cell on HTML canvas. // If rootCell is provided, then it's considered to be the root of the // hierarchy and the returned value is relative to it. wxPoint GetAbsPos(wxHtmlCell *rootCell = NULL) const; // Returns root cell of the hierarchy (i.e. grand-grand-...-parent that // doesn't have a parent itself) wxHtmlCell *GetRootCell() const; // Returns first (last) terminal cell inside this cell. It may return NULL, // but it is rare -- only if there are no terminals in the tree. virtual wxHtmlCell *GetFirstTerminal() const { return wxConstCast(this, wxHtmlCell); } virtual wxHtmlCell *GetLastTerminal() const { return wxConstCast(this, wxHtmlCell); } // Returns cell's depth, i.e. how far under the root cell it is // (if it is the root, depth is 0) unsigned GetDepth() const; // Returns true if the cell appears before 'cell' in natural order of // cells (= as they are read). If cell A is (grand)parent of cell B, // then both A.IsBefore(B) and B.IsBefore(A) always return true. bool IsBefore(wxHtmlCell *cell) const; // Converts the cell into text representation. If sel != NULL then // only part of the cell inside the selection is converted. virtual wxString ConvertToText(wxHtmlSelection *WXUNUSED(sel)) const { return wxEmptyString; } protected: // pointer to the next cell wxHtmlCell *m_Next; // pointer to parent cell wxHtmlContainerCell *m_Parent; // dimensions of fragment (m_Descent is used to position text & images) int m_Width, m_Height, m_Descent; // position where the fragment is drawn: int m_PosX, m_PosY; // superscript/subscript/normal: wxHtmlScriptMode m_ScriptMode; long m_ScriptBaseline; // destination address if this fragment is hypertext link, NULL otherwise wxHtmlLinkInfo *m_Link; // true if this cell can be placed on pagebreak, false otherwise bool m_CanLiveOnPagebreak; // unique identifier of the cell, generated from "id" property of tags wxString m_id; wxDECLARE_ABSTRACT_CLASS(wxHtmlCell); wxDECLARE_NO_COPY_CLASS(wxHtmlCell); }; // ---------------------------------------------------------------------------- // Inherited cells: // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // wxHtmlWordCell // Single word in input stream. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlWordCell : public wxHtmlCell { public: wxHtmlWordCell(const wxString& word, const wxDC& dc); void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info) wxOVERRIDE; virtual wxCursor GetMouseCursor(wxHtmlWindowInterface *window) const wxOVERRIDE; virtual wxString ConvertToText(wxHtmlSelection *sel) const wxOVERRIDE; bool IsLinebreakAllowed() const wxOVERRIDE { return m_allowLinebreak; } void SetPreviousWord(wxHtmlWordCell *cell); protected: virtual wxString GetAllAsText() const { return m_Word; } virtual wxString GetPartAsText(int begin, int end) const { return m_Word.Mid(begin, end - begin); } void SetSelectionPrivPos(const wxDC& dc, wxHtmlSelection *s) const; void Split(const wxDC& dc, const wxPoint& selFrom, const wxPoint& selTo, unsigned& pos1, unsigned& pos2) const; wxString m_Word; bool m_allowLinebreak; wxDECLARE_ABSTRACT_CLASS(wxHtmlWordCell); wxDECLARE_NO_COPY_CLASS(wxHtmlWordCell); }; // wxHtmlWordCell specialization for storing text fragments with embedded // '\t's; these differ from normal words in that the displayed text is // different from the text copied to clipboard class WXDLLIMPEXP_HTML wxHtmlWordWithTabsCell : public wxHtmlWordCell { public: wxHtmlWordWithTabsCell(const wxString& word, const wxString& wordOrig, size_t linepos, const wxDC& dc) : wxHtmlWordCell(word, dc), m_wordOrig(wordOrig), m_linepos(linepos) {} protected: virtual wxString GetAllAsText() const wxOVERRIDE; virtual wxString GetPartAsText(int begin, int end) const wxOVERRIDE; wxString m_wordOrig; size_t m_linepos; }; // Container contains other cells, thus forming tree structure of rendering // elements. Basic code of layout algorithm is contained in this class. class WXDLLIMPEXP_HTML wxHtmlContainerCell : public wxHtmlCell { public: explicit wxHtmlContainerCell(wxHtmlContainerCell *parent); virtual ~wxHtmlContainerCell(); virtual void Layout(int w) wxOVERRIDE; virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info) wxOVERRIDE; virtual void DrawInvisible(wxDC& dc, int x, int y, wxHtmlRenderingInfo& info) wxOVERRIDE; virtual bool AdjustPagebreak(int *pagebreak, int pageHeight) const wxOVERRIDE; // insert cell at the end of m_Cells list void InsertCell(wxHtmlCell *cell); // Detach a child cell. After calling this method, it's the caller // responsibility to destroy this cell (possibly by calling InsertCell() // with it to attach it elsewhere). void Detach(wxHtmlCell *cell); // sets horizontal/vertical alignment void SetAlignHor(int al) {m_AlignHor = al; m_LastLayout = -1;} int GetAlignHor() const {return m_AlignHor;} void SetAlignVer(int al) {m_AlignVer = al; m_LastLayout = -1;} int GetAlignVer() const {return m_AlignVer;} // sets left-border indentation. units is one of wxHTML_UNITS_* constants // what is combination of wxHTML_INDENT_* void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS); // returns the indentation. ind is one of wxHTML_INDENT_* constants int GetIndent(int ind) const; // returns type of value returned by GetIndent(ind) int GetIndentUnits(int ind) const; // sets alignment info based on given tag's params void SetAlign(const wxHtmlTag& tag); // sets floating width adjustment // (examples : 32 percent of parent container, // -15 pixels percent (this means 100 % - 15 pixels) void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units; m_LastLayout = -1;} void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0); // sets minimal height of this container. void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;} void SetBackgroundColour(const wxColour& clr) {m_BkColour = clr;} // returns background colour (of wxNullColour if none set), so that widgets can // adapt to it: wxColour GetBackgroundColour(); void SetBorder(const wxColour& clr1, const wxColour& clr2, int border = 1) {m_Border = border; m_BorderColour1 = clr1; m_BorderColour2 = clr2;} virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const wxOVERRIDE; virtual const wxHtmlCell* Find(int condition, const void* param) const wxOVERRIDE; virtual bool ProcessMouseClick(wxHtmlWindowInterface *window, const wxPoint& pos, const wxMouseEvent& event) wxOVERRIDE; virtual wxHtmlCell* GetFirstChild() const wxOVERRIDE { return m_Cells; } // returns last child cell: wxHtmlCell* GetLastChild() const { return m_LastCell; } // see comment in wxHtmlCell about this method virtual bool IsTerminalCell() const wxOVERRIDE { return false; } virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y, unsigned flags = wxHTML_FIND_EXACT) const wxOVERRIDE; virtual wxHtmlCell *GetFirstTerminal() const wxOVERRIDE; virtual wxHtmlCell *GetLastTerminal() const wxOVERRIDE; // Removes indentation on top or bottom of the container (i.e. above or // below first/last terminal cell). For internal use only. virtual void RemoveExtraSpacing(bool top, bool bottom); // Returns the maximum possible length of the container. // Call Layout at least once before using GetMaxTotalWidth() virtual int GetMaxTotalWidth() const wxOVERRIDE { return m_MaxTotalWidth; } protected: void UpdateRenderingStatePre(wxHtmlRenderingInfo& info, wxHtmlCell *cell) const; void UpdateRenderingStatePost(wxHtmlRenderingInfo& info, wxHtmlCell *cell) const; protected: int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom; // indentation of subcells. There is always m_Indent pixels // big space between given border of the container and the subcells // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels int m_MinHeight, m_MinHeightAlign; // minimal height. wxHtmlCell *m_Cells, *m_LastCell; // internal cells, m_Cells points to the first of them, m_LastCell to the last one. // (LastCell is needed only to speed-up InsertCell) int m_AlignHor, m_AlignVer; // alignment horizontal and vertical (left, center, right) int m_WidthFloat, m_WidthFloatUnits; // width float is used in adjustWidth wxColour m_BkColour; // background color of this container int m_Border; // border size. Draw only if m_Border > 0 wxColour m_BorderColour1, m_BorderColour2; // borders color of this container int m_LastLayout; // if != -1 then call to Layout may be no-op // if previous call to Layout has same argument int m_MaxTotalWidth; // Maximum possible length if ignoring line wrap wxDECLARE_ABSTRACT_CLASS(wxHtmlContainerCell); wxDECLARE_NO_COPY_CLASS(wxHtmlContainerCell); }; // --------------------------------------------------------------------------- // wxHtmlColourCell // Color changer. // --------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlColourCell : public wxHtmlCell { public: wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;} virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info) wxOVERRIDE; virtual void DrawInvisible(wxDC& dc, int x, int y, wxHtmlRenderingInfo& info) wxOVERRIDE; protected: wxColour m_Colour; unsigned m_Flags; wxDECLARE_ABSTRACT_CLASS(wxHtmlColourCell); wxDECLARE_NO_COPY_CLASS(wxHtmlColourCell); }; //-------------------------------------------------------------------------------- // wxHtmlFontCell // Sets actual font used for text rendering //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlFontCell : public wxHtmlCell { public: wxHtmlFontCell(wxFont *font) : wxHtmlCell() { m_Font = (*font); } virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info) wxOVERRIDE; virtual void DrawInvisible(wxDC& dc, int x, int y, wxHtmlRenderingInfo& info) wxOVERRIDE; protected: wxFont m_Font; wxDECLARE_ABSTRACT_CLASS(wxHtmlFontCell); wxDECLARE_NO_COPY_CLASS(wxHtmlFontCell); }; //-------------------------------------------------------------------------------- // wxHtmlwidgetCell // This cell is connected with wxWindow object // You can use it to insert windows into HTML page // (buttons, input boxes etc.) //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlWidgetCell : public wxHtmlCell { public: // !!! wnd must have correct parent! // if w != 0 then the m_Wnd has 'floating' width - it adjust // it's width according to parent container's width // (w is percent of parent's width) wxHtmlWidgetCell(wxWindow *wnd, int w = 0); virtual ~wxHtmlWidgetCell() { m_Wnd->Destroy(); } virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info) wxOVERRIDE; virtual void DrawInvisible(wxDC& dc, int x, int y, wxHtmlRenderingInfo& info) wxOVERRIDE; virtual void Layout(int w) wxOVERRIDE; protected: wxWindow* m_Wnd; int m_WidthFloat; // width float is used in adjustWidth (it is in percents) wxDECLARE_ABSTRACT_CLASS(wxHtmlWidgetCell); wxDECLARE_NO_COPY_CLASS(wxHtmlWidgetCell); }; //-------------------------------------------------------------------------------- // wxHtmlLinkInfo // Internal data structure. It represents hypertext link //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlLinkInfo : public wxObject { public: wxHtmlLinkInfo() { m_Event = NULL; m_Cell = NULL; } wxHtmlLinkInfo(const wxString& href, const wxString& target = wxString()) : m_Href(href) , m_Target(target) { m_Event = NULL; m_Cell = NULL; } void SetEvent(const wxMouseEvent *e) { m_Event = e; } void SetHtmlCell(const wxHtmlCell *e) { m_Cell = e; } wxString GetHref() const { return m_Href; } wxString GetTarget() const { return m_Target; } const wxMouseEvent* GetEvent() const { return m_Event; } const wxHtmlCell* GetHtmlCell() const { return m_Cell; } private: wxString m_Href, m_Target; const wxMouseEvent *m_Event; const wxHtmlCell *m_Cell; }; // ---------------------------------------------------------------------------- // wxHtmlTerminalCellsInterator // ---------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlTerminalCellsInterator { public: wxHtmlTerminalCellsInterator(const wxHtmlCell *from, const wxHtmlCell *to) : m_to(to), m_pos(from) {} operator bool() const { return m_pos != NULL; } const wxHtmlCell* operator++(); const wxHtmlCell* operator->() const { return m_pos; } const wxHtmlCell* operator*() const { return m_pos; } private: const wxHtmlCell *m_to, *m_pos; }; #endif // wxUSE_HTML #endif // _WX_HTMLCELL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmlpars.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmlpars.h // Purpose: wxHtmlParser class (generic parser) // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMLPARS_H_ #define _WX_HTMLPARS_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/html/htmltag.h" #include "wx/filesys.h" #include "wx/hashmap.h" #include "wx/hashset.h" #include "wx/vector.h" #include "wx/fontenc.h" class WXDLLIMPEXP_FWD_BASE wxMBConv; class WXDLLIMPEXP_FWD_HTML wxHtmlParser; class WXDLLIMPEXP_FWD_HTML wxHtmlTagHandler; class WXDLLIMPEXP_FWD_HTML wxHtmlEntitiesParser; class wxHtmlTextPieces; class wxHtmlParserState; WX_DECLARE_HASH_SET_WITH_DECL_PTR(wxHtmlTagHandler*, wxPointerHash, wxPointerEqual, wxHtmlTagHandlersSet, class WXDLLIMPEXP_HTML); WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxHtmlTagHandler*, wxHtmlTagHandlersHash, class WXDLLIMPEXP_HTML); enum wxHtmlURLType { wxHTML_URL_PAGE, wxHTML_URL_IMAGE, wxHTML_URL_OTHER }; // This class handles generic parsing of HTML document : it scans // the document and divides it into blocks of tags (where one block // consists of starting and ending tag and of text between these // 2 tags. class WXDLLIMPEXP_HTML wxHtmlParser : public wxObject { wxDECLARE_ABSTRACT_CLASS(wxHtmlParser); public: wxHtmlParser(); virtual ~wxHtmlParser(); // Sets the class which will be used for opening files void SetFS(wxFileSystem *fs) { m_FS = fs; } wxFileSystem* GetFS() const { return m_FS; } // Opens file if the parser is allowed to open given URL (may be forbidden // for security reasons) virtual wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const; // You can simply call this method when you need parsed output. // This method does these things: // 1. call InitParser(source); // 2. call DoParsing(); // 3. call GetProduct(); (its return value is then returned) // 4. call DoneParser(); wxObject* Parse(const wxString& source); // Sets the source. This must be called before running Parse() method. virtual void InitParser(const wxString& source); // This must be called after Parse(). virtual void DoneParser(); // May be called during parsing to immediately return from Parse(). virtual void StopParsing() { m_stopParsing = true; } // Parses the m_Source from begin_pos to end_pos-1. // (in noparams version it parses whole m_Source) void DoParsing(const wxString::const_iterator& begin_pos, const wxString::const_iterator& end_pos); void DoParsing(); // Returns pointer to the tag at parser's current position wxHtmlTag *GetCurrentTag() const { return m_CurTag; } // Returns product of parsing // Returned value is result of parsing of the part. The type of this result // depends on internal representation in derived parser // (see wxHtmlWinParser for details). virtual wxObject* GetProduct() = 0; // adds handler to the list & hash table of handlers. virtual void AddTagHandler(wxHtmlTagHandler *handler); // Forces the handler to handle additional tags (not returned by GetSupportedTags). // The handler should already be in use by this parser. // Example: you want to parse following pseudo-html structure: // <myitems> // <it name="one" value="1"> // <it name="two" value="2"> // </myitems> // <it> This last it has different meaning, we don't want it to be parsed by myitems handler! // handler can handle only 'myitems' (e.g. its GetSupportedTags returns "MYITEMS") // you can call PushTagHandler(handler, "IT") when you find <myitems> // and call PopTagHandler() when you find </myitems> void PushTagHandler(wxHtmlTagHandler *handler, const wxString& tags); // Restores state before last call to PushTagHandler void PopTagHandler(); const wxString* GetSource() {return m_Source;} void SetSource(const wxString& src); // Sets HTML source and remembers current parser's state so that it can // later be restored. This is useful for on-line modifications of // HTML source (for example, <pre> handler replaces spaces with &nbsp; // and newlines with <br>) virtual void SetSourceAndSaveState(const wxString& src); // Restores parser's state from stack or returns false if the stack is // empty virtual bool RestoreState(); // Returns HTML source inside the element (i.e. between the starting // and ending tag) wxString GetInnerSource(const wxHtmlTag& tag); // Parses HTML string 'markup' and extracts charset info from <meta> tag // if present. Returns empty string if the tag is missing. // For wxHTML's internal use. static wxString ExtractCharsetInformation(const wxString& markup); // Returns entity parser object, used to substitute HTML &entities; wxHtmlEntitiesParser *GetEntitiesParser() const { return m_entitiesParser; } // Returns true if the tag starting at the given position is a comment tag // // p should point to '<' character and is modified to point to the closing // '>' of the end comment tag if this is indeed a comment static bool SkipCommentTag(wxString::const_iterator& p, wxString::const_iterator end); protected: // DOM structure void CreateDOMTree(); void DestroyDOMTree(); void CreateDOMSubTree(wxHtmlTag *cur, const wxString::const_iterator& begin_pos, const wxString::const_iterator& end_pos, wxHtmlTagsCache *cache); // Adds text to the output. // This is called from Parse() and must be overridden in derived classes. // txt is not guaranteed to be only one word. It is largest continuous part // of text (= not broken by tags) virtual void AddText(const wxString& txt) = 0; // Adds tag and proceeds it. Parse() may (and usually is) called from this method. // This is called from Parse() and may be overridden. // Default behaviour is that it looks for proper handler in m_Handlers. The tag is // ignored if no hander is found. // Derived class is *responsible* for filling in m_Handlers table. virtual void AddTag(const wxHtmlTag& tag); protected: // DOM tree: wxHtmlTag *m_CurTag; wxHtmlTag *m_Tags; wxHtmlTextPieces *m_TextPieces; size_t m_CurTextPiece; const wxString *m_Source; wxHtmlParserState *m_SavedStates; // handlers that handle particular tags. The table is accessed by // key = tag's name. // This attribute MUST be filled by derived class otherwise it would // be empty and no tags would be recognized // (see wxHtmlWinParser for details about filling it) // m_HandlersHash is for random access based on knowledge of tag name (BR, P, etc.) // it may (and often does) contain more references to one object // m_HandlersList is list of all handlers and it is guaranteed to contain // only one reference to each handler instance. wxHtmlTagHandlersSet m_HandlersSet; wxHtmlTagHandlersHash m_HandlersHash; wxDECLARE_NO_COPY_CLASS(wxHtmlParser); // class for opening files (file system) wxFileSystem *m_FS; // handlers stack used by PushTagHandler and PopTagHandler wxVector<wxHtmlTagHandlersHash*> m_HandlersStack; // entity parse wxHtmlEntitiesParser *m_entitiesParser; // flag indicating that the parser should stop bool m_stopParsing; }; // This class (and derived classes) cooperates with wxHtmlParser. // Each recognized tag is passed to handler which is capable // of handling it. Each tag is handled in 3 steps: // 1. Handler will modifies state of parser // (using its public methods) // 2. Parser parses source between starting and ending tag // 3. Handler restores original state of the parser class WXDLLIMPEXP_HTML wxHtmlTagHandler : public wxObject { wxDECLARE_ABSTRACT_CLASS(wxHtmlTagHandler); public: wxHtmlTagHandler() : wxObject () { m_Parser = NULL; } // Sets the parser. // NOTE : each _instance_ of handler is guaranteed to be called // only by one parser. This means you don't have to care about // reentrancy. virtual void SetParser(wxHtmlParser *parser) { m_Parser = parser; } // Get the parser associated with this tag handler. wxHtmlParser* GetParser() const { return m_Parser; } // Returns list of supported tags. The list is in uppercase and // tags are delimited by ','. // Example : "I,B,FONT,P" // is capable of handling italic, bold, font and paragraph tags virtual wxString GetSupportedTags() = 0; // This is hadling core method. It does all the Steps 1-3. // To process step 2, you can call ParseInner() // returned value : true if it called ParseInner(), // false etherwise virtual bool HandleTag(const wxHtmlTag& tag) = 0; protected: // parses input between beginning and ending tag. // m_Parser must be set. void ParseInner(const wxHtmlTag& tag) { m_Parser->DoParsing(tag.GetBeginIter(), tag.GetEndIter1()); } // Parses given source as if it was tag's inner code (see // wxHtmlParser::GetInnerSource). Unlike ParseInner(), this method lets // you specify the source code to parse. This is useful when you need to // modify the inner text before parsing. void ParseInnerSource(const wxString& source); wxHtmlParser *m_Parser; wxDECLARE_NO_COPY_CLASS(wxHtmlTagHandler); }; // This class is used to parse HTML entities in strings. It can handle // both named entities and &#xxxx entries where xxxx is Unicode code. class WXDLLIMPEXP_HTML wxHtmlEntitiesParser : public wxObject { wxDECLARE_DYNAMIC_CLASS(wxHtmlEntitiesParser); public: wxHtmlEntitiesParser(); virtual ~wxHtmlEntitiesParser(); // Sets encoding of output string. // Has no effect if wxUSE_UNICODE==1 #if wxUSE_UNICODE void SetEncoding(wxFontEncoding WXUNUSED(encoding)) {} #else void SetEncoding(wxFontEncoding encoding); #endif // Parses entities in input and replaces them with respective characters // (with respect to output encoding) wxString Parse(const wxString& input) const; // Returns character for given entity or 0 if the enity is unknown wxChar GetEntityChar(const wxString& entity) const; // Returns character that represents given Unicode code #if wxUSE_UNICODE wxChar GetCharForCode(unsigned code) const { return (wxChar)code; } #else wxChar GetCharForCode(unsigned code) const; #endif protected: #if !wxUSE_UNICODE wxMBConv *m_conv; wxFontEncoding m_encoding; #endif wxDECLARE_NO_COPY_CLASS(wxHtmlEntitiesParser); }; #endif #endif // _WX_HTMLPARS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/htmlproc.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/htmlprep.h // Purpose: HTML processor // Author: Vaclav Slavik // Copyright: (c) 2001 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTMLPREP_H_ #define _WX_HTMLPREP_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/string.h" // Priority of preprocessor in the chain. The higher, the earlier it is used enum { wxHTML_PRIORITY_DONTCARE = 128, // if the order doesn't matter, use this // priority wxHTML_PRIORITY_SYSTEM = 256 // >=256 is only for wxHTML's internals }; // Classes derived from this class serve as simple text processors for // wxHtmlWindow. wxHtmlWindow runs HTML markup through all registered // processors before displaying it, thus allowing for on-the-fly // modifications of the markup. class WXDLLIMPEXP_HTML wxHtmlProcessor : public wxObject { wxDECLARE_ABSTRACT_CLASS(wxHtmlProcessor); public: wxHtmlProcessor() : wxObject(), m_enabled(true) {} virtual ~wxHtmlProcessor() {} // Process input text and return processed result virtual wxString Process(const wxString& text) const = 0; // Return priority value of this processor. The higher, the sooner // is the processor applied to the text. virtual int GetPriority() const { return wxHTML_PRIORITY_DONTCARE; } // Enable/disable the processor. wxHtmlWindow won't use a disabled // processor even if it is in its processors queue. virtual void Enable(bool enable = true) { m_enabled = enable; } bool IsEnabled() const { return m_enabled; } protected: bool m_enabled; }; #endif // wxUSE_HTML #endif // _WX_HTMLPROC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/html/helpdata.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/html/helpdata.h // Purpose: wxHtmlHelpData // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik // Author: Harm van der Heijden and Vaclav Slavik // Copyright: (c) Harm van der Heijden and Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELPDATA_H_ #define _WX_HELPDATA_H_ #include "wx/defs.h" #if wxUSE_HTML #include "wx/object.h" #include "wx/string.h" #include "wx/filesys.h" #include "wx/dynarray.h" #include "wx/font.h" class WXDLLIMPEXP_FWD_HTML wxHtmlHelpData; //-------------------------------------------------------------------------------- // helper classes & structs //-------------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlBookRecord { public: wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath, const wxString& title, const wxString& start) { m_BookFile = bookfile; m_BasePath = basepath; m_Title = title; m_Start = start; // for debugging, give the contents index obvious default values m_ContentsStart = m_ContentsEnd = -1; } wxString GetBookFile() const { return m_BookFile; } wxString GetTitle() const { return m_Title; } wxString GetStart() const { return m_Start; } wxString GetBasePath() const { return m_BasePath; } /* SetContentsRange: store in the bookrecord where in the index/contents lists the * book's records are stored. This to facilitate searching in a specific book. * This code will have to be revised when loading/removing books becomes dynamic. * (as opposed to appending only) * Note that storing index range is pointless, because the index is alphab. sorted. */ void SetContentsRange(int start, int end) { m_ContentsStart = start; m_ContentsEnd = end; } int GetContentsStart() const { return m_ContentsStart; } int GetContentsEnd() const { return m_ContentsEnd; } void SetTitle(const wxString& title) { m_Title = title; } void SetBasePath(const wxString& path) { m_BasePath = path; } void SetStart(const wxString& start) { m_Start = start; } // returns full filename of page (which is part of the book), // i.e. with book's basePath prepended. If page is already absolute // path, basePath is _not_ prepended. wxString GetFullPath(const wxString &page) const; protected: wxString m_BookFile; wxString m_BasePath; wxString m_Title; wxString m_Start; int m_ContentsStart; int m_ContentsEnd; }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxHtmlBookRecord, wxHtmlBookRecArray, WXDLLIMPEXP_HTML); struct WXDLLIMPEXP_HTML wxHtmlHelpDataItem { wxHtmlHelpDataItem() : level(0), parent(NULL), id(wxID_ANY), book(NULL) {} int level; wxHtmlHelpDataItem *parent; int id; wxString name; wxString page; wxHtmlBookRecord *book; // returns full filename of m_Page, i.e. with book's basePath prepended wxString GetFullPath() const { return book->GetFullPath(page); } // returns item indented with spaces if it has level>1: wxString GetIndentedName() const; }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxHtmlHelpDataItem, wxHtmlHelpDataItems, WXDLLIMPEXP_HTML); //------------------------------------------------------------------------------ // wxHtmlSearchEngine // This class takes input streams and scans them for occurrence // of keyword(s) //------------------------------------------------------------------------------ class WXDLLIMPEXP_HTML wxHtmlSearchEngine : public wxObject { public: wxHtmlSearchEngine() : wxObject() {} virtual ~wxHtmlSearchEngine() {} // Sets the keyword we will be searching for virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only); // Scans the stream for the keyword. // Returns true if the stream contains keyword, fALSE otherwise virtual bool Scan(const wxFSFile& file); private: wxString m_Keyword; bool m_CaseSensitive; bool m_WholeWords; wxDECLARE_NO_COPY_CLASS(wxHtmlSearchEngine); }; // State information of a search action. I'd have preferred to make this a // nested class inside wxHtmlHelpData, but that's against coding standards :-( // Never construct this class yourself, obtain a copy from // wxHtmlHelpData::PrepareKeywordSearch(const wxString& key) class WXDLLIMPEXP_HTML wxHtmlSearchStatus { public: // constructor; supply wxHtmlHelpData ptr, the keyword and (optionally) the // title of the book to search. By default, all books are searched. wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword, bool case_sensitive, bool whole_words_only, const wxString& book = wxEmptyString); bool Search(); // do the next iteration bool IsActive() { return m_Active; } int GetCurIndex() { return m_CurIndex; } int GetMaxIndex() { return m_MaxIndex; } const wxString& GetName() { return m_Name; } const wxHtmlHelpDataItem *GetCurItem() const { return m_CurItem; } private: wxHtmlHelpData* m_Data; wxHtmlSearchEngine m_Engine; wxString m_Keyword, m_Name; wxString m_LastPage; wxHtmlHelpDataItem* m_CurItem; bool m_Active; // search is not finished int m_CurIndex; // where we are now int m_MaxIndex; // number of files we search // For progress bar: 100*curindex/maxindex = % complete wxDECLARE_NO_COPY_CLASS(wxHtmlSearchStatus); }; class WXDLLIMPEXP_HTML wxHtmlHelpData : public wxObject { wxDECLARE_DYNAMIC_CLASS(wxHtmlHelpData); friend class wxHtmlSearchStatus; public: wxHtmlHelpData(); virtual ~wxHtmlHelpData(); // Sets directory where temporary files are stored. // These temp files are index & contents file in binary (much faster to read) // form. These files are NOT deleted on program's exit. void SetTempDir(const wxString& path); // Adds new book. 'book' is location of .htb file (stands for "html book"). // See documentation for details on its format. // Returns success. bool AddBook(const wxString& book); bool AddBookParam(const wxFSFile& bookfile, wxFontEncoding encoding, const wxString& title, const wxString& contfile, const wxString& indexfile = wxEmptyString, const wxString& deftopic = wxEmptyString, const wxString& path = wxEmptyString); // Some accessing stuff: // returns URL of page on basis of (file)name wxString FindPageByName(const wxString& page); // returns URL of page on basis of MS id wxString FindPageById(int id); const wxHtmlBookRecArray& GetBookRecArray() const { return m_bookRecords; } const wxHtmlHelpDataItems& GetContentsArray() const { return m_contents; } const wxHtmlHelpDataItems& GetIndexArray() const { return m_index; } protected: wxString m_tempPath; // each book has one record in this array: wxHtmlBookRecArray m_bookRecords; wxHtmlHelpDataItems m_contents; // list of all available books and pages wxHtmlHelpDataItems m_index; // list of index itesm protected: // Imports .hhp files (MS HTML Help Workshop) bool LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, const wxString& indexfile, const wxString& contentsfile); // Reads binary book bool LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f); // Writes binary book bool SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f); wxDECLARE_NO_COPY_CLASS(wxHtmlHelpData); }; #endif #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/dcclient.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/dcclient.h // Purpose: wxWindowDCImpl, wxClientDCImpl and wxPaintDCImpl // Author: Vaclav Slavik // Created: 2006-08-10 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_DCCLIENT_H_ #define _WX_DFB_DCCLIENT_H_ #include "wx/dfb/dc.h" class WXDLLIMPEXP_FWD_CORE wxWindow; //----------------------------------------------------------------------------- // wxWindowDCImpl //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxDFBDCImpl { public: wxWindowDCImpl(wxDC *owner) : wxDFBDCImpl(owner), m_shouldFlip(false) { } wxWindowDCImpl(wxDC *owner, wxWindow *win); virtual ~wxWindowDCImpl(); protected: // initializes the DC for painting on given window; if rect!=NULL, then // for painting only on the given region of the window void InitForWin(wxWindow *win, const wxRect *rect); private: wxRect m_winRect; // rectangle of the window being painted bool m_shouldFlip; // flip the surface when done? friend class wxOverlayImpl; // for m_shouldFlip; wxDECLARE_DYNAMIC_CLASS(wxWindowDCImpl); wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl); }; //----------------------------------------------------------------------------- // wxClientDCImpl //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl { public: wxClientDCImpl(wxDC *owner) : wxWindowDCImpl(owner) { } wxClientDCImpl(wxDC *owner, wxWindow *win); wxDECLARE_DYNAMIC_CLASS(wxClientDCImpl); wxDECLARE_NO_COPY_CLASS(wxClientDCImpl); }; //----------------------------------------------------------------------------- // wxPaintDCImpl //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl { public: wxPaintDCImpl(wxDC *owner) : wxClientDCImpl(owner) { } wxPaintDCImpl(wxDC *owner, wxWindow *win) : wxClientDCImpl(owner, win) { } wxDECLARE_DYNAMIC_CLASS(wxPaintDCImpl); wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl); }; #endif // _WX_DFB_DCCLIENT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/font.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/font.h // Author: Vaclav Slavik // Purpose: wxFont declaration // Created: 2006-08-08 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_FONT_H_ #define _WX_DFB_FONT_H_ #include "wx/dfb/dfbptr.h" wxDFB_DECLARE_INTERFACE(IDirectFBFont); // ---------------------------------------------------------------------------- // wxFont // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFont : public wxFontBase { public: wxFont() {} wxFont(const wxFontInfo& info) { Create(info.GetPointSize(), info.GetFamily(), info.GetStyle(), info.GetWeight(), info.IsUnderlined(), info.GetFaceName(), info.GetEncoding()); if ( info.IsUsingSizeInPixels() ) SetPixelSize(info.GetPixelSize()); } wxFont(const wxNativeFontInfo& info) { Create(info); } wxFont(const wxString& nativeFontInfoString); wxFont(int size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { Create(size, family, style, weight, underlined, face, encoding); } wxFont(const wxSize& pixelSize, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { Create(10, family, style, weight, underlined, face, encoding); SetPixelSize(pixelSize); } bool Create(int size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); bool Create(const wxNativeFontInfo& fontinfo); // implement base class pure virtuals virtual float GetFractionalPointSize() const; virtual wxFontStyle GetStyle() const; virtual int GetNumericWeight() const; virtual wxString GetFaceName() const; virtual bool GetUnderlined() const; virtual wxFontEncoding GetEncoding() const; virtual bool IsFixedWidth() const; virtual const wxNativeFontInfo *GetNativeFontInfo() const; virtual void SetFractionalPointSize(float pointSize); virtual void SetFamily(wxFontFamily family); virtual void SetStyle(wxFontStyle style); virtual void SetNumericWeight(int weight); virtual bool SetFaceName(const wxString& faceName); virtual void SetUnderlined(bool underlined); virtual void SetEncoding(wxFontEncoding encoding); wxDECLARE_COMMON_FONT_METHODS(); wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") wxFont(int size, int family, int style, int weight, bool underlined = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); } // implementation from now on: wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; virtual wxFontFamily DoGetFamily() const; private: wxDECLARE_DYNAMIC_CLASS(wxFont); }; #endif // _WX_DFB_FONT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/nonownedwnd.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/nonownedwnd.h // Purpose: declares wxNonOwnedWindow class // Author: Vaclav Slavik // Modified by: // Created: 2006-12-24 // Copyright: (c) 2006 TT-Solutions // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_NONOWNEDWND_H_ #define _WX_DFB_NONOWNEDWND_H_ #include "wx/window.h" #include "wx/dfb/dfbptr.h" wxDFB_DECLARE_INTERFACE(IDirectFBWindow); class wxDfbQueuedPaintRequests; struct wxDFBWindowEvent; class wxDFBEventsHandler; //----------------------------------------------------------------------------- // wxNonOwnedWindow //----------------------------------------------------------------------------- // This class represents "non-owned" window. A window is owned by another // window if it has a parent and is positioned within the parent. For example, // wxFrame is non-owned, because even though it can have a parent, it's // location is independent of it. This class is for internal use only, it's // the base class for wxTopLevelWindow and wxPopupWindow. class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase { public: // construction wxNonOwnedWindow() { Init(); } wxNonOwnedWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) { Init(); Create(parent, id, pos, size, style, name); } bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr); virtual ~wxNonOwnedWindow(); // implement base class pure virtuals virtual bool Show(bool show = true); virtual void Update(); virtual void Raise(); virtual void Lower(); // implementation from now on // -------------------------- void OnInternalIdle(); wxIDirectFBWindowPtr GetDirectFBWindow() const { return m_dfbwin; } // Returns true if some invalidated area of the TLW is currently being // painted bool IsPainting() const { return m_isPainting; } protected: // common part of all ctors void Init(); virtual wxIDirectFBSurfacePtr ObtainDfbSurface() const; // overridden wxWindow methods virtual void DoGetPosition(int *x, int *y) const; virtual void DoGetSize(int *width, int *height) const; virtual void DoMoveWindow(int x, int y, int width, int height); virtual void DoRefreshRect(const wxRect& rect); // sets DirectFB keyboard focus to this toplevel window (note that DFB // focus is different from wx: only shown TLWs can have it and not any // wxWindows as in wx void SetDfbFocus(); // overridden in wxTopLevelWindowDFB, there's no common handling for wxTLW // and wxPopupWindow to be done here virtual void HandleFocusEvent(const wxDFBWindowEvent& WXUNUSED(event_)) {} private: // do queued painting in idle time void HandleQueuedPaintRequests(); // DirectFB events handling static void HandleDFBWindowEvent(const wxDFBWindowEvent& event_); protected: // did we sent wxSizeEvent at least once? bool m_sizeSet:1; // window's opacity (0: transparent, 255: opaque) wxByte m_opacity; // interface to the underlying DirectFB window wxIDirectFBWindowPtr m_dfbwin; private: // invalidated areas of the TLW that need repainting wxDfbQueuedPaintRequests *m_toPaint; // are we currently painting some area of this TLW? bool m_isPainting; friend class wxDFBEventsHandler; // for HandleDFBWindowEvent friend class wxWindowDFB; // for SetDfbFocus }; #endif // _WX_DFB_NONOWNEDWND_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/app.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/app.h // Purpose: wxApp class // Author: Vaclav Slavik // Created: 2006-08-10 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_APP_H_ #define _WX_DFB_APP_H_ #include "wx/dfb/dfbptr.h" #include "wx/vidmode.h" wxDFB_DECLARE_INTERFACE(IDirectFB); //----------------------------------------------------------------------------- // wxApp //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxApp: public wxAppBase { public: wxApp(); ~wxApp(); // override base class (pure) virtuals virtual bool Initialize(int& argc, wxChar **argv); virtual void CleanUp(); virtual void WakeUpIdle(); virtual wxVideoMode GetDisplayMode() const; virtual bool SetDisplayMode(const wxVideoMode& mode); private: wxVideoMode m_videoMode; wxDECLARE_DYNAMIC_CLASS(wxApp); }; #endif // _WX_DFB_APP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/dcmemory.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/dcmemory.h // Purpose: wxMemoryDC class declaration // Created: 2006-08-10 // Author: Vaclav Slavik // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_DCMEMORY_H_ #define _WX_DFB_DCMEMORY_H_ #include "wx/dfb/dc.h" #include "wx/bitmap.h" class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxDFBDCImpl { public: wxMemoryDCImpl(wxMemoryDC *owner); wxMemoryDCImpl(wxMemoryDC *owner, wxBitmap& bitmap); wxMemoryDCImpl(wxMemoryDC *owner, wxDC *dc); // create compatible DC // override wxMemoryDC-specific base class virtual methods virtual const wxBitmap& GetSelectedBitmap() const { return m_bmp; } virtual wxBitmap& GetSelectedBitmap() { return m_bmp; } virtual void DoSelect(const wxBitmap& bitmap); private: void Init(); wxBitmap m_bmp; wxDECLARE_DYNAMIC_CLASS(wxMemoryDCImpl); }; #endif // _WX_DFB_DCMEMORY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/toplevel.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/toplevel.h // Purpose: Top level window, abstraction of wxFrame and wxDialog // Author: Vaclav Slavik // Created: 2006-08-10 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_TOPLEVEL_H_ #define _WX_DFB_TOPLEVEL_H_ //----------------------------------------------------------------------------- // wxTopLevelWindowDFB //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTopLevelWindowDFB : public wxTopLevelWindowBase { public: // construction wxTopLevelWindowDFB() { Init(); } wxTopLevelWindowDFB(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { Init(); Create(parent, id, title, pos, size, style, name); } bool Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); // implement base class pure virtuals virtual void Maximize(bool maximize = true); virtual bool IsMaximized() const; virtual void Iconize(bool iconize = true); virtual bool IsIconized() const; virtual void Restore(); virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual bool IsFullScreen() const { return m_fsIsShowing; } virtual bool CanSetTransparent() { return true; } virtual bool SetTransparent(wxByte alpha); virtual void SetTitle(const wxString &title) { m_title = title; } virtual wxString GetTitle() const { return m_title; } protected: // common part of all ctors void Init(); virtual void HandleFocusEvent(const wxDFBWindowEvent& event_); protected: wxString m_title; bool m_fsIsShowing:1; /* full screen */ long m_fsSaveStyle; long m_fsSaveFlag; wxRect m_fsSaveFrame; // is the frame currently maximized? bool m_isMaximized:1; wxRect m_savedFrame; }; #endif // _WX_DFB_TOPLEVEL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/wrapdfb.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/wrapdfb.h // Purpose: wx wrappers for DirectFB interfaces // Author: Vaclav Slavik // Created: 2006-08-23 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_WRAPDFB_H_ #define _WX_DFB_WRAPDFB_H_ #include "wx/dfb/dfbptr.h" #include "wx/gdicmn.h" #include "wx/vidmode.h" #include <directfb.h> #include <directfb_version.h> // DFB < 1.0 didn't have u8 type, only __u8 #if DIRECTFB_MAJOR_VERSION == 0 typedef __u8 u8; #endif wxDFB_DECLARE_INTERFACE(IDirectFB); wxDFB_DECLARE_INTERFACE(IDirectFBDisplayLayer); wxDFB_DECLARE_INTERFACE(IDirectFBFont); wxDFB_DECLARE_INTERFACE(IDirectFBWindow); wxDFB_DECLARE_INTERFACE(IDirectFBSurface); wxDFB_DECLARE_INTERFACE(IDirectFBPalette); wxDFB_DECLARE_INTERFACE(IDirectFBEventBuffer); /** Checks the @a code of a DirectFB call and returns true if it was successful and false if it failed, logging the errors as appropriate (asserts for programming errors, wxLogError for runtime failures). */ bool wxDfbCheckReturn(DFBResult code); //----------------------------------------------------------------------------- // wxDfbEvent //----------------------------------------------------------------------------- /** The struct defined by this macro is a thin wrapper around DFB*Event type. It is needed because DFB*Event are typedefs and so we can't forward declare them, but we need to pass them to methods declared in public headers where <directfb.h> cannot be included. So this struct just holds the event value, it's sole purpose is that it can be forward declared. */ #define WXDFB_DEFINE_EVENT_WRAPPER(T) \ struct wx##T \ { \ wx##T() {} \ wx##T(const T& event) : m_event(event) {} \ \ operator T&() { return m_event; } \ operator const T&() const { return m_event; } \ T* operator&() { return &m_event; } \ \ DFBEventClass GetClass() const { return m_event.clazz; } \ \ private: \ T m_event; \ }; WXDFB_DEFINE_EVENT_WRAPPER(DFBEvent) WXDFB_DEFINE_EVENT_WRAPPER(DFBWindowEvent) //----------------------------------------------------------------------------- // wxDfbWrapper<T> //----------------------------------------------------------------------------- /// Base class for wxDfbWrapper<T> class wxDfbWrapperBase { public: /// Increases reference count of the object void AddRef() { m_refCnt++; } /// Decreases reference count and if it reaches zero, deletes the object void Release() { if ( --m_refCnt == 0 ) delete this; } /// Returns result code of the last call DFBResult GetLastResult() const { return m_lastResult; } protected: wxDfbWrapperBase() : m_refCnt(1), m_lastResult(DFB_OK) {} /// Dtor may only be called from Release() virtual ~wxDfbWrapperBase() {} /** Checks the @a result of a DirectFB call and returns true if it was successful and false if it failed. Also stores result of the call so that it can be obtained by calling GetLastResult(). */ bool Check(DFBResult result) { m_lastResult = result; return wxDfbCheckReturn(result); } protected: /// Reference count unsigned m_refCnt; /// Result of the last DirectFB call DFBResult m_lastResult; }; /** This template is base class for friendly C++ wrapper around DirectFB interface T. The wrapper provides same API as DirectFB, with a few exceptions: - methods return true/false instead of error code - methods that return or create another interface return pointer to the interface (or NULL on failure) instead of storing it in the last argument - interface arguments use wxFooPtr type instead of raw DirectFB pointer - methods taking flags use int type instead of an enum when the flags can be or-combination of enum elements (this is workaround for C++-unfriendly DirectFB API) */ template<typename T> class wxDfbWrapper : public wxDfbWrapperBase { public: /// "Raw" DirectFB interface type typedef T DirectFBIface; /// Returns raw DirectFB pointer T *GetRaw() const { return m_ptr; } protected: /// To be called from ctor. Takes ownership of raw object. void Init(T *ptr) { m_ptr = ptr; } /// Dtor may only be used from Release ~wxDfbWrapper() { if ( m_ptr ) m_ptr->Release(m_ptr); } protected: // pointer to DirectFB object T *m_ptr; }; //----------------------------------------------------------------------------- // wxIDirectFBFont //----------------------------------------------------------------------------- struct wxIDirectFBFont : public wxDfbWrapper<IDirectFBFont> { wxIDirectFBFont(IDirectFBFont *s) { Init(s); } bool GetStringWidth(const char *text, int bytes, int *w) { return Check(m_ptr->GetStringWidth(m_ptr, text, bytes, w)); } bool GetStringExtents(const char *text, int bytes, DFBRectangle *logicalRect, DFBRectangle *inkRect) { return Check(m_ptr->GetStringExtents(m_ptr, text, bytes, logicalRect, inkRect)); } bool GetHeight(int *h) { return Check(m_ptr->GetHeight(m_ptr, h)); } bool GetDescender(int *descender) { return Check(m_ptr->GetDescender(m_ptr, descender)); } }; //----------------------------------------------------------------------------- // wxIDirectFBPalette //----------------------------------------------------------------------------- struct wxIDirectFBPalette : public wxDfbWrapper<IDirectFBPalette> { wxIDirectFBPalette(IDirectFBPalette *s) { Init(s); } }; //----------------------------------------------------------------------------- // wxIDirectFBSurface //----------------------------------------------------------------------------- struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface> { wxIDirectFBSurface(IDirectFBSurface *s) { Init(s); } bool GetSize(int *w, int *h) { return Check(m_ptr->GetSize(m_ptr, w, h)); } bool GetCapabilities(DFBSurfaceCapabilities *caps) { return Check(m_ptr->GetCapabilities(m_ptr, caps)); } bool GetPixelFormat(DFBSurfacePixelFormat *caps) { return Check(m_ptr->GetPixelFormat(m_ptr, caps)); } // convenience version of GetPixelFormat, returns DSPF_UNKNOWN if fails DFBSurfacePixelFormat GetPixelFormat(); bool SetClip(const DFBRegion *clip) { return Check(m_ptr->SetClip(m_ptr, clip)); } bool SetColor(u8 r, u8 g, u8 b, u8 a) { return Check(m_ptr->SetColor(m_ptr, r, g, b, a)); } bool Clear(u8 r, u8 g, u8 b, u8 a) { return Check(m_ptr->Clear(m_ptr, r, g, b, a)); } bool DrawLine(int x1, int y1, int x2, int y2) { return Check(m_ptr->DrawLine(m_ptr, x1, y1, x2, y2)); } bool DrawRectangle(int x, int y, int w, int h) { return Check(m_ptr->DrawRectangle(m_ptr, x, y, w, h)); } bool FillRectangle(int x, int y, int w, int h) { return Check(m_ptr->FillRectangle(m_ptr, x, y, w, h)); } bool SetFont(const wxIDirectFBFontPtr& font) { return Check(m_ptr->SetFont(m_ptr, font->GetRaw())); } bool DrawString(const char *text, int bytes, int x, int y, int flags) { return Check(m_ptr->DrawString(m_ptr, text, bytes, x, y, (DFBSurfaceTextFlags)flags)); } /** Updates the front buffer from the back buffer. If @a region is not NULL, only given rectangle is updated. */ bool FlipToFront(const DFBRegion *region = NULL); wxIDirectFBSurfacePtr GetSubSurface(const DFBRectangle *rect) { IDirectFBSurface *s; if ( Check(m_ptr->GetSubSurface(m_ptr, rect, &s)) ) return new wxIDirectFBSurface(s); else return NULL; } wxIDirectFBPalettePtr GetPalette() { IDirectFBPalette *s; if ( Check(m_ptr->GetPalette(m_ptr, &s)) ) return new wxIDirectFBPalette(s); else return NULL; } bool SetPalette(const wxIDirectFBPalettePtr& pal) { return Check(m_ptr->SetPalette(m_ptr, pal->GetRaw())); } bool SetBlittingFlags(int flags) { return Check( m_ptr->SetBlittingFlags(m_ptr, (DFBSurfaceBlittingFlags)flags)); } bool Blit(const wxIDirectFBSurfacePtr& source, const DFBRectangle *source_rect, int x, int y) { return Blit(source->GetRaw(), source_rect, x, y); } bool Blit(IDirectFBSurface *source, const DFBRectangle *source_rect, int x, int y) { return Check(m_ptr->Blit(m_ptr, source, source_rect, x, y)); } bool StretchBlit(const wxIDirectFBSurfacePtr& source, const DFBRectangle *source_rect, const DFBRectangle *dest_rect) { return Check(m_ptr->StretchBlit(m_ptr, source->GetRaw(), source_rect, dest_rect)); } /// Returns bit depth used by the surface or -1 on error int GetDepth(); /** Creates a new surface by cloning this one. New surface will have same capabilities, pixel format and pixel data as the existing one. @see CreateCompatible */ wxIDirectFBSurfacePtr Clone(); /// Flags for CreateCompatible() enum CreateCompatibleFlags { /// Don't create double-buffered surface CreateCompatible_NoBackBuffer = 1 }; /** Creates a surface compatible with this one, i.e. surface with the same capabilities and pixel format, but with different and size. @param size Size of the surface to create. If wxDefaultSize, use the size of this surface. @param flags Or-combination of CreateCompatibleFlags values */ wxIDirectFBSurfacePtr CreateCompatible(const wxSize& size = wxDefaultSize, int flags = 0); bool Lock(DFBSurfaceLockFlags flags, void **ret_ptr, int *ret_pitch) { return Check(m_ptr->Lock(m_ptr, flags, ret_ptr, ret_pitch)); } bool Unlock() { return Check(m_ptr->Unlock(m_ptr)); } /// Helper struct for safe locking & unlocking of surfaces struct Locked { Locked(const wxIDirectFBSurfacePtr& surface, DFBSurfaceLockFlags flags) : m_surface(surface) { if ( !surface->Lock(flags, &ptr, &pitch) ) ptr = NULL; } ~Locked() { if ( ptr ) m_surface->Unlock(); } void *ptr; int pitch; private: wxIDirectFBSurfacePtr m_surface; }; private: // this is private because we want user code to use FlipToFront() bool Flip(const DFBRegion *region, int flags); }; //----------------------------------------------------------------------------- // wxIDirectFBEventBuffer //----------------------------------------------------------------------------- struct wxIDirectFBEventBuffer : public wxDfbWrapper<IDirectFBEventBuffer> { wxIDirectFBEventBuffer(IDirectFBEventBuffer *s) { Init(s); } bool CreateFileDescriptor(int *ret_fd) { return Check(m_ptr->CreateFileDescriptor(m_ptr, ret_fd)); } }; //----------------------------------------------------------------------------- // wxIDirectFBWindow //----------------------------------------------------------------------------- struct wxIDirectFBWindow : public wxDfbWrapper<IDirectFBWindow> { wxIDirectFBWindow(IDirectFBWindow *s) { Init(s); } bool GetID(DFBWindowID *id) { return Check(m_ptr->GetID(m_ptr, id)); } bool GetPosition(int *x, int *y) { return Check(m_ptr->GetPosition(m_ptr, x, y)); } bool GetSize(int *w, int *h) { return Check(m_ptr->GetSize(m_ptr, w, h)); } bool MoveTo(int x, int y) { return Check(m_ptr->MoveTo(m_ptr, x, y)); } bool Resize(int w, int h) { return Check(m_ptr->Resize(m_ptr, w, h)); } bool SetOpacity(u8 opacity) { return Check(m_ptr->SetOpacity(m_ptr, opacity)); } bool SetStackingClass(DFBWindowStackingClass klass) { return Check(m_ptr->SetStackingClass(m_ptr, klass)); } bool RaiseToTop() { return Check(m_ptr->RaiseToTop(m_ptr)); } bool LowerToBottom() { return Check(m_ptr->LowerToBottom(m_ptr)); } wxIDirectFBSurfacePtr GetSurface() { IDirectFBSurface *s; if ( Check(m_ptr->GetSurface(m_ptr, &s)) ) return new wxIDirectFBSurface(s); else return NULL; } bool AttachEventBuffer(const wxIDirectFBEventBufferPtr& buffer) { return Check(m_ptr->AttachEventBuffer(m_ptr, buffer->GetRaw())); } bool RequestFocus() { return Check(m_ptr->RequestFocus(m_ptr)); } bool Destroy() { return Check(m_ptr->Destroy(m_ptr)); } }; //----------------------------------------------------------------------------- // wxIDirectFBDisplayLayer //----------------------------------------------------------------------------- struct wxIDirectFBDisplayLayer : public wxDfbWrapper<IDirectFBDisplayLayer> { wxIDirectFBDisplayLayer(IDirectFBDisplayLayer *s) { Init(s); } wxIDirectFBWindowPtr CreateWindow(const DFBWindowDescription *desc) { IDirectFBWindow *w; if ( Check(m_ptr->CreateWindow(m_ptr, desc, &w)) ) return new wxIDirectFBWindow(w); else return NULL; } bool GetConfiguration(DFBDisplayLayerConfig *config) { return Check(m_ptr->GetConfiguration(m_ptr, config)); } wxVideoMode GetVideoMode(); bool GetCursorPosition(int *x, int *y) { return Check(m_ptr->GetCursorPosition(m_ptr, x, y)); } bool WarpCursor(int x, int y) { return Check(m_ptr->WarpCursor(m_ptr, x, y)); } }; //----------------------------------------------------------------------------- // wxIDirectFB //----------------------------------------------------------------------------- struct wxIDirectFB : public wxDfbWrapper<IDirectFB> { /** Returns pointer to DirectFB singleton object, it never returns NULL after wxApp was initialized. The object is cached, so calling this method is cheap. */ static wxIDirectFBPtr Get() { if ( !ms_ptr ) CreateDirectFB(); return ms_ptr; } bool SetVideoMode(int w, int h, int bpp) { return Check(m_ptr->SetVideoMode(m_ptr, w, h, bpp)); } wxIDirectFBSurfacePtr CreateSurface(const DFBSurfaceDescription *desc) { IDirectFBSurface *s; if ( Check(m_ptr->CreateSurface(m_ptr, desc, &s)) ) return new wxIDirectFBSurface(s); else return NULL; } wxIDirectFBEventBufferPtr CreateEventBuffer() { IDirectFBEventBuffer *b; if ( Check(m_ptr->CreateEventBuffer(m_ptr, &b)) ) return new wxIDirectFBEventBuffer(b); else return NULL; } wxIDirectFBFontPtr CreateFont(const char *filename, const DFBFontDescription *desc) { IDirectFBFont *f; if ( Check(m_ptr->CreateFont(m_ptr, filename, desc, &f)) ) return new wxIDirectFBFont(f); else return NULL; } wxIDirectFBDisplayLayerPtr GetDisplayLayer(DFBDisplayLayerID id = DLID_PRIMARY) { IDirectFBDisplayLayer *l; if ( Check(m_ptr->GetDisplayLayer(m_ptr, id, &l)) ) return new wxIDirectFBDisplayLayer(l); else return NULL; } /// Returns primary surface wxIDirectFBSurfacePtr GetPrimarySurface(); private: wxIDirectFB(IDirectFB *ptr) { Init(ptr); } // creates ms_ptr instance static void CreateDirectFB(); static void CleanUp(); friend class wxApp; // calls CleanUp // pointer to the singleton IDirectFB object static wxIDirectFBPtr ms_ptr; }; #endif // _WX_DFB_WRAPDFB_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/region.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/region.h // Purpose: wxRegion class // Author: Vaclav Slavik // Created: 2006-08-08 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_REGION_H_ #define _WX_DFB_REGION_H_ class WXDLLIMPEXP_CORE wxRegion : public wxRegionBase { public: wxRegion(); wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h); wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); wxRegion(const wxRect& rect); wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE); wxRegion(const wxBitmap& bmp) { Union(bmp); } wxRegion(const wxBitmap& bmp, const wxColour& transColour, int tolerance = 0) { Union(bmp, transColour, tolerance); } virtual ~wxRegion(); // wxRegionBase methods virtual void Clear(); virtual bool IsEmpty() const; // NB: implementation detail of DirectFB, should be removed if full // (i.e. not rect-only version is implemented) so that all code that // assumes region==rect breaks wxRect AsRect() const { return GetBox(); } protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; // wxRegionBase pure virtuals virtual bool DoIsEqual(const wxRegion& region) const; virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const; virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const; virtual wxRegionContain DoContainsRect(const wxRect& rect) const; virtual bool DoOffset(wxCoord x, wxCoord y); virtual bool DoUnionWithRect(const wxRect& rect); virtual bool DoUnionWithRegion(const wxRegion& region); virtual bool DoIntersect(const wxRegion& region); virtual bool DoSubtract(const wxRegion& region); virtual bool DoXor(const wxRegion& region); friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator; wxDECLARE_DYNAMIC_CLASS(wxRegion); }; class WXDLLIMPEXP_CORE wxRegionIterator : public wxObject { public: wxRegionIterator() {} wxRegionIterator(const wxRegion& region) { Reset(region); } void Reset() { m_rect = wxRect(); } void Reset(const wxRegion& region); bool HaveRects() const { return !m_rect.IsEmpty(); } operator bool() const { return HaveRects(); } wxRegionIterator& operator++(); wxRegionIterator operator++(int); wxCoord GetX() const { return m_rect.GetX(); } wxCoord GetY() const { return m_rect.GetY(); } wxCoord GetW() const { return m_rect.GetWidth(); } wxCoord GetWidth() const { return GetW(); } wxCoord GetH() const { return m_rect.GetHeight(); } wxCoord GetHeight() const { return GetH(); } wxRect GetRect() const { return m_rect; } private: wxRect m_rect; wxDECLARE_DYNAMIC_CLASS(wxRegionIterator); }; #endif // _WX_DFB_REGION_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/evtloop.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/evtloop.h // Purpose: declares wxEventLoop class // Author: Vaclav Slavik // Created: 2006-08-16 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_EVTLOOP_H_ #define _WX_DFB_EVTLOOP_H_ #include "wx/dfb/dfbptr.h" #include "wx/unix/evtloop.h" wxDFB_DECLARE_INTERFACE(IDirectFBEventBuffer); // ---------------------------------------------------------------------------- // wxEventLoop // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxConsoleEventLoop { public: wxGUIEventLoop(); // returns DirectFB event buffer used by wx static wxIDirectFBEventBufferPtr GetDirectFBEventBuffer(); protected: virtual void DoYieldFor(long eventsToProcess); private: static void InitBuffer(); static void CleanUp(); friend class wxApp; // calls CleanUp() private: static wxIDirectFBEventBufferPtr ms_buffer; static int ms_bufferFd; wxDECLARE_NO_COPY_CLASS(wxGUIEventLoop); }; #endif // _WX_DFB_EVTLOOP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/private.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/private.h // Purpose: private helpers for wxDFB implementation // Author: Vaclav Slavik // Created: 2006-08-09 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_PRIVATE_H_ #define _WX_DFB_PRIVATE_H_ #include "wx/intl.h" #include "wx/log.h" #include "wx/dfb/wrapdfb.h" #include <directfb_version.h> //----------------------------------------------------------------------------- // misc helpers //----------------------------------------------------------------------------- /// Convert DirectFB timestamp to wxEvent one: #define wxDFB_EVENT_TIMESTAMP(event) \ ((event).timestamp.tv_sec * 1000 + (event).timestamp.tv_usec / 1000) /** Check if DirectFB library version is at least @a major.@a minor.@a release. @see wxCHECK_VERSION */ #define wxCHECK_DFB_VERSION(major,minor,release) \ (DIRECTFB_MAJOR_VERSION > (major) || \ (DIRECTFB_MAJOR_VERSION == (major) && \ DIRECTFB_MINOR_VERSION > (minor)) || \ (DIRECTFB_MAJOR_VERSION == (major) && \ DIRECTFB_MINOR_VERSION == (minor) && \ DIRECTFB_MICRO_VERSION >= (release))) #endif // _WX_DFB_PRIVATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/bitmap.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/bitmap.h // Purpose: wxBitmap class // Author: Vaclav Slavik // Created: 2006-08-04 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_BITMAP_H_ #define _WX_DFB_BITMAP_H_ #include "wx/dfb/dfbptr.h" class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; wxDFB_DECLARE_INTERFACE(IDirectFBSurface); //----------------------------------------------------------------------------- // wxBitmap //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase { public: wxBitmap() {} wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); } wxBitmap(int width, int height, int depth = -1) { Create(width, height, depth); } wxBitmap(const wxSize& sz, int depth = -1) { Create(sz, depth); } wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); wxBitmap(const char* const* bits); #if wxUSE_IMAGE wxBitmap(const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0); #endif bool Create(const wxIDirectFBSurfacePtr& surface); bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) { return Create(sz.GetWidth(), sz.GetHeight(), depth); } bool Create(int width, int height, const wxDC& WXUNUSED(dc)) { return Create(width,height); } virtual int GetHeight() const; virtual int GetWidth() const; virtual int GetDepth() const; #if wxUSE_IMAGE virtual wxImage ConvertToImage() const; #endif virtual wxMask *GetMask() const; virtual void SetMask(wxMask *mask); virtual wxBitmap GetSubBitmap(const wxRect& rect) const; virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = NULL) const; virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); #if wxUSE_PALETTE virtual wxPalette *GetPalette() const; virtual void SetPalette(const wxPalette& palette); #endif // copies the contents and mask of the given (colour) icon to the bitmap virtual bool CopyFromIcon(const wxIcon& icon); static void InitStandardHandlers(); // raw bitmap access support functions void *GetRawData(wxPixelDataBase& data, int bpp); void UngetRawData(wxPixelDataBase& data); bool HasAlpha() const; // implementation: #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED(virtual void SetHeight(int height)); wxDEPRECATED(virtual void SetWidth(int width)); wxDEPRECATED(virtual void SetDepth(int depth)); #endif // get underlying native representation: wxIDirectFBSurfacePtr GetDirectFBSurface() const; protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; bool CreateWithFormat(int width, int height, int dfbFormat); wxDECLARE_DYNAMIC_CLASS(wxBitmap); }; #endif // _WX_DFB_BITMAP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/dfbptr.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/dfbptr.h // Purpose: wxDfbPtr<T> for holding objects declared in wrapdfb.h // Author: Vaclav Slavik // Created: 2006-08-09 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_DFBPTR_H_ #define _WX_DFB_DFBPTR_H_ //----------------------------------------------------------------------------- // wxDFB_DECLARE_INTERFACE //----------------------------------------------------------------------------- /** Forward declares wx wrapper around DirectFB interface @a name. Also declares wx##name##Ptr typedef for wxDfbPtr<wx##name> pointer. @param name name of the DirectFB interface */ #define wxDFB_DECLARE_INTERFACE(name) \ class wx##name; \ typedef wxDfbPtr<wx##name> wx##name##Ptr; //----------------------------------------------------------------------------- // wxDfbPtr<T> //----------------------------------------------------------------------------- class wxDfbWrapperBase; class WXDLLIMPEXP_CORE wxDfbPtrBase { protected: static void DoAddRef(wxDfbWrapperBase *ptr); static void DoRelease(wxDfbWrapperBase *ptr); }; /** This template implements smart pointer for keeping pointers to DirectFB wrappers (i.e. wxIFoo classes derived from wxDfbWrapper<T>). Interface's reference count is increased on copying and the interface is released when the pointer is deleted. */ template<typename T> class wxDfbPtr : private wxDfbPtrBase { public: /** Creates the pointer from raw pointer to the wrapper. Takes ownership of @a ptr, i.e. AddRef() is @em not called on it. */ wxDfbPtr(T *ptr = NULL) : m_ptr(ptr) {} /// Copy ctor wxDfbPtr(const wxDfbPtr& ptr) { InitFrom(ptr); } /// Dtor. Releases the interface ~wxDfbPtr() { Reset(); } /// Resets the pointer to NULL, decreasing reference count of the interface. void Reset() { if ( m_ptr ) { this->DoRelease((wxDfbWrapperBase*)m_ptr); m_ptr = NULL; } } /// Cast to the wrapper pointer operator T*() const { return m_ptr; } // standard operators: wxDfbPtr& operator=(T *ptr) { Reset(); m_ptr = ptr; return *this; } wxDfbPtr& operator=(const wxDfbPtr& ptr) { Reset(); InitFrom(ptr); return *this; } T& operator*() const { return *m_ptr; } T* operator->() const { return m_ptr; } private: void InitFrom(const wxDfbPtr& ptr) { m_ptr = ptr.m_ptr; if ( m_ptr ) this->DoAddRef((wxDfbWrapperBase*)m_ptr); } private: T *m_ptr; }; #endif // _WX_DFB_DFBPTR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/pen.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/pen.h // Purpose: wxPen class declaration // Author: Vaclav Slavik // Created: 2006-08-04 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_PEN_H_ #define _WX_DFB_PEN_H_ #include "wx/defs.h" #include "wx/object.h" #include "wx/string.h" #include "wx/gdiobj.h" #include "wx/gdicmn.h" //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxPen; //----------------------------------------------------------------------------- // wxPen //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPen: public wxPenBase { public: wxPen() {} wxPen(const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); wxPen(const wxBitmap& stipple, int width); wxPen(const wxPenInfo& info); bool operator==(const wxPen& pen) const; bool operator!=(const wxPen& pen) const { return !(*this == pen); } void SetColour(const wxColour &colour); void SetColour(unsigned char red, unsigned char green, unsigned char blue); void SetCap(wxPenCap capStyle); void SetJoin(wxPenJoin joinStyle); void SetStyle(wxPenStyle style); void SetWidth(int width); void SetDashes(int number_of_dashes, const wxDash *dash); void SetStipple(const wxBitmap& stipple); wxColour GetColour() const; wxPenCap GetCap() const; wxPenJoin GetJoin() const; wxPenStyle GetStyle() const; int GetWidth() const; int GetDashes(wxDash **ptr) const; int GetDashCount() const; wxDash* GetDash() const; wxBitmap *GetStipple() const; wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") wxPen(const wxColour& col, int width, int style); wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxPenStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; wxDECLARE_DYNAMIC_CLASS(wxPen); }; #endif // _WX_DFB_PEN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/cursor.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/cursor.h // Purpose: wxCursor declaration // Author: Vaclav Slavik // Created: 2006-08-08 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_CURSOR_H_ #define _WX_DFB_CURSOR_H_ class WXDLLIMPEXP_FWD_CORE wxBitmap; //----------------------------------------------------------------------------- // wxCursor //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase { public: wxCursor() {} wxCursor(wxStockCursor id) { InitFromStock(id); } #if WXWIN_COMPATIBILITY_2_8 wxCursor(int id) { InitFromStock((wxStockCursor)id); } #endif wxCursor(const wxString& name, wxBitmapType type = wxCURSOR_DEFAULT_TYPE, int hotSpotX = 0, int hotSpotY = 0); // implementation wxBitmap GetBitmap() const; protected: void InitFromStock(wxStockCursor); // ref counting code virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; wxDECLARE_DYNAMIC_CLASS(wxCursor); }; #endif // _WX_DFB_CURSOR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/popupwin.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/popupwin.h // Purpose: wxPopupWindow class for wxDFB // Author: Vaclav Slavik // Created: 2006-12-24 // Copyright: (c) 2006 TT-Solutions // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_POPUPWIN_H_ #define _WX_DFB_POPUPWIN_H_ // ---------------------------------------------------------------------------- // wxPopupWindow // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase { public: wxPopupWindow() {} wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE) { Create(parent, flags); } bool Create(wxWindow *parent, int flags = wxBORDER_NONE) { if ( !wxPopupWindowBase::Create(parent) ) return false; return wxNonOwnedWindow::Create ( parent, -1, // DFB windows must have valid pos & size: wxPoint(0, 0), wxSize(1, 1), (flags & wxBORDER_MASK) | wxPOPUP_WINDOW ); } wxDECLARE_DYNAMIC_CLASS(wxPopupWindow); }; #endif // _WX_DFB_POPUPWIN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/brush.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/brush.h // Purpose: wxBrush class declaration // Author: Vaclav Slavik // Created: 2006-08-04 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_BRUSH_H_ #define _WX_DFB_BRUSH_H_ #include "wx/defs.h" #include "wx/object.h" #include "wx/string.h" #include "wx/gdiobj.h" #include "wx/bitmap.h" //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxBrush; //----------------------------------------------------------------------------- // wxBrush //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase { public: wxBrush() {} wxBrush(const wxColour &colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID); wxBrush(const wxBitmap &stippleBitmap); bool operator==(const wxBrush& brush) const; bool operator!=(const wxBrush& brush) const { return !(*this == brush); } wxBrushStyle GetStyle() const; wxColour GetColour() const; wxBitmap *GetStipple() const; void SetColour(const wxColour& col); void SetColour(unsigned char r, unsigned char g, unsigned char b); void SetStyle(wxBrushStyle style); void SetStipple(const wxBitmap& stipple); wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") wxBrush(const wxColour& col, int style); wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxBrushStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; wxDECLARE_DYNAMIC_CLASS(wxBrush); }; #endif // _WX_DFB_BRUSH_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/dcscreen.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/dcscreen.h // Purpose: wxScreenDCImpl declaration // Author: Vaclav Slavik // Created: 2006-08-10 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_DCSCREEN_H_ #define _WX_DFB_DCSCREEN_H_ #include "wx/dfb/dc.h" class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxDFBDCImpl { public: wxScreenDCImpl(wxScreenDC *owner); wxDECLARE_DYNAMIC_CLASS(wxScreenDCImpl); }; #endif // _WX_DFB_DCSCREEN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/window.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/window.h // Purpose: wxWindow class // Author: Vaclav Slavik // Created: 2006-08-10 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_WINDOW_H_ #define _WX_DFB_WINDOW_H_ // --------------------------------------------------------------------------- // headers // --------------------------------------------------------------------------- #include "wx/dfb/dfbptr.h" wxDFB_DECLARE_INTERFACE(IDirectFBSurface); struct wxDFBWindowEvent; class WXDLLIMPEXP_FWD_CORE wxFont; class WXDLLIMPEXP_FWD_CORE wxNonOwnedWindow; class wxOverlayImpl; class wxDfbOverlaysList; // --------------------------------------------------------------------------- // wxWindow // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxWindowDFB : public wxWindowBase { public: wxWindowDFB() { Init(); } wxWindowDFB(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) { Init(); Create(parent, id, pos, size, style, name); } virtual ~wxWindowDFB(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr); // implement base class (pure) virtual methods // ------------------------------------------- virtual void SetLabel( const wxString &WXUNUSED(label) ) {} virtual wxString GetLabel() const { return wxEmptyString; } virtual void Raise(); virtual void Lower(); virtual bool Show(bool show = true); virtual void SetFocus(); virtual bool Reparent(wxWindowBase *newParent); virtual void WarpPointer(int x, int y); virtual void Refresh(bool eraseBackground = true, const wxRect *rect = (const wxRect *) NULL); virtual void Update(); virtual bool SetCursor(const wxCursor &cursor); virtual bool SetFont(const wxFont &font) { m_font = font; return true; } virtual int GetCharHeight() const; virtual int GetCharWidth() const; #if wxUSE_DRAG_AND_DROP virtual void SetDropTarget(wxDropTarget *dropTarget); // Accept files for dragging virtual void DragAcceptFiles(bool accept); #endif // wxUSE_DRAG_AND_DROP virtual WXWidget GetHandle() const { return this; } // implementation from now on // -------------------------- // Returns DirectFB surface used for rendering of this window wxIDirectFBSurfacePtr GetDfbSurface(); // returns toplevel window the window belongs to wxNonOwnedWindow *GetTLW() const { return m_tlw; } virtual bool IsDoubleBuffered() const { return true; } protected: // implement the base class pure virtuals virtual void DoGetTextExtent(const wxString& string, int *x, int *y, int *descent = NULL, int *externalLeading = NULL, const wxFont *theFont = NULL) const; virtual void DoClientToScreen(int *x, int *y) const; virtual void DoScreenToClient(int *x, int *y) const; virtual void DoGetPosition(int *x, int *y) const; virtual void DoGetSize(int *width, int *height) const; virtual void DoGetClientSize(int *width, int *height) const; virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); virtual void DoSetClientSize(int width, int height); virtual void DoCaptureMouse(); virtual void DoReleaseMouse(); virtual void DoThaw(); // move the window to the specified location and resize it: this is called // from both DoSetSize() and DoSetClientSize() and would usually just call // ::MoveWindow() except for composite controls which will want to arrange // themselves inside the given rectangle virtual void DoMoveWindow(int x, int y, int width, int height); // return DFB surface used to render this window (will be assigned to // m_surface if the window is visible) virtual wxIDirectFBSurfacePtr ObtainDfbSurface() const; // this method must be called when window's position, size or visibility // changes; it resets m_surface so that ObtainDfbSurface has to be called // next time GetDfbSurface is called void InvalidateDfbSurface(); // called by parent to render (part of) the window void PaintWindow(const wxRect& rect); // paint window's overlays (if any) on top of window's surface void PaintOverlays(const wxRect& rect); // refreshes the entire window (including non-client areas) void DoRefreshWindow(); // refreshes given rectangle of the window (in window, _not_ client coords) virtual void DoRefreshRect(const wxRect& rect); // refreshes given rectangle; unlike RefreshRect(), the argument is in // window, not client, coords and unlike DoRefreshRect() and like Refresh(), // does nothing if the window is hidden or frozen void RefreshWindowRect(const wxRect& rect); // add/remove overlay for this window void AddOverlay(wxOverlayImpl *overlay); void RemoveOverlay(wxOverlayImpl *overlay); // DirectFB events handling void HandleKeyEvent(const wxDFBWindowEvent& event_); private: // common part of all ctors void Init(); // counterpart to SetFocus void DFBKillFocus(); protected: // toplevel window (i.e. DirectFB window) this window belongs to wxNonOwnedWindow *m_tlw; private: // subsurface of TLW's surface covered by this window wxIDirectFBSurfacePtr m_surface; // position of the window (relative to the parent, not used by wxTLW, so // don't access it directly) wxRect m_rect; // overlays for this window (or NULL if it doesn't have any) wxDfbOverlaysList *m_overlays; friend class wxNonOwnedWindow; // for HandleXXXEvent friend class wxOverlayImpl; // for Add/RemoveOverlay friend class wxWindowDCImpl; // for PaintOverlays wxDECLARE_DYNAMIC_CLASS(wxWindowDFB); wxDECLARE_NO_COPY_CLASS(wxWindowDFB); wxDECLARE_EVENT_TABLE(); }; #endif // _WX_DFB_WINDOW_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/dc.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/dc.h // Purpose: wxDC class // Author: Vaclav Slavik // Created: 2006-08-07 // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_DC_H_ #define _WX_DFB_DC_H_ #include "wx/defs.h" #include "wx/region.h" #include "wx/dc.h" #include "wx/dfb/dfbptr.h" wxDFB_DECLARE_INTERFACE(IDirectFBSurface); //----------------------------------------------------------------------------- // wxDFBDCImpl //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDFBDCImpl : public wxDCImpl { public: // ctors wxDFBDCImpl(wxDC *owner) : wxDCImpl(owner) { m_surface = NULL; } wxDFBDCImpl(wxDC *owner, const wxIDirectFBSurfacePtr& surface) : wxDCImpl(owner) { DFBInit(surface); } bool IsOk() const { return m_surface != NULL; } // implement base class pure virtuals // ---------------------------------- virtual void Clear(); virtual bool StartDoc(const wxString& message); virtual void EndDoc(); virtual void StartPage(); virtual void EndPage(); virtual void SetFont(const wxFont& font); virtual void SetPen(const wxPen& pen); virtual void SetBrush(const wxBrush& brush); virtual void SetBackground(const wxBrush& brush); virtual void SetBackgroundMode(int mode); #if wxUSE_PALETTE virtual void SetPalette(const wxPalette& palette); #endif virtual void SetLogicalFunction(wxRasterOperationMode function); virtual void DestroyClippingRegion(); virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharWidth() const; virtual void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, const wxFont *theFont = NULL) const; virtual bool CanDrawBitmap() const { return true; } virtual bool CanGetTextExtent() const { return true; } virtual int GetDepth() const; virtual wxSize GetPPI() const; // Returns the surface (and increases its ref count) wxIDirectFBSurfacePtr GetDirectFBSurface() const { return m_surface; } protected: // implementation wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); } wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); } wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); } wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); } wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); } wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); } wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); } wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); } // initializes the DC from a surface, must be called if default ctor // was used void DFBInit(const wxIDirectFBSurfacePtr& surface); virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style = wxFLOOD_SURFACE); virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; virtual void DoDrawPoint(wxCoord x, wxCoord y); virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); virtual void DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc); virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea); virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius); virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); virtual void DoCrossHair(wxCoord x, wxCoord y); virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = false); virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoGetSize(int *width, int *height) const; virtual void DoGetSizeMM(int* width, int* height) const; virtual void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle = wxODDEVEN_RULE); // implementation from now on: protected: wxIDirectFBFontPtr GetCurrentFont() const; private: // Unified implementation of DrawIcon, DrawBitmap and Blit: void DoDrawSubBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxCoord destx, wxCoord desty, int rop, bool useMask); bool DoBlitFromSurface(const wxIDirectFBSurfacePtr& src, wxCoord srcx, wxCoord srcy, wxCoord w, wxCoord h, wxCoord dstx, wxCoord dsty); // selects colour into surface's state void SelectColour(const wxColour& clr); protected: wxIDirectFBSurfacePtr m_surface; friend class WXDLLIMPEXP_FWD_CORE wxOverlayImpl; // for Init wxDECLARE_ABSTRACT_CLASS(wxDFBDCImpl); }; #endif // _WX_DFB_DC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/chkconf.h
/* * Name: wx/dfb/chkconf.h * Author: Vaclav Slavik * Purpose: Compiler-specific configuration checking * Created: 2006-08-10 * Copyright: (c) 2006 REA Elektronik GmbH * Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ #ifndef _WX_DFB_CHKCONF_H_ #define _WX_DFB_CHKCONF_H_ #ifndef __WXUNIVERSAL__ # error "wxDirectFB cannot be built without wxUniversal" #endif #if !wxUSE_CONFIG # error "wxFileConfig is required by wxDFB port" #endif #if wxUSE_SOCKETS && !wxUSE_CONSOLE_EVENTLOOP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxSocket requires wxSelectDispatcher in wxDFB" # else # undef wxUSE_CONSOLE_EVENTLOOP # define wxUSE_CONSOLE_EVENTLOOP 1 # endif #endif #if wxUSE_DATAOBJ # ifdef wxABORT_ON_CONFIG_ERROR # error "wxDataObject not supported in wxDFB" # else # undef wxUSE_DATAOBJ # define wxUSE_DATAOBJ 0 # endif #endif #endif /* _WX_DFB_CHKCONF_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/private/fontmgr.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/private/fontmgr.h // Purpose: font management for wxDFB // Author: Vaclav Slavik // Created: 2006-11-18 // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) // (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_PRIVATE_FONTMGR_H_ #define _WX_DFB_PRIVATE_FONTMGR_H_ #include "wx/dfb/wrapdfb.h" class wxFileConfig; class wxFontInstance : public wxFontInstanceBase { public: wxFontInstance(float ptSize, bool aa, const wxString& filename); wxIDirectFBFontPtr GetDirectFBFont() const { return m_font; } private: wxIDirectFBFontPtr m_font; }; class wxFontFace : public wxFontFaceBase { public: wxFontFace(const wxString& filename) : m_fileName(filename) {} protected: wxFontInstance *CreateFontInstance(float ptSize, bool aa); private: wxString m_fileName; }; class wxFontBundle : public wxFontBundleBase { public: wxFontBundle(const wxString& name, const wxString& fileRegular, const wxString& fileBold, const wxString& fileItalic, const wxString& fileBoldItalic, bool isFixed); /// Returns name of the family virtual wxString GetName() const { return m_name; } virtual bool IsFixed() const { return m_isFixed; } private: wxString m_name; bool m_isFixed; }; class wxFontsManager : public wxFontsManagerBase { public: wxFontsManager() { AddAllFonts(); } virtual wxString GetDefaultFacename(wxFontFamily family) const { return m_defaultFacenames[family]; } private: // adds all fonts using AddBundle() void AddAllFonts(); void AddFontsFromDir(const wxString& indexFile); void AddFont(const wxString& dir, const wxString& name, wxFileConfig& cfg); void SetDefaultFonts(wxFileConfig& cfg); private: // default facenames wxString m_defaultFacenames[wxFONTFAMILY_MAX]; }; #endif // _WX_DFB_PRIVATE_FONTMGR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dfb/private/overlay.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dfb/private/overlay.h // Purpose: wxOverlayImpl declaration // Author: Vaclav Slavik // Created: 2006-10-20 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DFB_PRIVATE_OVERLAY_H_ #define _WX_DFB_PRIVATE_OVERLAY_H_ #include "wx/dfb/dfbptr.h" #include "wx/gdicmn.h" wxDFB_DECLARE_INTERFACE(IDirectFBSurface); class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxDC; class wxOverlayImpl { public: wxOverlayImpl(); ~wxOverlayImpl(); void Reset(); bool IsOk(); void Init(wxDC* dc, int x , int y , int width , int height); void BeginDrawing(wxDC* dc); void EndDrawing(wxDC* dc); void Clear(wxDC* dc); // wxDFB specific methods: bool IsEmpty() const { return m_isEmpty; } wxRect GetRect() const { return m_rect; } wxIDirectFBSurfacePtr GetDirectFBSurface() const { return m_surface; } public: // window the overlay is associated with wxWindow *m_window; // rectangle covered by the overlay, in m_window's window coordinates wxRect m_rect; // surface of the overlay, same size as m_rect wxIDirectFBSurfacePtr m_surface; // this flag is set to true if nothing was drawn on the overlay (either // initially or Clear() was called) bool m_isEmpty; }; #endif // _WX_DFB_PRIVATE_OVERLAY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/stc/private.h
//////////////////////////////////////////////////////////////////////////// // Name: wx/stc/private.h // Purpose: Private declarations for wxSTC // Author: Robin Dunn // Created: 2007-07-15 // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STC_PRIVATE_H_ #define _WX_STC_PRIVATE_H_ #include "wx/defs.h" #include "wx/string.h" //---------------------------------------------------------------------- // Utility functions used within wxSTC #if wxUSE_UNICODE extern wxString stc2wx(const char* str); extern wxString stc2wx(const char* str, size_t len); extern wxCharBuffer wx2stc(const wxString& str); // This function takes both wxString and wxCharBuffer because it uses either // one or the other of them depending on the build mode. In Unicode it uses the // length of the already converted buffer to avoid doing the conversion again // just to compute the length. inline size_t wx2stclen(const wxString& WXUNUSED(str), const wxCharBuffer& buf) { return buf.length(); } #else // not UNICODE inline wxString stc2wx(const char* str) { return wxString(str); } inline wxString stc2wx(const char* str, size_t len) { return wxString(str, len); } inline const char* wx2stc(const wxString& str) { return str.mbc_str(); } // As explained above, the buffer argument is only used in Unicode build. inline size_t wx2stclen(const wxString& str, const char* WXUNUSED(buf)) { return str.length(); } #endif // UNICODE #endif // _WX_STC_PRIVATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/stc/stc.h
//////////////////////////////////////////////////////////////////////////// // Name: wx/stc/stc.h // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, and in fact there // is no mention of Scintilla classes at all in this header. // This class delegates all method calls and events to the // Scintilla objects and so forth. This allows the use of // Scintilla without polluting the namespace with all the // classes and identifiers from Scintilla. // // Author: Robin Dunn // // Created: 13-Jan-2000 // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* IMPORTANT: include/wx/stc/stc.h is generated by src/stc/gen_iface.py from src/stc/stc.h.in, don't edit stc.h file as your changes will be lost after the next regeneration, edit stc.h.in and rerun the gen_iface.py script instead! Parts of this file generated by the script are found in between the special "{{{" and "}}}" markers, the rest of it is copied verbatim from src.h.in. */ #ifndef _WX_STC_STC_H_ #define _WX_STC_STC_H_ #include "wx/defs.h" #if wxUSE_STC #include "wx/control.h" #include "wx/dnd.h" #include "wx/stopwatch.h" #include "wx/versioninfo.h" #include "wx/textentry.h" #if wxUSE_TEXTCTRL #include "wx/textctrl.h" #endif // wxUSE_TEXTCTRL class WXDLLIMPEXP_FWD_CORE wxScrollBar; // SWIG can't handle "#if" type of conditionals, only "#ifdef" #ifdef SWIG #define STC_USE_DND 1 #else #if wxUSE_DRAG_AND_DROP #define STC_USE_DND 1 #endif #endif //---------------------------------------------------------------------- // STC constants generated section {{{ #define wxSTC_INVALID_POSITION -1 /// Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages /// as many EM_ messages can be used although that use is deprecated. #define wxSTC_START 2000 #define wxSTC_OPTIONAL_START 3000 #define wxSTC_LEXER_START 4000 #define wxSTC_WS_INVISIBLE 0 #define wxSTC_WS_VISIBLEALWAYS 1 #define wxSTC_WS_VISIBLEAFTERINDENT 2 #define wxSTC_WS_VISIBLEONLYININDENT 3 #define wxSTC_TD_LONGARROW 0 #define wxSTC_TD_STRIKEOUT 1 #define wxSTC_EOL_CRLF 0 #define wxSTC_EOL_CR 1 #define wxSTC_EOL_LF 2 /// The SC_CP_UTF8 value can be used to enter Unicode mode. /// This is the same value as CP_UTF8 in Windows #define wxSTC_CP_UTF8 65001 #define wxSTC_IME_WINDOWED 0 #define wxSTC_IME_INLINE 1 #define wxSTC_MARKER_MAX 31 #define wxSTC_MARK_CIRCLE 0 #define wxSTC_MARK_ROUNDRECT 1 #define wxSTC_MARK_ARROW 2 #define wxSTC_MARK_SMALLRECT 3 #define wxSTC_MARK_SHORTARROW 4 #define wxSTC_MARK_EMPTY 5 #define wxSTC_MARK_ARROWDOWN 6 #define wxSTC_MARK_MINUS 7 #define wxSTC_MARK_PLUS 8 /// Shapes used for outlining column. #define wxSTC_MARK_VLINE 9 #define wxSTC_MARK_LCORNER 10 #define wxSTC_MARK_TCORNER 11 #define wxSTC_MARK_BOXPLUS 12 #define wxSTC_MARK_BOXPLUSCONNECTED 13 #define wxSTC_MARK_BOXMINUS 14 #define wxSTC_MARK_BOXMINUSCONNECTED 15 #define wxSTC_MARK_LCORNERCURVE 16 #define wxSTC_MARK_TCORNERCURVE 17 #define wxSTC_MARK_CIRCLEPLUS 18 #define wxSTC_MARK_CIRCLEPLUSCONNECTED 19 #define wxSTC_MARK_CIRCLEMINUS 20 #define wxSTC_MARK_CIRCLEMINUSCONNECTED 21 /// Invisible mark that only sets the line background colour. #define wxSTC_MARK_BACKGROUND 22 #define wxSTC_MARK_DOTDOTDOT 23 #define wxSTC_MARK_ARROWS 24 #define wxSTC_MARK_PIXMAP 25 #define wxSTC_MARK_FULLRECT 26 #define wxSTC_MARK_LEFTRECT 27 #define wxSTC_MARK_AVAILABLE 28 #define wxSTC_MARK_UNDERLINE 29 #define wxSTC_MARK_RGBAIMAGE 30 #define wxSTC_MARK_BOOKMARK 31 #define wxSTC_MARK_CHARACTER 10000 /// Markers used for outlining column. #define wxSTC_MARKNUM_FOLDEREND 25 #define wxSTC_MARKNUM_FOLDEROPENMID 26 #define wxSTC_MARKNUM_FOLDERMIDTAIL 27 #define wxSTC_MARKNUM_FOLDERTAIL 28 #define wxSTC_MARKNUM_FOLDERSUB 29 #define wxSTC_MARKNUM_FOLDER 30 #define wxSTC_MARKNUM_FOLDEROPEN 31 #define wxSTC_MASK_FOLDERS 0xFE000000 #define wxSTC_MAX_MARGIN 4 #define wxSTC_MARGIN_SYMBOL 0 #define wxSTC_MARGIN_NUMBER 1 #define wxSTC_MARGIN_BACK 2 #define wxSTC_MARGIN_FORE 3 #define wxSTC_MARGIN_TEXT 4 #define wxSTC_MARGIN_RTEXT 5 #define wxSTC_MARGIN_COLOUR 6 /// Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. /// Style 39 is for future use. #define wxSTC_STYLE_DEFAULT 32 #define wxSTC_STYLE_LINENUMBER 33 #define wxSTC_STYLE_BRACELIGHT 34 #define wxSTC_STYLE_BRACEBAD 35 #define wxSTC_STYLE_CONTROLCHAR 36 #define wxSTC_STYLE_INDENTGUIDE 37 #define wxSTC_STYLE_CALLTIP 38 #define wxSTC_STYLE_FOLDDISPLAYTEXT 39 #define wxSTC_STYLE_LASTPREDEFINED 39 #define wxSTC_STYLE_MAX 255 /// Character set identifiers are used in StyleSetCharacterSet. /// The values are the same as the Windows *_CHARSET values. #define wxSTC_CHARSET_ANSI 0 #define wxSTC_CHARSET_DEFAULT 1 #define wxSTC_CHARSET_BALTIC 186 #define wxSTC_CHARSET_CHINESEBIG5 136 #define wxSTC_CHARSET_EASTEUROPE 238 #define wxSTC_CHARSET_GB2312 134 #define wxSTC_CHARSET_GREEK 161 #define wxSTC_CHARSET_HANGUL 129 #define wxSTC_CHARSET_MAC 77 #define wxSTC_CHARSET_OEM 255 #define wxSTC_CHARSET_RUSSIAN 204 #define wxSTC_CHARSET_OEM866 866 #define wxSTC_CHARSET_CYRILLIC 1251 #define wxSTC_CHARSET_SHIFTJIS 128 #define wxSTC_CHARSET_SYMBOL 2 #define wxSTC_CHARSET_TURKISH 162 #define wxSTC_CHARSET_JOHAB 130 #define wxSTC_CHARSET_HEBREW 177 #define wxSTC_CHARSET_ARABIC 178 #define wxSTC_CHARSET_VIETNAMESE 163 #define wxSTC_CHARSET_THAI 222 #define wxSTC_CHARSET_8859_15 1000 #define wxSTC_CASE_MIXED 0 #define wxSTC_CASE_UPPER 1 #define wxSTC_CASE_LOWER 2 #define wxSTC_CASE_CAMEL 3 #define wxSTC_FONT_SIZE_MULTIPLIER 100 #define wxSTC_WEIGHT_NORMAL 400 #define wxSTC_WEIGHT_SEMIBOLD 600 #define wxSTC_WEIGHT_BOLD 700 /// Indicator style enumeration and some constants #define wxSTC_INDIC_PLAIN 0 #define wxSTC_INDIC_SQUIGGLE 1 #define wxSTC_INDIC_TT 2 #define wxSTC_INDIC_DIAGONAL 3 #define wxSTC_INDIC_STRIKE 4 #define wxSTC_INDIC_HIDDEN 5 #define wxSTC_INDIC_BOX 6 #define wxSTC_INDIC_ROUNDBOX 7 #define wxSTC_INDIC_STRAIGHTBOX 8 #define wxSTC_INDIC_DASH 9 #define wxSTC_INDIC_DOTS 10 #define wxSTC_INDIC_SQUIGGLELOW 11 #define wxSTC_INDIC_DOTBOX 12 #define wxSTC_INDIC_SQUIGGLEPIXMAP 13 #define wxSTC_INDIC_COMPOSITIONTHICK 14 #define wxSTC_INDIC_COMPOSITIONTHIN 15 #define wxSTC_INDIC_FULLBOX 16 #define wxSTC_INDIC_TEXTFORE 17 #define wxSTC_INDIC_POINT 18 #define wxSTC_INDIC_POINTCHARACTER 19 #define wxSTC_INDIC_IME 32 #define wxSTC_INDIC_IME_MAX 35 #define wxSTC_INDIC_MAX 35 #define wxSTC_INDIC_CONTAINER 8 #define wxSTC_INDICVALUEBIT 0x1000000 #define wxSTC_INDICVALUEMASK 0xFFFFFF #define wxSTC_INDICFLAG_VALUEFORE 1 #define wxSTC_IV_NONE 0 #define wxSTC_IV_REAL 1 #define wxSTC_IV_LOOKFORWARD 2 #define wxSTC_IV_LOOKBOTH 3 /// PrintColourMode - use same colours as screen. #define wxSTC_PRINT_NORMAL 0 /// PrintColourMode - invert the light value of each style for printing. #define wxSTC_PRINT_INVERTLIGHT 1 /// PrintColourMode - force black text on white background for printing. #define wxSTC_PRINT_BLACKONWHITE 2 /// PrintColourMode - text stays coloured, but all background is forced to be white for printing. #define wxSTC_PRINT_COLOURONWHITE 3 /// PrintColourMode - only the default-background is forced to be white for printing. #define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4 #define wxSTC_FIND_WHOLEWORD 0x2 #define wxSTC_FIND_MATCHCASE 0x4 #define wxSTC_FIND_WORDSTART 0x00100000 #define wxSTC_FIND_REGEXP 0x00200000 #define wxSTC_FIND_POSIX 0x00400000 #define wxSTC_FIND_CXX11REGEX 0x00800000 #define wxSTC_FOLDLEVELBASE 0x400 #define wxSTC_FOLDLEVELWHITEFLAG 0x1000 #define wxSTC_FOLDLEVELHEADERFLAG 0x2000 #define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF #define wxSTC_FOLDDISPLAYTEXT_HIDDEN 0 #define wxSTC_FOLDDISPLAYTEXT_STANDARD 1 #define wxSTC_FOLDDISPLAYTEXT_BOXED 2 #define wxSTC_FOLDACTION_CONTRACT 0 #define wxSTC_FOLDACTION_EXPAND 1 #define wxSTC_FOLDACTION_TOGGLE 2 #define wxSTC_AUTOMATICFOLD_SHOW 0x0001 #define wxSTC_AUTOMATICFOLD_CLICK 0x0002 #define wxSTC_AUTOMATICFOLD_CHANGE 0x0004 #define wxSTC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define wxSTC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define wxSTC_FOLDFLAG_LEVELNUMBERS 0x0040 #define wxSTC_FOLDFLAG_LINESTATE 0x0080 #define wxSTC_TIME_FOREVER 10000000 #define wxSTC_IDLESTYLING_NONE 0 #define wxSTC_IDLESTYLING_TOVISIBLE 1 #define wxSTC_IDLESTYLING_AFTERVISIBLE 2 #define wxSTC_IDLESTYLING_ALL 3 #define wxSTC_WRAP_NONE 0 #define wxSTC_WRAP_WORD 1 #define wxSTC_WRAP_CHAR 2 #define wxSTC_WRAP_WHITESPACE 3 #define wxSTC_WRAPVISUALFLAG_NONE 0x0000 #define wxSTC_WRAPVISUALFLAG_END 0x0001 #define wxSTC_WRAPVISUALFLAG_START 0x0002 #define wxSTC_WRAPVISUALFLAG_MARGIN 0x0004 #define wxSTC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #define wxSTC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define wxSTC_WRAPINDENT_FIXED 0 #define wxSTC_WRAPINDENT_SAME 1 #define wxSTC_WRAPINDENT_INDENT 2 #define wxSTC_CACHE_NONE 0 #define wxSTC_CACHE_CARET 1 #define wxSTC_CACHE_PAGE 2 #define wxSTC_CACHE_DOCUMENT 3 #define wxSTC_PHASES_ONE 0 #define wxSTC_PHASES_TWO 1 #define wxSTC_PHASES_MULTIPLE 2 /// Control font anti-aliasing. #define wxSTC_EFF_QUALITY_MASK 0xF #define wxSTC_EFF_QUALITY_DEFAULT 0 #define wxSTC_EFF_QUALITY_NON_ANTIALIASED 1 #define wxSTC_EFF_QUALITY_ANTIALIASED 2 #define wxSTC_EFF_QUALITY_LCD_OPTIMIZED 3 #define wxSTC_MULTIPASTE_ONCE 0 #define wxSTC_MULTIPASTE_EACH 1 #define wxSTC_EDGE_NONE 0 #define wxSTC_EDGE_LINE 1 #define wxSTC_EDGE_BACKGROUND 2 #define wxSTC_EDGE_MULTILINE 3 #define wxSTC_POPUP_NEVER 0 #define wxSTC_POPUP_ALL 1 #define wxSTC_POPUP_TEXT 2 #define wxSTC_STATUS_OK 0 #define wxSTC_STATUS_FAILURE 1 #define wxSTC_STATUS_BADALLOC 2 #define wxSTC_STATUS_WARN_START 1000 #define wxSTC_STATUS_WARN_REGEX 1001 #define wxSTC_CURSORNORMAL -1 #define wxSTC_CURSORARROW 2 #define wxSTC_CURSORWAIT 4 #define wxSTC_CURSORREVERSEARROW 7 /// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. #define wxSTC_VISIBLE_SLOP 0x01 #define wxSTC_VISIBLE_STRICT 0x04 /// Caret policy, used by SetXCaretPolicy and SetYCaretPolicy. /// If CARET_SLOP is set, we can define a slop value: caretSlop. /// This value defines an unwanted zone (UZ) where the caret is... unwanted. /// This zone is defined as a number of pixels near the vertical margins, /// and as a number of lines near the horizontal margins. /// By keeping the caret away from the edges, it is seen within its context, /// so it is likely that the identifier that the caret is on can be completely seen, /// and that the current line is seen with some of the lines following it which are /// often dependent on that line. #define wxSTC_CARET_SLOP 0x01 /// If CARET_STRICT is set, the policy is enforced... strictly. /// The caret is centred on the display if slop is not set, /// and cannot go in the UZ if slop is set. #define wxSTC_CARET_STRICT 0x04 /// If CARET_JUMPS is set, the display is moved more energetically /// so the caret can move in the same direction longer before the policy is applied again. #define wxSTC_CARET_JUMPS 0x10 /// If CARET_EVEN is not set, instead of having symmetrical UZs, /// the left and bottom UZs are extended up to right and top UZs respectively. /// This way, we favour the displaying of useful information: the beginning of lines, /// where most code reside, and the lines after the caret, eg. the body of a function. #define wxSTC_CARET_EVEN 0x08 #define wxSTC_SEL_STREAM 0 #define wxSTC_SEL_RECTANGLE 1 #define wxSTC_SEL_LINES 2 #define wxSTC_SEL_THIN 3 #define wxSTC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0 #define wxSTC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1 #define wxSTC_MULTIAUTOC_ONCE 0 #define wxSTC_MULTIAUTOC_EACH 1 #define wxSTC_ORDER_PRESORTED 0 #define wxSTC_ORDER_PERFORMSORT 1 #define wxSTC_ORDER_CUSTOM 2 #define wxSTC_CARETSTICKY_OFF 0 #define wxSTC_CARETSTICKY_ON 1 #define wxSTC_CARETSTICKY_WHITESPACE 2 #define wxSTC_ALPHA_TRANSPARENT 0 #define wxSTC_ALPHA_OPAQUE 255 #define wxSTC_ALPHA_NOALPHA 256 #define wxSTC_CARETSTYLE_INVISIBLE 0 #define wxSTC_CARETSTYLE_LINE 1 #define wxSTC_CARETSTYLE_BLOCK 2 #define wxSTC_MARGINOPTION_NONE 0 #define wxSTC_MARGINOPTION_SUBLINESELECT 1 #define wxSTC_ANNOTATION_HIDDEN 0 #define wxSTC_ANNOTATION_STANDARD 1 #define wxSTC_ANNOTATION_BOXED 2 #define wxSTC_ANNOTATION_INDENTED 3 #define wxSTC_UNDO_MAY_COALESCE 1 #define wxSTC_VS_NONE 0 #define wxSTC_VS_RECTANGULARSELECTION 1 #define wxSTC_VS_USERACCESSIBLE 2 #define wxSTC_VS_NOWRAPLINESTART 4 #define wxSTC_TECHNOLOGY_DEFAULT 0 #define wxSTC_TECHNOLOGY_DIRECTWRITE 1 /// Line end types which may be used in addition to LF, CR, and CRLF /// SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator, /// U+2029 Paragraph Separator, and U+0085 Next Line #define wxSTC_LINE_END_TYPE_DEFAULT 0 #define wxSTC_LINE_END_TYPE_UNICODE 1 /// Maximum value of keywordSet parameter of SetKeyWords. #define wxSTC_KEYWORDSET_MAX 8 #define wxSTC_TYPE_BOOLEAN 0 #define wxSTC_TYPE_INTEGER 1 #define wxSTC_TYPE_STRING 2 /// Notifications /// Type of modification and the action which caused the modification. /// These are defined as a bit mask to make it easy to specify which notifications are wanted. /// One bit is set from each of SC_MOD_* and SC_PERFORMED_*. #define wxSTC_MOD_INSERTTEXT 0x1 #define wxSTC_MOD_DELETETEXT 0x2 #define wxSTC_MOD_CHANGESTYLE 0x4 #define wxSTC_MOD_CHANGEFOLD 0x8 #define wxSTC_PERFORMED_USER 0x10 #define wxSTC_PERFORMED_UNDO 0x20 #define wxSTC_PERFORMED_REDO 0x40 #define wxSTC_MULTISTEPUNDOREDO 0x80 #define wxSTC_LASTSTEPINUNDOREDO 0x100 #define wxSTC_MOD_CHANGEMARKER 0x200 #define wxSTC_MOD_BEFOREINSERT 0x400 #define wxSTC_MOD_BEFOREDELETE 0x800 #define wxSTC_MULTILINEUNDOREDO 0x1000 #define wxSTC_STARTACTION 0x2000 #define wxSTC_MOD_CHANGEINDICATOR 0x4000 #define wxSTC_MOD_CHANGELINESTATE 0x8000 #define wxSTC_MOD_CHANGEMARGIN 0x10000 #define wxSTC_MOD_CHANGEANNOTATION 0x20000 #define wxSTC_MOD_CONTAINER 0x40000 #define wxSTC_MOD_LEXERSTATE 0x80000 #define wxSTC_MOD_INSERTCHECK 0x100000 #define wxSTC_MOD_CHANGETABSTOPS 0x200000 #define wxSTC_MODEVENTMASKALL 0x3FFFFF #define wxSTC_UPDATE_CONTENT 0x1 #define wxSTC_UPDATE_SELECTION 0x2 #define wxSTC_UPDATE_V_SCROLL 0x4 #define wxSTC_UPDATE_H_SCROLL 0x8 /// Symbolic key codes and modifier flags. /// ASCII and other printable characters below 256. /// Extended keys above 300. #define wxSTC_KEY_DOWN 300 #define wxSTC_KEY_UP 301 #define wxSTC_KEY_LEFT 302 #define wxSTC_KEY_RIGHT 303 #define wxSTC_KEY_HOME 304 #define wxSTC_KEY_END 305 #define wxSTC_KEY_PRIOR 306 #define wxSTC_KEY_NEXT 307 #define wxSTC_KEY_DELETE 308 #define wxSTC_KEY_INSERT 309 #define wxSTC_KEY_ESCAPE 7 #define wxSTC_KEY_BACK 8 #define wxSTC_KEY_TAB 9 #define wxSTC_KEY_RETURN 13 #define wxSTC_KEY_ADD 310 #define wxSTC_KEY_SUBTRACT 311 #define wxSTC_KEY_DIVIDE 312 #define wxSTC_KEY_WIN 313 #define wxSTC_KEY_RWIN 314 #define wxSTC_KEY_MENU 315 #define wxSTC_KEYMOD_NORM 0 #define wxSTC_KEYMOD_SHIFT 1 #define wxSTC_KEYMOD_CTRL 2 #define wxSTC_KEYMOD_ALT 4 #define wxSTC_KEYMOD_SUPER 8 #define wxSTC_KEYMOD_META 16 #define wxSTC_AC_FILLUP 1 #define wxSTC_AC_DOUBLECLICK 2 #define wxSTC_AC_TAB 3 #define wxSTC_AC_NEWLINE 4 #define wxSTC_AC_COMMAND 5 /// For SciLexer.h #define wxSTC_LEX_CONTAINER 0 #define wxSTC_LEX_NULL 1 #define wxSTC_LEX_PYTHON 2 #define wxSTC_LEX_CPP 3 #define wxSTC_LEX_HTML 4 #define wxSTC_LEX_XML 5 #define wxSTC_LEX_PERL 6 #define wxSTC_LEX_SQL 7 #define wxSTC_LEX_VB 8 #define wxSTC_LEX_PROPERTIES 9 #define wxSTC_LEX_ERRORLIST 10 #define wxSTC_LEX_MAKEFILE 11 #define wxSTC_LEX_BATCH 12 #define wxSTC_LEX_XCODE 13 #define wxSTC_LEX_LATEX 14 #define wxSTC_LEX_LUA 15 #define wxSTC_LEX_DIFF 16 #define wxSTC_LEX_CONF 17 #define wxSTC_LEX_PASCAL 18 #define wxSTC_LEX_AVE 19 #define wxSTC_LEX_ADA 20 #define wxSTC_LEX_LISP 21 #define wxSTC_LEX_RUBY 22 #define wxSTC_LEX_EIFFEL 23 #define wxSTC_LEX_EIFFELKW 24 #define wxSTC_LEX_TCL 25 #define wxSTC_LEX_NNCRONTAB 26 #define wxSTC_LEX_BULLANT 27 #define wxSTC_LEX_VBSCRIPT 28 #define wxSTC_LEX_BAAN 31 #define wxSTC_LEX_MATLAB 32 #define wxSTC_LEX_SCRIPTOL 33 #define wxSTC_LEX_ASM 34 #define wxSTC_LEX_CPPNOCASE 35 #define wxSTC_LEX_FORTRAN 36 #define wxSTC_LEX_F77 37 #define wxSTC_LEX_CSS 38 #define wxSTC_LEX_POV 39 #define wxSTC_LEX_LOUT 40 #define wxSTC_LEX_ESCRIPT 41 #define wxSTC_LEX_PS 42 #define wxSTC_LEX_NSIS 43 #define wxSTC_LEX_MMIXAL 44 #define wxSTC_LEX_CLW 45 #define wxSTC_LEX_CLWNOCASE 46 #define wxSTC_LEX_LOT 47 #define wxSTC_LEX_YAML 48 #define wxSTC_LEX_TEX 49 #define wxSTC_LEX_METAPOST 50 #define wxSTC_LEX_POWERBASIC 51 #define wxSTC_LEX_FORTH 52 #define wxSTC_LEX_ERLANG 53 #define wxSTC_LEX_OCTAVE 54 #define wxSTC_LEX_MSSQL 55 #define wxSTC_LEX_VERILOG 56 #define wxSTC_LEX_KIX 57 #define wxSTC_LEX_GUI4CLI 58 #define wxSTC_LEX_SPECMAN 59 #define wxSTC_LEX_AU3 60 #define wxSTC_LEX_APDL 61 #define wxSTC_LEX_BASH 62 #define wxSTC_LEX_ASN1 63 #define wxSTC_LEX_VHDL 64 #define wxSTC_LEX_CAML 65 #define wxSTC_LEX_BLITZBASIC 66 #define wxSTC_LEX_PUREBASIC 67 #define wxSTC_LEX_HASKELL 68 #define wxSTC_LEX_PHPSCRIPT 69 #define wxSTC_LEX_TADS3 70 #define wxSTC_LEX_REBOL 71 #define wxSTC_LEX_SMALLTALK 72 #define wxSTC_LEX_FLAGSHIP 73 #define wxSTC_LEX_CSOUND 74 #define wxSTC_LEX_FREEBASIC 75 #define wxSTC_LEX_INNOSETUP 76 #define wxSTC_LEX_OPAL 77 #define wxSTC_LEX_SPICE 78 #define wxSTC_LEX_D 79 #define wxSTC_LEX_CMAKE 80 #define wxSTC_LEX_GAP 81 #define wxSTC_LEX_PLM 82 #define wxSTC_LEX_PROGRESS 83 #define wxSTC_LEX_ABAQUS 84 #define wxSTC_LEX_ASYMPTOTE 85 #define wxSTC_LEX_R 86 #define wxSTC_LEX_MAGIK 87 #define wxSTC_LEX_POWERSHELL 88 #define wxSTC_LEX_MYSQL 89 #define wxSTC_LEX_PO 90 #define wxSTC_LEX_TAL 91 #define wxSTC_LEX_COBOL 92 #define wxSTC_LEX_TACL 93 #define wxSTC_LEX_SORCUS 94 #define wxSTC_LEX_POWERPRO 95 #define wxSTC_LEX_NIMROD 96 #define wxSTC_LEX_SML 97 #define wxSTC_LEX_MARKDOWN 98 #define wxSTC_LEX_TXT2TAGS 99 #define wxSTC_LEX_A68K 100 #define wxSTC_LEX_MODULA 101 #define wxSTC_LEX_COFFEESCRIPT 102 #define wxSTC_LEX_TCMD 103 #define wxSTC_LEX_AVS 104 #define wxSTC_LEX_ECL 105 #define wxSTC_LEX_OSCRIPT 106 #define wxSTC_LEX_VISUALPROLOG 107 #define wxSTC_LEX_LITERATEHASKELL 108 #define wxSTC_LEX_STTXT 109 #define wxSTC_LEX_KVIRC 110 #define wxSTC_LEX_RUST 111 #define wxSTC_LEX_DMAP 112 #define wxSTC_LEX_AS 113 #define wxSTC_LEX_DMIS 114 #define wxSTC_LEX_REGISTRY 115 #define wxSTC_LEX_BIBTEX 116 #define wxSTC_LEX_SREC 117 #define wxSTC_LEX_IHEX 118 #define wxSTC_LEX_TEHEX 119 #define wxSTC_LEX_JSON 120 #define wxSTC_LEX_EDIFACT 121 /// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a /// value assigned in sequence from SCLEX_AUTOMATIC+1. #define wxSTC_LEX_AUTOMATIC 1000 /// Lexical states for SCLEX_PYTHON #define wxSTC_P_DEFAULT 0 #define wxSTC_P_COMMENTLINE 1 #define wxSTC_P_NUMBER 2 #define wxSTC_P_STRING 3 #define wxSTC_P_CHARACTER 4 #define wxSTC_P_WORD 5 #define wxSTC_P_TRIPLE 6 #define wxSTC_P_TRIPLEDOUBLE 7 #define wxSTC_P_CLASSNAME 8 #define wxSTC_P_DEFNAME 9 #define wxSTC_P_OPERATOR 10 #define wxSTC_P_IDENTIFIER 11 #define wxSTC_P_COMMENTBLOCK 12 #define wxSTC_P_STRINGEOL 13 #define wxSTC_P_WORD2 14 #define wxSTC_P_DECORATOR 15 /// Lexical states for SCLEX_CPP, SCLEX_BULLANT, SCLEX_COBOL, SCLEX_TACL, SCLEX_TAL #define wxSTC_C_DEFAULT 0 #define wxSTC_C_COMMENT 1 #define wxSTC_C_COMMENTLINE 2 #define wxSTC_C_COMMENTDOC 3 #define wxSTC_C_NUMBER 4 #define wxSTC_C_WORD 5 #define wxSTC_C_STRING 6 #define wxSTC_C_CHARACTER 7 #define wxSTC_C_UUID 8 #define wxSTC_C_PREPROCESSOR 9 #define wxSTC_C_OPERATOR 10 #define wxSTC_C_IDENTIFIER 11 #define wxSTC_C_STRINGEOL 12 #define wxSTC_C_VERBATIM 13 #define wxSTC_C_REGEX 14 #define wxSTC_C_COMMENTLINEDOC 15 #define wxSTC_C_WORD2 16 #define wxSTC_C_COMMENTDOCKEYWORD 17 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18 #define wxSTC_C_GLOBALCLASS 19 #define wxSTC_C_STRINGRAW 20 #define wxSTC_C_TRIPLEVERBATIM 21 #define wxSTC_C_HASHQUOTEDSTRING 22 #define wxSTC_C_PREPROCESSORCOMMENT 23 #define wxSTC_C_PREPROCESSORCOMMENTDOC 24 #define wxSTC_C_USERLITERAL 25 #define wxSTC_C_TASKMARKER 26 #define wxSTC_C_ESCAPESEQUENCE 27 /// Lexical states for SCLEX_D #define wxSTC_D_DEFAULT 0 #define wxSTC_D_COMMENT 1 #define wxSTC_D_COMMENTLINE 2 #define wxSTC_D_COMMENTDOC 3 #define wxSTC_D_COMMENTNESTED 4 #define wxSTC_D_NUMBER 5 #define wxSTC_D_WORD 6 #define wxSTC_D_WORD2 7 #define wxSTC_D_WORD3 8 #define wxSTC_D_TYPEDEF 9 #define wxSTC_D_STRING 10 #define wxSTC_D_STRINGEOL 11 #define wxSTC_D_CHARACTER 12 #define wxSTC_D_OPERATOR 13 #define wxSTC_D_IDENTIFIER 14 #define wxSTC_D_COMMENTLINEDOC 15 #define wxSTC_D_COMMENTDOCKEYWORD 16 #define wxSTC_D_COMMENTDOCKEYWORDERROR 17 #define wxSTC_D_STRINGB 18 #define wxSTC_D_STRINGR 19 #define wxSTC_D_WORD5 20 #define wxSTC_D_WORD6 21 #define wxSTC_D_WORD7 22 /// Lexical states for SCLEX_TCL #define wxSTC_TCL_DEFAULT 0 #define wxSTC_TCL_COMMENT 1 #define wxSTC_TCL_COMMENTLINE 2 #define wxSTC_TCL_NUMBER 3 #define wxSTC_TCL_WORD_IN_QUOTE 4 #define wxSTC_TCL_IN_QUOTE 5 #define wxSTC_TCL_OPERATOR 6 #define wxSTC_TCL_IDENTIFIER 7 #define wxSTC_TCL_SUBSTITUTION 8 #define wxSTC_TCL_SUB_BRACE 9 #define wxSTC_TCL_MODIFIER 10 #define wxSTC_TCL_EXPAND 11 #define wxSTC_TCL_WORD 12 #define wxSTC_TCL_WORD2 13 #define wxSTC_TCL_WORD3 14 #define wxSTC_TCL_WORD4 15 #define wxSTC_TCL_WORD5 16 #define wxSTC_TCL_WORD6 17 #define wxSTC_TCL_WORD7 18 #define wxSTC_TCL_WORD8 19 #define wxSTC_TCL_COMMENT_BOX 20 #define wxSTC_TCL_BLOCK_COMMENT 21 /// Lexical states for SCLEX_HTML, SCLEX_XML #define wxSTC_H_DEFAULT 0 #define wxSTC_H_TAG 1 #define wxSTC_H_TAGUNKNOWN 2 #define wxSTC_H_ATTRIBUTE 3 #define wxSTC_H_ATTRIBUTEUNKNOWN 4 #define wxSTC_H_NUMBER 5 #define wxSTC_H_DOUBLESTRING 6 #define wxSTC_H_SINGLESTRING 7 #define wxSTC_H_OTHER 8 #define wxSTC_H_COMMENT 9 #define wxSTC_H_ENTITY 10 /// XML and ASP #define wxSTC_H_TAGEND 11 #define wxSTC_H_XMLSTART 12 #define wxSTC_H_XMLEND 13 #define wxSTC_H_SCRIPT 14 #define wxSTC_H_ASP 15 #define wxSTC_H_ASPAT 16 #define wxSTC_H_CDATA 17 #define wxSTC_H_QUESTION 18 /// More HTML #define wxSTC_H_VALUE 19 /// X-Code #define wxSTC_H_XCCOMMENT 20 /// SGML #define wxSTC_H_SGML_DEFAULT 21 #define wxSTC_H_SGML_COMMAND 22 #define wxSTC_H_SGML_1ST_PARAM 23 #define wxSTC_H_SGML_DOUBLESTRING 24 #define wxSTC_H_SGML_SIMPLESTRING 25 #define wxSTC_H_SGML_ERROR 26 #define wxSTC_H_SGML_SPECIAL 27 #define wxSTC_H_SGML_ENTITY 28 #define wxSTC_H_SGML_COMMENT 29 #define wxSTC_H_SGML_1ST_PARAM_COMMENT 30 #define wxSTC_H_SGML_BLOCK_DEFAULT 31 /// Embedded Javascript #define wxSTC_HJ_START 40 #define wxSTC_HJ_DEFAULT 41 #define wxSTC_HJ_COMMENT 42 #define wxSTC_HJ_COMMENTLINE 43 #define wxSTC_HJ_COMMENTDOC 44 #define wxSTC_HJ_NUMBER 45 #define wxSTC_HJ_WORD 46 #define wxSTC_HJ_KEYWORD 47 #define wxSTC_HJ_DOUBLESTRING 48 #define wxSTC_HJ_SINGLESTRING 49 #define wxSTC_HJ_SYMBOLS 50 #define wxSTC_HJ_STRINGEOL 51 #define wxSTC_HJ_REGEX 52 /// ASP Javascript #define wxSTC_HJA_START 55 #define wxSTC_HJA_DEFAULT 56 #define wxSTC_HJA_COMMENT 57 #define wxSTC_HJA_COMMENTLINE 58 #define wxSTC_HJA_COMMENTDOC 59 #define wxSTC_HJA_NUMBER 60 #define wxSTC_HJA_WORD 61 #define wxSTC_HJA_KEYWORD 62 #define wxSTC_HJA_DOUBLESTRING 63 #define wxSTC_HJA_SINGLESTRING 64 #define wxSTC_HJA_SYMBOLS 65 #define wxSTC_HJA_STRINGEOL 66 #define wxSTC_HJA_REGEX 67 /// Embedded VBScript #define wxSTC_HB_START 70 #define wxSTC_HB_DEFAULT 71 #define wxSTC_HB_COMMENTLINE 72 #define wxSTC_HB_NUMBER 73 #define wxSTC_HB_WORD 74 #define wxSTC_HB_STRING 75 #define wxSTC_HB_IDENTIFIER 76 #define wxSTC_HB_STRINGEOL 77 /// ASP VBScript #define wxSTC_HBA_START 80 #define wxSTC_HBA_DEFAULT 81 #define wxSTC_HBA_COMMENTLINE 82 #define wxSTC_HBA_NUMBER 83 #define wxSTC_HBA_WORD 84 #define wxSTC_HBA_STRING 85 #define wxSTC_HBA_IDENTIFIER 86 #define wxSTC_HBA_STRINGEOL 87 /// Embedded Python #define wxSTC_HP_START 90 #define wxSTC_HP_DEFAULT 91 #define wxSTC_HP_COMMENTLINE 92 #define wxSTC_HP_NUMBER 93 #define wxSTC_HP_STRING 94 #define wxSTC_HP_CHARACTER 95 #define wxSTC_HP_WORD 96 #define wxSTC_HP_TRIPLE 97 #define wxSTC_HP_TRIPLEDOUBLE 98 #define wxSTC_HP_CLASSNAME 99 #define wxSTC_HP_DEFNAME 100 #define wxSTC_HP_OPERATOR 101 #define wxSTC_HP_IDENTIFIER 102 /// PHP #define wxSTC_HPHP_COMPLEX_VARIABLE 104 /// ASP Python #define wxSTC_HPA_START 105 #define wxSTC_HPA_DEFAULT 106 #define wxSTC_HPA_COMMENTLINE 107 #define wxSTC_HPA_NUMBER 108 #define wxSTC_HPA_STRING 109 #define wxSTC_HPA_CHARACTER 110 #define wxSTC_HPA_WORD 111 #define wxSTC_HPA_TRIPLE 112 #define wxSTC_HPA_TRIPLEDOUBLE 113 #define wxSTC_HPA_CLASSNAME 114 #define wxSTC_HPA_DEFNAME 115 #define wxSTC_HPA_OPERATOR 116 #define wxSTC_HPA_IDENTIFIER 117 /// PHP #define wxSTC_HPHP_DEFAULT 118 #define wxSTC_HPHP_HSTRING 119 #define wxSTC_HPHP_SIMPLESTRING 120 #define wxSTC_HPHP_WORD 121 #define wxSTC_HPHP_NUMBER 122 #define wxSTC_HPHP_VARIABLE 123 #define wxSTC_HPHP_COMMENT 124 #define wxSTC_HPHP_COMMENTLINE 125 #define wxSTC_HPHP_HSTRING_VARIABLE 126 #define wxSTC_HPHP_OPERATOR 127 /// Lexical states for SCLEX_PERL #define wxSTC_PL_DEFAULT 0 #define wxSTC_PL_ERROR 1 #define wxSTC_PL_COMMENTLINE 2 #define wxSTC_PL_POD 3 #define wxSTC_PL_NUMBER 4 #define wxSTC_PL_WORD 5 #define wxSTC_PL_STRING 6 #define wxSTC_PL_CHARACTER 7 #define wxSTC_PL_PUNCTUATION 8 #define wxSTC_PL_PREPROCESSOR 9 #define wxSTC_PL_OPERATOR 10 #define wxSTC_PL_IDENTIFIER 11 #define wxSTC_PL_SCALAR 12 #define wxSTC_PL_ARRAY 13 #define wxSTC_PL_HASH 14 #define wxSTC_PL_SYMBOLTABLE 15 #define wxSTC_PL_VARIABLE_INDEXER 16 #define wxSTC_PL_REGEX 17 #define wxSTC_PL_REGSUBST 18 #define wxSTC_PL_LONGQUOTE 19 #define wxSTC_PL_BACKTICKS 20 #define wxSTC_PL_DATASECTION 21 #define wxSTC_PL_HERE_DELIM 22 #define wxSTC_PL_HERE_Q 23 #define wxSTC_PL_HERE_QQ 24 #define wxSTC_PL_HERE_QX 25 #define wxSTC_PL_STRING_Q 26 #define wxSTC_PL_STRING_QQ 27 #define wxSTC_PL_STRING_QX 28 #define wxSTC_PL_STRING_QR 29 #define wxSTC_PL_STRING_QW 30 #define wxSTC_PL_POD_VERB 31 #define wxSTC_PL_SUB_PROTOTYPE 40 #define wxSTC_PL_FORMAT_IDENT 41 #define wxSTC_PL_FORMAT 42 #define wxSTC_PL_STRING_VAR 43 #define wxSTC_PL_XLAT 44 #define wxSTC_PL_REGEX_VAR 54 #define wxSTC_PL_REGSUBST_VAR 55 #define wxSTC_PL_BACKTICKS_VAR 57 #define wxSTC_PL_HERE_QQ_VAR 61 #define wxSTC_PL_HERE_QX_VAR 62 #define wxSTC_PL_STRING_QQ_VAR 64 #define wxSTC_PL_STRING_QX_VAR 65 #define wxSTC_PL_STRING_QR_VAR 66 /// Lexical states for SCLEX_RUBY #define wxSTC_RB_DEFAULT 0 #define wxSTC_RB_ERROR 1 #define wxSTC_RB_COMMENTLINE 2 #define wxSTC_RB_POD 3 #define wxSTC_RB_NUMBER 4 #define wxSTC_RB_WORD 5 #define wxSTC_RB_STRING 6 #define wxSTC_RB_CHARACTER 7 #define wxSTC_RB_CLASSNAME 8 #define wxSTC_RB_DEFNAME 9 #define wxSTC_RB_OPERATOR 10 #define wxSTC_RB_IDENTIFIER 11 #define wxSTC_RB_REGEX 12 #define wxSTC_RB_GLOBAL 13 #define wxSTC_RB_SYMBOL 14 #define wxSTC_RB_MODULE_NAME 15 #define wxSTC_RB_INSTANCE_VAR 16 #define wxSTC_RB_CLASS_VAR 17 #define wxSTC_RB_BACKTICKS 18 #define wxSTC_RB_DATASECTION 19 #define wxSTC_RB_HERE_DELIM 20 #define wxSTC_RB_HERE_Q 21 #define wxSTC_RB_HERE_QQ 22 #define wxSTC_RB_HERE_QX 23 #define wxSTC_RB_STRING_Q 24 #define wxSTC_RB_STRING_QQ 25 #define wxSTC_RB_STRING_QX 26 #define wxSTC_RB_STRING_QR 27 #define wxSTC_RB_STRING_QW 28 #define wxSTC_RB_WORD_DEMOTED 29 #define wxSTC_RB_STDIN 30 #define wxSTC_RB_STDOUT 31 #define wxSTC_RB_STDERR 40 #define wxSTC_RB_UPPER_BOUND 41 /// Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC, SCLEX_BLITZBASIC, SCLEX_PUREBASIC, SCLEX_FREEBASIC #define wxSTC_B_DEFAULT 0 #define wxSTC_B_COMMENT 1 #define wxSTC_B_NUMBER 2 #define wxSTC_B_KEYWORD 3 #define wxSTC_B_STRING 4 #define wxSTC_B_PREPROCESSOR 5 #define wxSTC_B_OPERATOR 6 #define wxSTC_B_IDENTIFIER 7 #define wxSTC_B_DATE 8 #define wxSTC_B_STRINGEOL 9 #define wxSTC_B_KEYWORD2 10 #define wxSTC_B_KEYWORD3 11 #define wxSTC_B_KEYWORD4 12 #define wxSTC_B_CONSTANT 13 #define wxSTC_B_ASM 14 #define wxSTC_B_LABEL 15 #define wxSTC_B_ERROR 16 #define wxSTC_B_HEXNUMBER 17 #define wxSTC_B_BINNUMBER 18 #define wxSTC_B_COMMENTBLOCK 19 #define wxSTC_B_DOCLINE 20 #define wxSTC_B_DOCBLOCK 21 #define wxSTC_B_DOCKEYWORD 22 /// Lexical states for SCLEX_PROPERTIES #define wxSTC_PROPS_DEFAULT 0 #define wxSTC_PROPS_COMMENT 1 #define wxSTC_PROPS_SECTION 2 #define wxSTC_PROPS_ASSIGNMENT 3 #define wxSTC_PROPS_DEFVAL 4 #define wxSTC_PROPS_KEY 5 /// Lexical states for SCLEX_LATEX #define wxSTC_L_DEFAULT 0 #define wxSTC_L_COMMAND 1 #define wxSTC_L_TAG 2 #define wxSTC_L_MATH 3 #define wxSTC_L_COMMENT 4 #define wxSTC_L_TAG2 5 #define wxSTC_L_MATH2 6 #define wxSTC_L_COMMENT2 7 #define wxSTC_L_VERBATIM 8 #define wxSTC_L_SHORTCMD 9 #define wxSTC_L_SPECIAL 10 #define wxSTC_L_CMDOPT 11 #define wxSTC_L_ERROR 12 /// Lexical states for SCLEX_LUA #define wxSTC_LUA_DEFAULT 0 #define wxSTC_LUA_COMMENT 1 #define wxSTC_LUA_COMMENTLINE 2 #define wxSTC_LUA_COMMENTDOC 3 #define wxSTC_LUA_NUMBER 4 #define wxSTC_LUA_WORD 5 #define wxSTC_LUA_STRING 6 #define wxSTC_LUA_CHARACTER 7 #define wxSTC_LUA_LITERALSTRING 8 #define wxSTC_LUA_PREPROCESSOR 9 #define wxSTC_LUA_OPERATOR 10 #define wxSTC_LUA_IDENTIFIER 11 #define wxSTC_LUA_STRINGEOL 12 #define wxSTC_LUA_WORD2 13 #define wxSTC_LUA_WORD3 14 #define wxSTC_LUA_WORD4 15 #define wxSTC_LUA_WORD5 16 #define wxSTC_LUA_WORD6 17 #define wxSTC_LUA_WORD7 18 #define wxSTC_LUA_WORD8 19 #define wxSTC_LUA_LABEL 20 /// Lexical states for SCLEX_ERRORLIST #define wxSTC_ERR_DEFAULT 0 #define wxSTC_ERR_PYTHON 1 #define wxSTC_ERR_GCC 2 #define wxSTC_ERR_MS 3 #define wxSTC_ERR_CMD 4 #define wxSTC_ERR_BORLAND 5 #define wxSTC_ERR_PERL 6 #define wxSTC_ERR_NET 7 #define wxSTC_ERR_LUA 8 #define wxSTC_ERR_CTAG 9 #define wxSTC_ERR_DIFF_CHANGED 10 #define wxSTC_ERR_DIFF_ADDITION 11 #define wxSTC_ERR_DIFF_DELETION 12 #define wxSTC_ERR_DIFF_MESSAGE 13 #define wxSTC_ERR_PHP 14 #define wxSTC_ERR_ELF 15 #define wxSTC_ERR_IFC 16 #define wxSTC_ERR_IFORT 17 #define wxSTC_ERR_ABSF 18 #define wxSTC_ERR_TIDY 19 #define wxSTC_ERR_JAVA_STACK 20 #define wxSTC_ERR_VALUE 21 #define wxSTC_ERR_GCC_INCLUDED_FROM 22 #define wxSTC_ERR_ESCSEQ 23 #define wxSTC_ERR_ESCSEQ_UNKNOWN 24 #define wxSTC_ERR_ES_BLACK 40 #define wxSTC_ERR_ES_RED 41 #define wxSTC_ERR_ES_GREEN 42 #define wxSTC_ERR_ES_BROWN 43 #define wxSTC_ERR_ES_BLUE 44 #define wxSTC_ERR_ES_MAGENTA 45 #define wxSTC_ERR_ES_CYAN 46 #define wxSTC_ERR_ES_GRAY 47 #define wxSTC_ERR_ES_DARK_GRAY 48 #define wxSTC_ERR_ES_BRIGHT_RED 49 #define wxSTC_ERR_ES_BRIGHT_GREEN 50 #define wxSTC_ERR_ES_YELLOW 51 #define wxSTC_ERR_ES_BRIGHT_BLUE 52 #define wxSTC_ERR_ES_BRIGHT_MAGENTA 53 #define wxSTC_ERR_ES_BRIGHT_CYAN 54 #define wxSTC_ERR_ES_WHITE 55 /// Lexical states for SCLEX_BATCH #define wxSTC_BAT_DEFAULT 0 #define wxSTC_BAT_COMMENT 1 #define wxSTC_BAT_WORD 2 #define wxSTC_BAT_LABEL 3 #define wxSTC_BAT_HIDE 4 #define wxSTC_BAT_COMMAND 5 #define wxSTC_BAT_IDENTIFIER 6 #define wxSTC_BAT_OPERATOR 7 /// Lexical states for SCLEX_TCMD #define wxSTC_TCMD_DEFAULT 0 #define wxSTC_TCMD_COMMENT 1 #define wxSTC_TCMD_WORD 2 #define wxSTC_TCMD_LABEL 3 #define wxSTC_TCMD_HIDE 4 #define wxSTC_TCMD_COMMAND 5 #define wxSTC_TCMD_IDENTIFIER 6 #define wxSTC_TCMD_OPERATOR 7 #define wxSTC_TCMD_ENVIRONMENT 8 #define wxSTC_TCMD_EXPANSION 9 #define wxSTC_TCMD_CLABEL 10 /// Lexical states for SCLEX_MAKEFILE #define wxSTC_MAKE_DEFAULT 0 #define wxSTC_MAKE_COMMENT 1 #define wxSTC_MAKE_PREPROCESSOR 2 #define wxSTC_MAKE_IDENTIFIER 3 #define wxSTC_MAKE_OPERATOR 4 #define wxSTC_MAKE_TARGET 5 #define wxSTC_MAKE_IDEOL 9 /// Lexical states for SCLEX_DIFF #define wxSTC_DIFF_DEFAULT 0 #define wxSTC_DIFF_COMMENT 1 #define wxSTC_DIFF_COMMAND 2 #define wxSTC_DIFF_HEADER 3 #define wxSTC_DIFF_POSITION 4 #define wxSTC_DIFF_DELETED 5 #define wxSTC_DIFF_ADDED 6 #define wxSTC_DIFF_CHANGED 7 /// Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) #define wxSTC_CONF_DEFAULT 0 #define wxSTC_CONF_COMMENT 1 #define wxSTC_CONF_NUMBER 2 #define wxSTC_CONF_IDENTIFIER 3 #define wxSTC_CONF_EXTENSION 4 #define wxSTC_CONF_PARAMETER 5 #define wxSTC_CONF_STRING 6 #define wxSTC_CONF_OPERATOR 7 #define wxSTC_CONF_IP 8 #define wxSTC_CONF_DIRECTIVE 9 /// Lexical states for SCLEX_AVE, Avenue #define wxSTC_AVE_DEFAULT 0 #define wxSTC_AVE_COMMENT 1 #define wxSTC_AVE_NUMBER 2 #define wxSTC_AVE_WORD 3 #define wxSTC_AVE_STRING 6 #define wxSTC_AVE_ENUM 7 #define wxSTC_AVE_STRINGEOL 8 #define wxSTC_AVE_IDENTIFIER 9 #define wxSTC_AVE_OPERATOR 10 #define wxSTC_AVE_WORD1 11 #define wxSTC_AVE_WORD2 12 #define wxSTC_AVE_WORD3 13 #define wxSTC_AVE_WORD4 14 #define wxSTC_AVE_WORD5 15 #define wxSTC_AVE_WORD6 16 /// Lexical states for SCLEX_ADA #define wxSTC_ADA_DEFAULT 0 #define wxSTC_ADA_WORD 1 #define wxSTC_ADA_IDENTIFIER 2 #define wxSTC_ADA_NUMBER 3 #define wxSTC_ADA_DELIMITER 4 #define wxSTC_ADA_CHARACTER 5 #define wxSTC_ADA_CHARACTEREOL 6 #define wxSTC_ADA_STRING 7 #define wxSTC_ADA_STRINGEOL 8 #define wxSTC_ADA_LABEL 9 #define wxSTC_ADA_COMMENTLINE 10 #define wxSTC_ADA_ILLEGAL 11 /// Lexical states for SCLEX_BAAN #define wxSTC_BAAN_DEFAULT 0 #define wxSTC_BAAN_COMMENT 1 #define wxSTC_BAAN_COMMENTDOC 2 #define wxSTC_BAAN_NUMBER 3 #define wxSTC_BAAN_WORD 4 #define wxSTC_BAAN_STRING 5 #define wxSTC_BAAN_PREPROCESSOR 6 #define wxSTC_BAAN_OPERATOR 7 #define wxSTC_BAAN_IDENTIFIER 8 #define wxSTC_BAAN_STRINGEOL 9 #define wxSTC_BAAN_WORD2 10 #define wxSTC_BAAN_WORD3 11 #define wxSTC_BAAN_WORD4 12 #define wxSTC_BAAN_WORD5 13 #define wxSTC_BAAN_WORD6 14 #define wxSTC_BAAN_WORD7 15 #define wxSTC_BAAN_WORD8 16 #define wxSTC_BAAN_WORD9 17 #define wxSTC_BAAN_TABLEDEF 18 #define wxSTC_BAAN_TABLESQL 19 #define wxSTC_BAAN_FUNCTION 20 #define wxSTC_BAAN_DOMDEF 21 #define wxSTC_BAAN_FUNCDEF 22 #define wxSTC_BAAN_OBJECTDEF 23 #define wxSTC_BAAN_DEFINEDEF 24 /// Lexical states for SCLEX_LISP #define wxSTC_LISP_DEFAULT 0 #define wxSTC_LISP_COMMENT 1 #define wxSTC_LISP_NUMBER 2 #define wxSTC_LISP_KEYWORD 3 #define wxSTC_LISP_KEYWORD_KW 4 #define wxSTC_LISP_SYMBOL 5 #define wxSTC_LISP_STRING 6 #define wxSTC_LISP_STRINGEOL 8 #define wxSTC_LISP_IDENTIFIER 9 #define wxSTC_LISP_OPERATOR 10 #define wxSTC_LISP_SPECIAL 11 #define wxSTC_LISP_MULTI_COMMENT 12 /// Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW #define wxSTC_EIFFEL_DEFAULT 0 #define wxSTC_EIFFEL_COMMENTLINE 1 #define wxSTC_EIFFEL_NUMBER 2 #define wxSTC_EIFFEL_WORD 3 #define wxSTC_EIFFEL_STRING 4 #define wxSTC_EIFFEL_CHARACTER 5 #define wxSTC_EIFFEL_OPERATOR 6 #define wxSTC_EIFFEL_IDENTIFIER 7 #define wxSTC_EIFFEL_STRINGEOL 8 /// Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) #define wxSTC_NNCRONTAB_DEFAULT 0 #define wxSTC_NNCRONTAB_COMMENT 1 #define wxSTC_NNCRONTAB_TASK 2 #define wxSTC_NNCRONTAB_SECTION 3 #define wxSTC_NNCRONTAB_KEYWORD 4 #define wxSTC_NNCRONTAB_MODIFIER 5 #define wxSTC_NNCRONTAB_ASTERISK 6 #define wxSTC_NNCRONTAB_NUMBER 7 #define wxSTC_NNCRONTAB_STRING 8 #define wxSTC_NNCRONTAB_ENVIRONMENT 9 #define wxSTC_NNCRONTAB_IDENTIFIER 10 /// Lexical states for SCLEX_FORTH (Forth Lexer) #define wxSTC_FORTH_DEFAULT 0 #define wxSTC_FORTH_COMMENT 1 #define wxSTC_FORTH_COMMENT_ML 2 #define wxSTC_FORTH_IDENTIFIER 3 #define wxSTC_FORTH_CONTROL 4 #define wxSTC_FORTH_KEYWORD 5 #define wxSTC_FORTH_DEFWORD 6 #define wxSTC_FORTH_PREWORD1 7 #define wxSTC_FORTH_PREWORD2 8 #define wxSTC_FORTH_NUMBER 9 #define wxSTC_FORTH_STRING 10 #define wxSTC_FORTH_LOCALE 11 /// Lexical states for SCLEX_MATLAB #define wxSTC_MATLAB_DEFAULT 0 #define wxSTC_MATLAB_COMMENT 1 #define wxSTC_MATLAB_COMMAND 2 #define wxSTC_MATLAB_NUMBER 3 #define wxSTC_MATLAB_KEYWORD 4 /// single quoted string #define wxSTC_MATLAB_STRING 5 #define wxSTC_MATLAB_OPERATOR 6 #define wxSTC_MATLAB_IDENTIFIER 7 #define wxSTC_MATLAB_DOUBLEQUOTESTRING 8 /// Lexical states for SCLEX_SCRIPTOL #define wxSTC_SCRIPTOL_DEFAULT 0 #define wxSTC_SCRIPTOL_WHITE 1 #define wxSTC_SCRIPTOL_COMMENTLINE 2 #define wxSTC_SCRIPTOL_PERSISTENT 3 #define wxSTC_SCRIPTOL_CSTYLE 4 #define wxSTC_SCRIPTOL_COMMENTBLOCK 5 #define wxSTC_SCRIPTOL_NUMBER 6 #define wxSTC_SCRIPTOL_STRING 7 #define wxSTC_SCRIPTOL_CHARACTER 8 #define wxSTC_SCRIPTOL_STRINGEOL 9 #define wxSTC_SCRIPTOL_KEYWORD 10 #define wxSTC_SCRIPTOL_OPERATOR 11 #define wxSTC_SCRIPTOL_IDENTIFIER 12 #define wxSTC_SCRIPTOL_TRIPLE 13 #define wxSTC_SCRIPTOL_CLASSNAME 14 #define wxSTC_SCRIPTOL_PREPROCESSOR 15 /// Lexical states for SCLEX_ASM, SCLEX_AS #define wxSTC_ASM_DEFAULT 0 #define wxSTC_ASM_COMMENT 1 #define wxSTC_ASM_NUMBER 2 #define wxSTC_ASM_STRING 3 #define wxSTC_ASM_OPERATOR 4 #define wxSTC_ASM_IDENTIFIER 5 #define wxSTC_ASM_CPUINSTRUCTION 6 #define wxSTC_ASM_MATHINSTRUCTION 7 #define wxSTC_ASM_REGISTER 8 #define wxSTC_ASM_DIRECTIVE 9 #define wxSTC_ASM_DIRECTIVEOPERAND 10 #define wxSTC_ASM_COMMENTBLOCK 11 #define wxSTC_ASM_CHARACTER 12 #define wxSTC_ASM_STRINGEOL 13 #define wxSTC_ASM_EXTINSTRUCTION 14 #define wxSTC_ASM_COMMENTDIRECTIVE 15 /// Lexical states for SCLEX_FORTRAN #define wxSTC_F_DEFAULT 0 #define wxSTC_F_COMMENT 1 #define wxSTC_F_NUMBER 2 #define wxSTC_F_STRING1 3 #define wxSTC_F_STRING2 4 #define wxSTC_F_STRINGEOL 5 #define wxSTC_F_OPERATOR 6 #define wxSTC_F_IDENTIFIER 7 #define wxSTC_F_WORD 8 #define wxSTC_F_WORD2 9 #define wxSTC_F_WORD3 10 #define wxSTC_F_PREPROCESSOR 11 #define wxSTC_F_OPERATOR2 12 #define wxSTC_F_LABEL 13 #define wxSTC_F_CONTINUATION 14 /// Lexical states for SCLEX_CSS #define wxSTC_CSS_DEFAULT 0 #define wxSTC_CSS_TAG 1 #define wxSTC_CSS_CLASS 2 #define wxSTC_CSS_PSEUDOCLASS 3 #define wxSTC_CSS_UNKNOWN_PSEUDOCLASS 4 #define wxSTC_CSS_OPERATOR 5 #define wxSTC_CSS_IDENTIFIER 6 #define wxSTC_CSS_UNKNOWN_IDENTIFIER 7 #define wxSTC_CSS_VALUE 8 #define wxSTC_CSS_COMMENT 9 #define wxSTC_CSS_ID 10 #define wxSTC_CSS_IMPORTANT 11 #define wxSTC_CSS_DIRECTIVE 12 #define wxSTC_CSS_DOUBLESTRING 13 #define wxSTC_CSS_SINGLESTRING 14 #define wxSTC_CSS_IDENTIFIER2 15 #define wxSTC_CSS_ATTRIBUTE 16 #define wxSTC_CSS_IDENTIFIER3 17 #define wxSTC_CSS_PSEUDOELEMENT 18 #define wxSTC_CSS_EXTENDED_IDENTIFIER 19 #define wxSTC_CSS_EXTENDED_PSEUDOCLASS 20 #define wxSTC_CSS_EXTENDED_PSEUDOELEMENT 21 #define wxSTC_CSS_MEDIA 22 #define wxSTC_CSS_VARIABLE 23 /// Lexical states for SCLEX_POV #define wxSTC_POV_DEFAULT 0 #define wxSTC_POV_COMMENT 1 #define wxSTC_POV_COMMENTLINE 2 #define wxSTC_POV_NUMBER 3 #define wxSTC_POV_OPERATOR 4 #define wxSTC_POV_IDENTIFIER 5 #define wxSTC_POV_STRING 6 #define wxSTC_POV_STRINGEOL 7 #define wxSTC_POV_DIRECTIVE 8 #define wxSTC_POV_BADDIRECTIVE 9 #define wxSTC_POV_WORD2 10 #define wxSTC_POV_WORD3 11 #define wxSTC_POV_WORD4 12 #define wxSTC_POV_WORD5 13 #define wxSTC_POV_WORD6 14 #define wxSTC_POV_WORD7 15 #define wxSTC_POV_WORD8 16 /// Lexical states for SCLEX_LOUT #define wxSTC_LOUT_DEFAULT 0 #define wxSTC_LOUT_COMMENT 1 #define wxSTC_LOUT_NUMBER 2 #define wxSTC_LOUT_WORD 3 #define wxSTC_LOUT_WORD2 4 #define wxSTC_LOUT_WORD3 5 #define wxSTC_LOUT_WORD4 6 #define wxSTC_LOUT_STRING 7 #define wxSTC_LOUT_OPERATOR 8 #define wxSTC_LOUT_IDENTIFIER 9 #define wxSTC_LOUT_STRINGEOL 10 /// Lexical states for SCLEX_ESCRIPT #define wxSTC_ESCRIPT_DEFAULT 0 #define wxSTC_ESCRIPT_COMMENT 1 #define wxSTC_ESCRIPT_COMMENTLINE 2 #define wxSTC_ESCRIPT_COMMENTDOC 3 #define wxSTC_ESCRIPT_NUMBER 4 #define wxSTC_ESCRIPT_WORD 5 #define wxSTC_ESCRIPT_STRING 6 #define wxSTC_ESCRIPT_OPERATOR 7 #define wxSTC_ESCRIPT_IDENTIFIER 8 #define wxSTC_ESCRIPT_BRACE 9 #define wxSTC_ESCRIPT_WORD2 10 #define wxSTC_ESCRIPT_WORD3 11 /// Lexical states for SCLEX_PS #define wxSTC_PS_DEFAULT 0 #define wxSTC_PS_COMMENT 1 #define wxSTC_PS_DSC_COMMENT 2 #define wxSTC_PS_DSC_VALUE 3 #define wxSTC_PS_NUMBER 4 #define wxSTC_PS_NAME 5 #define wxSTC_PS_KEYWORD 6 #define wxSTC_PS_LITERAL 7 #define wxSTC_PS_IMMEVAL 8 #define wxSTC_PS_PAREN_ARRAY 9 #define wxSTC_PS_PAREN_DICT 10 #define wxSTC_PS_PAREN_PROC 11 #define wxSTC_PS_TEXT 12 #define wxSTC_PS_HEXSTRING 13 #define wxSTC_PS_BASE85STRING 14 #define wxSTC_PS_BADSTRINGCHAR 15 /// Lexical states for SCLEX_NSIS #define wxSTC_NSIS_DEFAULT 0 #define wxSTC_NSIS_COMMENT 1 #define wxSTC_NSIS_STRINGDQ 2 #define wxSTC_NSIS_STRINGLQ 3 #define wxSTC_NSIS_STRINGRQ 4 #define wxSTC_NSIS_FUNCTION 5 #define wxSTC_NSIS_VARIABLE 6 #define wxSTC_NSIS_LABEL 7 #define wxSTC_NSIS_USERDEFINED 8 #define wxSTC_NSIS_SECTIONDEF 9 #define wxSTC_NSIS_SUBSECTIONDEF 10 #define wxSTC_NSIS_IFDEFINEDEF 11 #define wxSTC_NSIS_MACRODEF 12 #define wxSTC_NSIS_STRINGVAR 13 #define wxSTC_NSIS_NUMBER 14 #define wxSTC_NSIS_SECTIONGROUP 15 #define wxSTC_NSIS_PAGEEX 16 #define wxSTC_NSIS_FUNCTIONDEF 17 #define wxSTC_NSIS_COMMENTBOX 18 /// Lexical states for SCLEX_MMIXAL #define wxSTC_MMIXAL_LEADWS 0 #define wxSTC_MMIXAL_COMMENT 1 #define wxSTC_MMIXAL_LABEL 2 #define wxSTC_MMIXAL_OPCODE 3 #define wxSTC_MMIXAL_OPCODE_PRE 4 #define wxSTC_MMIXAL_OPCODE_VALID 5 #define wxSTC_MMIXAL_OPCODE_UNKNOWN 6 #define wxSTC_MMIXAL_OPCODE_POST 7 #define wxSTC_MMIXAL_OPERANDS 8 #define wxSTC_MMIXAL_NUMBER 9 #define wxSTC_MMIXAL_REF 10 #define wxSTC_MMIXAL_CHAR 11 #define wxSTC_MMIXAL_STRING 12 #define wxSTC_MMIXAL_REGISTER 13 #define wxSTC_MMIXAL_HEX 14 #define wxSTC_MMIXAL_OPERATOR 15 #define wxSTC_MMIXAL_SYMBOL 16 #define wxSTC_MMIXAL_INCLUDE 17 /// Lexical states for SCLEX_CLW #define wxSTC_CLW_DEFAULT 0 #define wxSTC_CLW_LABEL 1 #define wxSTC_CLW_COMMENT 2 #define wxSTC_CLW_STRING 3 #define wxSTC_CLW_USER_IDENTIFIER 4 #define wxSTC_CLW_INTEGER_CONSTANT 5 #define wxSTC_CLW_REAL_CONSTANT 6 #define wxSTC_CLW_PICTURE_STRING 7 #define wxSTC_CLW_KEYWORD 8 #define wxSTC_CLW_COMPILER_DIRECTIVE 9 #define wxSTC_CLW_RUNTIME_EXPRESSIONS 10 #define wxSTC_CLW_BUILTIN_PROCEDURES_FUNCTION 11 #define wxSTC_CLW_STRUCTURE_DATA_TYPE 12 #define wxSTC_CLW_ATTRIBUTE 13 #define wxSTC_CLW_STANDARD_EQUATE 14 #define wxSTC_CLW_ERROR 15 #define wxSTC_CLW_DEPRECATED 16 /// Lexical states for SCLEX_LOT #define wxSTC_LOT_DEFAULT 0 #define wxSTC_LOT_HEADER 1 #define wxSTC_LOT_BREAK 2 #define wxSTC_LOT_SET 3 #define wxSTC_LOT_PASS 4 #define wxSTC_LOT_FAIL 5 #define wxSTC_LOT_ABORT 6 /// Lexical states for SCLEX_YAML #define wxSTC_YAML_DEFAULT 0 #define wxSTC_YAML_COMMENT 1 #define wxSTC_YAML_IDENTIFIER 2 #define wxSTC_YAML_KEYWORD 3 #define wxSTC_YAML_NUMBER 4 #define wxSTC_YAML_REFERENCE 5 #define wxSTC_YAML_DOCUMENT 6 #define wxSTC_YAML_TEXT 7 #define wxSTC_YAML_ERROR 8 #define wxSTC_YAML_OPERATOR 9 /// Lexical states for SCLEX_TEX #define wxSTC_TEX_DEFAULT 0 #define wxSTC_TEX_SPECIAL 1 #define wxSTC_TEX_GROUP 2 #define wxSTC_TEX_SYMBOL 3 #define wxSTC_TEX_COMMAND 4 #define wxSTC_TEX_TEXT 5 #define wxSTC_METAPOST_DEFAULT 0 #define wxSTC_METAPOST_SPECIAL 1 #define wxSTC_METAPOST_GROUP 2 #define wxSTC_METAPOST_SYMBOL 3 #define wxSTC_METAPOST_COMMAND 4 #define wxSTC_METAPOST_TEXT 5 #define wxSTC_METAPOST_EXTRA 6 /// Lexical states for SCLEX_ERLANG #define wxSTC_ERLANG_DEFAULT 0 #define wxSTC_ERLANG_COMMENT 1 #define wxSTC_ERLANG_VARIABLE 2 #define wxSTC_ERLANG_NUMBER 3 #define wxSTC_ERLANG_KEYWORD 4 #define wxSTC_ERLANG_STRING 5 #define wxSTC_ERLANG_OPERATOR 6 #define wxSTC_ERLANG_ATOM 7 #define wxSTC_ERLANG_FUNCTION_NAME 8 #define wxSTC_ERLANG_CHARACTER 9 #define wxSTC_ERLANG_MACRO 10 #define wxSTC_ERLANG_RECORD 11 #define wxSTC_ERLANG_PREPROC 12 #define wxSTC_ERLANG_NODE_NAME 13 #define wxSTC_ERLANG_COMMENT_FUNCTION 14 #define wxSTC_ERLANG_COMMENT_MODULE 15 #define wxSTC_ERLANG_COMMENT_DOC 16 #define wxSTC_ERLANG_COMMENT_DOC_MACRO 17 #define wxSTC_ERLANG_ATOM_QUOTED 18 #define wxSTC_ERLANG_MACRO_QUOTED 19 #define wxSTC_ERLANG_RECORD_QUOTED 20 #define wxSTC_ERLANG_NODE_NAME_QUOTED 21 #define wxSTC_ERLANG_BIFS 22 #define wxSTC_ERLANG_MODULES 23 #define wxSTC_ERLANG_MODULES_ATT 24 #define wxSTC_ERLANG_UNKNOWN 31 /// Lexical states for SCLEX_OCTAVE are identical to MatLab /// Lexical states for SCLEX_MSSQL #define wxSTC_MSSQL_DEFAULT 0 #define wxSTC_MSSQL_COMMENT 1 #define wxSTC_MSSQL_LINE_COMMENT 2 #define wxSTC_MSSQL_NUMBER 3 #define wxSTC_MSSQL_STRING 4 #define wxSTC_MSSQL_OPERATOR 5 #define wxSTC_MSSQL_IDENTIFIER 6 #define wxSTC_MSSQL_VARIABLE 7 #define wxSTC_MSSQL_COLUMN_NAME 8 #define wxSTC_MSSQL_STATEMENT 9 #define wxSTC_MSSQL_DATATYPE 10 #define wxSTC_MSSQL_SYSTABLE 11 #define wxSTC_MSSQL_GLOBAL_VARIABLE 12 #define wxSTC_MSSQL_FUNCTION 13 #define wxSTC_MSSQL_STORED_PROCEDURE 14 #define wxSTC_MSSQL_DEFAULT_PREF_DATATYPE 15 #define wxSTC_MSSQL_COLUMN_NAME_2 16 /// Lexical states for SCLEX_VERILOG #define wxSTC_V_DEFAULT 0 #define wxSTC_V_COMMENT 1 #define wxSTC_V_COMMENTLINE 2 #define wxSTC_V_COMMENTLINEBANG 3 #define wxSTC_V_NUMBER 4 #define wxSTC_V_WORD 5 #define wxSTC_V_STRING 6 #define wxSTC_V_WORD2 7 #define wxSTC_V_WORD3 8 #define wxSTC_V_PREPROCESSOR 9 #define wxSTC_V_OPERATOR 10 #define wxSTC_V_IDENTIFIER 11 #define wxSTC_V_STRINGEOL 12 #define wxSTC_V_USER 19 #define wxSTC_V_COMMENT_WORD 20 #define wxSTC_V_INPUT 21 #define wxSTC_V_OUTPUT 22 #define wxSTC_V_INOUT 23 #define wxSTC_V_PORT_CONNECT 24 /// Lexical states for SCLEX_KIX #define wxSTC_KIX_DEFAULT 0 #define wxSTC_KIX_COMMENT 1 #define wxSTC_KIX_STRING1 2 #define wxSTC_KIX_STRING2 3 #define wxSTC_KIX_NUMBER 4 #define wxSTC_KIX_VAR 5 #define wxSTC_KIX_MACRO 6 #define wxSTC_KIX_KEYWORD 7 #define wxSTC_KIX_FUNCTIONS 8 #define wxSTC_KIX_OPERATOR 9 #define wxSTC_KIX_COMMENTSTREAM 10 #define wxSTC_KIX_IDENTIFIER 31 /// Lexical states for SCLEX_GUI4CLI #define wxSTC_GC_DEFAULT 0 #define wxSTC_GC_COMMENTLINE 1 #define wxSTC_GC_COMMENTBLOCK 2 #define wxSTC_GC_GLOBAL 3 #define wxSTC_GC_EVENT 4 #define wxSTC_GC_ATTRIBUTE 5 #define wxSTC_GC_CONTROL 6 #define wxSTC_GC_COMMAND 7 #define wxSTC_GC_STRING 8 #define wxSTC_GC_OPERATOR 9 /// Lexical states for SCLEX_SPECMAN #define wxSTC_SN_DEFAULT 0 #define wxSTC_SN_CODE 1 #define wxSTC_SN_COMMENTLINE 2 #define wxSTC_SN_COMMENTLINEBANG 3 #define wxSTC_SN_NUMBER 4 #define wxSTC_SN_WORD 5 #define wxSTC_SN_STRING 6 #define wxSTC_SN_WORD2 7 #define wxSTC_SN_WORD3 8 #define wxSTC_SN_PREPROCESSOR 9 #define wxSTC_SN_OPERATOR 10 #define wxSTC_SN_IDENTIFIER 11 #define wxSTC_SN_STRINGEOL 12 #define wxSTC_SN_REGEXTAG 13 #define wxSTC_SN_SIGNAL 14 #define wxSTC_SN_USER 19 /// Lexical states for SCLEX_AU3 #define wxSTC_AU3_DEFAULT 0 #define wxSTC_AU3_COMMENT 1 #define wxSTC_AU3_COMMENTBLOCK 2 #define wxSTC_AU3_NUMBER 3 #define wxSTC_AU3_FUNCTION 4 #define wxSTC_AU3_KEYWORD 5 #define wxSTC_AU3_MACRO 6 #define wxSTC_AU3_STRING 7 #define wxSTC_AU3_OPERATOR 8 #define wxSTC_AU3_VARIABLE 9 #define wxSTC_AU3_SENT 10 #define wxSTC_AU3_PREPROCESSOR 11 #define wxSTC_AU3_SPECIAL 12 #define wxSTC_AU3_EXPAND 13 #define wxSTC_AU3_COMOBJ 14 #define wxSTC_AU3_UDF 15 /// Lexical states for SCLEX_APDL #define wxSTC_APDL_DEFAULT 0 #define wxSTC_APDL_COMMENT 1 #define wxSTC_APDL_COMMENTBLOCK 2 #define wxSTC_APDL_NUMBER 3 #define wxSTC_APDL_STRING 4 #define wxSTC_APDL_OPERATOR 5 #define wxSTC_APDL_WORD 6 #define wxSTC_APDL_PROCESSOR 7 #define wxSTC_APDL_COMMAND 8 #define wxSTC_APDL_SLASHCOMMAND 9 #define wxSTC_APDL_STARCOMMAND 10 #define wxSTC_APDL_ARGUMENT 11 #define wxSTC_APDL_FUNCTION 12 /// Lexical states for SCLEX_BASH #define wxSTC_SH_DEFAULT 0 #define wxSTC_SH_ERROR 1 #define wxSTC_SH_COMMENTLINE 2 #define wxSTC_SH_NUMBER 3 #define wxSTC_SH_WORD 4 #define wxSTC_SH_STRING 5 #define wxSTC_SH_CHARACTER 6 #define wxSTC_SH_OPERATOR 7 #define wxSTC_SH_IDENTIFIER 8 #define wxSTC_SH_SCALAR 9 #define wxSTC_SH_PARAM 10 #define wxSTC_SH_BACKTICKS 11 #define wxSTC_SH_HERE_DELIM 12 #define wxSTC_SH_HERE_Q 13 /// Lexical states for SCLEX_ASN1 #define wxSTC_ASN1_DEFAULT 0 #define wxSTC_ASN1_COMMENT 1 #define wxSTC_ASN1_IDENTIFIER 2 #define wxSTC_ASN1_STRING 3 #define wxSTC_ASN1_OID 4 #define wxSTC_ASN1_SCALAR 5 #define wxSTC_ASN1_KEYWORD 6 #define wxSTC_ASN1_ATTRIBUTE 7 #define wxSTC_ASN1_DESCRIPTOR 8 #define wxSTC_ASN1_TYPE 9 #define wxSTC_ASN1_OPERATOR 10 /// Lexical states for SCLEX_VHDL #define wxSTC_VHDL_DEFAULT 0 #define wxSTC_VHDL_COMMENT 1 #define wxSTC_VHDL_COMMENTLINEBANG 2 #define wxSTC_VHDL_NUMBER 3 #define wxSTC_VHDL_STRING 4 #define wxSTC_VHDL_OPERATOR 5 #define wxSTC_VHDL_IDENTIFIER 6 #define wxSTC_VHDL_STRINGEOL 7 #define wxSTC_VHDL_KEYWORD 8 #define wxSTC_VHDL_STDOPERATOR 9 #define wxSTC_VHDL_ATTRIBUTE 10 #define wxSTC_VHDL_STDFUNCTION 11 #define wxSTC_VHDL_STDPACKAGE 12 #define wxSTC_VHDL_STDTYPE 13 #define wxSTC_VHDL_USERWORD 14 #define wxSTC_VHDL_BLOCK_COMMENT 15 /// Lexical states for SCLEX_CAML #define wxSTC_CAML_DEFAULT 0 #define wxSTC_CAML_IDENTIFIER 1 #define wxSTC_CAML_TAGNAME 2 #define wxSTC_CAML_KEYWORD 3 #define wxSTC_CAML_KEYWORD2 4 #define wxSTC_CAML_KEYWORD3 5 #define wxSTC_CAML_LINENUM 6 #define wxSTC_CAML_OPERATOR 7 #define wxSTC_CAML_NUMBER 8 #define wxSTC_CAML_CHAR 9 #define wxSTC_CAML_WHITE 10 #define wxSTC_CAML_STRING 11 #define wxSTC_CAML_COMMENT 12 #define wxSTC_CAML_COMMENT1 13 #define wxSTC_CAML_COMMENT2 14 #define wxSTC_CAML_COMMENT3 15 /// Lexical states for SCLEX_HASKELL #define wxSTC_HA_DEFAULT 0 #define wxSTC_HA_IDENTIFIER 1 #define wxSTC_HA_KEYWORD 2 #define wxSTC_HA_NUMBER 3 #define wxSTC_HA_STRING 4 #define wxSTC_HA_CHARACTER 5 #define wxSTC_HA_CLASS 6 #define wxSTC_HA_MODULE 7 #define wxSTC_HA_CAPITAL 8 #define wxSTC_HA_DATA 9 #define wxSTC_HA_IMPORT 10 #define wxSTC_HA_OPERATOR 11 #define wxSTC_HA_INSTANCE 12 #define wxSTC_HA_COMMENTLINE 13 #define wxSTC_HA_COMMENTBLOCK 14 #define wxSTC_HA_COMMENTBLOCK2 15 #define wxSTC_HA_COMMENTBLOCK3 16 #define wxSTC_HA_PRAGMA 17 #define wxSTC_HA_PREPROCESSOR 18 #define wxSTC_HA_STRINGEOL 19 #define wxSTC_HA_RESERVED_OPERATOR 20 #define wxSTC_HA_LITERATE_COMMENT 21 #define wxSTC_HA_LITERATE_CODEDELIM 22 /// Lexical states of SCLEX_TADS3 #define wxSTC_T3_DEFAULT 0 #define wxSTC_T3_X_DEFAULT 1 #define wxSTC_T3_PREPROCESSOR 2 #define wxSTC_T3_BLOCK_COMMENT 3 #define wxSTC_T3_LINE_COMMENT 4 #define wxSTC_T3_OPERATOR 5 #define wxSTC_T3_KEYWORD 6 #define wxSTC_T3_NUMBER 7 #define wxSTC_T3_IDENTIFIER 8 #define wxSTC_T3_S_STRING 9 #define wxSTC_T3_D_STRING 10 #define wxSTC_T3_X_STRING 11 #define wxSTC_T3_LIB_DIRECTIVE 12 #define wxSTC_T3_MSG_PARAM 13 #define wxSTC_T3_HTML_TAG 14 #define wxSTC_T3_HTML_DEFAULT 15 #define wxSTC_T3_HTML_STRING 16 #define wxSTC_T3_USER1 17 #define wxSTC_T3_USER2 18 #define wxSTC_T3_USER3 19 #define wxSTC_T3_BRACE 20 /// Lexical states for SCLEX_REBOL #define wxSTC_REBOL_DEFAULT 0 #define wxSTC_REBOL_COMMENTLINE 1 #define wxSTC_REBOL_COMMENTBLOCK 2 #define wxSTC_REBOL_PREFACE 3 #define wxSTC_REBOL_OPERATOR 4 #define wxSTC_REBOL_CHARACTER 5 #define wxSTC_REBOL_QUOTEDSTRING 6 #define wxSTC_REBOL_BRACEDSTRING 7 #define wxSTC_REBOL_NUMBER 8 #define wxSTC_REBOL_PAIR 9 #define wxSTC_REBOL_TUPLE 10 #define wxSTC_REBOL_BINARY 11 #define wxSTC_REBOL_MONEY 12 #define wxSTC_REBOL_ISSUE 13 #define wxSTC_REBOL_TAG 14 #define wxSTC_REBOL_FILE 15 #define wxSTC_REBOL_EMAIL 16 #define wxSTC_REBOL_URL 17 #define wxSTC_REBOL_DATE 18 #define wxSTC_REBOL_TIME 19 #define wxSTC_REBOL_IDENTIFIER 20 #define wxSTC_REBOL_WORD 21 #define wxSTC_REBOL_WORD2 22 #define wxSTC_REBOL_WORD3 23 #define wxSTC_REBOL_WORD4 24 #define wxSTC_REBOL_WORD5 25 #define wxSTC_REBOL_WORD6 26 #define wxSTC_REBOL_WORD7 27 #define wxSTC_REBOL_WORD8 28 /// Lexical states for SCLEX_SQL #define wxSTC_SQL_DEFAULT 0 #define wxSTC_SQL_COMMENT 1 #define wxSTC_SQL_COMMENTLINE 2 #define wxSTC_SQL_COMMENTDOC 3 #define wxSTC_SQL_NUMBER 4 #define wxSTC_SQL_WORD 5 #define wxSTC_SQL_STRING 6 #define wxSTC_SQL_CHARACTER 7 #define wxSTC_SQL_SQLPLUS 8 #define wxSTC_SQL_SQLPLUS_PROMPT 9 #define wxSTC_SQL_OPERATOR 10 #define wxSTC_SQL_IDENTIFIER 11 #define wxSTC_SQL_SQLPLUS_COMMENT 13 #define wxSTC_SQL_COMMENTLINEDOC 15 #define wxSTC_SQL_WORD2 16 #define wxSTC_SQL_COMMENTDOCKEYWORD 17 #define wxSTC_SQL_COMMENTDOCKEYWORDERROR 18 #define wxSTC_SQL_USER1 19 #define wxSTC_SQL_USER2 20 #define wxSTC_SQL_USER3 21 #define wxSTC_SQL_USER4 22 #define wxSTC_SQL_QUOTEDIDENTIFIER 23 #define wxSTC_SQL_QOPERATOR 24 /// Lexical states for SCLEX_SMALLTALK #define wxSTC_ST_DEFAULT 0 #define wxSTC_ST_STRING 1 #define wxSTC_ST_NUMBER 2 #define wxSTC_ST_COMMENT 3 #define wxSTC_ST_SYMBOL 4 #define wxSTC_ST_BINARY 5 #define wxSTC_ST_BOOL 6 #define wxSTC_ST_SELF 7 #define wxSTC_ST_SUPER 8 #define wxSTC_ST_NIL 9 #define wxSTC_ST_GLOBAL 10 #define wxSTC_ST_RETURN 11 #define wxSTC_ST_SPECIAL 12 #define wxSTC_ST_KWSEND 13 #define wxSTC_ST_ASSIGN 14 #define wxSTC_ST_CHARACTER 15 #define wxSTC_ST_SPEC_SEL 16 /// Lexical states for SCLEX_FLAGSHIP (clipper) #define wxSTC_FS_DEFAULT 0 #define wxSTC_FS_COMMENT 1 #define wxSTC_FS_COMMENTLINE 2 #define wxSTC_FS_COMMENTDOC 3 #define wxSTC_FS_COMMENTLINEDOC 4 #define wxSTC_FS_COMMENTDOCKEYWORD 5 #define wxSTC_FS_COMMENTDOCKEYWORDERROR 6 #define wxSTC_FS_KEYWORD 7 #define wxSTC_FS_KEYWORD2 8 #define wxSTC_FS_KEYWORD3 9 #define wxSTC_FS_KEYWORD4 10 #define wxSTC_FS_NUMBER 11 #define wxSTC_FS_STRING 12 #define wxSTC_FS_PREPROCESSOR 13 #define wxSTC_FS_OPERATOR 14 #define wxSTC_FS_IDENTIFIER 15 #define wxSTC_FS_DATE 16 #define wxSTC_FS_STRINGEOL 17 #define wxSTC_FS_CONSTANT 18 #define wxSTC_FS_WORDOPERATOR 19 #define wxSTC_FS_DISABLEDCODE 20 #define wxSTC_FS_DEFAULT_C 21 #define wxSTC_FS_COMMENTDOC_C 22 #define wxSTC_FS_COMMENTLINEDOC_C 23 #define wxSTC_FS_KEYWORD_C 24 #define wxSTC_FS_KEYWORD2_C 25 #define wxSTC_FS_NUMBER_C 26 #define wxSTC_FS_STRING_C 27 #define wxSTC_FS_PREPROCESSOR_C 28 #define wxSTC_FS_OPERATOR_C 29 #define wxSTC_FS_IDENTIFIER_C 30 #define wxSTC_FS_STRINGEOL_C 31 /// Lexical states for SCLEX_CSOUND #define wxSTC_CSOUND_DEFAULT 0 #define wxSTC_CSOUND_COMMENT 1 #define wxSTC_CSOUND_NUMBER 2 #define wxSTC_CSOUND_OPERATOR 3 #define wxSTC_CSOUND_INSTR 4 #define wxSTC_CSOUND_IDENTIFIER 5 #define wxSTC_CSOUND_OPCODE 6 #define wxSTC_CSOUND_HEADERSTMT 7 #define wxSTC_CSOUND_USERKEYWORD 8 #define wxSTC_CSOUND_COMMENTBLOCK 9 #define wxSTC_CSOUND_PARAM 10 #define wxSTC_CSOUND_ARATE_VAR 11 #define wxSTC_CSOUND_KRATE_VAR 12 #define wxSTC_CSOUND_IRATE_VAR 13 #define wxSTC_CSOUND_GLOBAL_VAR 14 #define wxSTC_CSOUND_STRINGEOL 15 /// Lexical states for SCLEX_INNOSETUP #define wxSTC_INNO_DEFAULT 0 #define wxSTC_INNO_COMMENT 1 #define wxSTC_INNO_KEYWORD 2 #define wxSTC_INNO_PARAMETER 3 #define wxSTC_INNO_SECTION 4 #define wxSTC_INNO_PREPROC 5 #define wxSTC_INNO_INLINE_EXPANSION 6 #define wxSTC_INNO_COMMENT_PASCAL 7 #define wxSTC_INNO_KEYWORD_PASCAL 8 #define wxSTC_INNO_KEYWORD_USER 9 #define wxSTC_INNO_STRING_DOUBLE 10 #define wxSTC_INNO_STRING_SINGLE 11 #define wxSTC_INNO_IDENTIFIER 12 /// Lexical states for SCLEX_OPAL #define wxSTC_OPAL_SPACE 0 #define wxSTC_OPAL_COMMENT_BLOCK 1 #define wxSTC_OPAL_COMMENT_LINE 2 #define wxSTC_OPAL_INTEGER 3 #define wxSTC_OPAL_KEYWORD 4 #define wxSTC_OPAL_SORT 5 #define wxSTC_OPAL_STRING 6 #define wxSTC_OPAL_PAR 7 #define wxSTC_OPAL_BOOL_CONST 8 #define wxSTC_OPAL_DEFAULT 32 /// Lexical states for SCLEX_SPICE #define wxSTC_SPICE_DEFAULT 0 #define wxSTC_SPICE_IDENTIFIER 1 #define wxSTC_SPICE_KEYWORD 2 #define wxSTC_SPICE_KEYWORD2 3 #define wxSTC_SPICE_KEYWORD3 4 #define wxSTC_SPICE_NUMBER 5 #define wxSTC_SPICE_DELIMITER 6 #define wxSTC_SPICE_VALUE 7 #define wxSTC_SPICE_COMMENTLINE 8 /// Lexical states for SCLEX_CMAKE #define wxSTC_CMAKE_DEFAULT 0 #define wxSTC_CMAKE_COMMENT 1 #define wxSTC_CMAKE_STRINGDQ 2 #define wxSTC_CMAKE_STRINGLQ 3 #define wxSTC_CMAKE_STRINGRQ 4 #define wxSTC_CMAKE_COMMANDS 5 #define wxSTC_CMAKE_PARAMETERS 6 #define wxSTC_CMAKE_VARIABLE 7 #define wxSTC_CMAKE_USERDEFINED 8 #define wxSTC_CMAKE_WHILEDEF 9 #define wxSTC_CMAKE_FOREACHDEF 10 #define wxSTC_CMAKE_IFDEFINEDEF 11 #define wxSTC_CMAKE_MACRODEF 12 #define wxSTC_CMAKE_STRINGVAR 13 #define wxSTC_CMAKE_NUMBER 14 /// Lexical states for SCLEX_GAP #define wxSTC_GAP_DEFAULT 0 #define wxSTC_GAP_IDENTIFIER 1 #define wxSTC_GAP_KEYWORD 2 #define wxSTC_GAP_KEYWORD2 3 #define wxSTC_GAP_KEYWORD3 4 #define wxSTC_GAP_KEYWORD4 5 #define wxSTC_GAP_STRING 6 #define wxSTC_GAP_CHAR 7 #define wxSTC_GAP_OPERATOR 8 #define wxSTC_GAP_COMMENT 9 #define wxSTC_GAP_NUMBER 10 #define wxSTC_GAP_STRINGEOL 11 /// Lexical state for SCLEX_PLM #define wxSTC_PLM_DEFAULT 0 #define wxSTC_PLM_COMMENT 1 #define wxSTC_PLM_STRING 2 #define wxSTC_PLM_NUMBER 3 #define wxSTC_PLM_IDENTIFIER 4 #define wxSTC_PLM_OPERATOR 5 #define wxSTC_PLM_CONTROL 6 #define wxSTC_PLM_KEYWORD 7 /// Lexical state for SCLEX_PROGRESS #define wxSTC_ABL_DEFAULT 0 #define wxSTC_ABL_NUMBER 1 #define wxSTC_ABL_WORD 2 #define wxSTC_ABL_STRING 3 #define wxSTC_ABL_CHARACTER 4 #define wxSTC_ABL_PREPROCESSOR 5 #define wxSTC_ABL_OPERATOR 6 #define wxSTC_ABL_IDENTIFIER 7 #define wxSTC_ABL_BLOCK 8 #define wxSTC_ABL_END 9 #define wxSTC_ABL_COMMENT 10 #define wxSTC_ABL_TASKMARKER 11 #define wxSTC_ABL_LINECOMMENT 12 /// Lexical states for SCLEX_ABAQUS #define wxSTC_ABAQUS_DEFAULT 0 #define wxSTC_ABAQUS_COMMENT 1 #define wxSTC_ABAQUS_COMMENTBLOCK 2 #define wxSTC_ABAQUS_NUMBER 3 #define wxSTC_ABAQUS_STRING 4 #define wxSTC_ABAQUS_OPERATOR 5 #define wxSTC_ABAQUS_WORD 6 #define wxSTC_ABAQUS_PROCESSOR 7 #define wxSTC_ABAQUS_COMMAND 8 #define wxSTC_ABAQUS_SLASHCOMMAND 9 #define wxSTC_ABAQUS_STARCOMMAND 10 #define wxSTC_ABAQUS_ARGUMENT 11 #define wxSTC_ABAQUS_FUNCTION 12 /// Lexical states for SCLEX_ASYMPTOTE #define wxSTC_ASY_DEFAULT 0 #define wxSTC_ASY_COMMENT 1 #define wxSTC_ASY_COMMENTLINE 2 #define wxSTC_ASY_NUMBER 3 #define wxSTC_ASY_WORD 4 #define wxSTC_ASY_STRING 5 #define wxSTC_ASY_CHARACTER 6 #define wxSTC_ASY_OPERATOR 7 #define wxSTC_ASY_IDENTIFIER 8 #define wxSTC_ASY_STRINGEOL 9 #define wxSTC_ASY_COMMENTLINEDOC 10 #define wxSTC_ASY_WORD2 11 /// Lexical states for SCLEX_R #define wxSTC_R_DEFAULT 0 #define wxSTC_R_COMMENT 1 #define wxSTC_R_KWORD 2 #define wxSTC_R_BASEKWORD 3 #define wxSTC_R_OTHERKWORD 4 #define wxSTC_R_NUMBER 5 #define wxSTC_R_STRING 6 #define wxSTC_R_STRING2 7 #define wxSTC_R_OPERATOR 8 #define wxSTC_R_IDENTIFIER 9 #define wxSTC_R_INFIX 10 #define wxSTC_R_INFIXEOL 11 /// Lexical state for SCLEX_MAGIK #define wxSTC_MAGIK_DEFAULT 0 #define wxSTC_MAGIK_COMMENT 1 #define wxSTC_MAGIK_HYPER_COMMENT 16 #define wxSTC_MAGIK_STRING 2 #define wxSTC_MAGIK_CHARACTER 3 #define wxSTC_MAGIK_NUMBER 4 #define wxSTC_MAGIK_IDENTIFIER 5 #define wxSTC_MAGIK_OPERATOR 6 #define wxSTC_MAGIK_FLOW 7 #define wxSTC_MAGIK_CONTAINER 8 #define wxSTC_MAGIK_BRACKET_BLOCK 9 #define wxSTC_MAGIK_BRACE_BLOCK 10 #define wxSTC_MAGIK_SQBRACKET_BLOCK 11 #define wxSTC_MAGIK_UNKNOWN_KEYWORD 12 #define wxSTC_MAGIK_KEYWORD 13 #define wxSTC_MAGIK_PRAGMA 14 #define wxSTC_MAGIK_SYMBOL 15 /// Lexical state for SCLEX_POWERSHELL #define wxSTC_POWERSHELL_DEFAULT 0 #define wxSTC_POWERSHELL_COMMENT 1 #define wxSTC_POWERSHELL_STRING 2 #define wxSTC_POWERSHELL_CHARACTER 3 #define wxSTC_POWERSHELL_NUMBER 4 #define wxSTC_POWERSHELL_VARIABLE 5 #define wxSTC_POWERSHELL_OPERATOR 6 #define wxSTC_POWERSHELL_IDENTIFIER 7 #define wxSTC_POWERSHELL_KEYWORD 8 #define wxSTC_POWERSHELL_CMDLET 9 #define wxSTC_POWERSHELL_ALIAS 10 #define wxSTC_POWERSHELL_FUNCTION 11 #define wxSTC_POWERSHELL_USER1 12 #define wxSTC_POWERSHELL_COMMENTSTREAM 13 #define wxSTC_POWERSHELL_HERE_STRING 14 #define wxSTC_POWERSHELL_HERE_CHARACTER 15 #define wxSTC_POWERSHELL_COMMENTDOCKEYWORD 16 /// Lexical state for SCLEX_MYSQL #define wxSTC_MYSQL_DEFAULT 0 #define wxSTC_MYSQL_COMMENT 1 #define wxSTC_MYSQL_COMMENTLINE 2 #define wxSTC_MYSQL_VARIABLE 3 #define wxSTC_MYSQL_SYSTEMVARIABLE 4 #define wxSTC_MYSQL_KNOWNSYSTEMVARIABLE 5 #define wxSTC_MYSQL_NUMBER 6 #define wxSTC_MYSQL_MAJORKEYWORD 7 #define wxSTC_MYSQL_KEYWORD 8 #define wxSTC_MYSQL_DATABASEOBJECT 9 #define wxSTC_MYSQL_PROCEDUREKEYWORD 10 #define wxSTC_MYSQL_STRING 11 #define wxSTC_MYSQL_SQSTRING 12 #define wxSTC_MYSQL_DQSTRING 13 #define wxSTC_MYSQL_OPERATOR 14 #define wxSTC_MYSQL_FUNCTION 15 #define wxSTC_MYSQL_IDENTIFIER 16 #define wxSTC_MYSQL_QUOTEDIDENTIFIER 17 #define wxSTC_MYSQL_USER1 18 #define wxSTC_MYSQL_USER2 19 #define wxSTC_MYSQL_USER3 20 #define wxSTC_MYSQL_HIDDENCOMMAND 21 #define wxSTC_MYSQL_PLACEHOLDER 22 /// Lexical state for SCLEX_PO #define wxSTC_PO_DEFAULT 0 #define wxSTC_PO_COMMENT 1 #define wxSTC_PO_MSGID 2 #define wxSTC_PO_MSGID_TEXT 3 #define wxSTC_PO_MSGSTR 4 #define wxSTC_PO_MSGSTR_TEXT 5 #define wxSTC_PO_MSGCTXT 6 #define wxSTC_PO_MSGCTXT_TEXT 7 #define wxSTC_PO_FUZZY 8 #define wxSTC_PO_PROGRAMMER_COMMENT 9 #define wxSTC_PO_REFERENCE 10 #define wxSTC_PO_FLAGS 11 #define wxSTC_PO_MSGID_TEXT_EOL 12 #define wxSTC_PO_MSGSTR_TEXT_EOL 13 #define wxSTC_PO_MSGCTXT_TEXT_EOL 14 #define wxSTC_PO_ERROR 15 /// Lexical states for SCLEX_PASCAL #define wxSTC_PAS_DEFAULT 0 #define wxSTC_PAS_IDENTIFIER 1 #define wxSTC_PAS_COMMENT 2 #define wxSTC_PAS_COMMENT2 3 #define wxSTC_PAS_COMMENTLINE 4 #define wxSTC_PAS_PREPROCESSOR 5 #define wxSTC_PAS_PREPROCESSOR2 6 #define wxSTC_PAS_NUMBER 7 #define wxSTC_PAS_HEXNUMBER 8 #define wxSTC_PAS_WORD 9 #define wxSTC_PAS_STRING 10 #define wxSTC_PAS_STRINGEOL 11 #define wxSTC_PAS_CHARACTER 12 #define wxSTC_PAS_OPERATOR 13 #define wxSTC_PAS_ASM 14 /// Lexical state for SCLEX_SORCUS #define wxSTC_SORCUS_DEFAULT 0 #define wxSTC_SORCUS_COMMAND 1 #define wxSTC_SORCUS_PARAMETER 2 #define wxSTC_SORCUS_COMMENTLINE 3 #define wxSTC_SORCUS_STRING 4 #define wxSTC_SORCUS_STRINGEOL 5 #define wxSTC_SORCUS_IDENTIFIER 6 #define wxSTC_SORCUS_OPERATOR 7 #define wxSTC_SORCUS_NUMBER 8 #define wxSTC_SORCUS_CONSTANT 9 /// Lexical state for SCLEX_POWERPRO #define wxSTC_POWERPRO_DEFAULT 0 #define wxSTC_POWERPRO_COMMENTBLOCK 1 #define wxSTC_POWERPRO_COMMENTLINE 2 #define wxSTC_POWERPRO_NUMBER 3 #define wxSTC_POWERPRO_WORD 4 #define wxSTC_POWERPRO_WORD2 5 #define wxSTC_POWERPRO_WORD3 6 #define wxSTC_POWERPRO_WORD4 7 #define wxSTC_POWERPRO_DOUBLEQUOTEDSTRING 8 #define wxSTC_POWERPRO_SINGLEQUOTEDSTRING 9 #define wxSTC_POWERPRO_LINECONTINUE 10 #define wxSTC_POWERPRO_OPERATOR 11 #define wxSTC_POWERPRO_IDENTIFIER 12 #define wxSTC_POWERPRO_STRINGEOL 13 #define wxSTC_POWERPRO_VERBATIM 14 #define wxSTC_POWERPRO_ALTQUOTE 15 #define wxSTC_POWERPRO_FUNCTION 16 /// Lexical states for SCLEX_SML #define wxSTC_SML_DEFAULT 0 #define wxSTC_SML_IDENTIFIER 1 #define wxSTC_SML_TAGNAME 2 #define wxSTC_SML_KEYWORD 3 #define wxSTC_SML_KEYWORD2 4 #define wxSTC_SML_KEYWORD3 5 #define wxSTC_SML_LINENUM 6 #define wxSTC_SML_OPERATOR 7 #define wxSTC_SML_NUMBER 8 #define wxSTC_SML_CHAR 9 #define wxSTC_SML_STRING 11 #define wxSTC_SML_COMMENT 12 #define wxSTC_SML_COMMENT1 13 #define wxSTC_SML_COMMENT2 14 #define wxSTC_SML_COMMENT3 15 /// Lexical state for SCLEX_MARKDOWN #define wxSTC_MARKDOWN_DEFAULT 0 #define wxSTC_MARKDOWN_LINE_BEGIN 1 #define wxSTC_MARKDOWN_STRONG1 2 #define wxSTC_MARKDOWN_STRONG2 3 #define wxSTC_MARKDOWN_EM1 4 #define wxSTC_MARKDOWN_EM2 5 #define wxSTC_MARKDOWN_HEADER1 6 #define wxSTC_MARKDOWN_HEADER2 7 #define wxSTC_MARKDOWN_HEADER3 8 #define wxSTC_MARKDOWN_HEADER4 9 #define wxSTC_MARKDOWN_HEADER5 10 #define wxSTC_MARKDOWN_HEADER6 11 #define wxSTC_MARKDOWN_PRECHAR 12 #define wxSTC_MARKDOWN_ULIST_ITEM 13 #define wxSTC_MARKDOWN_OLIST_ITEM 14 #define wxSTC_MARKDOWN_BLOCKQUOTE 15 #define wxSTC_MARKDOWN_STRIKEOUT 16 #define wxSTC_MARKDOWN_HRULE 17 #define wxSTC_MARKDOWN_LINK 18 #define wxSTC_MARKDOWN_CODE 19 #define wxSTC_MARKDOWN_CODE2 20 #define wxSTC_MARKDOWN_CODEBK 21 /// Lexical state for SCLEX_TXT2TAGS #define wxSTC_TXT2TAGS_DEFAULT 0 #define wxSTC_TXT2TAGS_LINE_BEGIN 1 #define wxSTC_TXT2TAGS_STRONG1 2 #define wxSTC_TXT2TAGS_STRONG2 3 #define wxSTC_TXT2TAGS_EM1 4 #define wxSTC_TXT2TAGS_EM2 5 #define wxSTC_TXT2TAGS_HEADER1 6 #define wxSTC_TXT2TAGS_HEADER2 7 #define wxSTC_TXT2TAGS_HEADER3 8 #define wxSTC_TXT2TAGS_HEADER4 9 #define wxSTC_TXT2TAGS_HEADER5 10 #define wxSTC_TXT2TAGS_HEADER6 11 #define wxSTC_TXT2TAGS_PRECHAR 12 #define wxSTC_TXT2TAGS_ULIST_ITEM 13 #define wxSTC_TXT2TAGS_OLIST_ITEM 14 #define wxSTC_TXT2TAGS_BLOCKQUOTE 15 #define wxSTC_TXT2TAGS_STRIKEOUT 16 #define wxSTC_TXT2TAGS_HRULE 17 #define wxSTC_TXT2TAGS_LINK 18 #define wxSTC_TXT2TAGS_CODE 19 #define wxSTC_TXT2TAGS_CODE2 20 #define wxSTC_TXT2TAGS_CODEBK 21 #define wxSTC_TXT2TAGS_COMMENT 22 #define wxSTC_TXT2TAGS_OPTION 23 #define wxSTC_TXT2TAGS_PREPROC 24 #define wxSTC_TXT2TAGS_POSTPROC 25 /// Lexical states for SCLEX_A68K #define wxSTC_A68K_DEFAULT 0 #define wxSTC_A68K_COMMENT 1 #define wxSTC_A68K_NUMBER_DEC 2 #define wxSTC_A68K_NUMBER_BIN 3 #define wxSTC_A68K_NUMBER_HEX 4 #define wxSTC_A68K_STRING1 5 #define wxSTC_A68K_OPERATOR 6 #define wxSTC_A68K_CPUINSTRUCTION 7 #define wxSTC_A68K_EXTINSTRUCTION 8 #define wxSTC_A68K_REGISTER 9 #define wxSTC_A68K_DIRECTIVE 10 #define wxSTC_A68K_MACRO_ARG 11 #define wxSTC_A68K_LABEL 12 #define wxSTC_A68K_STRING2 13 #define wxSTC_A68K_IDENTIFIER 14 #define wxSTC_A68K_MACRO_DECLARATION 15 #define wxSTC_A68K_COMMENT_WORD 16 #define wxSTC_A68K_COMMENT_SPECIAL 17 #define wxSTC_A68K_COMMENT_DOXYGEN 18 /// Lexical states for SCLEX_MODULA #define wxSTC_MODULA_DEFAULT 0 #define wxSTC_MODULA_COMMENT 1 #define wxSTC_MODULA_DOXYCOMM 2 #define wxSTC_MODULA_DOXYKEY 3 #define wxSTC_MODULA_KEYWORD 4 #define wxSTC_MODULA_RESERVED 5 #define wxSTC_MODULA_NUMBER 6 #define wxSTC_MODULA_BASENUM 7 #define wxSTC_MODULA_FLOAT 8 #define wxSTC_MODULA_STRING 9 #define wxSTC_MODULA_STRSPEC 10 #define wxSTC_MODULA_CHAR 11 #define wxSTC_MODULA_CHARSPEC 12 #define wxSTC_MODULA_PROC 13 #define wxSTC_MODULA_PRAGMA 14 #define wxSTC_MODULA_PRGKEY 15 #define wxSTC_MODULA_OPERATOR 16 #define wxSTC_MODULA_BADSTR 17 /// Lexical states for SCLEX_COFFEESCRIPT #define wxSTC_COFFEESCRIPT_DEFAULT 0 #define wxSTC_COFFEESCRIPT_COMMENT 1 #define wxSTC_COFFEESCRIPT_COMMENTLINE 2 #define wxSTC_COFFEESCRIPT_COMMENTDOC 3 #define wxSTC_COFFEESCRIPT_NUMBER 4 #define wxSTC_COFFEESCRIPT_WORD 5 #define wxSTC_COFFEESCRIPT_STRING 6 #define wxSTC_COFFEESCRIPT_CHARACTER 7 #define wxSTC_COFFEESCRIPT_UUID 8 #define wxSTC_COFFEESCRIPT_PREPROCESSOR 9 #define wxSTC_COFFEESCRIPT_OPERATOR 10 #define wxSTC_COFFEESCRIPT_IDENTIFIER 11 #define wxSTC_COFFEESCRIPT_STRINGEOL 12 #define wxSTC_COFFEESCRIPT_VERBATIM 13 #define wxSTC_COFFEESCRIPT_REGEX 14 #define wxSTC_COFFEESCRIPT_COMMENTLINEDOC 15 #define wxSTC_COFFEESCRIPT_WORD2 16 #define wxSTC_COFFEESCRIPT_COMMENTDOCKEYWORD 17 #define wxSTC_COFFEESCRIPT_COMMENTDOCKEYWORDERROR 18 #define wxSTC_COFFEESCRIPT_GLOBALCLASS 19 #define wxSTC_COFFEESCRIPT_STRINGRAW 20 #define wxSTC_COFFEESCRIPT_TRIPLEVERBATIM 21 #define wxSTC_COFFEESCRIPT_COMMENTBLOCK 22 #define wxSTC_COFFEESCRIPT_VERBOSE_REGEX 23 #define wxSTC_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24 #define wxSTC_COFFEESCRIPT_INSTANCEPROPERTY 25 /// Lexical states for SCLEX_AVS #define wxSTC_AVS_DEFAULT 0 #define wxSTC_AVS_COMMENTBLOCK 1 #define wxSTC_AVS_COMMENTBLOCKN 2 #define wxSTC_AVS_COMMENTLINE 3 #define wxSTC_AVS_NUMBER 4 #define wxSTC_AVS_OPERATOR 5 #define wxSTC_AVS_IDENTIFIER 6 #define wxSTC_AVS_STRING 7 #define wxSTC_AVS_TRIPLESTRING 8 #define wxSTC_AVS_KEYWORD 9 #define wxSTC_AVS_FILTER 10 #define wxSTC_AVS_PLUGIN 11 #define wxSTC_AVS_FUNCTION 12 #define wxSTC_AVS_CLIPPROP 13 #define wxSTC_AVS_USERDFN 14 /// Lexical states for SCLEX_ECL #define wxSTC_ECL_DEFAULT 0 #define wxSTC_ECL_COMMENT 1 #define wxSTC_ECL_COMMENTLINE 2 #define wxSTC_ECL_NUMBER 3 #define wxSTC_ECL_STRING 4 #define wxSTC_ECL_WORD0 5 #define wxSTC_ECL_OPERATOR 6 #define wxSTC_ECL_CHARACTER 7 #define wxSTC_ECL_UUID 8 #define wxSTC_ECL_PREPROCESSOR 9 #define wxSTC_ECL_UNKNOWN 10 #define wxSTC_ECL_IDENTIFIER 11 #define wxSTC_ECL_STRINGEOL 12 #define wxSTC_ECL_VERBATIM 13 #define wxSTC_ECL_REGEX 14 #define wxSTC_ECL_COMMENTLINEDOC 15 #define wxSTC_ECL_WORD1 16 #define wxSTC_ECL_COMMENTDOCKEYWORD 17 #define wxSTC_ECL_COMMENTDOCKEYWORDERROR 18 #define wxSTC_ECL_WORD2 19 #define wxSTC_ECL_WORD3 20 #define wxSTC_ECL_WORD4 21 #define wxSTC_ECL_WORD5 22 #define wxSTC_ECL_COMMENTDOC 23 #define wxSTC_ECL_ADDED 24 #define wxSTC_ECL_DELETED 25 #define wxSTC_ECL_CHANGED 26 #define wxSTC_ECL_MOVED 27 /// Lexical states for SCLEX_OSCRIPT #define wxSTC_OSCRIPT_DEFAULT 0 #define wxSTC_OSCRIPT_LINE_COMMENT 1 #define wxSTC_OSCRIPT_BLOCK_COMMENT 2 #define wxSTC_OSCRIPT_DOC_COMMENT 3 #define wxSTC_OSCRIPT_PREPROCESSOR 4 #define wxSTC_OSCRIPT_NUMBER 5 #define wxSTC_OSCRIPT_SINGLEQUOTE_STRING 6 #define wxSTC_OSCRIPT_DOUBLEQUOTE_STRING 7 #define wxSTC_OSCRIPT_CONSTANT 8 #define wxSTC_OSCRIPT_IDENTIFIER 9 #define wxSTC_OSCRIPT_GLOBAL 10 #define wxSTC_OSCRIPT_KEYWORD 11 #define wxSTC_OSCRIPT_OPERATOR 12 #define wxSTC_OSCRIPT_LABEL 13 #define wxSTC_OSCRIPT_TYPE 14 #define wxSTC_OSCRIPT_FUNCTION 15 #define wxSTC_OSCRIPT_OBJECT 16 #define wxSTC_OSCRIPT_PROPERTY 17 #define wxSTC_OSCRIPT_METHOD 18 /// Lexical states for SCLEX_VISUALPROLOG #define wxSTC_VISUALPROLOG_DEFAULT 0 #define wxSTC_VISUALPROLOG_KEY_MAJOR 1 #define wxSTC_VISUALPROLOG_KEY_MINOR 2 #define wxSTC_VISUALPROLOG_KEY_DIRECTIVE 3 #define wxSTC_VISUALPROLOG_COMMENT_BLOCK 4 #define wxSTC_VISUALPROLOG_COMMENT_LINE 5 #define wxSTC_VISUALPROLOG_COMMENT_KEY 6 #define wxSTC_VISUALPROLOG_COMMENT_KEY_ERROR 7 #define wxSTC_VISUALPROLOG_IDENTIFIER 8 #define wxSTC_VISUALPROLOG_VARIABLE 9 #define wxSTC_VISUALPROLOG_ANONYMOUS 10 #define wxSTC_VISUALPROLOG_NUMBER 11 #define wxSTC_VISUALPROLOG_OPERATOR 12 #define wxSTC_VISUALPROLOG_CHARACTER 13 #define wxSTC_VISUALPROLOG_CHARACTER_TOO_MANY 14 #define wxSTC_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15 #define wxSTC_VISUALPROLOG_STRING 16 #define wxSTC_VISUALPROLOG_STRING_ESCAPE 17 #define wxSTC_VISUALPROLOG_STRING_ESCAPE_ERROR 18 #define wxSTC_VISUALPROLOG_STRING_EOL_OPEN 19 #define wxSTC_VISUALPROLOG_STRING_VERBATIM 20 #define wxSTC_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21 #define wxSTC_VISUALPROLOG_STRING_VERBATIM_EOL 22 /// Lexical states for SCLEX_STTXT #define wxSTC_STTXT_DEFAULT 0 #define wxSTC_STTXT_COMMENT 1 #define wxSTC_STTXT_COMMENTLINE 2 #define wxSTC_STTXT_KEYWORD 3 #define wxSTC_STTXT_TYPE 4 #define wxSTC_STTXT_FUNCTION 5 #define wxSTC_STTXT_FB 6 #define wxSTC_STTXT_NUMBER 7 #define wxSTC_STTXT_HEXNUMBER 8 #define wxSTC_STTXT_PRAGMA 9 #define wxSTC_STTXT_OPERATOR 10 #define wxSTC_STTXT_CHARACTER 11 #define wxSTC_STTXT_STRING1 12 #define wxSTC_STTXT_STRING2 13 #define wxSTC_STTXT_STRINGEOL 14 #define wxSTC_STTXT_IDENTIFIER 15 #define wxSTC_STTXT_DATETIME 16 #define wxSTC_STTXT_VARS 17 #define wxSTC_STTXT_PRAGMAS 18 /// Lexical states for SCLEX_KVIRC #define wxSTC_KVIRC_DEFAULT 0 #define wxSTC_KVIRC_COMMENT 1 #define wxSTC_KVIRC_COMMENTBLOCK 2 #define wxSTC_KVIRC_STRING 3 #define wxSTC_KVIRC_WORD 4 #define wxSTC_KVIRC_KEYWORD 5 #define wxSTC_KVIRC_FUNCTION_KEYWORD 6 #define wxSTC_KVIRC_FUNCTION 7 #define wxSTC_KVIRC_VARIABLE 8 #define wxSTC_KVIRC_NUMBER 9 #define wxSTC_KVIRC_OPERATOR 10 #define wxSTC_KVIRC_STRING_FUNCTION 11 #define wxSTC_KVIRC_STRING_VARIABLE 12 /// Lexical states for SCLEX_RUST #define wxSTC_RUST_DEFAULT 0 #define wxSTC_RUST_COMMENTBLOCK 1 #define wxSTC_RUST_COMMENTLINE 2 #define wxSTC_RUST_COMMENTBLOCKDOC 3 #define wxSTC_RUST_COMMENTLINEDOC 4 #define wxSTC_RUST_NUMBER 5 #define wxSTC_RUST_WORD 6 #define wxSTC_RUST_WORD2 7 #define wxSTC_RUST_WORD3 8 #define wxSTC_RUST_WORD4 9 #define wxSTC_RUST_WORD5 10 #define wxSTC_RUST_WORD6 11 #define wxSTC_RUST_WORD7 12 #define wxSTC_RUST_STRING 13 #define wxSTC_RUST_STRINGR 14 #define wxSTC_RUST_CHARACTER 15 #define wxSTC_RUST_OPERATOR 16 #define wxSTC_RUST_IDENTIFIER 17 #define wxSTC_RUST_LIFETIME 18 #define wxSTC_RUST_MACRO 19 #define wxSTC_RUST_LEXERROR 20 #define wxSTC_RUST_BYTESTRING 21 #define wxSTC_RUST_BYTESTRINGR 22 #define wxSTC_RUST_BYTECHARACTER 23 /// Lexical states for SCLEX_DMAP #define wxSTC_DMAP_DEFAULT 0 #define wxSTC_DMAP_COMMENT 1 #define wxSTC_DMAP_NUMBER 2 #define wxSTC_DMAP_STRING1 3 #define wxSTC_DMAP_STRING2 4 #define wxSTC_DMAP_STRINGEOL 5 #define wxSTC_DMAP_OPERATOR 6 #define wxSTC_DMAP_IDENTIFIER 7 #define wxSTC_DMAP_WORD 8 #define wxSTC_DMAP_WORD2 9 #define wxSTC_DMAP_WORD3 10 /// Lexical states for SCLEX_DMIS #define wxSTC_DMIS_DEFAULT 0 #define wxSTC_DMIS_COMMENT 1 #define wxSTC_DMIS_STRING 2 #define wxSTC_DMIS_NUMBER 3 #define wxSTC_DMIS_KEYWORD 4 #define wxSTC_DMIS_MAJORWORD 5 #define wxSTC_DMIS_MINORWORD 6 #define wxSTC_DMIS_UNSUPPORTED_MAJOR 7 #define wxSTC_DMIS_UNSUPPORTED_MINOR 8 #define wxSTC_DMIS_LABEL 9 /// Lexical states for SCLEX_REGISTRY #define wxSTC_REG_DEFAULT 0 #define wxSTC_REG_COMMENT 1 #define wxSTC_REG_VALUENAME 2 #define wxSTC_REG_STRING 3 #define wxSTC_REG_HEXDIGIT 4 #define wxSTC_REG_VALUETYPE 5 #define wxSTC_REG_ADDEDKEY 6 #define wxSTC_REG_DELETEDKEY 7 #define wxSTC_REG_ESCAPED 8 #define wxSTC_REG_KEYPATH_GUID 9 #define wxSTC_REG_STRING_GUID 10 #define wxSTC_REG_PARAMETER 11 #define wxSTC_REG_OPERATOR 12 /// Lexical state for SCLEX_BIBTEX #define wxSTC_BIBTEX_DEFAULT 0 #define wxSTC_BIBTEX_ENTRY 1 #define wxSTC_BIBTEX_UNKNOWN_ENTRY 2 #define wxSTC_BIBTEX_KEY 3 #define wxSTC_BIBTEX_PARAMETER 4 #define wxSTC_BIBTEX_VALUE 5 #define wxSTC_BIBTEX_COMMENT 6 /// Lexical state for SCLEX_SREC #define wxSTC_HEX_DEFAULT 0 #define wxSTC_HEX_RECSTART 1 #define wxSTC_HEX_RECTYPE 2 #define wxSTC_HEX_RECTYPE_UNKNOWN 3 #define wxSTC_HEX_BYTECOUNT 4 #define wxSTC_HEX_BYTECOUNT_WRONG 5 #define wxSTC_HEX_NOADDRESS 6 #define wxSTC_HEX_DATAADDRESS 7 #define wxSTC_HEX_RECCOUNT 8 #define wxSTC_HEX_STARTADDRESS 9 #define wxSTC_HEX_ADDRESSFIELD_UNKNOWN 10 #define wxSTC_HEX_EXTENDEDADDRESS 11 #define wxSTC_HEX_DATA_ODD 12 #define wxSTC_HEX_DATA_EVEN 13 #define wxSTC_HEX_DATA_UNKNOWN 14 #define wxSTC_HEX_DATA_EMPTY 15 #define wxSTC_HEX_CHECKSUM 16 #define wxSTC_HEX_CHECKSUM_WRONG 17 #define wxSTC_HEX_GARBAGE 18 /// Lexical state for SCLEX_IHEX (shared with Srec) /// Lexical state for SCLEX_TEHEX (shared with Srec) /// Lexical states for SCLEX_JSON #define wxSTC_JSON_DEFAULT 0 #define wxSTC_JSON_NUMBER 1 #define wxSTC_JSON_STRING 2 #define wxSTC_JSON_STRINGEOL 3 #define wxSTC_JSON_PROPERTYNAME 4 #define wxSTC_JSON_ESCAPESEQUENCE 5 #define wxSTC_JSON_LINECOMMENT 6 #define wxSTC_JSON_BLOCKCOMMENT 7 #define wxSTC_JSON_OPERATOR 8 #define wxSTC_JSON_URI 9 #define wxSTC_JSON_COMPACTIRI 10 #define wxSTC_JSON_KEYWORD 11 #define wxSTC_JSON_LDKEYWORD 12 #define wxSTC_JSON_ERROR 13 #define wxSTC_EDI_DEFAULT 0 #define wxSTC_EDI_SEGMENTSTART 1 #define wxSTC_EDI_SEGMENTEND 2 #define wxSTC_EDI_SEP_ELEMENT 3 #define wxSTC_EDI_SEP_COMPOSITE 4 #define wxSTC_EDI_SEP_RELEASE 5 #define wxSTC_EDI_UNA 6 #define wxSTC_EDI_UNH 7 #define wxSTC_EDI_BADSEGMENT 8 //}}} //---------------------------------------------------------------------- #if defined(__clang__) || wxCHECK_GCC_VERSION(4, 5) #define wxSTC_STRINGIFY(X) #X #define wxSTC_DEPRECATED_MACRO_VALUE(value,msg) \ _Pragma(wxSTC_STRINGIFY(GCC warning msg)) value #else #define wxSTC_DEPRECATED_MACRO_VALUE(value,msg) value #endif #if WXWIN_COMPATIBILITY_3_0 // The wxSTC_INDIC{0,1,2,S}_MASK values are no longer used in Scintilla #if wxCHECK_VISUALC_VERSION(10) #pragma deprecated(wxSTC_INDIC0_MASK, wxSTC_INDIC1_MASK, \ wxSTC_INDIC2_MASK, wxSTC_INDICS_MASK) #endif #define wxSTC_INDIC0_MASK wxSTC_DEPRECATED_MACRO_VALUE(0x20,\ "wxSTC_INDIC0_MASK is deprecated. Style byte indicators are no longer used.") #define wxSTC_INDIC1_MASK wxSTC_DEPRECATED_MACRO_VALUE(0x40,\ "wxSTC_INDIC1_MASK is deprecated. Style byte indicators are no longer used.") #define wxSTC_INDIC2_MASK wxSTC_DEPRECATED_MACRO_VALUE(0x80,\ "wxSTC_INDIC2_MASK is deprecated. Style byte indicators are no longer used.") #define wxSTC_INDICS_MASK wxSTC_DEPRECATED_MACRO_VALUE(0xE0,\ "wxSTC_INDICS_MASK is deprecated. Style byte indicators are no longer used.") // The following entries have non-conformant prefixes. #if wxCHECK_VISUALC_VERSION(10) #pragma deprecated(wxSTC_SCMOD_NORM, wxSTC_SCMOD_SHIFT, wxSTC_SCMOD_CTRL, \ wxSTC_SCMOD_ALT, wxSTC_SCMOD_SUPER, wxSTC_SCMOD_META, \ wxSTC_SCVS_NONE, wxSTC_SCVS_RECTANGULARSELECTION, \ wxSTC_SCVS_USERACCESSIBLE, wxSTC_SCVS_NOWRAPLINESTART) #endif #define wxSTC_SCMOD_NORM wxSTC_DEPRECATED_MACRO_VALUE(0,\ "wxSTC_SCMOD_NORM is deprecated. Use wxSTC_KEYMOD_NORM instead.") #define wxSTC_SCMOD_SHIFT wxSTC_DEPRECATED_MACRO_VALUE(1,\ "wxSTC_SCMOD_SHIFT is deprecated. Use wxSTC_KEYMOD_SHIFT instead.") #define wxSTC_SCMOD_CTRL wxSTC_DEPRECATED_MACRO_VALUE(2,\ "wxSTC_SCMOD_CTRL is deprecated. Use wxSTC_KEYMOD_CTRL instead.") #define wxSTC_SCMOD_ALT wxSTC_DEPRECATED_MACRO_VALUE(4,\ "wxSTC_SCMOD_ALT is deprecated. Use wxSTC_KEYMOD_ALT instead.") #define wxSTC_SCMOD_SUPER wxSTC_DEPRECATED_MACRO_VALUE(8,\ "wxSTC_SCMOD_SUPER is deprecated. Use wxSTC_KEYMOD_SUPER instead.") #define wxSTC_SCMOD_META wxSTC_DEPRECATED_MACRO_VALUE(16,\ "wxSTC_SCMOD_META is deprecated. Use wxSTC_KEYMOD_META instead.") #define wxSTC_SCVS_NONE wxSTC_DEPRECATED_MACRO_VALUE(0, \ "wxSTC_SCVS_NONE is deprecated. Use wxSTC_VS_NONE instead.") #define wxSTC_SCVS_RECTANGULARSELECTION wxSTC_DEPRECATED_MACRO_VALUE(1, \ "wxSTC_SCVS_RECTANGULARSELECTION is deprecated. Use wxSTC_VS_RECTANGULARSELECTION instead.") #define wxSTC_SCVS_USERACCESSIBLE wxSTC_DEPRECATED_MACRO_VALUE(2, \ "wxSTC_SCVS_USERACCESSIBLE is deprecated. Use wxSTC_VS_USERACCESSIBLE instead.") #define wxSTC_SCVS_NOWRAPLINESTART wxSTC_DEPRECATED_MACRO_VALUE(4, \ "wxSTC_SCVS_NOWRAPLINESTART is deprecated. Use wxSTC_VS_NOWRAPLINESTART instead.") #endif // WXWIN_COMPATIBILITY_3_0 //---------------------------------------------------------------------- // Commands that can be bound to keystrokes section {{{ /// Redoes the next action on the undo history. #define wxSTC_CMD_REDO 2011 /// Select all the text in the document. #define wxSTC_CMD_SELECTALL 2013 /// Undo one action in the undo history. #define wxSTC_CMD_UNDO 2176 /// Cut the selection to the clipboard. #define wxSTC_CMD_CUT 2177 /// Copy the selection to the clipboard. #define wxSTC_CMD_COPY 2178 /// Paste the contents of the clipboard into the document replacing the selection. #define wxSTC_CMD_PASTE 2179 /// Clear the selection. #define wxSTC_CMD_CLEAR 2180 /// Move caret down one line. #define wxSTC_CMD_LINEDOWN 2300 /// Move caret down one line extending selection to new caret position. #define wxSTC_CMD_LINEDOWNEXTEND 2301 /// Move caret up one line. #define wxSTC_CMD_LINEUP 2302 /// Move caret up one line extending selection to new caret position. #define wxSTC_CMD_LINEUPEXTEND 2303 /// Move caret left one character. #define wxSTC_CMD_CHARLEFT 2304 /// Move caret left one character extending selection to new caret position. #define wxSTC_CMD_CHARLEFTEXTEND 2305 /// Move caret right one character. #define wxSTC_CMD_CHARRIGHT 2306 /// Move caret right one character extending selection to new caret position. #define wxSTC_CMD_CHARRIGHTEXTEND 2307 /// Move caret left one word. #define wxSTC_CMD_WORDLEFT 2308 /// Move caret left one word extending selection to new caret position. #define wxSTC_CMD_WORDLEFTEXTEND 2309 /// Move caret right one word. #define wxSTC_CMD_WORDRIGHT 2310 /// Move caret right one word extending selection to new caret position. #define wxSTC_CMD_WORDRIGHTEXTEND 2311 /// Move caret to first position on line. #define wxSTC_CMD_HOME 2312 /// Move caret to first position on line extending selection to new caret position. #define wxSTC_CMD_HOMEEXTEND 2313 /// Move caret to last position on line. #define wxSTC_CMD_LINEEND 2314 /// Move caret to last position on line extending selection to new caret position. #define wxSTC_CMD_LINEENDEXTEND 2315 /// Move caret to first position in document. #define wxSTC_CMD_DOCUMENTSTART 2316 /// Move caret to first position in document extending selection to new caret position. #define wxSTC_CMD_DOCUMENTSTARTEXTEND 2317 /// Move caret to last position in document. #define wxSTC_CMD_DOCUMENTEND 2318 /// Move caret to last position in document extending selection to new caret position. #define wxSTC_CMD_DOCUMENTENDEXTEND 2319 /// Move caret one page up. #define wxSTC_CMD_PAGEUP 2320 /// Move caret one page up extending selection to new caret position. #define wxSTC_CMD_PAGEUPEXTEND 2321 /// Move caret one page down. #define wxSTC_CMD_PAGEDOWN 2322 /// Move caret one page down extending selection to new caret position. #define wxSTC_CMD_PAGEDOWNEXTEND 2323 /// Switch from insert to overtype mode or the reverse. #define wxSTC_CMD_EDITTOGGLEOVERTYPE 2324 /// Cancel any modes such as call tip or auto-completion list display. #define wxSTC_CMD_CANCEL 2325 /// Delete the selection or if no selection, the character before the caret. #define wxSTC_CMD_DELETEBACK 2326 /// If selection is empty or all on one line replace the selection with a tab character. /// If more than one line selected, indent the lines. #define wxSTC_CMD_TAB 2327 /// Dedent the selected lines. #define wxSTC_CMD_BACKTAB 2328 /// Insert a new line, may use a CRLF, CR or LF depending on EOL mode. #define wxSTC_CMD_NEWLINE 2329 /// Insert a Form Feed character. #define wxSTC_CMD_FORMFEED 2330 /// Move caret to before first visible character on line. /// If already there move to first character on line. #define wxSTC_CMD_VCHOME 2331 /// Like VCHome but extending selection to new caret position. #define wxSTC_CMD_VCHOMEEXTEND 2332 /// Magnify the displayed text by increasing the sizes by 1 point. #define wxSTC_CMD_ZOOMIN 2333 /// Make the displayed text smaller by decreasing the sizes by 1 point. #define wxSTC_CMD_ZOOMOUT 2334 /// Delete the word to the left of the caret. #define wxSTC_CMD_DELWORDLEFT 2335 /// Delete the word to the right of the caret. #define wxSTC_CMD_DELWORDRIGHT 2336 /// Delete the word to the right of the caret, but not the trailing non-word characters. #define wxSTC_CMD_DELWORDRIGHTEND 2518 /// Cut the line containing the caret. #define wxSTC_CMD_LINECUT 2337 /// Delete the line containing the caret. #define wxSTC_CMD_LINEDELETE 2338 /// Switch the current line with the previous. #define wxSTC_CMD_LINETRANSPOSE 2339 /// Duplicate the current line. #define wxSTC_CMD_LINEDUPLICATE 2404 /// Transform the selection to lower case. #define wxSTC_CMD_LOWERCASE 2340 /// Transform the selection to upper case. #define wxSTC_CMD_UPPERCASE 2341 /// Scroll the document down, keeping the caret visible. #define wxSTC_CMD_LINESCROLLDOWN 2342 /// Scroll the document up, keeping the caret visible. #define wxSTC_CMD_LINESCROLLUP 2343 /// Delete the selection or if no selection, the character before the caret. /// Will not delete the character before at the start of a line. #define wxSTC_CMD_DELETEBACKNOTLINE 2344 /// Move caret to first position on display line. #define wxSTC_CMD_HOMEDISPLAY 2345 /// Move caret to first position on display line extending selection to /// new caret position. #define wxSTC_CMD_HOMEDISPLAYEXTEND 2346 /// Move caret to last position on display line. #define wxSTC_CMD_LINEENDDISPLAY 2347 /// Move caret to last position on display line extending selection to new /// caret position. #define wxSTC_CMD_LINEENDDISPLAYEXTEND 2348 /// Like Home but when word-wrap is enabled goes first to start of display line /// HomeDisplay, then to start of document line Home. #define wxSTC_CMD_HOMEWRAP 2349 /// Like HomeExtend but when word-wrap is enabled extends first to start of display line /// HomeDisplayExtend, then to start of document line HomeExtend. #define wxSTC_CMD_HOMEWRAPEXTEND 2450 /// Like LineEnd but when word-wrap is enabled goes first to end of display line /// LineEndDisplay, then to start of document line LineEnd. #define wxSTC_CMD_LINEENDWRAP 2451 /// Like LineEndExtend but when word-wrap is enabled extends first to end of display line /// LineEndDisplayExtend, then to start of document line LineEndExtend. #define wxSTC_CMD_LINEENDWRAPEXTEND 2452 /// Like VCHome but when word-wrap is enabled goes first to start of display line /// VCHomeDisplay, then behaves like VCHome. #define wxSTC_CMD_VCHOMEWRAP 2453 /// Like VCHomeExtend but when word-wrap is enabled extends first to start of display line /// VCHomeDisplayExtend, then behaves like VCHomeExtend. #define wxSTC_CMD_VCHOMEWRAPEXTEND 2454 /// Copy the line containing the caret. #define wxSTC_CMD_LINECOPY 2455 /// Move to the previous change in capitalisation. #define wxSTC_CMD_WORDPARTLEFT 2390 /// Move to the previous change in capitalisation extending selection /// to new caret position. #define wxSTC_CMD_WORDPARTLEFTEXTEND 2391 /// Move to the change next in capitalisation. #define wxSTC_CMD_WORDPARTRIGHT 2392 /// Move to the next change in capitalisation extending selection /// to new caret position. #define wxSTC_CMD_WORDPARTRIGHTEXTEND 2393 /// Delete back from the current position to the start of the line. #define wxSTC_CMD_DELLINELEFT 2395 /// Delete forwards from the current position to the end of the line. #define wxSTC_CMD_DELLINERIGHT 2396 /// Move caret down one paragraph (delimited by empty lines). #define wxSTC_CMD_PARADOWN 2413 /// Extend selection down one paragraph (delimited by empty lines). #define wxSTC_CMD_PARADOWNEXTEND 2414 /// Move caret up one paragraph (delimited by empty lines). #define wxSTC_CMD_PARAUP 2415 /// Extend selection up one paragraph (delimited by empty lines). #define wxSTC_CMD_PARAUPEXTEND 2416 /// Move caret down one line, extending rectangular selection to new caret position. #define wxSTC_CMD_LINEDOWNRECTEXTEND 2426 /// Move caret up one line, extending rectangular selection to new caret position. #define wxSTC_CMD_LINEUPRECTEXTEND 2427 /// Move caret left one character, extending rectangular selection to new caret position. #define wxSTC_CMD_CHARLEFTRECTEXTEND 2428 /// Move caret right one character, extending rectangular selection to new caret position. #define wxSTC_CMD_CHARRIGHTRECTEXTEND 2429 /// Move caret to first position on line, extending rectangular selection to new caret position. #define wxSTC_CMD_HOMERECTEXTEND 2430 /// Move caret to before first visible character on line. /// If already there move to first character on line. /// In either case, extend rectangular selection to new caret position. #define wxSTC_CMD_VCHOMERECTEXTEND 2431 /// Move caret to last position on line, extending rectangular selection to new caret position. #define wxSTC_CMD_LINEENDRECTEXTEND 2432 /// Move caret one page up, extending rectangular selection to new caret position. #define wxSTC_CMD_PAGEUPRECTEXTEND 2433 /// Move caret one page down, extending rectangular selection to new caret position. #define wxSTC_CMD_PAGEDOWNRECTEXTEND 2434 /// Move caret to top of page, or one page up if already at top of page. #define wxSTC_CMD_STUTTEREDPAGEUP 2435 /// Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. #define wxSTC_CMD_STUTTEREDPAGEUPEXTEND 2436 /// Move caret to bottom of page, or one page down if already at bottom of page. #define wxSTC_CMD_STUTTEREDPAGEDOWN 2437 /// Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. #define wxSTC_CMD_STUTTEREDPAGEDOWNEXTEND 2438 /// Move caret left one word, position cursor at end of word. #define wxSTC_CMD_WORDLEFTEND 2439 /// Move caret left one word, position cursor at end of word, extending selection to new caret position. #define wxSTC_CMD_WORDLEFTENDEXTEND 2440 /// Move caret right one word, position cursor at end of word. #define wxSTC_CMD_WORDRIGHTEND 2441 /// Move caret right one word, position cursor at end of word, extending selection to new caret position. #define wxSTC_CMD_WORDRIGHTENDEXTEND 2442 /// Centre current line in window. #define wxSTC_CMD_VERTICALCENTRECARET 2619 /// Move the selected lines up one line, shifting the line above after the selection #define wxSTC_CMD_MOVESELECTEDLINESUP 2620 /// Move the selected lines down one line, shifting the line below before the selection #define wxSTC_CMD_MOVESELECTEDLINESDOWN 2621 /// Scroll to start of document. #define wxSTC_CMD_SCROLLTOSTART 2628 /// Scroll to end of document. #define wxSTC_CMD_SCROLLTOEND 2629 /// Move caret to before first visible character on display line. /// If already there move to first character on display line. #define wxSTC_CMD_VCHOMEDISPLAY 2652 /// Like VCHomeDisplay but extending selection to new caret position. #define wxSTC_CMD_VCHOMEDISPLAYEXTEND 2653 //}}} //---------------------------------------------------------------------- class ScintillaWX; // forward declare class WordList; struct SCNotification; #ifndef SWIG extern WXDLLIMPEXP_DATA_STC(const char) wxSTCNameStr[]; class WXDLLIMPEXP_FWD_STC wxStyledTextCtrl; class WXDLLIMPEXP_FWD_STC wxStyledTextEvent; #endif //---------------------------------------------------------------------- class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl, #if wxUSE_TEXTCTRL public wxTextCtrlIface #else // !wxUSE_TEXTCTRL public wxTextEntryBase #endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL { public: #ifdef SWIG %pythonAppend wxStyledTextCtrl "self._setOORInfo(self)" %pythonAppend wxStyledTextCtrl() "" wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPySTCNameStr); %RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl()); #else wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSTCNameStr); wxStyledTextCtrl() { m_swx = NULL; } ~wxStyledTextCtrl(); #endif bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSTCNameStr); //---------------------------------------------------------------------- // Generated method declaration section {{{ // Add text to the document at current position. void AddText(const wxString& text); // Add array of cells to document. void AddStyledText(const wxMemoryBuffer& data); // Insert string at a position. void InsertText(int pos, const wxString& text); // Change the text that is being inserted in response to wxSTC_MOD_INSERTCHECK void ChangeInsertion(int length, const wxString& text); // Delete all text in the document. void ClearAll(); // Delete a range of text in the document. void DeleteRange(int start, int lengthDelete); // Set all style bytes to 0, remove all folding information. void ClearDocumentStyle(); // Returns the number of bytes in the document. int GetLength() const; // Returns the character byte at the position. int GetCharAt(int pos) const; // Returns the position of the caret. int GetCurrentPos() const; // Returns the position of the opposite end of the selection to the caret. int GetAnchor() const; // Returns the style byte at the position. int GetStyleAt(int pos) const; // Redoes the next action on the undo history. void Redo() wxOVERRIDE; // Choose between collecting actions into the undo // history and discarding them. void SetUndoCollection(bool collectUndo); // Select all the text in the document. void SelectAll() wxOVERRIDE; // Remember the current position in the undo history as the position // at which the document was saved. void SetSavePoint(); // Retrieve a buffer of cells. wxMemoryBuffer GetStyledText(int startPos, int endPos); // Are there any redoable actions in the undo history? bool CanRedo() const wxOVERRIDE; // Retrieve the line number at which a particular marker is located. int MarkerLineFromHandle(int markerHandle); // Delete a marker. void MarkerDeleteHandle(int markerHandle); // Is undo history being collected? bool GetUndoCollection() const; // Are white space characters currently visible? // Returns one of wxSTC_WS_* constants. int GetViewWhiteSpace() const; // Make white space characters invisible, always visible or visible outside indentation. void SetViewWhiteSpace(int viewWS); // Retrieve the current tab draw mode. // Returns one of wxSTC_TD_* constants. int GetTabDrawMode() const; // Set how tabs are drawn when visible. void SetTabDrawMode(int tabDrawMode); // Find the position from a point within the window. int PositionFromPoint(wxPoint pt) const; // Find the position from a point within the window but return // wxSTC_INVALID_POSITION if not close to text. int PositionFromPointClose(int x, int y); // Set caret to start of a line and ensure it is visible. void GotoLine(int line); // Set caret to a position and ensure it is visible. void GotoPos(int caret); // Set the selection anchor to a position. The anchor is the opposite // end of the selection from the caret. void SetAnchor(int anchor); // Retrieve the text of the line containing the caret. #ifdef SWIG wxString GetCurLine(int* OUTPUT); #else wxString GetCurLine(int* linePos=NULL); #endif // Retrieve the position of the last correctly styled character. int GetEndStyled() const; // Convert all line endings in the document to one mode. void ConvertEOLs(int eolMode); // Retrieve the current end of line mode - one of wxSTC_EOL_CRLF, wxSTC_EOL_CR, or wxSTC_EOL_LF. int GetEOLMode() const; // Set the current end of line mode. void SetEOLMode(int eolMode); // Set the current styling position to start. void StartStyling(int start); // Change style from current styling position for length characters to a style // and move the current styling position to after this newly styled segment. void SetStyling(int length, int style); // Is drawing done first into a buffer or direct to the screen? bool GetBufferedDraw() const; // If drawing is buffered then each line of text is drawn into a bitmap buffer // before drawing it to the screen to avoid flicker. void SetBufferedDraw(bool buffered); // Change the visible size of a tab to be a multiple of the width of a space character. void SetTabWidth(int tabWidth); // Retrieve the visible size of a tab. int GetTabWidth() const; // Clear explicit tabstops on a line. void ClearTabStops(int line); // Add an explicit tab stop for a line. void AddTabStop(int line, int x); // Find the next explicit tab stop position on a line after a position. int GetNextTabStop(int line, int x); // Set the code page used to interpret the bytes of the document as characters. void SetCodePage(int codePage); // Is the IME displayed in a window or inline? int GetIMEInteraction() const; // Choose to display the the IME in a winow or inline. void SetIMEInteraction(int imeInteraction); // Set the symbol used for a particular marker number, // and optionally the fore and background colours. void MarkerDefine(int markerNumber, int markerSymbol, const wxColour& foreground = wxNullColour, const wxColour& background = wxNullColour); // Set the foreground colour used for a particular marker number. void MarkerSetForeground(int markerNumber, const wxColour& fore); // Set the background colour used for a particular marker number. void MarkerSetBackground(int markerNumber, const wxColour& back); // Set the background colour used for a particular marker number when its folding block is selected. void MarkerSetBackgroundSelected(int markerNumber, const wxColour& back); // Enable/disable highlight for current folding bloc (smallest one that contains the caret) void MarkerEnableHighlight(bool enabled); // Add a marker to a line, returning an ID which can be used to find or delete the marker. int MarkerAdd(int line, int markerNumber); // Delete a marker from a line. void MarkerDelete(int line, int markerNumber); // Delete all markers with a particular number from all lines. void MarkerDeleteAll(int markerNumber); // Get a bit mask of all the markers set on a line. int MarkerGet(int line); // Find the next line at or after lineStart that includes a marker in mask. // Return -1 when no more lines. int MarkerNext(int lineStart, int markerMask); // Find the previous line before lineStart that includes a marker in mask. int MarkerPrevious(int lineStart, int markerMask); // Define a marker from a bitmap void MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp); // Add a set of markers to a line. void MarkerAddSet(int line, int markerSet); // Set the alpha used for a marker that is drawn in the text area, not the margin. void MarkerSetAlpha(int markerNumber, int alpha); // Set a margin to be either numeric or symbolic. void SetMarginType(int margin, int marginType); // Retrieve the type of a margin. int GetMarginType(int margin) const; // Set the width of a margin to a width expressed in pixels. void SetMarginWidth(int margin, int pixelWidth); // Retrieve the width of a margin in pixels. int GetMarginWidth(int margin) const; // Set a mask that determines which markers are displayed in a margin. void SetMarginMask(int margin, int mask); // Retrieve the marker mask of a margin. int GetMarginMask(int margin) const; // Make a margin sensitive or insensitive to mouse clicks. void SetMarginSensitive(int margin, bool sensitive); // Retrieve the mouse click sensitivity of a margin. bool GetMarginSensitive(int margin) const; // Set the cursor shown when the mouse is inside a margin. void SetMarginCursor(int margin, int cursor); // Retrieve the cursor shown in a margin. int GetMarginCursor(int margin) const; // Set the background colour of a margin. Only visible for wxSTC_MARGIN_COLOUR. void SetMarginBackground(int margin, const wxColour& back); // Retrieve the background colour of a margin wxColour GetMarginBackground(int margin) const; // Allocate a non-standard number of margins. void SetMarginCount(int margins); // How many margins are there?. int GetMarginCount() const; // Clear all the styles and make equivalent to the global default style. void StyleClearAll(); // Set the foreground colour of a style. void StyleSetForeground(int style, const wxColour& fore); // Set the background colour of a style. void StyleSetBackground(int style, const wxColour& back); // Set a style to be bold or not. void StyleSetBold(int style, bool bold); // Set a style to be italic or not. void StyleSetItalic(int style, bool italic); // Set the size of characters of a style. void StyleSetSize(int style, int sizePoints); // Set the font of a style. void StyleSetFaceName(int style, const wxString& fontName); // Set a style to have its end of line filled or not. void StyleSetEOLFilled(int style, bool eolFilled); // Reset the default style to its state at startup void StyleResetDefault(); // Set a style to be underlined or not. void StyleSetUnderline(int style, bool underline); // Get the foreground colour of a style. wxColour StyleGetForeground(int style) const; // Get the background colour of a style. wxColour StyleGetBackground(int style) const; // Get is a style bold or not. bool StyleGetBold(int style) const; // Get is a style italic or not. bool StyleGetItalic(int style) const; // Get the size of characters of a style. int StyleGetSize(int style) const; // Get the font facename of a style wxString StyleGetFaceName(int style); // Get is a style to have its end of line filled or not. bool StyleGetEOLFilled(int style) const; // Get is a style underlined or not. bool StyleGetUnderline(int style) const; // Get is a style mixed case, or to force upper or lower case. int StyleGetCase(int style) const; // Get the character get of the font in a style. int StyleGetCharacterSet(int style) const; // Get is a style visible or not. bool StyleGetVisible(int style) const; // Get is a style changeable or not (read only). // Experimental feature, currently buggy. bool StyleGetChangeable(int style) const; // Get is a style a hotspot or not. bool StyleGetHotSpot(int style) const; // Set a style to be mixed case, or to force upper or lower case. void StyleSetCase(int style, int caseVisible); // Set the size of characters of a style. Size is in points multiplied by 100. void StyleSetSizeFractional(int style, int sizeHundredthPoints); // Get the size of characters of a style in points multiplied by 100 int StyleGetSizeFractional(int style) const; // Set the weight of characters of a style. void StyleSetWeight(int style, int weight); // Get the weight of characters of a style. int StyleGetWeight(int style) const; // Set the character set of the font in a style. void StyleSetCharacterSet(int style, int characterSet); // Set a style to be a hotspot or not. void StyleSetHotSpot(int style, bool hotspot); // Set the foreground colour of the main and additional selections and whether to use this setting. void SetSelForeground(bool useSetting, const wxColour& fore); // Set the background colour of the main and additional selections and whether to use this setting. void SetSelBackground(bool useSetting, const wxColour& back); // Get the alpha of the selection. int GetSelAlpha() const; // Set the alpha of the selection. void SetSelAlpha(int alpha); // Is the selection end of line filled? bool GetSelEOLFilled() const; // Set the selection to have its end of line filled or not. void SetSelEOLFilled(bool filled); // Set the foreground colour of the caret. void SetCaretForeground(const wxColour& fore); // When key+modifier combination keyDefinition is pressed perform sciCommand. void CmdKeyAssign(int key, int modifiers, int cmd); // When key+modifier combination keyDefinition is pressed do nothing. void CmdKeyClear(int key, int modifiers); // Drop all key mappings. void CmdKeyClearAll(); // Set the styles for a segment of the document. void SetStyleBytes(int length, char* styleBytes); // Set a style to be visible or not. void StyleSetVisible(int style, bool visible); // Get the time in milliseconds that the caret is on and off. int GetCaretPeriod() const; // Get the time in milliseconds that the caret is on and off. 0 = steady on. void SetCaretPeriod(int periodMilliseconds); // Set the set of characters making up words for when moving or selecting by word. // First sets defaults like SetCharsDefault. void SetWordChars(const wxString& characters); // Get the set of characters making up words for when moving or selecting by word. wxString GetWordChars() const; // Start a sequence of actions that is undone and redone as a unit. // May be nested. void BeginUndoAction(); // End a sequence of actions that is undone and redone as a unit. void EndUndoAction(); // Set an indicator to plain, squiggle or TT. void IndicatorSetStyle(int indicator, int indicatorStyle); // Retrieve the style of an indicator. int IndicatorGetStyle(int indicator) const; // Set the foreground colour of an indicator. void IndicatorSetForeground(int indicator, const wxColour& fore); // Retrieve the foreground colour of an indicator. wxColour IndicatorGetForeground(int indicator) const; // Set an indicator to draw under text or over(default). void IndicatorSetUnder(int indicator, bool under); // Retrieve whether indicator drawn under or over text. bool IndicatorGetUnder(int indicator) const; // Set a hover indicator to plain, squiggle or TT. void IndicatorSetHoverStyle(int indicator, int indicatorStyle); // Retrieve the hover style of an indicator. int IndicatorGetHoverStyle(int indicator) const; // Set the foreground hover colour of an indicator. void IndicatorSetHoverForeground(int indicator, const wxColour& fore); // Retrieve the foreground hover colour of an indicator. wxColour IndicatorGetHoverForeground(int indicator) const; // Set the attributes of an indicator. void IndicatorSetFlags(int indicator, int flags); // Retrieve the attributes of an indicator. int IndicatorGetFlags(int indicator) const; // Set the foreground colour of all whitespace and whether to use this setting. void SetWhitespaceForeground(bool useSetting, const wxColour& fore); // Set the background colour of all whitespace and whether to use this setting. void SetWhitespaceBackground(bool useSetting, const wxColour& back); // Set the size of the dots used to mark space characters. void SetWhitespaceSize(int size); // Get the size of the dots used to mark space characters. int GetWhitespaceSize() const; // Divide each styling byte into lexical class bits (default: 5) and indicator // bits (default: 3). If a lexer requires more than 32 lexical states, then this // is used to expand the possible states. wxDEPRECATED_MSG( "This method uses a function deprecated in the Scintilla library." ) void SetStyleBits(int bits); // Retrieve number of bits in style bytes used to hold the lexical state. wxDEPRECATED_MSG( "This method uses a function deprecated in the Scintilla library." ) int GetStyleBits() const; // Used to hold extra styling information for each line. void SetLineState(int line, int state); // Retrieve the extra styling information for a line. int GetLineState(int line) const; // Retrieve the last line number that has line state. int GetMaxLineState() const; // Is the background of the line containing the caret in a different colour? bool GetCaretLineVisible() const; // Display the background of the line containing the caret in a different colour. void SetCaretLineVisible(bool show); // Get the colour of the background of the line containing the caret. wxColour GetCaretLineBackground() const; // Set the colour of the background of the line containing the caret. void SetCaretLineBackground(const wxColour& back); // Set a style to be changeable or not (read only). // Experimental feature, currently buggy. void StyleSetChangeable(int style, bool changeable); // Display a auto-completion list. // The lengthEntered parameter indicates how many characters before // the caret should be used to provide context. void AutoCompShow(int lengthEntered, const wxString& itemList); // Remove the auto-completion list from the screen. void AutoCompCancel(); // Is there an auto-completion list visible? bool AutoCompActive(); // Retrieve the position of the caret when the auto-completion list was displayed. int AutoCompPosStart(); // User has selected an item so remove the list and insert the selection. void AutoCompComplete(); // Define a set of character that when typed cancel the auto-completion list. void AutoCompStops(const wxString& characterSet); // Change the separator character in the string setting up an auto-completion list. // Default is space but can be changed if items contain space. void AutoCompSetSeparator(int separatorCharacter); // Retrieve the auto-completion list separator character. int AutoCompGetSeparator() const; // Select the item in the auto-completion list that starts with a string. void AutoCompSelect(const wxString& select); // Should the auto-completion list be cancelled if the user backspaces to a // position before where the box was created. void AutoCompSetCancelAtStart(bool cancel); // Retrieve whether auto-completion cancelled by backspacing before start. bool AutoCompGetCancelAtStart() const; // Define a set of characters that when typed will cause the autocompletion to // choose the selected item. void AutoCompSetFillUps(const wxString& characterSet); // Should a single item auto-completion list automatically choose the item. void AutoCompSetChooseSingle(bool chooseSingle); // Retrieve whether a single item auto-completion list automatically choose the item. bool AutoCompGetChooseSingle() const; // Set whether case is significant when performing auto-completion searches. void AutoCompSetIgnoreCase(bool ignoreCase); // Retrieve state of ignore case flag. bool AutoCompGetIgnoreCase() const; // Display a list of strings and send notification when user chooses one. void UserListShow(int listType, const wxString& itemList); // Set whether or not autocompletion is hidden automatically when nothing matches. void AutoCompSetAutoHide(bool autoHide); // Retrieve whether or not autocompletion is hidden automatically when nothing matches. bool AutoCompGetAutoHide() const; // Set whether or not autocompletion deletes any word characters // after the inserted text upon completion. void AutoCompSetDropRestOfWord(bool dropRestOfWord); // Retrieve whether or not autocompletion deletes any word characters // after the inserted text upon completion. bool AutoCompGetDropRestOfWord() const; // Register an image for use in autocompletion lists. void RegisterImage(int type, const wxBitmap& bmp); // Clear all the registered images. void ClearRegisteredImages(); // Retrieve the auto-completion list type-separator character. int AutoCompGetTypeSeparator() const; // Change the type-separator character in the string setting up an auto-completion list. // Default is '?' but can be changed if items contain '?'. void AutoCompSetTypeSeparator(int separatorCharacter); // Set the maximum width, in characters, of auto-completion and user lists. // Set to 0 to autosize to fit longest item, which is the default. void AutoCompSetMaxWidth(int characterCount); // Get the maximum width, in characters, of auto-completion and user lists. int AutoCompGetMaxWidth() const; // Set the maximum height, in rows, of auto-completion and user lists. // The default is 5 rows. void AutoCompSetMaxHeight(int rowCount); // Set the maximum height, in rows, of auto-completion and user lists. int AutoCompGetMaxHeight() const; // Set the number of spaces used for one level of indentation. void SetIndent(int indentSize); // Retrieve indentation size. int GetIndent() const; // Indentation will only use space characters if useTabs is false, otherwise // it will use a combination of tabs and spaces. void SetUseTabs(bool useTabs); // Retrieve whether tabs will be used in indentation. bool GetUseTabs() const; // Change the indentation of a line to a number of columns. void SetLineIndentation(int line, int indentation); // Retrieve the number of columns that a line is indented. int GetLineIndentation(int line) const; // Retrieve the position before the first non indentation character on a line. int GetLineIndentPosition(int line) const; // Retrieve the column number of a position, taking tab width into account. int GetColumn(int pos) const; // Count characters between two positions. int CountCharacters(int start, int end); // Show or hide the horizontal scroll bar. void SetUseHorizontalScrollBar(bool visible); // Is the horizontal scroll bar visible? bool GetUseHorizontalScrollBar() const; // Show or hide indentation guides. void SetIndentationGuides(int indentView); // Are the indentation guides visible? int GetIndentationGuides() const; // Set the highlighted indentation guide column. // 0 = no highlighted guide. void SetHighlightGuide(int column); // Get the highlighted indentation guide column. int GetHighlightGuide() const; // Get the position after the last visible characters on a line. int GetLineEndPosition(int line) const; // Get the code page used to interpret the bytes of the document as characters. int GetCodePage() const; // Get the foreground colour of the caret. wxColour GetCaretForeground() const; // In read-only mode? bool GetReadOnly() const; // Sets the position of the caret. void SetCurrentPos(int caret); // Sets the position that starts the selection - this becomes the anchor. void SetSelectionStart(int anchor); // Returns the position at the start of the selection. int GetSelectionStart() const; // Sets the position that ends the selection - this becomes the caret. void SetSelectionEnd(int caret); // Returns the position at the end of the selection. int GetSelectionEnd() const; // Set caret to a position, while removing any existing selection. void SetEmptySelection(int caret); // Sets the print magnification added to the point size of each style for printing. void SetPrintMagnification(int magnification); // Returns the print magnification. int GetPrintMagnification() const; // Modify colours when printing for clearer printed text. void SetPrintColourMode(int mode); // Returns the print colour mode. int GetPrintColourMode() const; // Find some text in the document. int FindText(int minPos, int maxPos, const wxString& text, int flags=0, int* findEnd=NULL); // On Windows, will draw the document into a display context such as a printer. int FormatRange(bool doDraw, int startPos, int endPos, wxDC* draw, wxDC* target, wxRect renderRect, wxRect pageRect); // Retrieve the display line at the top of the display. int GetFirstVisibleLine() const; // Retrieve the contents of a line. wxString GetLine(int line) const; // Returns the number of lines in the document. There is always at least one. int GetLineCount() const; // Sets the size in pixels of the left margin. void SetMarginLeft(int pixelWidth); // Returns the size in pixels of the left margin. int GetMarginLeft() const; // Sets the size in pixels of the right margin. void SetMarginRight(int pixelWidth); // Returns the size in pixels of the right margin. int GetMarginRight() const; // Is the document different from when it was last saved? bool GetModify() const; // Retrieve the selected text. wxString GetSelectedText(); // Retrieve a range of text. wxString GetTextRange(int startPos, int endPos); // Draw the selection in normal style or with selection highlighted. void HideSelection(bool hide); // Retrieve the point in the window where a position is displayed. wxPoint PointFromPosition(int pos); // Retrieve the line containing a position. int LineFromPosition(int pos) const; // Retrieve the position at the start of a line. int PositionFromLine(int line) const; // Scroll horizontally and vertically. void LineScroll(int columns, int lines); // Ensure the caret is visible. void EnsureCaretVisible(); // Scroll the argument positions and the range between them into view giving // priority to the primary position then the secondary position. // This may be used to make a search match visible. void ScrollRange(int secondary, int primary); // Replace the selected text with the argument text. void ReplaceSelection(const wxString& text); // Set to read only or read write. void SetReadOnly(bool readOnly); // Will a paste succeed? bool CanPaste() const wxOVERRIDE; // Are there any undoable actions in the undo history? bool CanUndo() const wxOVERRIDE; // Delete the undo history. void EmptyUndoBuffer(); // Undo one action in the undo history. void Undo() wxOVERRIDE; // Cut the selection to the clipboard. void Cut() wxOVERRIDE; // Copy the selection to the clipboard. void Copy() wxOVERRIDE; // Paste the contents of the clipboard into the document replacing the selection. void Paste() wxOVERRIDE; // Clear the selection. void Clear() wxOVERRIDE; // Replace the contents of the document with the argument text. void SetText(const wxString& text); // Retrieve all the text in the document. wxString GetText() const; // Retrieve the number of characters in the document. int GetTextLength() const; // Retrieve a pointer to a function that processes messages for this Scintilla. void* GetDirectFunction() const; // Retrieve a pointer value to use as the first argument when calling // the function returned by GetDirectFunction. void* GetDirectPointer() const; // Set to overtype (true) or insert mode. void SetOvertype(bool overType); // Returns true if overtype mode is active otherwise false is returned. bool GetOvertype() const; // Set the width of the insert mode caret. void SetCaretWidth(int pixelWidth); // Returns the width of the insert mode caret. int GetCaretWidth() const; // Sets the position that starts the target which is used for updating the // document without affecting the scroll position. void SetTargetStart(int start); // Get the position that starts the target. int GetTargetStart() const; // Sets the position that ends the target which is used for updating the // document without affecting the scroll position. void SetTargetEnd(int end); // Get the position that ends the target. int GetTargetEnd() const; // Sets both the start and end of the target in one call. void SetTargetRange(int start, int end); // Retrieve the text in the target. wxString GetTargetText() const; // Make the target range start and end be the same as the selection range start and end. void TargetFromSelection(); // Sets the target to the whole document. void TargetWholeDocument(); // Replace the target text with the argument text. // Text is counted so it can contain NULs. // Returns the length of the replacement text. int ReplaceTarget(const wxString& text); // Replace the target text with the argument text after \\d processing. // Text is counted so it can contain NULs. // Looks for \\d where d is between 1 and 9 and replaces these with the strings // matched in the last search operation which were surrounded by \\( and \\). // Returns the length of the replacement text including any change // caused by processing the \\d patterns. int ReplaceTargetRE(const wxString& text); // Search for a counted string in the target and set the target to the found // range. Text is counted so it can contain NULs. // Returns length of range or -1 for failure in which case target is not moved. int SearchInTarget(const wxString& text); // Set the search flags used by SearchInTarget. void SetSearchFlags(int searchFlags); // Get the search flags used by SearchInTarget. int GetSearchFlags() const; // Show a call tip containing a definition near position pos. void CallTipShow(int pos, const wxString& definition); // Remove the call tip from the screen. void CallTipCancel(); // Is there an active call tip? bool CallTipActive(); // Retrieve the position where the caret was before displaying the call tip. int CallTipPosAtStart(); // Set the start position in order to change when backspacing removes the calltip. void CallTipSetPosAtStart(int posStart); // Highlight a segment of the definition. void CallTipSetHighlight(int highlightStart, int highlightEnd); // Set the background colour for the call tip. void CallTipSetBackground(const wxColour& back); // Set the foreground colour for the call tip. void CallTipSetForeground(const wxColour& fore); // Set the foreground colour for the highlighted part of the call tip. void CallTipSetForegroundHighlight(const wxColour& fore); // Enable use of wxSTC_STYLE_CALLTIP and set call tip tab size in pixels. void CallTipUseStyle(int tabSize); // Set position of calltip, above or below text. void CallTipSetPosition(bool above); // Find the display line of a document line taking hidden lines into account. int VisibleFromDocLine(int docLine); // Find the document line of a display line taking hidden lines into account. int DocLineFromVisible(int displayLine); // The number of display lines needed to wrap a document line int WrapCount(int docLine); // Set the fold level of a line. // This encodes an integer level along with flags indicating whether the // line is a header and whether it is effectively white space. void SetFoldLevel(int line, int level); // Retrieve the fold level of a line. int GetFoldLevel(int line) const; // Find the last child line of a header line. int GetLastChild(int line, int level) const; // Find the parent line of a child line. int GetFoldParent(int line) const; // Make a range of lines visible. void ShowLines(int lineStart, int lineEnd); // Make a range of lines invisible. void HideLines(int lineStart, int lineEnd); // Is a line visible? bool GetLineVisible(int line) const; // Are all lines visible? bool GetAllLinesVisible() const; // Show the children of a header line. void SetFoldExpanded(int line, bool expanded); // Is a header line expanded? bool GetFoldExpanded(int line) const; // Switch a header line between expanded and contracted. void ToggleFold(int line); // Switch a header line between expanded and contracted and show some text after the line. void ToggleFoldShowText(int line, const wxString& text); // Set the style of fold display text void FoldDisplayTextSetStyle(int style); // Expand or contract a fold header. void FoldLine(int line, int action); // Expand or contract a fold header and its children. void FoldChildren(int line, int action); // Expand a fold header and all children. Use the level argument instead of the line's current level. void ExpandChildren(int line, int level); // Expand or contract all fold headers. void FoldAll(int action); // Ensure a particular line is visible by expanding any header line hiding it. void EnsureVisible(int line); // Set automatic folding behaviours. void SetAutomaticFold(int automaticFold); // Get automatic folding behaviours. int GetAutomaticFold() const; // Set some style options for folding. void SetFoldFlags(int flags); // Ensure a particular line is visible by expanding any header line hiding it. // Use the currently set visibility policy to determine which range to display. void EnsureVisibleEnforcePolicy(int line); // Sets whether a tab pressed when caret is within indentation indents. void SetTabIndents(bool tabIndents); // Does a tab pressed when caret is within indentation indent? bool GetTabIndents() const; // Sets whether a backspace pressed when caret is within indentation unindents. void SetBackSpaceUnIndents(bool bsUnIndents); // Does a backspace pressed when caret is within indentation unindent? bool GetBackSpaceUnIndents() const; // Sets the time the mouse must sit still to generate a mouse dwell event. void SetMouseDwellTime(int periodMilliseconds); // Retrieve the time the mouse must sit still to generate a mouse dwell event. int GetMouseDwellTime() const; // Get position of start of word. int WordStartPosition(int pos, bool onlyWordCharacters); // Get position of end of word. int WordEndPosition(int pos, bool onlyWordCharacters); // Is the range start..end considered a word? bool IsRangeWord(int start, int end); // Sets limits to idle styling. void SetIdleStyling(int idleStyling); // Retrieve the limits to idle styling. int GetIdleStyling() const; // Sets whether text is word wrapped. void SetWrapMode(int wrapMode); // Retrieve whether text is word wrapped. int GetWrapMode() const; // Set the display mode of visual flags for wrapped lines. void SetWrapVisualFlags(int wrapVisualFlags); // Retrive the display mode of visual flags for wrapped lines. int GetWrapVisualFlags() const; // Set the location of visual flags for wrapped lines. void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation); // Retrive the location of visual flags for wrapped lines. int GetWrapVisualFlagsLocation() const; // Set the start indent for wrapped lines. void SetWrapStartIndent(int indent); // Retrive the start indent for wrapped lines. int GetWrapStartIndent() const; // Sets how wrapped sublines are placed. Default is wxSTC_WRAPINDENT_FIXED. void SetWrapIndentMode(int wrapIndentMode); // Retrieve how wrapped sublines are placed. Default is wxSTC_WRAPINDENT_FIXED. int GetWrapIndentMode() const; // Sets the degree of caching of layout information. void SetLayoutCache(int cacheMode); // Retrieve the degree of caching of layout information. int GetLayoutCache() const; // Sets the document width assumed for scrolling. void SetScrollWidth(int pixelWidth); // Retrieve the document width assumed for scrolling. int GetScrollWidth() const; // Sets whether the maximum width line displayed is used to set scroll width. void SetScrollWidthTracking(bool tracking); // Retrieve whether the scroll width tracks wide lines. bool GetScrollWidthTracking() const; // Measure the pixel width of some text in a particular style. // Does not handle tab or control characters. int TextWidth(int style, const wxString& text); // Sets the scroll range so that maximum scroll position has // the last line at the bottom of the view (default). // Setting this to false allows scrolling one page below the last line. void SetEndAtLastLine(bool endAtLastLine); // Retrieve whether the maximum scroll position has the last // line at the bottom of the view. bool GetEndAtLastLine() const; // Retrieve the height of a particular line of text in pixels. int TextHeight(int line); // Show or hide the vertical scroll bar. void SetUseVerticalScrollBar(bool visible); // Is the vertical scroll bar visible? bool GetUseVerticalScrollBar() const; // Append a string to the end of the document without changing the selection. void AppendText(const wxString& text) wxOVERRIDE; // Is drawing done in two phases with backgrounds drawn before foregrounds? bool GetTwoPhaseDraw() const; // In twoPhaseDraw mode, drawing is performed in two phases, first the background // and then the foreground. This avoids chopping off characters that overlap the next run. void SetTwoPhaseDraw(bool twoPhase); // How many phases is drawing done in? int GetPhasesDraw() const; // In one phase draw, text is drawn in a series of rectangular blocks with no overlap. // In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. // In multiple phase draw, each element is drawn over the whole drawing area, allowing text // to overlap from one line to the next. void SetPhasesDraw(int phases); // Choose the quality level for text. void SetFontQuality(int fontQuality); // Retrieve the quality level for text. int GetFontQuality() const; // Scroll so that a display line is at the top of the display. void SetFirstVisibleLine(int displayLine); // Change the effect of pasting when there are multiple selections. void SetMultiPaste(int multiPaste); // Retrieve the effect of pasting when there are multiple selections. int GetMultiPaste() const; // Retrieve the value of a tag from a regular expression search. wxString GetTag(int tagNumber) const; // Join the lines in the target. void LinesJoin(); // Split the lines in the target into lines that are less wide than pixelWidth // where possible. void LinesSplit(int pixelWidth); // Set one of the colours used as a chequerboard pattern in the fold margin void SetFoldMarginColour(bool useSetting, const wxColour& back); // Set the other colour used as a chequerboard pattern in the fold margin void SetFoldMarginHiColour(bool useSetting, const wxColour& fore); // Move caret down one line. void LineDown(); // Move caret down one line extending selection to new caret position. void LineDownExtend(); // Move caret up one line. void LineUp(); // Move caret up one line extending selection to new caret position. void LineUpExtend(); // Move caret left one character. void CharLeft(); // Move caret left one character extending selection to new caret position. void CharLeftExtend(); // Move caret right one character. void CharRight(); // Move caret right one character extending selection to new caret position. void CharRightExtend(); // Move caret left one word. void WordLeft(); // Move caret left one word extending selection to new caret position. void WordLeftExtend(); // Move caret right one word. void WordRight(); // Move caret right one word extending selection to new caret position. void WordRightExtend(); // Move caret to first position on line. void Home(); // Move caret to first position on line extending selection to new caret position. void HomeExtend(); // Move caret to last position on line. void LineEnd(); // Move caret to last position on line extending selection to new caret position. void LineEndExtend(); // Move caret to first position in document. void DocumentStart(); // Move caret to first position in document extending selection to new caret position. void DocumentStartExtend(); // Move caret to last position in document. void DocumentEnd(); // Move caret to last position in document extending selection to new caret position. void DocumentEndExtend(); // Move caret one page up. void PageUp(); // Move caret one page up extending selection to new caret position. void PageUpExtend(); // Move caret one page down. void PageDown(); // Move caret one page down extending selection to new caret position. void PageDownExtend(); // Switch from insert to overtype mode or the reverse. void EditToggleOvertype(); // Cancel any modes such as call tip or auto-completion list display. void Cancel(); // Delete the selection or if no selection, the character before the caret. void DeleteBack(); // If selection is empty or all on one line replace the selection with a tab character. // If more than one line selected, indent the lines. void Tab(); // Dedent the selected lines. void BackTab(); // Insert a new line, may use a CRLF, CR or LF depending on EOL mode. void NewLine(); // Insert a Form Feed character. void FormFeed(); // Move caret to before first visible character on line. // If already there move to first character on line. void VCHome(); // Like VCHome but extending selection to new caret position. void VCHomeExtend(); // Magnify the displayed text by increasing the sizes by 1 point. void ZoomIn(); // Make the displayed text smaller by decreasing the sizes by 1 point. void ZoomOut(); // Delete the word to the left of the caret. void DelWordLeft(); // Delete the word to the right of the caret. void DelWordRight(); // Delete the word to the right of the caret, but not the trailing non-word characters. void DelWordRightEnd(); // Cut the line containing the caret. void LineCut(); // Delete the line containing the caret. void LineDelete(); // Switch the current line with the previous. void LineTranspose(); // Duplicate the current line. void LineDuplicate(); // Transform the selection to lower case. void LowerCase(); // Transform the selection to upper case. void UpperCase(); // Scroll the document down, keeping the caret visible. void LineScrollDown(); // Scroll the document up, keeping the caret visible. void LineScrollUp(); // Delete the selection or if no selection, the character before the caret. // Will not delete the character before at the start of a line. void DeleteBackNotLine(); // Move caret to first position on display line. void HomeDisplay(); // Move caret to first position on display line extending selection to // new caret position. void HomeDisplayExtend(); // Move caret to last position on display line. void LineEndDisplay(); // Move caret to last position on display line extending selection to new // caret position. void LineEndDisplayExtend(); // Like Home but when word-wrap is enabled goes first to start of display line // HomeDisplay, then to start of document line Home. void HomeWrap(); // Like HomeExtend but when word-wrap is enabled extends first to start of display line // HomeDisplayExtend, then to start of document line HomeExtend. void HomeWrapExtend(); // Like LineEnd but when word-wrap is enabled goes first to end of display line // LineEndDisplay, then to start of document line LineEnd. void LineEndWrap(); // Like LineEndExtend but when word-wrap is enabled extends first to end of display line // LineEndDisplayExtend, then to start of document line LineEndExtend. void LineEndWrapExtend(); // Like VCHome but when word-wrap is enabled goes first to start of display line // VCHomeDisplay, then behaves like VCHome. void VCHomeWrap(); // Like VCHomeExtend but when word-wrap is enabled extends first to start of display line // VCHomeDisplayExtend, then behaves like VCHomeExtend. void VCHomeWrapExtend(); // Copy the line containing the caret. void LineCopy(); // Move the caret inside current view if it's not there already. void MoveCaretInsideView(); // How many characters are on a line, including end of line characters? int LineLength(int line) const; // Highlight the characters at two positions. void BraceHighlight(int posA, int posB); // Use specified indicator to highlight matching braces instead of changing their style. void BraceHighlightIndicator(bool useSetting, int indicator); // Highlight the character at a position indicating there is no matching brace. void BraceBadLight(int pos); // Use specified indicator to highlight non matching brace instead of changing its style. void BraceBadLightIndicator(bool useSetting, int indicator); // Find the position of a matching brace or wxSTC_INVALID_POSITION if no match. // The maxReStyle must be 0 for now. It may be defined in a future release. int BraceMatch(int pos, int maxReStyle=0); // Are the end of line characters visible? bool GetViewEOL() const; // Make the end of line characters visible or invisible. void SetViewEOL(bool visible); // Retrieve a pointer to the document object. void* GetDocPointer(); // Change the document object used. void SetDocPointer(void* docPointer); // Set which document modification events are sent to the container. void SetModEventMask(int eventMask); // Retrieve the column number which text should be kept within. int GetEdgeColumn() const; // Set the column number of the edge. // If text goes past the edge then it is highlighted. void SetEdgeColumn(int column); // Retrieve the edge highlight mode. int GetEdgeMode() const; // The edge may be displayed by a line (wxSTC_EDGE_LINE/wxSTC_EDGE_MULTILINE) or by highlighting text that // goes beyond it (wxSTC_EDGE_BACKGROUND) or not displayed at all (wxSTC_EDGE_NONE). void SetEdgeMode(int edgeMode); // Retrieve the colour used in edge indication. wxColour GetEdgeColour() const; // Change the colour used in edge indication. void SetEdgeColour(const wxColour& edgeColour); // Add a new vertical edge to the view. void MultiEdgeAddLine(int column, const wxColour& edgeColour); // Clear all vertical edges. void MultiEdgeClearAll(); // Sets the current caret position to be the search anchor. void SearchAnchor(); // Find some text starting at the search anchor. // Does not ensure the selection is visible. int SearchNext(int searchFlags, const wxString& text); // Find some text starting at the search anchor and moving backwards. // Does not ensure the selection is visible. int SearchPrev(int searchFlags, const wxString& text); // Retrieves the number of lines completely visible. int LinesOnScreen() const; // Set whether a pop up menu is displayed automatically when the user presses // the wrong mouse button on certain areas. void UsePopUp(int popUpMode); // Is the selection rectangular? The alternative is the more common stream selection. bool SelectionIsRectangle() const; // Set the zoom level. This number of points is added to the size of all fonts. // It may be positive to magnify or negative to reduce. void SetZoom(int zoomInPoints); // Retrieve the zoom level. int GetZoom() const; // Create a new document object. // Starts with reference count of 1 and not selected into editor. void* CreateDocument(); // Extend life of document. void AddRefDocument(void* docPointer); // Release a reference to the document, deleting document if it fades to black. void ReleaseDocument(void* docPointer); // Get which document modification events are sent to the container. int GetModEventMask() const; // Change internal focus flag. void SetSTCFocus(bool focus); // Get internal focus flag. bool GetSTCFocus() const; // Change error status - 0 = OK. void SetStatus(int status); // Get error status. int GetStatus() const; // Set whether the mouse is captured when its button is pressed. void SetMouseDownCaptures(bool captures); // Get whether mouse gets captured. bool GetMouseDownCaptures() const; // Set whether the mouse wheel can be active outside the window. void SetMouseWheelCaptures(bool captures); // Get whether mouse wheel can be active outside the window. bool GetMouseWheelCaptures() const; // Sets the cursor to one of the wxSTC_CURSOR* values. void SetSTCCursor(int cursorType); // Get cursor type. int GetSTCCursor() const; // Change the way control characters are displayed: // If symbol is < 32, keep the drawn way, else, use the given character. void SetControlCharSymbol(int symbol); // Get the way control characters are displayed. int GetControlCharSymbol() const; // Move to the previous change in capitalisation. void WordPartLeft(); // Move to the previous change in capitalisation extending selection // to new caret position. void WordPartLeftExtend(); // Move to the change next in capitalisation. void WordPartRight(); // Move to the next change in capitalisation extending selection // to new caret position. void WordPartRightExtend(); // Set the way the display area is determined when a particular line // is to be moved to by Find, FindNext, GotoLine, etc. void SetVisiblePolicy(int visiblePolicy, int visibleSlop); // Delete back from the current position to the start of the line. void DelLineLeft(); // Delete forwards from the current position to the end of the line. void DelLineRight(); // Set the xOffset (ie, horizontal scroll position). void SetXOffset(int xOffset); // Get the xOffset (ie, horizontal scroll position). int GetXOffset() const; // Set the last x chosen value to be the caret x position. void ChooseCaretX(); // Set the way the caret is kept visible when going sideways. // The exclusion zone is given in pixels. void SetXCaretPolicy(int caretPolicy, int caretSlop); // Set the way the line the caret is on is kept visible. // The exclusion zone is given in lines. void SetYCaretPolicy(int caretPolicy, int caretSlop); // Set printing to line wrapped (wxSTC_WRAP_WORD) or not line wrapped (wxSTC_WRAP_NONE). void SetPrintWrapMode(int wrapMode); // Is printing line wrapped? int GetPrintWrapMode() const; // Set a fore colour for active hotspots. void SetHotspotActiveForeground(bool useSetting, const wxColour& fore); // Get the fore colour for active hotspots. wxColour GetHotspotActiveForeground() const; // Set a back colour for active hotspots. void SetHotspotActiveBackground(bool useSetting, const wxColour& back); // Get the back colour for active hotspots. wxColour GetHotspotActiveBackground() const; // Enable / Disable underlining active hotspots. void SetHotspotActiveUnderline(bool underline); // Get whether underlining for active hotspots. bool GetHotspotActiveUnderline() const; // Limit hotspots to single line so hotspots on two lines don't merge. void SetHotspotSingleLine(bool singleLine); // Get the HotspotSingleLine property bool GetHotspotSingleLine() const; // Move caret down one paragraph (delimited by empty lines). void ParaDown(); // Extend selection down one paragraph (delimited by empty lines). void ParaDownExtend(); // Move caret up one paragraph (delimited by empty lines). void ParaUp(); // Extend selection up one paragraph (delimited by empty lines). void ParaUpExtend(); // Given a valid document position, return the previous position taking code // page into account. Returns 0 if passed 0. int PositionBefore(int pos); // Given a valid document position, return the next position taking code // page into account. Maximum value returned is the last position in the document. int PositionAfter(int pos); // Given a valid document position, return a position that differs in a number // of characters. Returned value is always between 0 and last position in document. int PositionRelative(int pos, int relative); // Copy a range of text to the clipboard. Positions are clipped into the document. void CopyRange(int start, int end); // Copy argument text to the clipboard. void CopyText(int length, const wxString& text); // Set the selection mode to stream (wxSTC_SEL_STREAM) or rectangular (wxSTC_SEL_RECTANGLE/wxSTC_SEL_THIN) or // by lines (wxSTC_SEL_LINES). void SetSelectionMode(int selectionMode); // Get the mode of the current selection. int GetSelectionMode() const; // Retrieve the position of the start of the selection at the given line (wxSTC_INVALID_POSITION if no selection on this line). int GetLineSelStartPosition(int line); // Retrieve the position of the end of the selection at the given line (wxSTC_INVALID_POSITION if no selection on this line). int GetLineSelEndPosition(int line); // Move caret down one line, extending rectangular selection to new caret position. void LineDownRectExtend(); // Move caret up one line, extending rectangular selection to new caret position. void LineUpRectExtend(); // Move caret left one character, extending rectangular selection to new caret position. void CharLeftRectExtend(); // Move caret right one character, extending rectangular selection to new caret position. void CharRightRectExtend(); // Move caret to first position on line, extending rectangular selection to new caret position. void HomeRectExtend(); // Move caret to before first visible character on line. // If already there move to first character on line. // In either case, extend rectangular selection to new caret position. void VCHomeRectExtend(); // Move caret to last position on line, extending rectangular selection to new caret position. void LineEndRectExtend(); // Move caret one page up, extending rectangular selection to new caret position. void PageUpRectExtend(); // Move caret one page down, extending rectangular selection to new caret position. void PageDownRectExtend(); // Move caret to top of page, or one page up if already at top of page. void StutteredPageUp(); // Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. void StutteredPageUpExtend(); // Move caret to bottom of page, or one page down if already at bottom of page. void StutteredPageDown(); // Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. void StutteredPageDownExtend(); // Move caret left one word, position cursor at end of word. void WordLeftEnd(); // Move caret left one word, position cursor at end of word, extending selection to new caret position. void WordLeftEndExtend(); // Move caret right one word, position cursor at end of word. void WordRightEnd(); // Move caret right one word, position cursor at end of word, extending selection to new caret position. void WordRightEndExtend(); // Set the set of characters making up whitespace for when moving or selecting by word. // Should be called after SetWordChars. void SetWhitespaceChars(const wxString& characters); // Get the set of characters making up whitespace for when moving or selecting by word. wxString GetWhitespaceChars() const; // Set the set of characters making up punctuation characters // Should be called after SetWordChars. void SetPunctuationChars(const wxString& characters); // Get the set of characters making up punctuation characters wxString GetPunctuationChars() const; // Reset the set of characters for whitespace and word characters to the defaults. void SetCharsDefault(); // Get currently selected item position in the auto-completion list int AutoCompGetCurrent() const; // Get currently selected item text in the auto-completion list wxString AutoCompGetCurrentText() const; // Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. void AutoCompSetCaseInsensitiveBehaviour(int behaviour); // Get auto-completion case insensitive behaviour. int AutoCompGetCaseInsensitiveBehaviour() const; // Change the effect of autocompleting when there are multiple selections. void AutoCompSetMulti(int multi); // Retrieve the effect of autocompleting when there are multiple selections. int AutoCompGetMulti() const; // Set the way autocompletion lists are ordered. void AutoCompSetOrder(int order); // Get the way autocompletion lists are ordered. int AutoCompGetOrder() const; // Enlarge the document to a particular size of text bytes. void Allocate(int bytes); // Find the position of a column on a line taking into account tabs and // multi-byte characters. If beyond end of line, return line end position. int FindColumn(int line, int column); // Can the caret preferred x position only be changed by explicit movement commands? int GetCaretSticky() const; // Stop the caret preferred x position changing when the user types. void SetCaretSticky(int useCaretStickyBehaviour); // Switch between sticky and non-sticky: meant to be bound to a key. void ToggleCaretSticky(); // Enable/Disable convert-on-paste for line endings void SetPasteConvertEndings(bool convert); // Get convert-on-paste setting bool GetPasteConvertEndings() const; // Duplicate the selection. If selection empty duplicate the line containing the caret. void SelectionDuplicate(); // Set background alpha of the caret line. void SetCaretLineBackAlpha(int alpha); // Get the background alpha of the caret line. int GetCaretLineBackAlpha() const; // Set the style of the caret to be drawn. void SetCaretStyle(int caretStyle); // Returns the current style of the caret. int GetCaretStyle() const; // Set the indicator used for IndicatorFillRange and IndicatorClearRange void SetIndicatorCurrent(int indicator); // Get the current indicator int GetIndicatorCurrent() const; // Set the value used for IndicatorFillRange void SetIndicatorValue(int value); // Get the current indicator value int GetIndicatorValue() const; // Turn a indicator on over a range. void IndicatorFillRange(int start, int lengthFill); // Turn a indicator off over a range. void IndicatorClearRange(int start, int lengthClear); // Are any indicators present at pos? int IndicatorAllOnFor(int pos); // What value does a particular indicator have at a position? int IndicatorValueAt(int indicator, int pos); // Where does a particular indicator start? int IndicatorStart(int indicator, int pos); // Where does a particular indicator end? int IndicatorEnd(int indicator, int pos); // Set number of entries in position cache void SetPositionCacheSize(int size); // How many entries are allocated to the position cache? int GetPositionCacheSize() const; // Copy the selection, if selection empty copy the line with the caret void CopyAllowLine(); // Compact the document buffer and return a read-only pointer to the // characters in the document. const char* GetCharacterPointer() const; // Return a read-only pointer to a range of characters in the document. // May move the gap so that the range is contiguous, but will only move up // to lengthRange bytes. const char* GetRangePointer(int position, int rangeLength) const; // Return a position which, to avoid performance costs, should not be within // the range of a call to GetRangePointer. int GetGapPosition() const; // Set the alpha fill colour of the given indicator. void IndicatorSetAlpha(int indicator, int alpha); // Get the alpha fill colour of the given indicator. int IndicatorGetAlpha(int indicator) const; // Set the alpha outline colour of the given indicator. void IndicatorSetOutlineAlpha(int indicator, int alpha); // Get the alpha outline colour of the given indicator. int IndicatorGetOutlineAlpha(int indicator) const; // Set extra ascent for each line void SetExtraAscent(int extraAscent); // Get extra ascent for each line int GetExtraAscent() const; // Set extra descent for each line void SetExtraDescent(int extraDescent); // Get extra descent for each line int GetExtraDescent() const; // Which symbol was defined for markerNumber with MarkerDefine int GetMarkerSymbolDefined(int markerNumber); // Set the text in the text margin for a line void MarginSetText(int line, const wxString& text); // Get the text in the text margin for a line wxString MarginGetText(int line) const; // Set the style number for the text margin for a line void MarginSetStyle(int line, int style); // Get the style number for the text margin for a line int MarginGetStyle(int line) const; // Set the style in the text margin for a line void MarginSetStyles(int line, const wxString& styles); // Get the styles in the text margin for a line wxString MarginGetStyles(int line) const; // Clear the margin text on all lines void MarginTextClearAll(); // Get the start of the range of style numbers used for margin text void MarginSetStyleOffset(int style); // Get the start of the range of style numbers used for margin text int MarginGetStyleOffset() const; // Set the margin options. void SetMarginOptions(int marginOptions); // Get the margin options. int GetMarginOptions() const; // Set the annotation text for a line void AnnotationSetText(int line, const wxString& text); // Get the annotation text for a line wxString AnnotationGetText(int line) const; // Set the style number for the annotations for a line void AnnotationSetStyle(int line, int style); // Get the style number for the annotations for a line int AnnotationGetStyle(int line) const; // Set the annotation styles for a line void AnnotationSetStyles(int line, const wxString& styles); // Get the annotation styles for a line wxString AnnotationGetStyles(int line) const; // Get the number of annotation lines for a line int AnnotationGetLines(int line) const; // Clear the annotations from all lines void AnnotationClearAll(); // Set the visibility for the annotations for a view void AnnotationSetVisible(int visible); // Get the visibility for the annotations for a view int AnnotationGetVisible() const; // Get the start of the range of style numbers used for annotations void AnnotationSetStyleOffset(int style); // Get the start of the range of style numbers used for annotations int AnnotationGetStyleOffset() const; // Release all extended (>255) style numbers void ReleaseAllExtendedStyles(); // Allocate some extended (>255) style numbers and return the start of the range int AllocateExtendedStyles(int numberStyles); // Add a container action to the undo stack void AddUndoAction(int token, int flags); // Find the position of a character from a point within the window. int CharPositionFromPoint(int x, int y); // Find the position of a character from a point within the window. // Return wxSTC_INVALID_POSITION if not close to text. int CharPositionFromPointClose(int x, int y); // Set whether switching to rectangular mode while selecting with the mouse is allowed. void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch); // Whether switching to rectangular mode while selecting with the mouse is allowed. bool GetMouseSelectionRectangularSwitch() const; // Set whether multiple selections can be made void SetMultipleSelection(bool multipleSelection); // Whether multiple selections can be made bool GetMultipleSelection() const; // Set whether typing can be performed into multiple selections void SetAdditionalSelectionTyping(bool additionalSelectionTyping); // Whether typing can be performed into multiple selections bool GetAdditionalSelectionTyping() const; // Set whether additional carets will blink void SetAdditionalCaretsBlink(bool additionalCaretsBlink); // Whether additional carets will blink bool GetAdditionalCaretsBlink() const; // Set whether additional carets are visible void SetAdditionalCaretsVisible(bool additionalCaretsVisible); // Whether additional carets are visible bool GetAdditionalCaretsVisible() const; // How many selections are there? int GetSelections() const; // Is every selected range empty? bool GetSelectionEmpty() const; // Clear selections to a single empty stream selection void ClearSelections(); // Add a selection int AddSelection(int caret, int anchor); // Drop one selection void DropSelectionN(int selection); // Set the main selection void SetMainSelection(int selection); // Which selection is the main selection int GetMainSelection() const; // Set the caret position of the nth selection. void SetSelectionNCaret(int selection, int caret); // Return the caret position of the nth selection. int GetSelectionNCaret(int selection) const; // Set the anchor position of the nth selection. void SetSelectionNAnchor(int selection, int anchor); // Return the anchor position of the nth selection. int GetSelectionNAnchor(int selection) const; // Set the virtual space of the caret of the nth selection. void SetSelectionNCaretVirtualSpace(int selection, int space); // Return the virtual space of the caret of the nth selection. int GetSelectionNCaretVirtualSpace(int selection) const; // Set the virtual space of the anchor of the nth selection. void SetSelectionNAnchorVirtualSpace(int selection, int space); // Return the virtual space of the anchor of the nth selection. int GetSelectionNAnchorVirtualSpace(int selection) const; // Sets the position that starts the selection - this becomes the anchor. void SetSelectionNStart(int selection, int anchor); // Returns the position at the start of the selection. int GetSelectionNStart(int selection) const; // Sets the position that ends the selection - this becomes the currentPosition. void SetSelectionNEnd(int selection, int caret); // Returns the position at the end of the selection. int GetSelectionNEnd(int selection) const; // Set the caret position of the rectangular selection. void SetRectangularSelectionCaret(int caret); // Return the caret position of the rectangular selection. int GetRectangularSelectionCaret() const; // Set the anchor position of the rectangular selection. void SetRectangularSelectionAnchor(int anchor); // Return the anchor position of the rectangular selection. int GetRectangularSelectionAnchor() const; // Set the virtual space of the caret of the rectangular selection. void SetRectangularSelectionCaretVirtualSpace(int space); // Return the virtual space of the caret of the rectangular selection. int GetRectangularSelectionCaretVirtualSpace() const; // Set the virtual space of the anchor of the rectangular selection. void SetRectangularSelectionAnchorVirtualSpace(int space); // Return the virtual space of the anchor of the rectangular selection. int GetRectangularSelectionAnchorVirtualSpace() const; // Set options for virtual space behaviour. void SetVirtualSpaceOptions(int virtualSpaceOptions); // Return options for virtual space behaviour. int GetVirtualSpaceOptions() const; // On GTK+, allow selecting the modifier key to use for mouse-based // rectangular selection. Often the window manager requires Alt+Mouse Drag // for moving windows. // Valid values are wxSTC_KEYMOD_CTRL (default), wxSTC_KEYMOD_ALT, or wxSTC_KEYMOD_SUPER. void SetRectangularSelectionModifier(int modifier); // Get the modifier key used for rectangular selection. int GetRectangularSelectionModifier() const; // Set the foreground colour of additional selections. // Must have previously called SetSelFore with non-zero first argument for this to have an effect. void SetAdditionalSelForeground(const wxColour& fore); // Set the background colour of additional selections. // Must have previously called SetSelBack with non-zero first argument for this to have an effect. void SetAdditionalSelBackground(const wxColour& back); // Set the alpha of the selection. void SetAdditionalSelAlpha(int alpha); // Get the alpha of the selection. int GetAdditionalSelAlpha() const; // Set the foreground colour of additional carets. void SetAdditionalCaretForeground(const wxColour& fore); // Get the foreground colour of additional carets. wxColour GetAdditionalCaretForeground() const; // Set the main selection to the next selection. void RotateSelection(); // Swap that caret and anchor of the main selection. void SwapMainAnchorCaret(); // Add the next occurrence of the main selection to the set of selections as main. // If the current selection is empty then select word around caret. void MultipleSelectAddNext(); // Add each occurrence of the main selection in the target to the set of selections. // If the current selection is empty then select word around caret. void MultipleSelectAddEach(); // Indicate that the internal state of a lexer has changed over a range and therefore // there may be a need to redraw. int ChangeLexerState(int start, int end); // Find the next line at or after lineStart that is a contracted fold header line. // Return -1 when no more lines. int ContractedFoldNext(int lineStart); // Centre current line in window. void VerticalCentreCaret(); // Move the selected lines up one line, shifting the line above after the selection void MoveSelectedLinesUp(); // Move the selected lines down one line, shifting the line below before the selection void MoveSelectedLinesDown(); // Set the identifier reported as idFrom in notification messages. void SetIdentifier(int identifier); // Get the identifier. int GetIdentifier() const; // Set the width for future RGBA image data. void RGBAImageSetWidth(int width); // Set the height for future RGBA image data. void RGBAImageSetHeight(int height); // Set the scale factor in percent for future RGBA image data. void RGBAImageSetScale(int scalePercent); // Define a marker from RGBA data. // It has the width and height from RGBAImageSetWidth/Height void MarkerDefineRGBAImage(int markerNumber, const unsigned char* pixels); // Register an RGBA image for use in autocompletion lists. // It has the width and height from RGBAImageSetWidth/Height void RegisterRGBAImage(int type, const unsigned char* pixels); // Scroll to start of document. void ScrollToStart(); // Scroll to end of document. void ScrollToEnd(); // Set the technology used. void SetTechnology(int technology); // Get the tech. int GetTechnology() const; // Create an ILoader*. void* CreateLoader(int bytes) const; // Move caret to before first visible character on display line. // If already there move to first character on display line. void VCHomeDisplay(); // Like VCHomeDisplay but extending selection to new caret position. void VCHomeDisplayExtend(); // Is the caret line always visible? bool GetCaretLineVisibleAlways() const; // Sets the caret line to always visible. void SetCaretLineVisibleAlways(bool alwaysVisible); // Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. void SetLineEndTypesAllowed(int lineEndBitSet); // Get the line end types currently allowed. int GetLineEndTypesAllowed() const; // Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. int GetLineEndTypesActive() const; // Set the way a character is drawn. void SetRepresentation(const wxString& encodedCharacter, const wxString& representation); // Set the way a character is drawn. wxString GetRepresentation(const wxString& encodedCharacter) const; // Remove a character representation. void ClearRepresentation(const wxString& encodedCharacter); // Start notifying the container of all key presses and commands. void StartRecord(); // Stop notifying the container of all key presses and commands. void StopRecord(); // Set the lexing language of the document. void SetLexer(int lexer); // Retrieve the lexing language of the document. int GetLexer() const; // Colourise a segment of the document using the current lexing language. void Colourise(int start, int end); // Set up a value that may be used by a lexer for some optional feature. void SetProperty(const wxString& key, const wxString& value); // Set up the key words used by the lexer. void SetKeyWords(int keyWordSet, const wxString& keyWords); // Set the lexing language of the document based on string name. void SetLexerLanguage(const wxString& language); // Load a lexer library (dll / so). void LoadLexerLibrary(const wxString& path); // Retrieve a "property" value previously set with SetProperty. wxString GetProperty(const wxString& key); // Retrieve a "property" value previously set with SetProperty, // with "$()" variable replacement on returned buffer. wxString GetPropertyExpanded(const wxString& key); // Retrieve a "property" value previously set with SetProperty, // interpreted as an int AFTER any "$()" variable replacement. int GetPropertyInt(const wxString &key, int defaultValue=0) const; // Retrieve the number of bits the current lexer needs for styling. wxDEPRECATED_MSG( "This method uses a function deprecated in the Scintilla library." ) int GetStyleBitsNeeded() const; // Retrieve the lexing language of the document. wxString GetLexerLanguage() const; // For private communication between an application and a known lexer. void* PrivateLexerCall(int operation, void* pointer); // Retrieve a '\\n' separated list of properties understood by the current lexer. wxString PropertyNames() const; // Retrieve the type of a property. int PropertyType(const wxString& name); // Describe a property. wxString DescribeProperty(const wxString& name) const; // Retrieve a '\\n' separated list of descriptions of the keyword sets understood by the current lexer. wxString DescribeKeyWordSets() const; // Bit set of LineEndType enumertion for which line ends beyond the standard // LF, CR, and CRLF are supported by the lexer. int GetLineEndTypesSupported() const; // Allocate a set of sub styles for a particular base style, returning start of range int AllocateSubStyles(int styleBase, int numberStyles); // The starting style number for the sub styles associated with a base style int GetSubStylesStart(int styleBase) const; // The number of sub styles associated with a base style int GetSubStylesLength(int styleBase) const; // For a sub style, return the base style, else return the argument. int GetStyleFromSubStyle(int subStyle) const; // For a secondary style, return the primary style, else return the argument. int GetPrimaryStyleFromStyle(int style) const; // Free allocated sub styles void FreeSubStyles(); // Set the identifiers that are shown in a particular style void SetIdentifiers(int style, const wxString& identifiers); // Where styles are duplicated by a feature such as active/inactive code // return the distance between the two types. int DistanceToSecondaryStyles() const; // Get the set of base styles that can be extended with sub styles wxString GetSubStyleBases() const; //}}} //---------------------------------------------------------------------- // Manually declared methods // Returns the line number of the line with the caret. int GetCurrentLine(); // Extract style settings from a spec-string which is composed of one or // more of the following comma separated elements: // // bold turns on bold // italic turns on italics // fore:[name or #RRGGBB] sets the foreground colour // back:[name or #RRGGBB] sets the background colour // face:[facename] sets the font face name to use // size:[num] sets the font size in points // eol turns on eol filling // underline turns on underlining // void StyleSetSpec(int styleNum, const wxString& spec); // Get the font of a style. wxFont StyleGetFont(int style); // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. void StyleSetFont(int styleNum, const wxFont& font); // Set all font style attributes at once. void StyleSetFontAttr(int styleNum, int size, const wxString& faceName, bool bold, bool italic, bool underline, wxFontEncoding encoding=wxFONTENCODING_DEFAULT); // Set the font encoding to be used by a style. void StyleSetFontEncoding(int style, wxFontEncoding encoding); // Perform one of the operations defined by the wxSTC_CMD_* constants. void CmdKeyExecute(int cmd); // Set the left and right margin in the edit area, measured in pixels. void SetMargins(int left, int right); // Scroll enough to make the given line visible void ScrollToLine(int line); // Scroll enough to make the given column visible void ScrollToColumn(int column); // Send a message to Scintilla // // NB: this method is not really const as it can modify the control but it // has to be declared as such as it's called from both const and // non-const methods and we can't distinguish between the two wxIntPtr SendMsg(int msg, wxUIntPtr wp=0, wxIntPtr lp=0) const; // Set the vertical scrollbar to use instead of the one that's built-in. void SetVScrollBar(wxScrollBar* bar); // Set the horizontal scrollbar to use instead of the one that's built-in. void SetHScrollBar(wxScrollBar* bar); // Can be used to prevent the EVT_CHAR handler from adding the char bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; } void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; } // if we derive from wxTextAreaBase it already provides these methods #if !wxUSE_TEXTCTRL // Write the contents of the editor to filename bool SaveFile(const wxString& filename); // Load the contents of filename into the editor bool LoadFile(const wxString& filename); #endif // !wxUSE_TEXTCTRL #ifdef STC_USE_DND // Allow for simulating a DnD DragEnter wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def); // Allow for simulating a DnD DragOver wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); // Allow for simulating a DnD DragLeave void DoDragLeave(); // Allow for simulating a DnD DropText bool DoDropText(long x, long y, const wxString& data); #endif // Specify whether anti-aliased fonts should be used. Will have no effect // on some platforms, but on some (wxMac for example) can greatly improve // performance. void SetUseAntiAliasing(bool useAA); // Returns the current UseAntiAliasing setting. bool GetUseAntiAliasing(); // Clear annotations from the given line. void AnnotationClearLine(int line); // The following methods are nearly equivalent to their similarly named // cousins above. The difference is that these methods bypass wxString // and always use a char* even if used in a unicode build of wxWidgets. // In that case the character data will be utf-8 encoded since that is // what is used internally by Scintilla in unicode builds. // Add text to the document at current position. void AddTextRaw(const char* text, int length=-1); // Insert string at a position. void InsertTextRaw(int pos, const char* text); // Retrieve the text of the line containing the caret. // Returns the index of the caret on the line. #ifdef SWIG wxCharBuffer GetCurLineRaw(int* OUTPUT); #else wxCharBuffer GetCurLineRaw(int* linePos=NULL); #endif // Retrieve the contents of a line. wxCharBuffer GetLineRaw(int line); // Retrieve the selected text. wxCharBuffer GetSelectedTextRaw(); // Retrieve the target text. wxCharBuffer GetTargetTextRaw(); // Retrieve a range of text. wxCharBuffer GetTextRangeRaw(int startPos, int endPos); // Replace the contents of the document with the argument text. void SetTextRaw(const char* text); // Retrieve all the text in the document. wxCharBuffer GetTextRaw(); // Append a string to the end of the document without changing the selection. void AppendTextRaw(const char* text, int length=-1); #ifdef SWIG %pythoncode "_stc_utf8_methods.py" #endif // implement wxTextEntryBase pure virtual methods // ---------------------------------------------- virtual void WriteText(const wxString& text) wxOVERRIDE { ReplaceSelection(text); } virtual void Remove(long from, long to) wxOVERRIDE { Replace(from, to, wxString()); } virtual void Replace(long from, long to, const wxString& text) wxOVERRIDE { SetTargetStart((int)from); SetTargetEnd((int)to); ReplaceTarget(text); } /* These functions are already declared in the generated section. virtual void Copy(); virtual void Cut(); virtual void Paste(); virtual void Undo(); virtual void Redo(); virtual bool CanUndo() const; virtual bool CanRedo() const; */ virtual void SetInsertionPoint(long pos) wxOVERRIDE { SetCurrentPos(int(pos == -1 ? GetLastPosition() : pos)); } virtual long GetInsertionPoint() const wxOVERRIDE { return GetCurrentPos(); } virtual long GetLastPosition() const wxOVERRIDE { return GetTextLength(); } virtual void SetSelection(long from, long to) wxOVERRIDE { if ( from == -1 && to == -1 ) { SelectAll(); } else { SetSelectionStart((int)from); SetSelectionEnd((int)to); } } virtual void SelectNone() wxOVERRIDE { ClearSelections(); } #ifdef SWIG void GetSelection(long* OUTPUT, long* OUTPUT) const; #else virtual void GetSelection(long *from, long *to) const wxOVERRIDE { if ( from ) *from = GetSelectionStart(); if ( to ) *to = GetSelectionEnd(); } // kept for compatibility only void GetSelection(int *from, int *to) { long f, t; GetSelection(&f, &t); if ( from ) *from = (int)f; if ( to ) *to = (int)t; } #endif virtual bool IsEditable() const wxOVERRIDE { return !GetReadOnly(); } virtual void SetEditable(bool editable) wxOVERRIDE { SetReadOnly(!editable); } // implement wxTextAreaBase pure virtual methods // --------------------------------------------- virtual int GetLineLength(long lineNo) const wxOVERRIDE { return static_cast<int>(GetLineText(lineNo).length()); } virtual wxString GetLineText(long lineNo) const wxOVERRIDE { wxString text = GetLine(static_cast<int>(lineNo)); size_t lastNewLine = text.find_last_not_of(wxS("\r\n")); if ( lastNewLine != wxString::npos ) text.erase(lastNewLine + 1); // remove trailing cr+lf else text.clear(); return text; } virtual int GetNumberOfLines() const wxOVERRIDE { return GetLineCount(); } virtual bool IsModified() const wxOVERRIDE { return GetModify(); } virtual void MarkDirty() wxOVERRIDE { wxFAIL_MSG("not implemented"); } virtual void DiscardEdits() wxOVERRIDE { SetSavePoint(); } virtual bool SetStyle(long WXUNUSED(start), long WXUNUSED(end), const wxTextAttr& WXUNUSED(style)) wxOVERRIDE { wxFAIL_MSG("not implemented"); return false; } virtual bool GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style)) wxOVERRIDE { wxFAIL_MSG("not implemented"); return false; } virtual bool SetDefaultStyle(const wxTextAttr& WXUNUSED(style)) wxOVERRIDE { wxFAIL_MSG("not implemented"); return false; } virtual long XYToPosition(long x, long y) const wxOVERRIDE { long pos = PositionFromLine((int)y); pos += x; return pos; } virtual bool PositionToXY(long pos, long *x, long *y) const wxOVERRIDE { int l = LineFromPosition((int)pos); if ( l == -1 ) return false; if ( x ) *x = pos - PositionFromLine(l); if ( y ) *y = l; return true; } virtual void ShowPosition(long pos) wxOVERRIDE { GotoPos((int)pos); } using wxWindow::HitTest; virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const wxOVERRIDE { const long l = PositionFromPoint(pt); if ( l == -1 ) return wxTE_HT_BELOW; // we don't really know where it was if ( pos ) *pos = l; return wxTE_HT_ON_TEXT; } // just unhide it virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const wxOVERRIDE { return wxTextAreaBase::HitTest(pt, col, row); } // methods deprecated due to changes in the scintilla library // --------------------------------------------- #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG("use UsePopUp(int) instead.") void UsePopUp(bool allowPopUp); wxDEPRECATED_MSG("use StartStyling(int start) instead.") void StartStyling(int start, int unused); #endif // WXWIN_COMPATIBILITY_3_0 static wxVersionInfo GetLibraryVersionInfo(); protected: virtual void DoSetValue(const wxString& value, int flags) wxOVERRIDE; virtual wxString DoGetValue() const wxOVERRIDE { return GetText(); } virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; } #ifndef SWIG virtual bool DoLoadFile(const wxString& file, int fileType) wxOVERRIDE; virtual bool DoSaveFile(const wxString& file, int fileType) wxOVERRIDE; // Event handlers void OnPaint(wxPaintEvent& evt); void OnScrollWin(wxScrollWinEvent& evt); void OnScroll(wxScrollEvent& evt); void OnSize(wxSizeEvent& evt); void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseRightDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); void OnMouseMiddleUp(wxMouseEvent& evt); void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt); void OnKeyDown(wxKeyEvent& evt); void OnLoseFocus(wxFocusEvent& evt); void OnGainFocus(wxFocusEvent& evt); void OnSysColourChanged(wxSysColourChangedEvent& evt); void OnEraseBackground(wxEraseEvent& evt); void OnMenu(wxCommandEvent& evt); void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); void OnMouseCaptureLost(wxMouseCaptureLostEvent& evt); virtual wxSize DoGetBestSize() const wxOVERRIDE; // Turn notifications from Scintilla into events void NotifyChange(); void NotifyParent(SCNotification* scn); private: wxDECLARE_EVENT_TABLE(); wxDECLARE_DYNAMIC_CLASS(wxStyledTextCtrl); protected: ScintillaWX* m_swx; wxStopWatch m_stopWatch; wxScrollBar* m_vScrollBar; wxScrollBar* m_hScrollBar; bool m_lastKeyDownConsumed; friend class ScintillaWX; friend class Platform; #endif // !SWIG }; //---------------------------------------------------------------------- class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent { public: wxStyledTextEvent(wxEventType commandType=0, int id=0); #ifndef SWIG wxStyledTextEvent(const wxStyledTextEvent& event); #endif ~wxStyledTextEvent() {} void SetPosition(int pos) { m_position = pos; } void SetKey(int k) { m_key = k; } void SetModifiers(int m) { m_modifiers = m; } void SetModificationType(int t) { m_modificationType = t; } // Kept for backwards compatibility, use SetString(). void SetText(const wxString& t) { SetString(t); } void SetLength(int len) { m_length = len; } void SetLinesAdded(int num) { m_linesAdded = num; } void SetLine(int val) { m_line = val; } void SetFoldLevelNow(int val) { m_foldLevelNow = val; } void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; } void SetMargin(int val) { m_margin = val; } void SetMessage(int val) { m_message = val; } void SetWParam(int val) { m_wParam = val; } void SetLParam(int val) { m_lParam = val; } void SetListType(int val) { m_listType = val; } void SetX(int val) { m_x = val; } void SetY(int val) { m_y = val; } void SetToken(int val) { m_token = val; } void SetAnnotationLinesAdded(int val) { m_annotationLinesAdded = val; } void SetUpdated(int val) { m_updated = val; } void SetListCompletionMethod(int val) { m_listCompletionMethod = val; } #ifdef STC_USE_DND // Kept for backwards compatibility, use SetString(). void SetDragText(const wxString& val) { SetString(val); } void SetDragFlags(int flags) { m_dragFlags = flags; } void SetDragResult(wxDragResult val) { m_dragResult = val; } // This method is kept mainly for backwards compatibility, use // SetDragFlags() in the new code. void SetDragAllowMove(bool allow) { if ( allow ) m_dragFlags |= wxDrag_AllowMove; else m_dragFlags &= ~(wxDrag_AllowMove | wxDrag_DefaultMove); } #endif int GetPosition() const { return m_position; } int GetKey() const { return m_key; } int GetModifiers() const { return m_modifiers; } int GetModificationType() const { return m_modificationType; } // Kept for backwards compatibility, use GetString(). wxString GetText() const { return GetString(); } int GetLength() const { return m_length; } int GetLinesAdded() const { return m_linesAdded; } int GetLine() const { return m_line; } int GetFoldLevelNow() const { return m_foldLevelNow; } int GetFoldLevelPrev() const { return m_foldLevelPrev; } int GetMargin() const { return m_margin; } int GetMessage() const { return m_message; } int GetWParam() const { return m_wParam; } int GetLParam() const { return m_lParam; } int GetListType() const { return m_listType; } int GetX() const { return m_x; } int GetY() const { return m_y; } int GetToken() const { return m_token; } int GetAnnotationsLinesAdded() const { return m_annotationLinesAdded; } int GetUpdated() const { return m_updated; } int GetListCompletionMethod() const { return m_listCompletionMethod; } #ifdef STC_USE_DND // Kept for backwards compatibility, use GetString(). wxString GetDragText() { return GetString(); } int GetDragFlags() { return m_dragFlags; } wxDragResult GetDragResult() { return m_dragResult; } bool GetDragAllowMove() { return (GetDragFlags() & wxDrag_AllowMove) != 0; } #endif bool GetShift() const; bool GetControl() const; bool GetAlt() const; virtual wxEvent* Clone() const wxOVERRIDE { return new wxStyledTextEvent(*this); } #ifndef SWIG private: wxDECLARE_DYNAMIC_CLASS(wxStyledTextEvent); int m_position; int m_key; int m_modifiers; int m_modificationType; // wxEVT_STC_MODIFIED int m_length; int m_linesAdded; int m_line; int m_foldLevelNow; int m_foldLevelPrev; int m_margin; // wxEVT_STC_MARGINCLICK int m_message; // wxEVT_STC_MACRORECORD int m_wParam; int m_lParam; int m_listType; int m_x; int m_y; int m_token; // wxEVT_STC__MODIFIED with SC_MOD_CONTAINER int m_annotationLinesAdded; // wxEVT_STC_MODIFIED with SC_MOD_CHANGEANNOTATION int m_updated; // wxEVT_STC_UPDATEUI int m_listCompletionMethod; #if wxUSE_DRAG_AND_DROP int m_dragFlags; // wxEVT_STC_START_DRAG wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP #endif #endif }; #ifndef SWIG wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ); #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG( "Don't handle wxEVT_STC_KEY. It's never generated." ) \ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ); #endif // WXWIN_COMPATIBILITY_3_0 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ); #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG( "Don't handle wxEVT_STC_URIDROPPED. It's never generated." ) \ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ); #endif // WXWIN_COMPATIBILITY_3_0 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_CLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_RELEASE, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_CANCELLED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_CHAR_DELETED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_RELEASE_CLICK, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CLIPBOARD_COPY, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CLIPBOARD_PASTE, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_COMPLETED, wxStyledTextEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGIN_RIGHT_CLICK, wxStyledTextEvent ); #else enum { wxEVT_STC_CHANGE, wxEVT_STC_STYLENEEDED, wxEVT_STC_CHARADDED, wxEVT_STC_SAVEPOINTREACHED, wxEVT_STC_SAVEPOINTLEFT, wxEVT_STC_ROMODIFYATTEMPT, #if WXWIN_COMPATIBILITY_3_0 wxEVT_STC_KEY, // deprecated #endif // WXWIN_COMPATIBILITY_3_0 wxEVT_STC_DOUBLECLICK, wxEVT_STC_UPDATEUI, wxEVT_STC_MODIFIED, wxEVT_STC_MACRORECORD, wxEVT_STC_MARGINCLICK, wxEVT_STC_NEEDSHOWN, wxEVT_STC_PAINTED, wxEVT_STC_USERLISTSELECTION, #if WXWIN_COMPATIBILITY_3_0 wxEVT_STC_URIDROPPED, // deprecated #endif // WXWIN_COMPATIBILITY_3_0 wxEVT_STC_DWELLSTART, wxEVT_STC_DWELLEND, wxEVT_STC_START_DRAG, wxEVT_STC_DRAG_OVER, wxEVT_STC_DO_DROP, wxEVT_STC_ZOOM, wxEVT_STC_HOTSPOT_CLICK, wxEVT_STC_HOTSPOT_DCLICK, wxEVT_STC_CALLTIP_CLICK, wxEVT_STC_AUTOCOMP_SELECTION, wxEVT_STC_INDICATOR_CLICK, wxEVT_STC_INDICATOR_RELEASE, wxEVT_STC_AUTOCOMP_CANCELLED, wxEVT_STC_AUTOCOMP_CHAR_DELETED, wxEVT_STC_HOTSPOT_RELEASE_CLICK, wxEVT_STC_CLIPBOARD_COPY, wxEVT_STC_CLIPBOARD_PASTE, wxEVT_STC_AUTOCOMP_COMPLETED, wxEVT_STC_MARGIN_RIGHT_CLICK }; #endif #ifndef SWIG typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); #define wxStyledTextEventHandler( func ) \ wxEVENT_HANDLER_CAST( wxStyledTextEventFunction, func ) #define EVT_STC_CHANGE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_STYLENEEDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_CHARADDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_SAVEPOINTREACHED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_SAVEPOINTLEFT(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_ROMODIFYATTEMPT(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_KEY(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DOUBLECLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_UPDATEUI(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_MODIFIED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_MACRORECORD(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_MARGINCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_NEEDSHOWN(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_PAINTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_USERLISTSELECTION(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_URIDROPPED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DWELLSTART(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DWELLEND(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_START_DRAG(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DRAG_OVER(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DO_DROP(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_ZOOM(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_HOTSPOT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_HOTSPOT_DCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_CALLTIP_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_AUTOCOMP_SELECTION(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_INDICATOR_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_INDICATOR_RELEASE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_AUTOCOMP_CANCELLED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_CANCELLED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_AUTOCOMP_CHAR_DELETED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_CHAR_DELETED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_HOTSPOT_RELEASE_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_RELEASE_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_CLIPBOARD_COPY(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CLIPBOARD_COPY, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_CLIPBOARD_PASTE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CLIPBOARD_PASTE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_AUTOCOMP_COMPLETED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_COMPLETED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_MARGIN_RIGHT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGIN_RIGHT_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #endif #endif // wxUSE_STC #endif // _WX_STC_STC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/shapelib-1.5.0/Linux/include/shapefil.h
#ifndef SHAPEFILE_H_INCLUDED #define SHAPEFILE_H_INCLUDED /****************************************************************************** * $Id: shapefil.h,v 1.55 2016-12-05 18:44:08 erouault Exp $ * * Project: Shapelib * Purpose: Primary include file for Shapelib. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 1999, Frank Warmerdam * Copyright (c) 2012-2016, Even Rouault <even dot rouault at mines-paris dot org> * * This software is available under the following "MIT Style" license, * or at the option of the licensee under the LGPL (see COPYING). This * option is discussed in more detail in shapelib.html. * * -- * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * $Log: shapefil.h,v $ * Revision 1.55 2016-12-05 18:44:08 erouault * * dbfopen.c, shapefil.h: write DBF end-of-file character 0x1A by default. * This behaviour can be controlled with the DBFSetWriteEndOfFileChar() * function. * * Revision 1.54 2016-12-05 12:44:05 erouault * * Major overhaul of Makefile build system to use autoconf/automake. * * * Warning fixes in contrib/ * * Revision 1.53 2016-12-04 15:30:15 erouault * * shpopen.c, dbfopen.c, shptree.c, shapefil.h: resync with * GDAL Shapefile driver. Mostly cleanups. SHPObject and DBFInfo * structures extended with new members. New functions: * DBFSetLastModifiedDate, SHPOpenLLEx, SHPRestoreSHX, * SHPSetFastModeReadObject * * * sbnsearch.c: new file to implement original ESRI .sbn spatial * index reading. (no write support). New functions: * SBNOpenDiskTree, SBNCloseDiskTree, SBNSearchDiskTree, * SBNSearchDiskTreeInteger, SBNSearchFreeIds * * * Makefile, makefile.vc, CMakeLists.txt, shapelib.def: updates * with new file and symbols. * * * commit: helper script to cvs commit * * Revision 1.52 2011-12-11 22:26:46 fwarmerdam * upgrade .qix access code to use SAHooks (gdal #3365) * * Revision 1.51 2011-07-24 05:59:25 fwarmerdam * minimize use of CPLError in favor of SAHooks.Error() * * Revision 1.50 2011-05-13 17:35:17 fwarmerdam * added DBFReorderFields() and DBFAlterFields() functions (from Even) * * Revision 1.49 2011-04-16 14:38:21 fwarmerdam * avoid warnings with gcc on SHP_CVSID * * Revision 1.48 2010-08-27 23:42:52 fwarmerdam * add SHPAPI_CALL attribute in code * * Revision 1.47 2010-01-28 11:34:34 fwarmerdam * handle the shape file length limits more gracefully (#3236) * * Revision 1.46 2008-11-12 14:28:15 fwarmerdam * DBFCreateField() now works on files with records * * Revision 1.45 2008/11/11 17:47:10 fwarmerdam * added DBFDeleteField() function * * Revision 1.44 2008/01/16 20:05:19 bram * Add file hooks that accept UTF-8 encoded filenames on some platforms. Use SASetupUtf8Hooks * tosetup the hooks and check SHPAPI_UTF8_HOOKS for its availability. Currently, this * is only available on the Windows platform that decodes the UTF-8 filenames to wide * character strings and feeds them to _wfopen and _wremove. * * Revision 1.43 2008/01/10 16:35:30 fwarmerdam * avoid _ prefix on #defined symbols (bug 1840) * * Revision 1.42 2007/12/18 18:28:14 bram * - create hook for client specific atof (bugzilla ticket 1615) * - check for NULL handle before closing cpCPG file, and close after reading. * * Revision 1.41 2007/12/15 20:25:32 bram * dbfopen.c now reads the Code Page information from the DBF file, and exports * this information as a string through the DBFGetCodePage function. This is * either the number from the LDID header field ("LDID/<number>") or as the * content of an accompanying .CPG file. When creating a DBF file, the code can * be set using DBFCreateEx. * * Revision 1.40 2007/12/06 07:00:25 fwarmerdam * dbfopen now using SAHooks for fileio * * Revision 1.39 2007/12/04 20:37:56 fwarmerdam * preliminary implementation of hooks api for io and errors * * Revision 1.38 2007/11/21 22:39:56 fwarmerdam * close shx file in readonly mode (GDAL #1956) * * Revision 1.37 2007/10/27 03:31:14 fwarmerdam * limit default depth of tree to 12 levels (gdal ticket #1594) * * Revision 1.36 2007/09/10 23:33:15 fwarmerdam * Upstreamed support for visibility flag in SHPAPI_CALL for the needs * of GDAL (gdal ticket #1810). * * Revision 1.35 2007/09/03 19:48:10 fwarmerdam * move DBFReadAttribute() static dDoubleField into dbfinfo * * Revision 1.34 2006/06/17 15:33:32 fwarmerdam * added pszWorkField - bug 1202 (rso) * * Revision 1.33 2006/02/15 01:14:30 fwarmerdam * added DBFAddNativeFieldType * * Revision 1.32 2006/01/26 15:07:32 fwarmerdam * add bMeasureIsUsed flag from Craig Bruce: Bug 1249 * * Revision 1.31 2006/01/05 01:27:27 fwarmerdam * added dbf deletion mark/fetch * * Revision 1.30 2005/01/03 22:30:13 fwarmerdam * added support for saved quadtrees * * Revision 1.29 2004/09/26 20:09:35 fwarmerdam * avoid rcsid warnings * * Revision 1.28 2003/12/29 06:02:18 fwarmerdam * added cpl_error.h option * * Revision 1.27 2003/04/21 18:30:37 warmerda * added header write/update public methods * * Revision 1.26 2002/09/29 00:00:08 warmerda * added FTLogical and logical attribute read/write calls * * Revision 1.25 2002/05/07 13:46:30 warmerda * added DBFWriteAttributeDirectly(). * * Revision 1.24 2002/04/10 16:59:54 warmerda * added SHPRewindObject * * Revision 1.23 2002/01/15 14:36:07 warmerda * updated email address * * Revision 1.22 2002/01/15 14:32:00 warmerda * try to improve SHPAPI_CALL docs */ #include <stdio.h> #ifdef USE_DBMALLOC #include <dbmalloc.h> #endif #ifdef USE_CPL #include "cpl_conv.h" #endif #ifdef __cplusplus extern "C" { #endif /************************************************************************/ /* Configuration options. */ /************************************************************************/ /* -------------------------------------------------------------------- */ /* Should the DBFReadStringAttribute() strip leading and */ /* trailing white space? */ /* -------------------------------------------------------------------- */ #define TRIM_DBF_WHITESPACE /* -------------------------------------------------------------------- */ /* Should we write measure values to the Multipatch object? */ /* Reportedly ArcView crashes if we do write it, so for now it */ /* is disabled. */ /* -------------------------------------------------------------------- */ #define DISABLE_MULTIPATCH_MEASURE /* -------------------------------------------------------------------- */ /* SHPAPI_CALL */ /* */ /* The following two macros are present to allow forcing */ /* various calling conventions on the Shapelib API. */ /* */ /* To force __stdcall conventions (needed to call Shapelib */ /* from Visual Basic and/or Dephi I believe) the makefile could */ /* be modified to define: */ /* */ /* /DSHPAPI_CALL=__stdcall */ /* */ /* If it is desired to force export of the Shapelib API without */ /* using the shapelib.def file, use the following definition. */ /* */ /* /DSHAPELIB_DLLEXPORT */ /* */ /* To get both at once it will be necessary to hack this */ /* include file to define: */ /* */ /* #define SHPAPI_CALL __declspec(dllexport) __stdcall */ /* #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall */ /* */ /* The complexity of the situation is partly caused by the */ /* peculiar requirement of Visual C++ that __stdcall appear */ /* after any "*"'s in the return value of a function while the */ /* __declspec(dllexport) must appear before them. */ /* -------------------------------------------------------------------- */ #ifdef SHAPELIB_DLLEXPORT # define SHPAPI_CALL __declspec(dllexport) # define SHPAPI_CALL1(x) __declspec(dllexport) x #endif #ifndef SHPAPI_CALL # if defined(USE_GCC_VISIBILITY_FLAG) # define SHPAPI_CALL __attribute__ ((visibility("default"))) # define SHPAPI_CALL1(x) __attribute__ ((visibility("default"))) x # else # define SHPAPI_CALL # endif #endif #ifndef SHPAPI_CALL1 # define SHPAPI_CALL1(x) x SHPAPI_CALL #endif /* -------------------------------------------------------------------- */ /* Macros for controlling CVSID and ensuring they don't appear */ /* as unreferenced variables resulting in lots of warnings. */ /* -------------------------------------------------------------------- */ #ifndef DISABLE_CVSID # if defined(__GNUC__) && __GNUC__ >= 4 # define SHP_CVSID(string) static const char cpl_cvsid[] __attribute__((used)) = string; # else # define SHP_CVSID(string) static const char cpl_cvsid[] = string; \ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); } # endif #else # define SHP_CVSID(string) #endif /* -------------------------------------------------------------------- */ /* On some platforms, additional file IO hooks are defined that */ /* UTF-8 encoded filenames Unicode filenames */ /* -------------------------------------------------------------------- */ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) # define SHPAPI_WINDOWS # define SHPAPI_UTF8_HOOKS #endif /* -------------------------------------------------------------------- */ /* IO/Error hook functions. */ /* -------------------------------------------------------------------- */ typedef int *SAFile; #ifndef SAOffset typedef unsigned long SAOffset; #endif typedef struct { SAFile (*FOpen) ( const char *filename, const char *access); SAOffset (*FRead) ( void *p, SAOffset size, SAOffset nmemb, SAFile file); SAOffset (*FWrite)( void *p, SAOffset size, SAOffset nmemb, SAFile file); SAOffset (*FSeek) ( SAFile file, SAOffset offset, int whence ); SAOffset (*FTell) ( SAFile file ); int (*FFlush)( SAFile file ); int (*FClose)( SAFile file ); int (*Remove) ( const char *filename ); void (*Error) ( const char *message ); double (*Atof) ( const char *str ); } SAHooks; void SHPAPI_CALL SASetupDefaultHooks( SAHooks *psHooks ); #ifdef SHPAPI_UTF8_HOOKS void SHPAPI_CALL SASetupUtf8Hooks( SAHooks *psHooks ); #endif /************************************************************************/ /* SHP Support. */ /************************************************************************/ typedef struct tagSHPObject SHPObject; typedef struct { SAHooks sHooks; SAFile fpSHP; SAFile fpSHX; int nShapeType; /* SHPT_* */ unsigned int nFileSize; /* SHP file */ int nRecords; int nMaxRecords; unsigned int*panRecOffset; unsigned int *panRecSize; double adBoundsMin[4]; double adBoundsMax[4]; int bUpdated; unsigned char *pabyRec; int nBufSize; int bFastModeReadObject; unsigned char *pabyObjectBuf; int nObjectBufSize; SHPObject* psCachedObject; } SHPInfo; typedef SHPInfo * SHPHandle; /* -------------------------------------------------------------------- */ /* Shape types (nSHPType) */ /* -------------------------------------------------------------------- */ #define SHPT_NULL 0 #define SHPT_POINT 1 #define SHPT_ARC 3 #define SHPT_POLYGON 5 #define SHPT_MULTIPOINT 8 #define SHPT_POINTZ 11 #define SHPT_ARCZ 13 #define SHPT_POLYGONZ 15 #define SHPT_MULTIPOINTZ 18 #define SHPT_POINTM 21 #define SHPT_ARCM 23 #define SHPT_POLYGONM 25 #define SHPT_MULTIPOINTM 28 #define SHPT_MULTIPATCH 31 /* -------------------------------------------------------------------- */ /* Part types - everything but SHPT_MULTIPATCH just uses */ /* SHPP_RING. */ /* -------------------------------------------------------------------- */ #define SHPP_TRISTRIP 0 #define SHPP_TRIFAN 1 #define SHPP_OUTERRING 2 #define SHPP_INNERRING 3 #define SHPP_FIRSTRING 4 #define SHPP_RING 5 /* -------------------------------------------------------------------- */ /* SHPObject - represents on shape (without attributes) read */ /* from the .shp file. */ /* -------------------------------------------------------------------- */ struct tagSHPObject { int nSHPType; int nShapeId; /* -1 is unknown/unassigned */ int nParts; int *panPartStart; int *panPartType; int nVertices; double *padfX; double *padfY; double *padfZ; double *padfM; double dfXMin; double dfYMin; double dfZMin; double dfMMin; double dfXMax; double dfYMax; double dfZMax; double dfMMax; int bMeasureIsUsed; int bFastModeReadObject; }; /* -------------------------------------------------------------------- */ /* SHP API Prototypes */ /* -------------------------------------------------------------------- */ /* If pszAccess is read-only, the fpSHX field of the returned structure */ /* will be NULL as it is not necessary to keep the SHX file open */ SHPHandle SHPAPI_CALL SHPOpen( const char * pszShapeFile, const char * pszAccess ); SHPHandle SHPAPI_CALL SHPOpenLL( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks ); SHPHandle SHPAPI_CALL SHPOpenLLEx( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks, int bRestoreSHX ); int SHPAPI_CALL SHPRestoreSHX( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks ); /* If setting bFastMode = TRUE, the content of SHPReadObject() is owned by the SHPHandle. */ /* So you cannot have 2 valid instances of SHPReadObject() simultaneously. */ /* The SHPObject padfZ and padfM members may be NULL depending on the geometry */ /* type. It is illegal to free at hand any of the pointer members of the SHPObject structure */ void SHPAPI_CALL SHPSetFastModeReadObject( SHPHandle hSHP, int bFastMode ); SHPHandle SHPAPI_CALL SHPCreate( const char * pszShapeFile, int nShapeType ); SHPHandle SHPAPI_CALL SHPCreateLL( const char * pszShapeFile, int nShapeType, SAHooks *psHooks ); void SHPAPI_CALL SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType, double * padfMinBound, double * padfMaxBound ); SHPObject SHPAPI_CALL1(*) SHPReadObject( SHPHandle hSHP, int iShape ); int SHPAPI_CALL SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject ); void SHPAPI_CALL SHPDestroyObject( SHPObject * psObject ); void SHPAPI_CALL SHPComputeExtents( SHPObject * psObject ); SHPObject SHPAPI_CALL1(*) SHPCreateObject( int nSHPType, int nShapeId, int nParts, const int * panPartStart, const int * panPartType, int nVertices, const double * padfX, const double * padfY, const double * padfZ, const double * padfM ); SHPObject SHPAPI_CALL1(*) SHPCreateSimpleObject( int nSHPType, int nVertices, const double * padfX, const double * padfY, const double * padfZ ); int SHPAPI_CALL SHPRewindObject( SHPHandle hSHP, SHPObject * psObject ); void SHPAPI_CALL SHPClose( SHPHandle hSHP ); void SHPAPI_CALL SHPWriteHeader( SHPHandle hSHP ); const char SHPAPI_CALL1(*) SHPTypeName( int nSHPType ); const char SHPAPI_CALL1(*) SHPPartTypeName( int nPartType ); /* -------------------------------------------------------------------- */ /* Shape quadtree indexing API. */ /* -------------------------------------------------------------------- */ /* this can be two or four for binary or quad tree */ #define MAX_SUBNODE 4 /* upper limit of tree levels for automatic estimation */ #define MAX_DEFAULT_TREE_DEPTH 12 typedef struct shape_tree_node { /* region covered by this node */ double adfBoundsMin[4]; double adfBoundsMax[4]; /* list of shapes stored at this node. The papsShapeObj pointers or the whole list can be NULL */ int nShapeCount; int *panShapeIds; SHPObject **papsShapeObj; int nSubNodes; struct shape_tree_node *apsSubNode[MAX_SUBNODE]; } SHPTreeNode; typedef struct { SHPHandle hSHP; int nMaxDepth; int nDimension; int nTotalCount; SHPTreeNode *psRoot; } SHPTree; SHPTree SHPAPI_CALL1(*) SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth, double *padfBoundsMin, double *padfBoundsMax ); void SHPAPI_CALL SHPDestroyTree( SHPTree * hTree ); int SHPAPI_CALL SHPWriteTree( SHPTree *hTree, const char * pszFilename ); int SHPAPI_CALL SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject ); int SHPAPI_CALL SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId ); void SHPAPI_CALL SHPTreeTrimExtraNodes( SHPTree * hTree ); int SHPAPI_CALL1(*) SHPTreeFindLikelyShapes( SHPTree * hTree, double * padfBoundsMin, double * padfBoundsMax, int * ); int SHPAPI_CALL SHPCheckBoundsOverlap( double *, double *, double *, double *, int ); int SHPAPI_CALL1(*) SHPSearchDiskTree( FILE *fp, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); typedef struct SHPDiskTreeInfo* SHPTreeDiskHandle; SHPTreeDiskHandle SHPAPI_CALL SHPOpenDiskTree( const char* pszQIXFilename, SAHooks *psHooks ); void SHPAPI_CALL SHPCloseDiskTree( SHPTreeDiskHandle hDiskTree ); int SHPAPI_CALL1(*) SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); int SHPAPI_CALL SHPWriteTreeLL(SHPTree *hTree, const char *pszFilename, SAHooks *psHooks ); /* -------------------------------------------------------------------- */ /* SBN Search API */ /* -------------------------------------------------------------------- */ typedef struct SBNSearchInfo* SBNSearchHandle; SBNSearchHandle SHPAPI_CALL SBNOpenDiskTree( const char* pszSBNFilename, SAHooks *psHooks ); void SHPAPI_CALL SBNCloseDiskTree( SBNSearchHandle hSBN ); int SHPAPI_CALL1(*) SBNSearchDiskTree( SBNSearchHandle hSBN, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); int SHPAPI_CALL1(*) SBNSearchDiskTreeInteger( SBNSearchHandle hSBN, int bMinX, int bMinY, int bMaxX, int bMaxY, int *pnShapeCount ); void SHPAPI_CALL SBNSearchFreeIds( int* panShapeId ); /************************************************************************/ /* DBF Support. */ /************************************************************************/ typedef struct { SAHooks sHooks; SAFile fp; int nRecords; int nRecordLength; /* Must fit on uint16 */ int nHeaderLength; /* File header length (32) + field descriptor length + spare space. Must fit on uint16 */ int nFields; int *panFieldOffset; int *panFieldSize; int *panFieldDecimals; char *pachFieldType; char *pszHeader; /* Field descriptors */ int nCurrentRecord; int bCurrentRecordModified; char *pszCurrentRecord; int nWorkFieldLength; char *pszWorkField; int bNoHeader; int bUpdated; union { double dfDoubleField; int nIntField; } fieldValue; int iLanguageDriver; char *pszCodePage; int nUpdateYearSince1900; /* 0-255 */ int nUpdateMonth; /* 1-12 */ int nUpdateDay; /* 1-31 */ int bWriteEndOfFileChar; /* defaults to TRUE */ } DBFInfo; typedef DBFInfo * DBFHandle; typedef enum { FTString, FTInteger, FTDouble, FTLogical, FTInvalid } DBFFieldType; /* Field descriptor/header size */ #define XBASE_FLDHDR_SZ 32 /* Shapelib read up to 11 characters, even if only 10 should normally be used */ #define XBASE_FLDNAME_LEN_READ 11 /* On writing, we limit to 10 characters */ #define XBASE_FLDNAME_LEN_WRITE 10 /* Normally only 254 characters should be used. We tolerate 255 historically */ #define XBASE_FLD_MAX_WIDTH 255 DBFHandle SHPAPI_CALL DBFOpen( const char * pszDBFFile, const char * pszAccess ); DBFHandle SHPAPI_CALL DBFOpenLL( const char * pszDBFFile, const char * pszAccess, SAHooks *psHooks ); DBFHandle SHPAPI_CALL DBFCreate( const char * pszDBFFile ); DBFHandle SHPAPI_CALL DBFCreateEx( const char * pszDBFFile, const char * pszCodePage ); DBFHandle SHPAPI_CALL DBFCreateLL( const char * pszDBFFile, const char * pszCodePage, SAHooks *psHooks ); int SHPAPI_CALL DBFGetFieldCount( DBFHandle psDBF ); int SHPAPI_CALL DBFGetRecordCount( DBFHandle psDBF ); int SHPAPI_CALL DBFAddField( DBFHandle hDBF, const char * pszFieldName, DBFFieldType eType, int nWidth, int nDecimals ); int SHPAPI_CALL DBFAddNativeFieldType( DBFHandle hDBF, const char * pszFieldName, char chType, int nWidth, int nDecimals ); int SHPAPI_CALL DBFDeleteField( DBFHandle hDBF, int iField ); int SHPAPI_CALL DBFReorderFields( DBFHandle psDBF, int* panMap ); int SHPAPI_CALL DBFAlterFieldDefn( DBFHandle psDBF, int iField, const char * pszFieldName, char chType, int nWidth, int nDecimals ); DBFFieldType SHPAPI_CALL DBFGetFieldInfo( DBFHandle psDBF, int iField, char * pszFieldName, int * pnWidth, int * pnDecimals ); int SHPAPI_CALL DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName); int SHPAPI_CALL DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField ); double SHPAPI_CALL DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField ); const char SHPAPI_CALL1(*) DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField ); const char SHPAPI_CALL1(*) DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, int nFieldValue ); int SHPAPI_CALL DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField, double dFieldValue ); int SHPAPI_CALL DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField, const char * pszFieldValue ); int SHPAPI_CALL DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField, const char lFieldValue); int SHPAPI_CALL DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField, void * pValue ); const char SHPAPI_CALL1(*) DBFReadTuple(DBFHandle psDBF, int hEntity ); int SHPAPI_CALL DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple ); int SHPAPI_CALL DBFIsRecordDeleted( DBFHandle psDBF, int iShape ); int SHPAPI_CALL DBFMarkRecordDeleted( DBFHandle psDBF, int iShape, int bIsDeleted ); DBFHandle SHPAPI_CALL DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename ); void SHPAPI_CALL DBFClose( DBFHandle hDBF ); void SHPAPI_CALL DBFUpdateHeader( DBFHandle hDBF ); char SHPAPI_CALL DBFGetNativeFieldType( DBFHandle hDBF, int iField ); const char SHPAPI_CALL1(*) DBFGetCodePage(DBFHandle psDBF ); void SHPAPI_CALL DBFSetLastModifiedDate( DBFHandle psDBF, int nYYSince1900, int nMM, int nDD ); void SHPAPI_CALL DBFSetWriteEndOfFileChar( DBFHandle psDBF, int bWriteFlag ); #ifdef __cplusplus } #endif #endif /* ndef SHAPEFILE_H_INCLUDED */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/shapelib-1.5.0/Win64/include/shapefil.h
#ifndef SHAPEFILE_H_INCLUDED #define SHAPEFILE_H_INCLUDED /****************************************************************************** * $Id: shapefil.h,v 1.55 2016-12-05 18:44:08 erouault Exp $ * * Project: Shapelib * Purpose: Primary include file for Shapelib. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 1999, Frank Warmerdam * Copyright (c) 2012-2016, Even Rouault <even dot rouault at mines-paris dot org> * * This software is available under the following "MIT Style" license, * or at the option of the licensee under the LGPL (see COPYING). This * option is discussed in more detail in shapelib.html. * * -- * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * $Log: shapefil.h,v $ * Revision 1.55 2016-12-05 18:44:08 erouault * * dbfopen.c, shapefil.h: write DBF end-of-file character 0x1A by default. * This behaviour can be controlled with the DBFSetWriteEndOfFileChar() * function. * * Revision 1.54 2016-12-05 12:44:05 erouault * * Major overhaul of Makefile build system to use autoconf/automake. * * * Warning fixes in contrib/ * * Revision 1.53 2016-12-04 15:30:15 erouault * * shpopen.c, dbfopen.c, shptree.c, shapefil.h: resync with * GDAL Shapefile driver. Mostly cleanups. SHPObject and DBFInfo * structures extended with new members. New functions: * DBFSetLastModifiedDate, SHPOpenLLEx, SHPRestoreSHX, * SHPSetFastModeReadObject * * * sbnsearch.c: new file to implement original ESRI .sbn spatial * index reading. (no write support). New functions: * SBNOpenDiskTree, SBNCloseDiskTree, SBNSearchDiskTree, * SBNSearchDiskTreeInteger, SBNSearchFreeIds * * * Makefile, makefile.vc, CMakeLists.txt, shapelib.def: updates * with new file and symbols. * * * commit: helper script to cvs commit * * Revision 1.52 2011-12-11 22:26:46 fwarmerdam * upgrade .qix access code to use SAHooks (gdal #3365) * * Revision 1.51 2011-07-24 05:59:25 fwarmerdam * minimize use of CPLError in favor of SAHooks.Error() * * Revision 1.50 2011-05-13 17:35:17 fwarmerdam * added DBFReorderFields() and DBFAlterFields() functions (from Even) * * Revision 1.49 2011-04-16 14:38:21 fwarmerdam * avoid warnings with gcc on SHP_CVSID * * Revision 1.48 2010-08-27 23:42:52 fwarmerdam * add SHPAPI_CALL attribute in code * * Revision 1.47 2010-01-28 11:34:34 fwarmerdam * handle the shape file length limits more gracefully (#3236) * * Revision 1.46 2008-11-12 14:28:15 fwarmerdam * DBFCreateField() now works on files with records * * Revision 1.45 2008/11/11 17:47:10 fwarmerdam * added DBFDeleteField() function * * Revision 1.44 2008/01/16 20:05:19 bram * Add file hooks that accept UTF-8 encoded filenames on some platforms. Use SASetupUtf8Hooks * tosetup the hooks and check SHPAPI_UTF8_HOOKS for its availability. Currently, this * is only available on the Windows platform that decodes the UTF-8 filenames to wide * character strings and feeds them to _wfopen and _wremove. * * Revision 1.43 2008/01/10 16:35:30 fwarmerdam * avoid _ prefix on #defined symbols (bug 1840) * * Revision 1.42 2007/12/18 18:28:14 bram * - create hook for client specific atof (bugzilla ticket 1615) * - check for NULL handle before closing cpCPG file, and close after reading. * * Revision 1.41 2007/12/15 20:25:32 bram * dbfopen.c now reads the Code Page information from the DBF file, and exports * this information as a string through the DBFGetCodePage function. This is * either the number from the LDID header field ("LDID/<number>") or as the * content of an accompanying .CPG file. When creating a DBF file, the code can * be set using DBFCreateEx. * * Revision 1.40 2007/12/06 07:00:25 fwarmerdam * dbfopen now using SAHooks for fileio * * Revision 1.39 2007/12/04 20:37:56 fwarmerdam * preliminary implementation of hooks api for io and errors * * Revision 1.38 2007/11/21 22:39:56 fwarmerdam * close shx file in readonly mode (GDAL #1956) * * Revision 1.37 2007/10/27 03:31:14 fwarmerdam * limit default depth of tree to 12 levels (gdal ticket #1594) * * Revision 1.36 2007/09/10 23:33:15 fwarmerdam * Upstreamed support for visibility flag in SHPAPI_CALL for the needs * of GDAL (gdal ticket #1810). * * Revision 1.35 2007/09/03 19:48:10 fwarmerdam * move DBFReadAttribute() static dDoubleField into dbfinfo * * Revision 1.34 2006/06/17 15:33:32 fwarmerdam * added pszWorkField - bug 1202 (rso) * * Revision 1.33 2006/02/15 01:14:30 fwarmerdam * added DBFAddNativeFieldType * * Revision 1.32 2006/01/26 15:07:32 fwarmerdam * add bMeasureIsUsed flag from Craig Bruce: Bug 1249 * * Revision 1.31 2006/01/05 01:27:27 fwarmerdam * added dbf deletion mark/fetch * * Revision 1.30 2005/01/03 22:30:13 fwarmerdam * added support for saved quadtrees * * Revision 1.29 2004/09/26 20:09:35 fwarmerdam * avoid rcsid warnings * * Revision 1.28 2003/12/29 06:02:18 fwarmerdam * added cpl_error.h option * * Revision 1.27 2003/04/21 18:30:37 warmerda * added header write/update public methods * * Revision 1.26 2002/09/29 00:00:08 warmerda * added FTLogical and logical attribute read/write calls * * Revision 1.25 2002/05/07 13:46:30 warmerda * added DBFWriteAttributeDirectly(). * * Revision 1.24 2002/04/10 16:59:54 warmerda * added SHPRewindObject * * Revision 1.23 2002/01/15 14:36:07 warmerda * updated email address * * Revision 1.22 2002/01/15 14:32:00 warmerda * try to improve SHPAPI_CALL docs */ #include <stdio.h> #ifdef USE_DBMALLOC #include <dbmalloc.h> #endif #ifdef USE_CPL #include "cpl_conv.h" #endif #ifdef __cplusplus extern "C" { #endif /************************************************************************/ /* Configuration options. */ /************************************************************************/ /* -------------------------------------------------------------------- */ /* Should the DBFReadStringAttribute() strip leading and */ /* trailing white space? */ /* -------------------------------------------------------------------- */ #define TRIM_DBF_WHITESPACE /* -------------------------------------------------------------------- */ /* Should we write measure values to the Multipatch object? */ /* Reportedly ArcView crashes if we do write it, so for now it */ /* is disabled. */ /* -------------------------------------------------------------------- */ #define DISABLE_MULTIPATCH_MEASURE /* -------------------------------------------------------------------- */ /* SHPAPI_CALL */ /* */ /* The following two macros are present to allow forcing */ /* various calling conventions on the Shapelib API. */ /* */ /* To force __stdcall conventions (needed to call Shapelib */ /* from Visual Basic and/or Dephi I believe) the makefile could */ /* be modified to define: */ /* */ /* /DSHPAPI_CALL=__stdcall */ /* */ /* If it is desired to force export of the Shapelib API without */ /* using the shapelib.def file, use the following definition. */ /* */ /* /DSHAPELIB_DLLEXPORT */ /* */ /* To get both at once it will be necessary to hack this */ /* include file to define: */ /* */ /* #define SHPAPI_CALL __declspec(dllexport) __stdcall */ /* #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall */ /* */ /* The complexity of the situation is partly caused by the */ /* peculiar requirement of Visual C++ that __stdcall appear */ /* after any "*"'s in the return value of a function while the */ /* __declspec(dllexport) must appear before them. */ /* -------------------------------------------------------------------- */ #ifdef SHAPELIB_DLLEXPORT # define SHPAPI_CALL __declspec(dllexport) # define SHPAPI_CALL1(x) __declspec(dllexport) x #endif #ifndef SHPAPI_CALL # if defined(USE_GCC_VISIBILITY_FLAG) # define SHPAPI_CALL __attribute__ ((visibility("default"))) # define SHPAPI_CALL1(x) __attribute__ ((visibility("default"))) x # else # define SHPAPI_CALL # endif #endif #ifndef SHPAPI_CALL1 # define SHPAPI_CALL1(x) x SHPAPI_CALL #endif /* -------------------------------------------------------------------- */ /* Macros for controlling CVSID and ensuring they don't appear */ /* as unreferenced variables resulting in lots of warnings. */ /* -------------------------------------------------------------------- */ #ifndef DISABLE_CVSID # if defined(__GNUC__) && __GNUC__ >= 4 # define SHP_CVSID(string) static const char cpl_cvsid[] __attribute__((used)) = string; # else # define SHP_CVSID(string) static const char cpl_cvsid[] = string; \ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); } # endif #else # define SHP_CVSID(string) #endif /* -------------------------------------------------------------------- */ /* On some platforms, additional file IO hooks are defined that */ /* UTF-8 encoded filenames Unicode filenames */ /* -------------------------------------------------------------------- */ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) # define SHPAPI_WINDOWS # define SHPAPI_UTF8_HOOKS #endif /* -------------------------------------------------------------------- */ /* IO/Error hook functions. */ /* -------------------------------------------------------------------- */ typedef int *SAFile; #ifndef SAOffset typedef unsigned long SAOffset; #endif typedef struct { SAFile (*FOpen) ( const char *filename, const char *access); SAOffset (*FRead) ( void *p, SAOffset size, SAOffset nmemb, SAFile file); SAOffset (*FWrite)( void *p, SAOffset size, SAOffset nmemb, SAFile file); SAOffset (*FSeek) ( SAFile file, SAOffset offset, int whence ); SAOffset (*FTell) ( SAFile file ); int (*FFlush)( SAFile file ); int (*FClose)( SAFile file ); int (*Remove) ( const char *filename ); void (*Error) ( const char *message ); double (*Atof) ( const char *str ); } SAHooks; void SHPAPI_CALL SASetupDefaultHooks( SAHooks *psHooks ); #ifdef SHPAPI_UTF8_HOOKS void SHPAPI_CALL SASetupUtf8Hooks( SAHooks *psHooks ); #endif /************************************************************************/ /* SHP Support. */ /************************************************************************/ typedef struct tagSHPObject SHPObject; typedef struct { SAHooks sHooks; SAFile fpSHP; SAFile fpSHX; int nShapeType; /* SHPT_* */ unsigned int nFileSize; /* SHP file */ int nRecords; int nMaxRecords; unsigned int*panRecOffset; unsigned int *panRecSize; double adBoundsMin[4]; double adBoundsMax[4]; int bUpdated; unsigned char *pabyRec; int nBufSize; int bFastModeReadObject; unsigned char *pabyObjectBuf; int nObjectBufSize; SHPObject* psCachedObject; } SHPInfo; typedef SHPInfo * SHPHandle; /* -------------------------------------------------------------------- */ /* Shape types (nSHPType) */ /* -------------------------------------------------------------------- */ #define SHPT_NULL 0 #define SHPT_POINT 1 #define SHPT_ARC 3 #define SHPT_POLYGON 5 #define SHPT_MULTIPOINT 8 #define SHPT_POINTZ 11 #define SHPT_ARCZ 13 #define SHPT_POLYGONZ 15 #define SHPT_MULTIPOINTZ 18 #define SHPT_POINTM 21 #define SHPT_ARCM 23 #define SHPT_POLYGONM 25 #define SHPT_MULTIPOINTM 28 #define SHPT_MULTIPATCH 31 /* -------------------------------------------------------------------- */ /* Part types - everything but SHPT_MULTIPATCH just uses */ /* SHPP_RING. */ /* -------------------------------------------------------------------- */ #define SHPP_TRISTRIP 0 #define SHPP_TRIFAN 1 #define SHPP_OUTERRING 2 #define SHPP_INNERRING 3 #define SHPP_FIRSTRING 4 #define SHPP_RING 5 /* -------------------------------------------------------------------- */ /* SHPObject - represents on shape (without attributes) read */ /* from the .shp file. */ /* -------------------------------------------------------------------- */ struct tagSHPObject { int nSHPType; int nShapeId; /* -1 is unknown/unassigned */ int nParts; int *panPartStart; int *panPartType; int nVertices; double *padfX; double *padfY; double *padfZ; double *padfM; double dfXMin; double dfYMin; double dfZMin; double dfMMin; double dfXMax; double dfYMax; double dfZMax; double dfMMax; int bMeasureIsUsed; int bFastModeReadObject; }; /* -------------------------------------------------------------------- */ /* SHP API Prototypes */ /* -------------------------------------------------------------------- */ /* If pszAccess is read-only, the fpSHX field of the returned structure */ /* will be NULL as it is not necessary to keep the SHX file open */ SHPHandle SHPAPI_CALL SHPOpen( const char * pszShapeFile, const char * pszAccess ); SHPHandle SHPAPI_CALL SHPOpenLL( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks ); SHPHandle SHPAPI_CALL SHPOpenLLEx( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks, int bRestoreSHX ); int SHPAPI_CALL SHPRestoreSHX( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks ); /* If setting bFastMode = TRUE, the content of SHPReadObject() is owned by the SHPHandle. */ /* So you cannot have 2 valid instances of SHPReadObject() simultaneously. */ /* The SHPObject padfZ and padfM members may be NULL depending on the geometry */ /* type. It is illegal to free at hand any of the pointer members of the SHPObject structure */ void SHPAPI_CALL SHPSetFastModeReadObject( SHPHandle hSHP, int bFastMode ); SHPHandle SHPAPI_CALL SHPCreate( const char * pszShapeFile, int nShapeType ); SHPHandle SHPAPI_CALL SHPCreateLL( const char * pszShapeFile, int nShapeType, SAHooks *psHooks ); void SHPAPI_CALL SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType, double * padfMinBound, double * padfMaxBound ); SHPObject SHPAPI_CALL1(*) SHPReadObject( SHPHandle hSHP, int iShape ); int SHPAPI_CALL SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject ); void SHPAPI_CALL SHPDestroyObject( SHPObject * psObject ); void SHPAPI_CALL SHPComputeExtents( SHPObject * psObject ); SHPObject SHPAPI_CALL1(*) SHPCreateObject( int nSHPType, int nShapeId, int nParts, const int * panPartStart, const int * panPartType, int nVertices, const double * padfX, const double * padfY, const double * padfZ, const double * padfM ); SHPObject SHPAPI_CALL1(*) SHPCreateSimpleObject( int nSHPType, int nVertices, const double * padfX, const double * padfY, const double * padfZ ); int SHPAPI_CALL SHPRewindObject( SHPHandle hSHP, SHPObject * psObject ); void SHPAPI_CALL SHPClose( SHPHandle hSHP ); void SHPAPI_CALL SHPWriteHeader( SHPHandle hSHP ); const char SHPAPI_CALL1(*) SHPTypeName( int nSHPType ); const char SHPAPI_CALL1(*) SHPPartTypeName( int nPartType ); /* -------------------------------------------------------------------- */ /* Shape quadtree indexing API. */ /* -------------------------------------------------------------------- */ /* this can be two or four for binary or quad tree */ #define MAX_SUBNODE 4 /* upper limit of tree levels for automatic estimation */ #define MAX_DEFAULT_TREE_DEPTH 12 typedef struct shape_tree_node { /* region covered by this node */ double adfBoundsMin[4]; double adfBoundsMax[4]; /* list of shapes stored at this node. The papsShapeObj pointers or the whole list can be NULL */ int nShapeCount; int *panShapeIds; SHPObject **papsShapeObj; int nSubNodes; struct shape_tree_node *apsSubNode[MAX_SUBNODE]; } SHPTreeNode; typedef struct { SHPHandle hSHP; int nMaxDepth; int nDimension; int nTotalCount; SHPTreeNode *psRoot; } SHPTree; SHPTree SHPAPI_CALL1(*) SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth, double *padfBoundsMin, double *padfBoundsMax ); void SHPAPI_CALL SHPDestroyTree( SHPTree * hTree ); int SHPAPI_CALL SHPWriteTree( SHPTree *hTree, const char * pszFilename ); int SHPAPI_CALL SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject ); int SHPAPI_CALL SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId ); void SHPAPI_CALL SHPTreeTrimExtraNodes( SHPTree * hTree ); int SHPAPI_CALL1(*) SHPTreeFindLikelyShapes( SHPTree * hTree, double * padfBoundsMin, double * padfBoundsMax, int * ); int SHPAPI_CALL SHPCheckBoundsOverlap( double *, double *, double *, double *, int ); int SHPAPI_CALL1(*) SHPSearchDiskTree( FILE *fp, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); typedef struct SHPDiskTreeInfo* SHPTreeDiskHandle; SHPTreeDiskHandle SHPAPI_CALL SHPOpenDiskTree( const char* pszQIXFilename, SAHooks *psHooks ); void SHPAPI_CALL SHPCloseDiskTree( SHPTreeDiskHandle hDiskTree ); int SHPAPI_CALL1(*) SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); int SHPAPI_CALL SHPWriteTreeLL(SHPTree *hTree, const char *pszFilename, SAHooks *psHooks ); /* -------------------------------------------------------------------- */ /* SBN Search API */ /* -------------------------------------------------------------------- */ typedef struct SBNSearchInfo* SBNSearchHandle; SBNSearchHandle SHPAPI_CALL SBNOpenDiskTree( const char* pszSBNFilename, SAHooks *psHooks ); void SHPAPI_CALL SBNCloseDiskTree( SBNSearchHandle hSBN ); int SHPAPI_CALL1(*) SBNSearchDiskTree( SBNSearchHandle hSBN, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); int SHPAPI_CALL1(*) SBNSearchDiskTreeInteger( SBNSearchHandle hSBN, int bMinX, int bMinY, int bMaxX, int bMaxY, int *pnShapeCount ); void SHPAPI_CALL SBNSearchFreeIds( int* panShapeId ); /************************************************************************/ /* DBF Support. */ /************************************************************************/ typedef struct { SAHooks sHooks; SAFile fp; int nRecords; int nRecordLength; /* Must fit on uint16 */ int nHeaderLength; /* File header length (32) + field descriptor length + spare space. Must fit on uint16 */ int nFields; int *panFieldOffset; int *panFieldSize; int *panFieldDecimals; char *pachFieldType; char *pszHeader; /* Field descriptors */ int nCurrentRecord; int bCurrentRecordModified; char *pszCurrentRecord; int nWorkFieldLength; char *pszWorkField; int bNoHeader; int bUpdated; union { double dfDoubleField; int nIntField; } fieldValue; int iLanguageDriver; char *pszCodePage; int nUpdateYearSince1900; /* 0-255 */ int nUpdateMonth; /* 1-12 */ int nUpdateDay; /* 1-31 */ int bWriteEndOfFileChar; /* defaults to TRUE */ } DBFInfo; typedef DBFInfo * DBFHandle; typedef enum { FTString, FTInteger, FTDouble, FTLogical, FTInvalid } DBFFieldType; /* Field descriptor/header size */ #define XBASE_FLDHDR_SZ 32 /* Shapelib read up to 11 characters, even if only 10 should normally be used */ #define XBASE_FLDNAME_LEN_READ 11 /* On writing, we limit to 10 characters */ #define XBASE_FLDNAME_LEN_WRITE 10 /* Normally only 254 characters should be used. We tolerate 255 historically */ #define XBASE_FLD_MAX_WIDTH 255 DBFHandle SHPAPI_CALL DBFOpen( const char * pszDBFFile, const char * pszAccess ); DBFHandle SHPAPI_CALL DBFOpenLL( const char * pszDBFFile, const char * pszAccess, SAHooks *psHooks ); DBFHandle SHPAPI_CALL DBFCreate( const char * pszDBFFile ); DBFHandle SHPAPI_CALL DBFCreateEx( const char * pszDBFFile, const char * pszCodePage ); DBFHandle SHPAPI_CALL DBFCreateLL( const char * pszDBFFile, const char * pszCodePage, SAHooks *psHooks ); int SHPAPI_CALL DBFGetFieldCount( DBFHandle psDBF ); int SHPAPI_CALL DBFGetRecordCount( DBFHandle psDBF ); int SHPAPI_CALL DBFAddField( DBFHandle hDBF, const char * pszFieldName, DBFFieldType eType, int nWidth, int nDecimals ); int SHPAPI_CALL DBFAddNativeFieldType( DBFHandle hDBF, const char * pszFieldName, char chType, int nWidth, int nDecimals ); int SHPAPI_CALL DBFDeleteField( DBFHandle hDBF, int iField ); int SHPAPI_CALL DBFReorderFields( DBFHandle psDBF, int* panMap ); int SHPAPI_CALL DBFAlterFieldDefn( DBFHandle psDBF, int iField, const char * pszFieldName, char chType, int nWidth, int nDecimals ); DBFFieldType SHPAPI_CALL DBFGetFieldInfo( DBFHandle psDBF, int iField, char * pszFieldName, int * pnWidth, int * pnDecimals ); int SHPAPI_CALL DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName); int SHPAPI_CALL DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField ); double SHPAPI_CALL DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField ); const char SHPAPI_CALL1(*) DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField ); const char SHPAPI_CALL1(*) DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, int nFieldValue ); int SHPAPI_CALL DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField, double dFieldValue ); int SHPAPI_CALL DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField, const char * pszFieldValue ); int SHPAPI_CALL DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField, const char lFieldValue); int SHPAPI_CALL DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField, void * pValue ); const char SHPAPI_CALL1(*) DBFReadTuple(DBFHandle psDBF, int hEntity ); int SHPAPI_CALL DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple ); int SHPAPI_CALL DBFIsRecordDeleted( DBFHandle psDBF, int iShape ); int SHPAPI_CALL DBFMarkRecordDeleted( DBFHandle psDBF, int iShape, int bIsDeleted ); DBFHandle SHPAPI_CALL DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename ); void SHPAPI_CALL DBFClose( DBFHandle hDBF ); void SHPAPI_CALL DBFUpdateHeader( DBFHandle hDBF ); char SHPAPI_CALL DBFGetNativeFieldType( DBFHandle hDBF, int iField ); const char SHPAPI_CALL1(*) DBFGetCodePage(DBFHandle psDBF ); void SHPAPI_CALL DBFSetLastModifiedDate( DBFHandle psDBF, int nYYSince1900, int nMM, int nDD ); void SHPAPI_CALL DBFSetWriteEndOfFileChar( DBFHandle psDBF, int bWriteFlag ); #ifdef __cplusplus } #endif #endif /* ndef SHAPEFILE_H_INCLUDED */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/shapelib-1.5.0/Win32/include/shapefil.h
#ifndef SHAPEFILE_H_INCLUDED #define SHAPEFILE_H_INCLUDED /****************************************************************************** * $Id: shapefil.h,v 1.55 2016-12-05 18:44:08 erouault Exp $ * * Project: Shapelib * Purpose: Primary include file for Shapelib. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 1999, Frank Warmerdam * Copyright (c) 2012-2016, Even Rouault <even dot rouault at mines-paris dot org> * * This software is available under the following "MIT Style" license, * or at the option of the licensee under the LGPL (see COPYING). This * option is discussed in more detail in shapelib.html. * * -- * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * $Log: shapefil.h,v $ * Revision 1.55 2016-12-05 18:44:08 erouault * * dbfopen.c, shapefil.h: write DBF end-of-file character 0x1A by default. * This behaviour can be controlled with the DBFSetWriteEndOfFileChar() * function. * * Revision 1.54 2016-12-05 12:44:05 erouault * * Major overhaul of Makefile build system to use autoconf/automake. * * * Warning fixes in contrib/ * * Revision 1.53 2016-12-04 15:30:15 erouault * * shpopen.c, dbfopen.c, shptree.c, shapefil.h: resync with * GDAL Shapefile driver. Mostly cleanups. SHPObject and DBFInfo * structures extended with new members. New functions: * DBFSetLastModifiedDate, SHPOpenLLEx, SHPRestoreSHX, * SHPSetFastModeReadObject * * * sbnsearch.c: new file to implement original ESRI .sbn spatial * index reading. (no write support). New functions: * SBNOpenDiskTree, SBNCloseDiskTree, SBNSearchDiskTree, * SBNSearchDiskTreeInteger, SBNSearchFreeIds * * * Makefile, makefile.vc, CMakeLists.txt, shapelib.def: updates * with new file and symbols. * * * commit: helper script to cvs commit * * Revision 1.52 2011-12-11 22:26:46 fwarmerdam * upgrade .qix access code to use SAHooks (gdal #3365) * * Revision 1.51 2011-07-24 05:59:25 fwarmerdam * minimize use of CPLError in favor of SAHooks.Error() * * Revision 1.50 2011-05-13 17:35:17 fwarmerdam * added DBFReorderFields() and DBFAlterFields() functions (from Even) * * Revision 1.49 2011-04-16 14:38:21 fwarmerdam * avoid warnings with gcc on SHP_CVSID * * Revision 1.48 2010-08-27 23:42:52 fwarmerdam * add SHPAPI_CALL attribute in code * * Revision 1.47 2010-01-28 11:34:34 fwarmerdam * handle the shape file length limits more gracefully (#3236) * * Revision 1.46 2008-11-12 14:28:15 fwarmerdam * DBFCreateField() now works on files with records * * Revision 1.45 2008/11/11 17:47:10 fwarmerdam * added DBFDeleteField() function * * Revision 1.44 2008/01/16 20:05:19 bram * Add file hooks that accept UTF-8 encoded filenames on some platforms. Use SASetupUtf8Hooks * tosetup the hooks and check SHPAPI_UTF8_HOOKS for its availability. Currently, this * is only available on the Windows platform that decodes the UTF-8 filenames to wide * character strings and feeds them to _wfopen and _wremove. * * Revision 1.43 2008/01/10 16:35:30 fwarmerdam * avoid _ prefix on #defined symbols (bug 1840) * * Revision 1.42 2007/12/18 18:28:14 bram * - create hook for client specific atof (bugzilla ticket 1615) * - check for NULL handle before closing cpCPG file, and close after reading. * * Revision 1.41 2007/12/15 20:25:32 bram * dbfopen.c now reads the Code Page information from the DBF file, and exports * this information as a string through the DBFGetCodePage function. This is * either the number from the LDID header field ("LDID/<number>") or as the * content of an accompanying .CPG file. When creating a DBF file, the code can * be set using DBFCreateEx. * * Revision 1.40 2007/12/06 07:00:25 fwarmerdam * dbfopen now using SAHooks for fileio * * Revision 1.39 2007/12/04 20:37:56 fwarmerdam * preliminary implementation of hooks api for io and errors * * Revision 1.38 2007/11/21 22:39:56 fwarmerdam * close shx file in readonly mode (GDAL #1956) * * Revision 1.37 2007/10/27 03:31:14 fwarmerdam * limit default depth of tree to 12 levels (gdal ticket #1594) * * Revision 1.36 2007/09/10 23:33:15 fwarmerdam * Upstreamed support for visibility flag in SHPAPI_CALL for the needs * of GDAL (gdal ticket #1810). * * Revision 1.35 2007/09/03 19:48:10 fwarmerdam * move DBFReadAttribute() static dDoubleField into dbfinfo * * Revision 1.34 2006/06/17 15:33:32 fwarmerdam * added pszWorkField - bug 1202 (rso) * * Revision 1.33 2006/02/15 01:14:30 fwarmerdam * added DBFAddNativeFieldType * * Revision 1.32 2006/01/26 15:07:32 fwarmerdam * add bMeasureIsUsed flag from Craig Bruce: Bug 1249 * * Revision 1.31 2006/01/05 01:27:27 fwarmerdam * added dbf deletion mark/fetch * * Revision 1.30 2005/01/03 22:30:13 fwarmerdam * added support for saved quadtrees * * Revision 1.29 2004/09/26 20:09:35 fwarmerdam * avoid rcsid warnings * * Revision 1.28 2003/12/29 06:02:18 fwarmerdam * added cpl_error.h option * * Revision 1.27 2003/04/21 18:30:37 warmerda * added header write/update public methods * * Revision 1.26 2002/09/29 00:00:08 warmerda * added FTLogical and logical attribute read/write calls * * Revision 1.25 2002/05/07 13:46:30 warmerda * added DBFWriteAttributeDirectly(). * * Revision 1.24 2002/04/10 16:59:54 warmerda * added SHPRewindObject * * Revision 1.23 2002/01/15 14:36:07 warmerda * updated email address * * Revision 1.22 2002/01/15 14:32:00 warmerda * try to improve SHPAPI_CALL docs */ #include <stdio.h> #ifdef USE_DBMALLOC #include <dbmalloc.h> #endif #ifdef USE_CPL #include "cpl_conv.h" #endif #ifdef __cplusplus extern "C" { #endif /************************************************************************/ /* Configuration options. */ /************************************************************************/ /* -------------------------------------------------------------------- */ /* Should the DBFReadStringAttribute() strip leading and */ /* trailing white space? */ /* -------------------------------------------------------------------- */ #define TRIM_DBF_WHITESPACE /* -------------------------------------------------------------------- */ /* Should we write measure values to the Multipatch object? */ /* Reportedly ArcView crashes if we do write it, so for now it */ /* is disabled. */ /* -------------------------------------------------------------------- */ #define DISABLE_MULTIPATCH_MEASURE /* -------------------------------------------------------------------- */ /* SHPAPI_CALL */ /* */ /* The following two macros are present to allow forcing */ /* various calling conventions on the Shapelib API. */ /* */ /* To force __stdcall conventions (needed to call Shapelib */ /* from Visual Basic and/or Dephi I believe) the makefile could */ /* be modified to define: */ /* */ /* /DSHPAPI_CALL=__stdcall */ /* */ /* If it is desired to force export of the Shapelib API without */ /* using the shapelib.def file, use the following definition. */ /* */ /* /DSHAPELIB_DLLEXPORT */ /* */ /* To get both at once it will be necessary to hack this */ /* include file to define: */ /* */ /* #define SHPAPI_CALL __declspec(dllexport) __stdcall */ /* #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall */ /* */ /* The complexity of the situation is partly caused by the */ /* peculiar requirement of Visual C++ that __stdcall appear */ /* after any "*"'s in the return value of a function while the */ /* __declspec(dllexport) must appear before them. */ /* -------------------------------------------------------------------- */ #ifdef SHAPELIB_DLLEXPORT # define SHPAPI_CALL __declspec(dllexport) # define SHPAPI_CALL1(x) __declspec(dllexport) x #endif #ifndef SHPAPI_CALL # if defined(USE_GCC_VISIBILITY_FLAG) # define SHPAPI_CALL __attribute__ ((visibility("default"))) # define SHPAPI_CALL1(x) __attribute__ ((visibility("default"))) x # else # define SHPAPI_CALL # endif #endif #ifndef SHPAPI_CALL1 # define SHPAPI_CALL1(x) x SHPAPI_CALL #endif /* -------------------------------------------------------------------- */ /* Macros for controlling CVSID and ensuring they don't appear */ /* as unreferenced variables resulting in lots of warnings. */ /* -------------------------------------------------------------------- */ #ifndef DISABLE_CVSID # if defined(__GNUC__) && __GNUC__ >= 4 # define SHP_CVSID(string) static const char cpl_cvsid[] __attribute__((used)) = string; # else # define SHP_CVSID(string) static const char cpl_cvsid[] = string; \ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); } # endif #else # define SHP_CVSID(string) #endif /* -------------------------------------------------------------------- */ /* On some platforms, additional file IO hooks are defined that */ /* UTF-8 encoded filenames Unicode filenames */ /* -------------------------------------------------------------------- */ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) # define SHPAPI_WINDOWS # define SHPAPI_UTF8_HOOKS #endif /* -------------------------------------------------------------------- */ /* IO/Error hook functions. */ /* -------------------------------------------------------------------- */ typedef int *SAFile; #ifndef SAOffset typedef unsigned long SAOffset; #endif typedef struct { SAFile (*FOpen) ( const char *filename, const char *access); SAOffset (*FRead) ( void *p, SAOffset size, SAOffset nmemb, SAFile file); SAOffset (*FWrite)( void *p, SAOffset size, SAOffset nmemb, SAFile file); SAOffset (*FSeek) ( SAFile file, SAOffset offset, int whence ); SAOffset (*FTell) ( SAFile file ); int (*FFlush)( SAFile file ); int (*FClose)( SAFile file ); int (*Remove) ( const char *filename ); void (*Error) ( const char *message ); double (*Atof) ( const char *str ); } SAHooks; void SHPAPI_CALL SASetupDefaultHooks( SAHooks *psHooks ); #ifdef SHPAPI_UTF8_HOOKS void SHPAPI_CALL SASetupUtf8Hooks( SAHooks *psHooks ); #endif /************************************************************************/ /* SHP Support. */ /************************************************************************/ typedef struct tagSHPObject SHPObject; typedef struct { SAHooks sHooks; SAFile fpSHP; SAFile fpSHX; int nShapeType; /* SHPT_* */ unsigned int nFileSize; /* SHP file */ int nRecords; int nMaxRecords; unsigned int*panRecOffset; unsigned int *panRecSize; double adBoundsMin[4]; double adBoundsMax[4]; int bUpdated; unsigned char *pabyRec; int nBufSize; int bFastModeReadObject; unsigned char *pabyObjectBuf; int nObjectBufSize; SHPObject* psCachedObject; } SHPInfo; typedef SHPInfo * SHPHandle; /* -------------------------------------------------------------------- */ /* Shape types (nSHPType) */ /* -------------------------------------------------------------------- */ #define SHPT_NULL 0 #define SHPT_POINT 1 #define SHPT_ARC 3 #define SHPT_POLYGON 5 #define SHPT_MULTIPOINT 8 #define SHPT_POINTZ 11 #define SHPT_ARCZ 13 #define SHPT_POLYGONZ 15 #define SHPT_MULTIPOINTZ 18 #define SHPT_POINTM 21 #define SHPT_ARCM 23 #define SHPT_POLYGONM 25 #define SHPT_MULTIPOINTM 28 #define SHPT_MULTIPATCH 31 /* -------------------------------------------------------------------- */ /* Part types - everything but SHPT_MULTIPATCH just uses */ /* SHPP_RING. */ /* -------------------------------------------------------------------- */ #define SHPP_TRISTRIP 0 #define SHPP_TRIFAN 1 #define SHPP_OUTERRING 2 #define SHPP_INNERRING 3 #define SHPP_FIRSTRING 4 #define SHPP_RING 5 /* -------------------------------------------------------------------- */ /* SHPObject - represents on shape (without attributes) read */ /* from the .shp file. */ /* -------------------------------------------------------------------- */ struct tagSHPObject { int nSHPType; int nShapeId; /* -1 is unknown/unassigned */ int nParts; int *panPartStart; int *panPartType; int nVertices; double *padfX; double *padfY; double *padfZ; double *padfM; double dfXMin; double dfYMin; double dfZMin; double dfMMin; double dfXMax; double dfYMax; double dfZMax; double dfMMax; int bMeasureIsUsed; int bFastModeReadObject; }; /* -------------------------------------------------------------------- */ /* SHP API Prototypes */ /* -------------------------------------------------------------------- */ /* If pszAccess is read-only, the fpSHX field of the returned structure */ /* will be NULL as it is not necessary to keep the SHX file open */ SHPHandle SHPAPI_CALL SHPOpen( const char * pszShapeFile, const char * pszAccess ); SHPHandle SHPAPI_CALL SHPOpenLL( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks ); SHPHandle SHPAPI_CALL SHPOpenLLEx( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks, int bRestoreSHX ); int SHPAPI_CALL SHPRestoreSHX( const char *pszShapeFile, const char *pszAccess, SAHooks *psHooks ); /* If setting bFastMode = TRUE, the content of SHPReadObject() is owned by the SHPHandle. */ /* So you cannot have 2 valid instances of SHPReadObject() simultaneously. */ /* The SHPObject padfZ and padfM members may be NULL depending on the geometry */ /* type. It is illegal to free at hand any of the pointer members of the SHPObject structure */ void SHPAPI_CALL SHPSetFastModeReadObject( SHPHandle hSHP, int bFastMode ); SHPHandle SHPAPI_CALL SHPCreate( const char * pszShapeFile, int nShapeType ); SHPHandle SHPAPI_CALL SHPCreateLL( const char * pszShapeFile, int nShapeType, SAHooks *psHooks ); void SHPAPI_CALL SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType, double * padfMinBound, double * padfMaxBound ); SHPObject SHPAPI_CALL1(*) SHPReadObject( SHPHandle hSHP, int iShape ); int SHPAPI_CALL SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject ); void SHPAPI_CALL SHPDestroyObject( SHPObject * psObject ); void SHPAPI_CALL SHPComputeExtents( SHPObject * psObject ); SHPObject SHPAPI_CALL1(*) SHPCreateObject( int nSHPType, int nShapeId, int nParts, const int * panPartStart, const int * panPartType, int nVertices, const double * padfX, const double * padfY, const double * padfZ, const double * padfM ); SHPObject SHPAPI_CALL1(*) SHPCreateSimpleObject( int nSHPType, int nVertices, const double * padfX, const double * padfY, const double * padfZ ); int SHPAPI_CALL SHPRewindObject( SHPHandle hSHP, SHPObject * psObject ); void SHPAPI_CALL SHPClose( SHPHandle hSHP ); void SHPAPI_CALL SHPWriteHeader( SHPHandle hSHP ); const char SHPAPI_CALL1(*) SHPTypeName( int nSHPType ); const char SHPAPI_CALL1(*) SHPPartTypeName( int nPartType ); /* -------------------------------------------------------------------- */ /* Shape quadtree indexing API. */ /* -------------------------------------------------------------------- */ /* this can be two or four for binary or quad tree */ #define MAX_SUBNODE 4 /* upper limit of tree levels for automatic estimation */ #define MAX_DEFAULT_TREE_DEPTH 12 typedef struct shape_tree_node { /* region covered by this node */ double adfBoundsMin[4]; double adfBoundsMax[4]; /* list of shapes stored at this node. The papsShapeObj pointers or the whole list can be NULL */ int nShapeCount; int *panShapeIds; SHPObject **papsShapeObj; int nSubNodes; struct shape_tree_node *apsSubNode[MAX_SUBNODE]; } SHPTreeNode; typedef struct { SHPHandle hSHP; int nMaxDepth; int nDimension; int nTotalCount; SHPTreeNode *psRoot; } SHPTree; SHPTree SHPAPI_CALL1(*) SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth, double *padfBoundsMin, double *padfBoundsMax ); void SHPAPI_CALL SHPDestroyTree( SHPTree * hTree ); int SHPAPI_CALL SHPWriteTree( SHPTree *hTree, const char * pszFilename ); int SHPAPI_CALL SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject ); int SHPAPI_CALL SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId ); void SHPAPI_CALL SHPTreeTrimExtraNodes( SHPTree * hTree ); int SHPAPI_CALL1(*) SHPTreeFindLikelyShapes( SHPTree * hTree, double * padfBoundsMin, double * padfBoundsMax, int * ); int SHPAPI_CALL SHPCheckBoundsOverlap( double *, double *, double *, double *, int ); int SHPAPI_CALL1(*) SHPSearchDiskTree( FILE *fp, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); typedef struct SHPDiskTreeInfo* SHPTreeDiskHandle; SHPTreeDiskHandle SHPAPI_CALL SHPOpenDiskTree( const char* pszQIXFilename, SAHooks *psHooks ); void SHPAPI_CALL SHPCloseDiskTree( SHPTreeDiskHandle hDiskTree ); int SHPAPI_CALL1(*) SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); int SHPAPI_CALL SHPWriteTreeLL(SHPTree *hTree, const char *pszFilename, SAHooks *psHooks ); /* -------------------------------------------------------------------- */ /* SBN Search API */ /* -------------------------------------------------------------------- */ typedef struct SBNSearchInfo* SBNSearchHandle; SBNSearchHandle SHPAPI_CALL SBNOpenDiskTree( const char* pszSBNFilename, SAHooks *psHooks ); void SHPAPI_CALL SBNCloseDiskTree( SBNSearchHandle hSBN ); int SHPAPI_CALL1(*) SBNSearchDiskTree( SBNSearchHandle hSBN, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount ); int SHPAPI_CALL1(*) SBNSearchDiskTreeInteger( SBNSearchHandle hSBN, int bMinX, int bMinY, int bMaxX, int bMaxY, int *pnShapeCount ); void SHPAPI_CALL SBNSearchFreeIds( int* panShapeId ); /************************************************************************/ /* DBF Support. */ /************************************************************************/ typedef struct { SAHooks sHooks; SAFile fp; int nRecords; int nRecordLength; /* Must fit on uint16 */ int nHeaderLength; /* File header length (32) + field descriptor length + spare space. Must fit on uint16 */ int nFields; int *panFieldOffset; int *panFieldSize; int *panFieldDecimals; char *pachFieldType; char *pszHeader; /* Field descriptors */ int nCurrentRecord; int bCurrentRecordModified; char *pszCurrentRecord; int nWorkFieldLength; char *pszWorkField; int bNoHeader; int bUpdated; union { double dfDoubleField; int nIntField; } fieldValue; int iLanguageDriver; char *pszCodePage; int nUpdateYearSince1900; /* 0-255 */ int nUpdateMonth; /* 1-12 */ int nUpdateDay; /* 1-31 */ int bWriteEndOfFileChar; /* defaults to TRUE */ } DBFInfo; typedef DBFInfo * DBFHandle; typedef enum { FTString, FTInteger, FTDouble, FTLogical, FTInvalid } DBFFieldType; /* Field descriptor/header size */ #define XBASE_FLDHDR_SZ 32 /* Shapelib read up to 11 characters, even if only 10 should normally be used */ #define XBASE_FLDNAME_LEN_READ 11 /* On writing, we limit to 10 characters */ #define XBASE_FLDNAME_LEN_WRITE 10 /* Normally only 254 characters should be used. We tolerate 255 historically */ #define XBASE_FLD_MAX_WIDTH 255 DBFHandle SHPAPI_CALL DBFOpen( const char * pszDBFFile, const char * pszAccess ); DBFHandle SHPAPI_CALL DBFOpenLL( const char * pszDBFFile, const char * pszAccess, SAHooks *psHooks ); DBFHandle SHPAPI_CALL DBFCreate( const char * pszDBFFile ); DBFHandle SHPAPI_CALL DBFCreateEx( const char * pszDBFFile, const char * pszCodePage ); DBFHandle SHPAPI_CALL DBFCreateLL( const char * pszDBFFile, const char * pszCodePage, SAHooks *psHooks ); int SHPAPI_CALL DBFGetFieldCount( DBFHandle psDBF ); int SHPAPI_CALL DBFGetRecordCount( DBFHandle psDBF ); int SHPAPI_CALL DBFAddField( DBFHandle hDBF, const char * pszFieldName, DBFFieldType eType, int nWidth, int nDecimals ); int SHPAPI_CALL DBFAddNativeFieldType( DBFHandle hDBF, const char * pszFieldName, char chType, int nWidth, int nDecimals ); int SHPAPI_CALL DBFDeleteField( DBFHandle hDBF, int iField ); int SHPAPI_CALL DBFReorderFields( DBFHandle psDBF, int* panMap ); int SHPAPI_CALL DBFAlterFieldDefn( DBFHandle psDBF, int iField, const char * pszFieldName, char chType, int nWidth, int nDecimals ); DBFFieldType SHPAPI_CALL DBFGetFieldInfo( DBFHandle psDBF, int iField, char * pszFieldName, int * pnWidth, int * pnDecimals ); int SHPAPI_CALL DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName); int SHPAPI_CALL DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField ); double SHPAPI_CALL DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField ); const char SHPAPI_CALL1(*) DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField ); const char SHPAPI_CALL1(*) DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, int nFieldValue ); int SHPAPI_CALL DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField, double dFieldValue ); int SHPAPI_CALL DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField, const char * pszFieldValue ); int SHPAPI_CALL DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField ); int SHPAPI_CALL DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField, const char lFieldValue); int SHPAPI_CALL DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField, void * pValue ); const char SHPAPI_CALL1(*) DBFReadTuple(DBFHandle psDBF, int hEntity ); int SHPAPI_CALL DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple ); int SHPAPI_CALL DBFIsRecordDeleted( DBFHandle psDBF, int iShape ); int SHPAPI_CALL DBFMarkRecordDeleted( DBFHandle psDBF, int iShape, int bIsDeleted ); DBFHandle SHPAPI_CALL DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename ); void SHPAPI_CALL DBFClose( DBFHandle hDBF ); void SHPAPI_CALL DBFUpdateHeader( DBFHandle hDBF ); char SHPAPI_CALL DBFGetNativeFieldType( DBFHandle hDBF, int iField ); const char SHPAPI_CALL1(*) DBFGetCodePage(DBFHandle psDBF ); void SHPAPI_CALL DBFSetLastModifiedDate( DBFHandle psDBF, int nYYSince1900, int nMM, int nDD ); void SHPAPI_CALL DBFSetWriteEndOfFileChar( DBFHandle psDBF, int bWriteFlag ); #ifdef __cplusplus } #endif #endif /* ndef SHAPEFILE_H_INCLUDED */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Linux/include/proj.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Revised, experimental API for PROJ.4, intended as the foundation * for added geodetic functionality. * * The original proj API (defined in projects.h) has grown organically * over the years, but it has also grown somewhat messy. * * The same has happened with the newer high level API (defined in * proj_api.h): To support various historical objectives, proj_api.h * contains a rather complex combination of conditional defines and * typedefs. Probably for good (historical) reasons, which are not * always evident from today's perspective. * * This is an evolving attempt at creating a re-rationalized API * with primary design goals focused on sanitizing the namespaces. * Hence, all symbols exposed are being moved to the proj_ namespace, * while all data types are being moved to the PJ_ namespace. * * Please note that this API is *orthogonal* to the previous APIs: * Apart from some inclusion guards, projects.h and proj_api.h are not * touched - if you do not include proj.h, the projects and proj_api * APIs should work as they always have. * * A few implementation details: * * Apart from the namespacing efforts, I'm trying to eliminate three * proj_api elements, which I have found especially confusing. * * FIRST and foremost, I try to avoid typedef'ing away pointer * semantics. I agree that it can be occasionally useful, but I * prefer having the pointer nature of function arguments being * explicitly visible. * * Hence, projCtx has been replaced by PJ_CONTEXT *. * and projPJ has been replaced by PJ * * * SECOND, I try to eliminate cases of information hiding implemented * by redefining data types to void pointers. * * I prefer using a combination of forward declarations and typedefs. * Hence: * typedef void *projCtx; * Has been replaced by: * struct projCtx_t; * typedef struct projCtx_t PJ_CONTEXT; * This makes it possible for the calling program to know that the * PJ_CONTEXT data type exists, and handle pointers to that data type * without having any idea about its internals. * * (obviously, in this example, struct projCtx_t should also be * renamed struct pj_ctx some day, but for backwards compatibility * it remains as-is for now). * * THIRD, I try to eliminate implicit type punning. Hence this API * introduces the PJ_COORD union data type, for generic 4D coordinate * handling. * * PJ_COORD makes it possible to make explicit the previously used * "implicit type punning", where a XY is turned into a LP by * re#defining both as UV, behind the back of the user. * * The PJ_COORD union is used for storing 1D, 2D, 3D and 4D coordinates. * * The bare essentials API presented here follows the PROJ.4 * convention of sailing the coordinate to be reprojected, up on * the stack ("call by value"), and symmetrically returning the * result on the stack. Although the PJ_COORD object is twice as large * as the traditional XY and LP objects, timing results have shown the * overhead to be very reasonable. * * Contexts and thread safety * -------------------------- * * After a year of experiments (and previous experience from the * trlib transformation library) it has become clear that the * context subsystem is unavoidable in a multi-threaded world. * Hence, instead of hiding it away, we move it into the limelight, * highly recommending (but not formally requiring) the bracketing * of any code block calling PROJ.4 functions with calls to * proj_context_create(...)/proj_context_destroy() * * Legacy single threaded code need not do anything, but *may* * implement a bit of future compatibility by using the backward * compatible call proj_context_create(0), which will not create * a new context, but simply provide a pointer to the default one. * * See proj_4D_api_test.c for examples of how to use the API. * * Author: Thomas Knudsen, <thokn@sdfe.dk> * Benefitting from a large number of comments and suggestions * by (primarily) Kristian Evers and Even Rouault. * ****************************************************************************** * Copyright (c) 2016, 2017, Thomas Knudsen / SDFE * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO COORD SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ #include <stddef.h> /* For size_t */ #ifdef PROJECTS_H #error proj.h must be included before projects.h #endif #ifdef PROJ_API_H #error proj.h must be included before proj_api.h #endif #ifndef PROJ_H #define PROJ_H #ifdef __cplusplus extern "C" { #endif /* The version numbers should be updated with every release! **/ #define PROJ_VERSION_MAJOR 5 #define PROJ_VERSION_MINOR 2 #define PROJ_VERSION_PATCH 0 extern char const pj_release[]; /* global release id string */ /* first forward declare everything needed */ /* Data type for generic geodetic 3D data plus epoch information */ union PJ_COORD; typedef union PJ_COORD PJ_COORD; struct PJ_AREA; typedef struct PJ_AREA PJ_AREA; struct P5_FACTORS { /* Common designation */ double meridional_scale; /* h */ double parallel_scale; /* k */ double areal_scale; /* s */ double angular_distortion; /* omega */ double meridian_parallel_angle; /* theta-prime */ double meridian_convergence; /* alpha */ double tissot_semimajor; /* a */ double tissot_semiminor; /* b */ double dx_dlam, dx_dphi; double dy_dlam, dy_dphi; }; typedef struct P5_FACTORS PJ_FACTORS; /* Data type for projection/transformation information */ struct PJconsts; typedef struct PJconsts PJ; /* the PJ object herself */ /* Data type for library level information */ struct PJ_INFO; typedef struct PJ_INFO PJ_INFO; struct PJ_PROJ_INFO; typedef struct PJ_PROJ_INFO PJ_PROJ_INFO; struct PJ_GRID_INFO; typedef struct PJ_GRID_INFO PJ_GRID_INFO; struct PJ_INIT_INFO; typedef struct PJ_INIT_INFO PJ_INIT_INFO; /* Data types for list of operations, ellipsoids, datums and units used in PROJ.4 */ struct PJ_LIST; typedef struct PJ_LIST PJ_OPERATIONS; struct PJ_ELLPS; typedef struct PJ_ELLPS PJ_ELLPS; struct PJ_UNITS; typedef struct PJ_UNITS PJ_UNITS; struct PJ_PRIME_MERIDIANS; typedef struct PJ_PRIME_MERIDIANS PJ_PRIME_MERIDIANS; /* Geodetic, mostly spatiotemporal coordinate types */ typedef struct { double x, y, z, t; } PJ_XYZT; typedef struct { double u, v, w, t; } PJ_UVWT; typedef struct { double lam, phi, z, t; } PJ_LPZT; typedef struct { double o, p, k; } PJ_OPK; /* Rotations: omega, phi, kappa */ typedef struct { double e, n, u; } PJ_ENU; /* East, North, Up */ typedef struct { double s, a1, a2; } PJ_GEOD; /* Geodesic length, fwd azi, rev azi */ /* Classic proj.4 pair/triplet types - moved into the PJ_ name space */ typedef struct { double u, v; } PJ_UV; typedef struct { double x, y; } PJ_XY; typedef struct { double lam, phi; } PJ_LP; typedef struct { double x, y, z; } PJ_XYZ; typedef struct { double u, v, w; } PJ_UVW; typedef struct { double lam, phi, z; } PJ_LPZ; /* Avoid preprocessor renaming and implicit type-punning: Use a union to make it explicit */ union PJ_COORD { double v[4]; /* First and foremost, it really is "just 4 numbers in a vector" */ PJ_XYZT xyzt; PJ_UVWT uvwt; PJ_LPZT lpzt; PJ_GEOD geod; PJ_OPK opk; PJ_ENU enu; PJ_XYZ xyz; PJ_UVW uvw; PJ_LPZ lpz; PJ_XY xy; PJ_UV uv; PJ_LP lp; }; struct PJ_INFO { int major; /* Major release number */ int minor; /* Minor release number */ int patch; /* Patch level */ const char *release; /* Release info. Version + date */ const char *version; /* Full version number */ const char *searchpath; /* Paths where init and grid files are */ /* looked for. Paths are separated by */ /* semi-colons. */ const char * const *paths; size_t path_count; }; struct PJ_PROJ_INFO { const char *id; /* Name of the projection in question */ const char *description; /* Description of the projection */ const char *definition; /* Projection definition */ int has_inverse; /* 1 if an inverse mapping exists, 0 otherwise */ double accuracy; /* Expected accuracy of the transformation. -1 if unknown. */ }; struct PJ_GRID_INFO { char gridname[32]; /* name of grid */ char filename[260]; /* full path to grid */ char format[8]; /* file format of grid */ PJ_LP lowerleft; /* Coordinates of lower left corner */ PJ_LP upperright; /* Coordinates of upper right corner */ int n_lon, n_lat; /* Grid size */ double cs_lon, cs_lat; /* Cell size of grid */ }; struct PJ_INIT_INFO { char name[32]; /* name of init file */ char filename[260]; /* full path to the init file. */ char version[32]; /* version of the init file */ char origin[32]; /* origin of the file, e.g. EPSG */ char lastupdate[16]; /* Date of last update in YYYY-MM-DD format */ }; typedef enum PJ_LOG_LEVEL { PJ_LOG_NONE = 0, PJ_LOG_ERROR = 1, PJ_LOG_DEBUG = 2, PJ_LOG_TRACE = 3, PJ_LOG_TELL = 4, PJ_LOG_DEBUG_MAJOR = 2, /* for proj_api.h compatibility */ PJ_LOG_DEBUG_MINOR = 3 /* for proj_api.h compatibility */ } PJ_LOG_LEVEL; typedef void (*PJ_LOG_FUNCTION)(void *, int, const char *); /* The context type - properly namespaced synonym for projCtx */ struct projCtx_t; typedef struct projCtx_t PJ_CONTEXT; /* A P I */ /* Functionality for handling thread contexts */ #define PJ_DEFAULT_CTX 0 PJ_CONTEXT *proj_context_create (void); PJ_CONTEXT *proj_context_destroy (PJ_CONTEXT *ctx); /* Manage the transformation definition object PJ */ PJ *proj_create (PJ_CONTEXT *ctx, const char *definition); PJ *proj_create_argv (PJ_CONTEXT *ctx, int argc, char **argv); PJ *proj_create_crs_to_crs(PJ_CONTEXT *ctx, const char *srid_from, const char *srid_to, PJ_AREA *area); PJ *proj_destroy (PJ *P); /* Setter-functions for the opaque PJ_AREA struct */ /* Uncomment these when implementing support for area-based transformations. void proj_area_bbox(PJ_AREA *area, LP ll, LP ur); void proj_area_description(PJ_AREA *area, const char *descr); */ /* Apply transformation to observation - in forward or inverse direction */ enum PJ_DIRECTION { PJ_FWD = 1, /* Forward */ PJ_IDENT = 0, /* Do nothing */ PJ_INV = -1 /* Inverse */ }; typedef enum PJ_DIRECTION PJ_DIRECTION; int proj_angular_input (PJ *P, enum PJ_DIRECTION dir); int proj_angular_output (PJ *P, enum PJ_DIRECTION dir); PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD coord); int proj_trans_array (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord); size_t proj_trans_generic ( PJ *P, PJ_DIRECTION direction, double *x, size_t sx, size_t nx, double *y, size_t sy, size_t ny, double *z, size_t sz, size_t nz, double *t, size_t st, size_t nt ); /* Initializers */ PJ_COORD proj_coord (double x, double y, double z, double t); /* Measure internal consistency - in forward or inverse direction */ double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coord); /* Geodesic distance between two points with angular 2D coordinates */ double proj_lp_dist (const PJ *P, PJ_COORD a, PJ_COORD b); /* The geodesic distance AND the vertical offset */ double proj_lpz_dist (const PJ *P, PJ_COORD a, PJ_COORD b); /* Euclidean distance between two points with linear 2D coordinates */ double proj_xy_dist (PJ_COORD a, PJ_COORD b); /* Euclidean distance between two points with linear 3D coordinates */ double proj_xyz_dist (PJ_COORD a, PJ_COORD b); /* Geodesic distance (in meter) + fwd and rev azimuth between two points on the ellipsoid */ PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b); /* Set or read error level */ int proj_context_errno (PJ_CONTEXT *ctx); int proj_errno (const PJ *P); int proj_errno_set (const PJ *P, int err); int proj_errno_reset (const PJ *P); int proj_errno_restore (const PJ *P, int err); const char* proj_errno_string (int err); PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL log_level); void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf); /* Scaling and angular distortion factors */ PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp); /* Info functions - get information about various PROJ.4 entities */ PJ_INFO proj_info(void); PJ_PROJ_INFO proj_pj_info(PJ *P); PJ_GRID_INFO proj_grid_info(const char *gridname); PJ_INIT_INFO proj_init_info(const char *initname); /* List functions: */ /* Get lists of operations, ellipsoids, units and prime meridians. */ const PJ_OPERATIONS *proj_list_operations(void); const PJ_ELLPS *proj_list_ellps(void); const PJ_UNITS *proj_list_units(void); const PJ_PRIME_MERIDIANS *proj_list_prime_meridians(void); /* These are trivial, and while occasionally useful in real code, primarily here to */ /* simplify demo code, and in acknowledgement of the proj-internal discrepancy between */ /* angular units expected by classical proj, and by Charles Karney's geodesics subsystem */ double proj_torad (double angle_in_degrees); double proj_todeg (double angle_in_radians); /* Geographical to geocentric latitude - another of the "simple, but useful" */ PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD coord); double proj_dmstor(const char *is, char **rs); char* proj_rtodms(char *s, double r, int pos, int neg); #ifdef __cplusplus } #endif #endif /* ndef PROJ_H */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Linux/include/proj_api.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Public (application) include file for PROJ.4 API, and constants. * Author: Frank Warmerdam, <warmerdam@pobox.com> * ****************************************************************************** * Copyright (c) 2001, Frank Warmerdam <warmerdam@pobox.com> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ /* * This version number should be updated with every release! * * This file is expected to be removed from the PROJ distribution * when a few minor-version releases has been made. * */ #ifndef PJ_VERSION #define PJ_VERSION 520 #endif /* If we're not asked for PJ_VERSION only, give them everything */ #ifndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY /* General projections header file */ #ifndef PROJ_API_H #define PROJ_API_H /* standard inclusions */ #include <math.h> #include <stddef.h> #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* pj_init() and similar functions can be used with a non-C locale */ /* Can be detected too at runtime if the symbol pj_atof exists */ #define PJ_LOCALE_SAFE 1 #define RAD_TO_DEG 57.295779513082321 #define DEG_TO_RAD .017453292519943296 #if defined(PROJECTS_H) || defined(PROJ_H) #define PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API #endif extern char const pj_release[]; /* global release id string */ extern int pj_errno; /* global error return code */ #ifndef PROJ_INTERNAL_H /* replaced by enum proj_log_level in proj_internal.h */ #define PJ_LOG_NONE 0 #define PJ_LOG_ERROR 1 #define PJ_LOG_DEBUG_MAJOR 2 #define PJ_LOG_DEBUG_MINOR 3 #endif #ifdef PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API /* These make the function declarations below conform with classic proj */ typedef PJ *projPJ; /* projPJ is a pointer to PJ */ typedef struct projCtx_t *projCtx; /* projCtx is a pointer to projCtx_t */ #ifdef PROJ_H # define projXY PJ_XY # define projLP PJ_LP # define projXYZ PJ_XYZ # define projLPZ PJ_LPZ #else # define projXY XY # define projLP LP # define projXYZ XYZ # define projLPZ LPZ #endif #else /* i.e. proj_api invoked as primary API */ typedef struct { double u, v; } projUV; typedef struct { double u, v, w; } projUVW; typedef void *projPJ; #define projXY projUV #define projLP projUV #define projXYZ projUVW #define projLPZ projUVW typedef void *projCtx; #endif /* If included *after* proj.h finishes, we have alternative names */ /* file reading api, like stdio */ typedef int *PAFile; typedef struct projFileAPI_t { PAFile (*FOpen)(projCtx ctx, const char *filename, const char *access); size_t (*FRead)(void *buffer, size_t size, size_t nmemb, PAFile file); int (*FSeek)(PAFile file, long offset, int whence); long (*FTell)(PAFile file); void (*FClose)(PAFile); } projFileAPI; /* procedure prototypes */ projCtx pj_get_default_ctx(void); projCtx pj_get_ctx( projPJ ); projXY pj_fwd(projLP, projPJ); projLP pj_inv(projXY, projPJ); projXYZ pj_fwd3d(projLPZ, projPJ); projLPZ pj_inv3d(projXYZ, projPJ); int pj_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); int pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); int pj_geocentric_to_geodetic( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); int pj_geodetic_to_geocentric( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); int pj_compare_datums( projPJ srcdefn, projPJ dstdefn ); int pj_apply_gridshift( projCtx, const char *, int, long point_count, int point_offset, double *x, double *y, double *z ); void pj_deallocate_grids(void); void pj_clear_initcache(void); int pj_is_latlong(projPJ); int pj_is_geocent(projPJ); void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared); void pj_pr_list(projPJ); void pj_free(projPJ); void pj_set_finder( const char *(*)(const char *) ); void pj_set_searchpath ( int count, const char **path ); projPJ pj_init(int, char **); projPJ pj_init_plus(const char *); projPJ pj_init_ctx( projCtx, int, char ** ); projPJ pj_init_plus_ctx( projCtx, const char * ); char *pj_get_def(projPJ, int); projPJ pj_latlong_from_proj( projPJ ); int pj_has_inverse(projPJ); void *pj_malloc(size_t); void pj_dalloc(void *); void *pj_calloc (size_t n, size_t size); void *pj_dealloc (void *ptr); char *pj_strdup(const char *str); char *pj_strerrno(int); int *pj_get_errno_ref(void); const char *pj_get_release(void); void pj_acquire_lock(void); void pj_release_lock(void); void pj_cleanup_lock(void); void pj_set_ctx( projPJ, projCtx ); projCtx pj_ctx_alloc(void); void pj_ctx_free( projCtx ); int pj_ctx_get_errno( projCtx ); void pj_ctx_set_errno( projCtx, int ); void pj_ctx_set_debug( projCtx, int ); void pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) ); void pj_ctx_set_app_data( projCtx, void * ); void *pj_ctx_get_app_data( projCtx ); void pj_ctx_set_fileapi( projCtx, projFileAPI *); projFileAPI *pj_ctx_get_fileapi( projCtx ); void pj_log( projCtx ctx, int level, const char *fmt, ... ); void pj_stderr_logger( void *, int, const char * ); /* file api */ projFileAPI *pj_get_default_fileapi(void); PAFile pj_ctx_fopen(projCtx ctx, const char *filename, const char *access); size_t pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file); int pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence); long pj_ctx_ftell(projCtx ctx, PAFile file); void pj_ctx_fclose(projCtx ctx, PAFile file); char *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file); PAFile pj_open_lib(projCtx, const char *, const char *); int pj_find_file(projCtx ctx, const char *short_filename, char* out_full_filename, size_t out_full_filename_size); #ifdef __cplusplus } #endif #endif /* ndef PROJ_API_H */ #endif /* ndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Linux/include/geodesic.h
/** * \file geodesic.h * \brief API for the geodesic routines in C * * This an implementation in C of the geodesic algorithms described in * - C. F. F. Karney, * <a href="https://doi.org/10.1007/s00190-012-0578-z"> * Algorithms for geodesics</a>, * J. Geodesy <b>87</b>, 43--55 (2013); * DOI: <a href="https://doi.org/10.1007/s00190-012-0578-z"> * 10.1007/s00190-012-0578-z</a>; * addenda: <a href="https://geographiclib.sourceforge.io/geod-addenda.html"> * geod-addenda.html</a>. * . * The principal advantages of these algorithms over previous ones (e.g., * Vincenty, 1975) are * - accurate to round off for |<i>f</i>| &lt; 1/50; * - the solution of the inverse problem is always found; * - differential and integral properties of geodesics are computed. * * The shortest path between two points on the ellipsoid at (\e lat1, \e * lon1) and (\e lat2, \e lon2) is called the geodesic. Its length is * \e s12 and the geodesic from point 1 to point 2 has forward azimuths * \e azi1 and \e azi2 at the two end points. * * Traditionally two geodesic problems are considered: * - the direct problem -- given \e lat1, \e lon1, \e s12, and \e azi1, * determine \e lat2, \e lon2, and \e azi2. This is solved by the function * geod_direct(). * - the inverse problem -- given \e lat1, \e lon1, and \e lat2, \e lon2, * determine \e s12, \e azi1, and \e azi2. This is solved by the function * geod_inverse(). * * The ellipsoid is specified by its equatorial radius \e a (typically in * meters) and flattening \e f. The routines are accurate to round off with * double precision arithmetic provided that |<i>f</i>| &lt; 1/50; for the * WGS84 ellipsoid, the errors are less than 15 nanometers. (Reasonably * accurate results are obtained for |<i>f</i>| &lt; 1/5.) For a prolate * ellipsoid, specify \e f &lt; 0. * * The routines also calculate several other quantities of interest * - \e S12 is the area between the geodesic from point 1 to point 2 and the * equator; i.e., it is the area, measured counter-clockwise, of the * quadrilateral with corners (\e lat1,\e lon1), (0,\e lon1), (0,\e lon2), * and (\e lat2,\e lon2). * - \e m12, the reduced length of the geodesic is defined such that if * the initial azimuth is perturbed by \e dazi1 (radians) then the * second point is displaced by \e m12 \e dazi1 in the direction * perpendicular to the geodesic. On a curved surface the reduced * length obeys a symmetry relation, \e m12 + \e m21 = 0. On a flat * surface, we have \e m12 = \e s12. * - \e M12 and \e M21 are geodesic scales. If two geodesics are * parallel at point 1 and separated by a small distance \e dt, then * they are separated by a distance \e M12 \e dt at point 2. \e M21 * is defined similarly (with the geodesics being parallel to one * another at point 2). On a flat surface, we have \e M12 = \e M21 * = 1. * - \e a12 is the arc length on the auxiliary sphere. This is a * construct for converting the problem to one in spherical * trigonometry. \e a12 is measured in degrees. The spherical arc * length from one equator crossing to the next is always 180&deg;. * * If points 1, 2, and 3 lie on a single geodesic, then the following * addition rules hold: * - \e s13 = \e s12 + \e s23 * - \e a13 = \e a12 + \e a23 * - \e S13 = \e S12 + \e S23 * - \e m13 = \e m12 \e M23 + \e m23 \e M21 * - \e M13 = \e M12 \e M23 &minus; (1 &minus; \e M12 \e M21) \e * m23 / \e m12 * - \e M31 = \e M32 \e M21 &minus; (1 &minus; \e M23 \e M32) \e * m12 / \e m23 * * The shortest distance returned by the solution of the inverse problem is * (obviously) uniquely defined. However, in a few special cases there are * multiple azimuths which yield the same shortest distance. Here is a * catalog of those cases: * - \e lat1 = &minus;\e lat2 (with neither point at a pole). If \e azi1 = \e * azi2, the geodesic is unique. Otherwise there are two geodesics and the * second one is obtained by setting [\e azi1, \e azi2] &rarr; [\e azi2, \e * azi1], [\e M12, \e M21] &rarr; [\e M21, \e M12], \e S12 &rarr; &minus;\e * S12. (This occurs when the longitude difference is near &plusmn;180&deg; * for oblate ellipsoids.) * - \e lon2 = \e lon1 &plusmn; 180&deg; (with neither point at a pole). If \e * azi1 = 0&deg; or &plusmn;180&deg;, the geodesic is unique. Otherwise * there are two geodesics and the second one is obtained by setting [\e * azi1, \e azi2] &rarr; [&minus;\e azi1, &minus;\e azi2], \e S12 &rarr; * &minus;\e S12. (This occurs when \e lat2 is near &minus;\e lat1 for * prolate ellipsoids.) * - Points 1 and 2 at opposite poles. There are infinitely many geodesics * which can be generated by setting [\e azi1, \e azi2] &rarr; [\e azi1, \e * azi2] + [\e d, &minus;\e d], for arbitrary \e d. (For spheres, this * prescription applies when points 1 and 2 are antipodal.) * - \e s12 = 0 (coincident points). There are infinitely many geodesics which * can be generated by setting [\e azi1, \e azi2] &rarr; [\e azi1, \e azi2] + * [\e d, \e d], for arbitrary \e d. * * These routines are a simple transcription of the corresponding C++ classes * in <a href="https://geographiclib.sourceforge.io"> GeographicLib</a>. The * "class data" is represented by the structs geod_geodesic, geod_geodesicline, * geod_polygon and pointers to these objects are passed as initial arguments * to the member functions. Most of the internal comments have been retained. * However, in the process of transcription some documentation has been lost * and the documentation for the C++ classes, GeographicLib::Geodesic, * GeographicLib::GeodesicLine, and GeographicLib::PolygonAreaT, should be * consulted. The C++ code remains the "reference implementation". Think * twice about restructuring the internals of the C code since this may make * porting fixes from the C++ code more difficult. * * Copyright (c) Charles Karney (2012-2018) <charles@karney.com> and licensed * under the MIT/X11 License. For more information, see * https://geographiclib.sourceforge.io/ * * This library was distributed with * <a href="../index.html">GeographicLib</a> 1.49. **********************************************************************/ #if !defined(GEODESIC_H) #define GEODESIC_H 1 /** * The major version of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_MAJOR 1 /** * The minor version of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_MINOR 49 /** * The patch level of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_PATCH 3 /** * Pack the version components into a single integer. Users should not rely on * this particular packing of the components of the version number; see the * documentation for GEODESIC_VERSION, below. **********************************************************************/ #define GEODESIC_VERSION_NUM(a,b,c) ((((a) * 10000 + (b)) * 100) + (c)) /** * The version of the geodesic library as a single integer, packed as MMmmmmpp * where MM is the major version, mmmm is the minor version, and pp is the * patch level. Users should not rely on this particular packing of the * components of the version number. Instead they should use a test such as * @code{.c} #if GEODESIC_VERSION >= GEODESIC_VERSION_NUM(1,40,0) ... #endif * @endcode **********************************************************************/ #define GEODESIC_VERSION \ GEODESIC_VERSION_NUM(GEODESIC_VERSION_MAJOR, \ GEODESIC_VERSION_MINOR, \ GEODESIC_VERSION_PATCH) #if defined(__cplusplus) extern "C" { #endif /** * The struct containing information about the ellipsoid. This must be * initialized by geod_init() before use. **********************************************************************/ struct geod_geodesic { double a; /**< the equatorial radius */ double f; /**< the flattening */ /**< @cond SKIP */ double f1, e2, ep2, n, b, c2, etol2; double A3x[6], C3x[15], C4x[21]; /**< @endcond */ }; /** * The struct containing information about a single geodesic. This must be * initialized by geod_lineinit(), geod_directline(), geod_gendirectline(), * or geod_inverseline() before use. **********************************************************************/ struct geod_geodesicline { double lat1; /**< the starting latitude */ double lon1; /**< the starting longitude */ double azi1; /**< the starting azimuth */ double a; /**< the equatorial radius */ double f; /**< the flattening */ double salp1; /**< sine of \e azi1 */ double calp1; /**< cosine of \e azi1 */ double a13; /**< arc length to reference point */ double s13; /**< distance to reference point */ /**< @cond SKIP */ double b, c2, f1, salp0, calp0, k2, ssig1, csig1, dn1, stau1, ctau1, somg1, comg1, A1m1, A2m1, A3c, B11, B21, B31, A4, B41; double C1a[6+1], C1pa[6+1], C2a[6+1], C3a[6], C4a[6]; /**< @endcond */ unsigned caps; /**< the capabilities */ }; /** * The struct for accumulating information about a geodesic polygon. This is * used for computing the perimeter and area of a polygon. This must be * initialized by geod_polygon_init() before use. **********************************************************************/ struct geod_polygon { double lat; /**< the current latitude */ double lon; /**< the current longitude */ /**< @cond SKIP */ double lat0; double lon0; double A[2]; double P[2]; int polyline; int crossings; /**< @endcond */ unsigned num; /**< the number of points so far */ }; /** * Initialize a geod_geodesic object. * * @param[out] g a pointer to the object to be initialized. * @param[in] a the equatorial radius (meters). * @param[in] f the flattening. **********************************************************************/ void geod_init(struct geod_geodesic* g, double a, double f); /** * Solve the direct geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. The values of \e lon2 * and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;]. Any of * the "return" arguments \e plat2, etc., may be replaced by 0, if you do not * need some quantities computed. * * If either point is at a pole, the azimuth is defined by keeping the * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and * taking the limit &epsilon; &rarr; 0+. An arc length greater that 180&deg; * signifies a geodesic which is not a shortest path. (For a prolate * ellipsoid, an additional condition is necessary for a shortest path: the * longitudinal extent must not exceed of 180&deg;.) * * Example, determine the point 10000 km NE of JFK: @code{.c} struct geod_geodesic g; double lat, lon; geod_init(&g, 6378137, 1/298.257223563); geod_direct(&g, 40.64, -73.78, 45.0, 10e6, &lat, &lon, 0); printf("%.5f %.5f\n", lat, lon); @endcode **********************************************************************/ void geod_direct(const struct geod_geodesic* g, double lat1, double lon1, double azi1, double s12, double* plat2, double* plon2, double* pazi2); /** * The general direct geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] flags bitor'ed combination of geod_flags(); \e flags & * GEOD_ARCMODE determines the meaning of \e s12_a12 and \e flags & * GEOD_LONG_UNROLL "unrolls" \e lon2. * @param[in] s12_a12 if \e flags & GEOD_ARCMODE is 0, this is the distance * from point 1 to point 2 (meters); otherwise it is the arc length * from point 1 to point 2 (degrees); it can be negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pm12 pointer to the reduced length of geodesic (meters). * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless). * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless). * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>). * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. The function value \e * a12 equals \e s12_a12 if \e flags & GEOD_ARCMODE. Any of the "return" * arguments, \e plat2, etc., may be replaced by 0, if you do not need some * quantities computed. * * With \e flags & GEOD_LONG_UNROLL bit set, the longitude is "unrolled" so * that the quantity \e lon2 &minus; \e lon1 indicates how many times and in * what sense the geodesic encircles the ellipsoid. **********************************************************************/ double geod_gendirect(const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned flags, double s12_a12, double* plat2, double* plon2, double* pazi2, double* ps12, double* pm12, double* pM12, double* pM21, double* pS12); /** * Solve the inverse geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 and * \e lat2 should be in the range [&minus;90&deg;, 90&deg;]. The values of * \e azi1 and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;]. * Any of the "return" arguments, \e ps12, etc., may be replaced by 0, if you * do not need some quantities computed. * * If either point is at a pole, the azimuth is defined by keeping the * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and * taking the limit &epsilon; &rarr; 0+. * * The solution to the inverse problem is found using Newton's method. If * this fails to converge (this is very unlikely in geodetic applications * but does occur for very eccentric ellipsoids), then the bisection method * is used to refine the solution. * * Example, determine the distance between JFK and Singapore Changi Airport: @code{.c} struct geod_geodesic g; double s12; geod_init(&g, 6378137, 1/298.257223563); geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, 0, 0); printf("%.3f\n", s12); @endcode **********************************************************************/ void geod_inverse(const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, double* ps12, double* pazi1, double* pazi2); /** * The general inverse geodesic calculation. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] pm12 pointer to the reduced length of geodesic (meters). * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless). * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless). * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>). * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 and * \e lat2 should be in the range [&minus;90&deg;, 90&deg;]. Any of the * "return" arguments \e ps12, etc., may be replaced by 0, if you do not need * some quantities computed. **********************************************************************/ double geod_geninverse(const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, double* ps12, double* pazi1, double* pazi2, double* pm12, double* pM12, double* pM21, double* pS12); /** * Initialize a geod_geodesicline object. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. * * The geod_mask values are [see geod_mask()]: * - \e caps |= GEOD_LATITUDE for the latitude \e lat2; this is * added automatically, * - \e caps |= GEOD_LONGITUDE for the latitude \e lon2, * - \e caps |= GEOD_AZIMUTH for the latitude \e azi2; this is * added automatically, * - \e caps |= GEOD_DISTANCE for the distance \e s12, * - \e caps |= GEOD_REDUCEDLENGTH for the reduced length \e m12, * - \e caps |= GEOD_GEODESICSCALE for the geodesic scales \e M12 * and \e M21, * - \e caps |= GEOD_AREA for the area \e S12, * - \e caps |= GEOD_DISTANCE_IN permits the length of the * geodesic to be given in terms of \e s12; without this capability the * length can only be specified in terms of arc length. * . * A value of \e caps = 0 is treated as GEOD_LATITUDE | GEOD_LONGITUDE | * GEOD_AZIMUTH | GEOD_DISTANCE_IN (to support the solution of the "standard" * direct problem). * * When initialized by this function, point 3 is undefined (l->s13 = l->a13 = * NaN). **********************************************************************/ void geod_lineinit(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the direct geodesic * problem. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the direct geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_directline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, double s12, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the direct geodesic * problem spacified in terms of either distance or arc length. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] flags either GEOD_NOFLAGS or GEOD_ARCMODE to determining the * meaning of the \e s12_a12. * @param[in] s12_a12 if \e flags = GEOD_NOFLAGS, this is the distance * from point 1 to point 2 (meters); if \e flags = GEOD_ARCMODE, it is * the arc length from point 1 to point 2 (degrees); it can be * negative. * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the direct geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_gendirectline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned flags, double s12_a12, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the inverse geodesic * problem. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the inverse geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_inverseline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, unsigned caps); /** * Compute the position along a geod_geodesicline. * * @param[in] l a pointer to the geod_geodesicline object specifying the * geodesic line. * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires * that \e l was initialized with \e caps |= GEOD_LONGITUDE. * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e l must have been initialized with a call, e.g., to geod_lineinit(), * with \e caps |= GEOD_DISTANCE_IN. The values of \e lon2 and \e azi2 * returned are in the range [&minus;180&deg;, 180&deg;]. Any of the * "return" arguments \e plat2, etc., may be replaced by 0, if you do not * need some quantities computed. * * Example, compute way points between JFK and Singapore Changi Airport * the "obvious" way using geod_direct(): @code{.c} struct geod_geodesic g; double s12, azi1, lat[101],lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0); for (i = 0; i < 101; ++i) { geod_direct(&g, 40.64, -73.78, azi1, i * s12 * 0.01, lat + i, lon + i, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode * A faster way using geod_position(): @code{.c} struct geod_geodesic g; struct geod_geodesicline l; double lat[101],lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverseline(&l, &g, 40.64, -73.78, 1.36, 103.99, 0); for (i = 0; i <= 100; ++i) { geod_position(&l, i * l.s13 * 0.01, lat + i, lon + i, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode **********************************************************************/ void geod_position(const struct geod_geodesicline* l, double s12, double* plat2, double* plon2, double* pazi2); /** * The general position function. * * @param[in] l a pointer to the geod_geodesicline object specifying the * geodesic line. * @param[in] flags bitor'ed combination of geod_flags(); \e flags & * GEOD_ARCMODE determines the meaning of \e s12_a12 and \e flags & * GEOD_LONG_UNROLL "unrolls" \e lon2; if \e flags & GEOD_ARCMODE is 0, * then \e l must have been initialized with \e caps |= GEOD_DISTANCE_IN. * @param[in] s12_a12 if \e flags & GEOD_ARCMODE is 0, this is the * distance from point 1 to point 2 (meters); otherwise it is the * arc length from point 1 to point 2 (degrees); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires * that \e l was initialized with \e caps |= GEOD_LONGITUDE. * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters); requires that \e l was initialized with \e caps |= * GEOD_DISTANCE. * @param[out] pm12 pointer to the reduced length of geodesic (meters); * requires that \e l was initialized with \e caps |= GEOD_REDUCEDLENGTH. * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless); requires that \e l was initialized with \e caps * |= GEOD_GEODESICSCALE. * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless); requires that \e l was initialized with \e caps * |= GEOD_GEODESICSCALE. * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>); requires that \e l was initialized with \e caps |= * GEOD_AREA. * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e l must have been initialized with a call to geod_lineinit() with \e * caps |= GEOD_DISTANCE_IN. The value \e azi2 returned is in the range * [&minus;180&deg;, 180&deg;]. Any of the "return" arguments \e plat2, * etc., may be replaced by 0, if you do not need some quantities * computed. Requesting a value which \e l is not capable of computing * is not an error; the corresponding argument will not be altered. * * With \e flags & GEOD_LONG_UNROLL bit set, the longitude is "unrolled" so * that the quantity \e lon2 &minus; \e lon1 indicates how many times and in * what sense the geodesic encircles the ellipsoid. * * Example, compute way points between JFK and Singapore Changi Airport using * geod_genposition(). In this example, the points are evenly space in arc * length (and so only approximately equally spaced in distance). This is * faster than using geod_position() and would be appropriate if drawing the * path on a map. @code{.c} struct geod_geodesic g; struct geod_geodesicline l; double lat[101], lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverseline(&l, &g, 40.64, -73.78, 1.36, 103.99, GEOD_LATITUDE | GEOD_LONGITUDE); for (i = 0; i <= 100; ++i) { geod_genposition(&l, GEOD_ARCMODE, i * l.a13 * 0.01, lat + i, lon + i, 0, 0, 0, 0, 0, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode **********************************************************************/ double geod_genposition(const struct geod_geodesicline* l, unsigned flags, double s12_a12, double* plat2, double* plon2, double* pazi2, double* ps12, double* pm12, double* pM12, double* pM21, double* pS12); /** * Specify position of point 3 in terms of distance. * * @param[in,out] l a pointer to the geod_geodesicline object. * @param[in] s13 the distance from point 1 to point 3 (meters); it * can be negative. * * This is only useful if the geod_geodesicline object has been constructed * with \e caps |= GEOD_DISTANCE_IN. **********************************************************************/ void geod_setdistance(struct geod_geodesicline* l, double s13); /** * Specify position of point 3 in terms of either distance or arc length. * * @param[in,out] l a pointer to the geod_geodesicline object. * @param[in] flags either GEOD_NOFLAGS or GEOD_ARCMODE to determining the * meaning of the \e s13_a13. * @param[in] s13_a13 if \e flags = GEOD_NOFLAGS, this is the distance * from point 1 to point 3 (meters); if \e flags = GEOD_ARCMODE, it is * the arc length from point 1 to point 3 (degrees); it can be * negative. * * If flags = GEOD_NOFLAGS, this calls geod_setdistance(). If flags = * GEOD_ARCMODE, the \e s13 is only set if the geod_geodesicline object has * been constructed with \e caps |= GEOD_DISTANCE. **********************************************************************/ void geod_gensetdistance(struct geod_geodesicline* l, unsigned flags, double s13_a13); /** * Initialize a geod_polygon object. * * @param[out] p a pointer to the object to be initialized. * @param[in] polylinep non-zero if a polyline instead of a polygon. * * If \e polylinep is zero, then the sequence of vertices and edges added by * geod_polygon_addpoint() and geod_polygon_addedge() define a polygon and * the perimeter and area are returned by geod_polygon_compute(). If \e * polylinep is non-zero, then the vertices and edges define a polyline and * only the perimeter is returned by geod_polygon_compute(). * * The area and perimeter are accumulated at two times the standard floating * point precision to guard against the loss of accuracy with many-sided * polygons. At any point you can ask for the perimeter and area so far. * * An example of the use of this function is given in the documentation for * geod_polygon_compute(). **********************************************************************/ void geod_polygon_init(struct geod_polygon* p, int polylinep); /** * Clear the polygon, allowing a new polygon to be started. * * @param[in,out] p a pointer to the object to be cleared. **********************************************************************/ void geod_polygon_clear(struct geod_polygon* p); /** * Add a point to the polygon or polyline. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in,out] p a pointer to the geod_polygon object specifying the * polygon. * @param[in] lat the latitude of the point (degrees). * @param[in] lon the longitude of the point (degrees). * * \e g and \e p must have been initialized with calls to geod_init() and * geod_polygon_init(), respectively. The same \e g must be used for all the * points and edges in a polygon. \e lat should be in the range * [&minus;90&deg;, 90&deg;]. * * An example of the use of this function is given in the documentation for * geod_polygon_compute(). **********************************************************************/ void geod_polygon_addpoint(const struct geod_geodesic* g, struct geod_polygon* p, double lat, double lon); /** * Add an edge to the polygon or polyline. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in,out] p a pointer to the geod_polygon object specifying the * polygon. * @param[in] azi azimuth at current point (degrees). * @param[in] s distance from current point to next point (meters). * * \e g and \e p must have been initialized with calls to geod_init() and * geod_polygon_init(), respectively. The same \e g must be used for all the * points and edges in a polygon. This does nothing if no points have been * added yet. The \e lat and \e lon fields of \e p give the location of the * new vertex. **********************************************************************/ void geod_polygon_addedge(const struct geod_geodesic* g, struct geod_polygon* p, double azi, double s); /** * Return the results for a polygon. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. * * The area and perimeter are accumulated at two times the standard floating * point precision to guard against the loss of accuracy with many-sided * polygons. Only simple polygons (which are not self-intersecting) are * allowed. There's no need to "close" the polygon by repeating the first * vertex. Set \e pA or \e pP to zero, if you do not want the corresponding * quantity returned. * * More points can be added to the polygon after this call. * * Example, compute the perimeter and area of the geodesic triangle with * vertices (0&deg;N,0&deg;E), (0&deg;N,90&deg;E), (90&deg;N,0&deg;E). @code{.c} double A, P; int n; struct geod_geodesic g; struct geod_polygon p; geod_init(&g, 6378137, 1/298.257223563); geod_polygon_init(&p, 0); geod_polygon_addpoint(&g, &p, 0, 0); geod_polygon_addpoint(&g, &p, 0, 90); geod_polygon_addpoint(&g, &p, 90, 0); n = geod_polygon_compute(&g, &p, 0, 1, &A, &P); printf("%d %.8f %.3f\n", n, P, A); @endcode **********************************************************************/ unsigned geod_polygon_compute(const struct geod_geodesic* g, const struct geod_polygon* p, int reverse, int sign, double* pA, double* pP); /** * Return the results assuming a tentative final test point is added; * however, the data for the test point is not saved. This lets you report a * running result for the perimeter and area as the user moves the mouse * cursor. Ordinary floating point arithmetic is used to accumulate the data * for the test point; thus the area and perimeter returned are less accurate * than if geod_polygon_addpoint() and geod_polygon_compute() are used. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] lat the latitude of the test point (degrees). * @param[in] lon the longitude of the test point (degrees). * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. * * \e lat should be in the range [&minus;90&deg;, 90&deg;]. **********************************************************************/ unsigned geod_polygon_testpoint(const struct geod_geodesic* g, const struct geod_polygon* p, double lat, double lon, int reverse, int sign, double* pA, double* pP); /** * Return the results assuming a tentative final test point is added via an * azimuth and distance; however, the data for the test point is not saved. * This lets you report a running result for the perimeter and area as the * user moves the mouse cursor. Ordinary floating point arithmetic is used * to accumulate the data for the test point; thus the area and perimeter * returned are less accurate than if geod_polygon_addedge() and * geod_polygon_compute() are used. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] azi azimuth at current point (degrees). * @param[in] s distance from current point to final test point (meters). * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. **********************************************************************/ unsigned geod_polygon_testedge(const struct geod_geodesic* g, const struct geod_polygon* p, double azi, double s, int reverse, int sign, double* pA, double* pP); /** * A simple interface for computing the area of a geodesic polygon. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lats an array of latitudes of the polygon vertices (degrees). * @param[in] lons an array of longitudes of the polygon vertices (degrees). * @param[in] n the number of vertices. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>). * @param[out] pP pointer to the perimeter of the polygon (meters). * * \e lats should be in the range [&minus;90&deg;, 90&deg;]. * * Only simple polygons (which are not self-intersecting) are allowed. * There's no need to "close" the polygon by repeating the first vertex. The * area returned is signed with counter-clockwise traversal being treated as * positive. * * Example, compute the area of Antarctica: @code{.c} double lats[] = {-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7, -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7}, lons[] = {-74, -102, -102, -131, -163, 163, 172, 140, 113, 88, 59, 25, -4, -14, -33, -46, -61}; struct geod_geodesic g; double A, P; geod_init(&g, 6378137, 1/298.257223563); geod_polygonarea(&g, lats, lons, (sizeof lats) / (sizeof lats[0]), &A, &P); printf("%.0f %.2f\n", A, P); @endcode **********************************************************************/ void geod_polygonarea(const struct geod_geodesic* g, double lats[], double lons[], int n, double* pA, double* pP); /** * mask values for the \e caps argument to geod_lineinit(). **********************************************************************/ enum geod_mask { GEOD_NONE = 0U, /**< Calculate nothing */ GEOD_LATITUDE = 1U<<7 | 0U, /**< Calculate latitude */ GEOD_LONGITUDE = 1U<<8 | 1U<<3, /**< Calculate longitude */ GEOD_AZIMUTH = 1U<<9 | 0U, /**< Calculate azimuth */ GEOD_DISTANCE = 1U<<10 | 1U<<0, /**< Calculate distance */ GEOD_DISTANCE_IN = 1U<<11 | 1U<<0 | 1U<<1,/**< Allow distance as input */ GEOD_REDUCEDLENGTH= 1U<<12 | 1U<<0 | 1U<<2,/**< Calculate reduced length */ GEOD_GEODESICSCALE= 1U<<13 | 1U<<0 | 1U<<2,/**< Calculate geodesic scale */ GEOD_AREA = 1U<<14 | 1U<<4, /**< Calculate reduced length */ GEOD_ALL = 0x7F80U| 0x1FU /**< Calculate everything */ }; /** * flag values for the \e flags argument to geod_gendirect() and * geod_genposition() **********************************************************************/ enum geod_flags { GEOD_NOFLAGS = 0U, /**< No flags */ GEOD_ARCMODE = 1U<<0, /**< Position given in terms of arc distance */ GEOD_LONG_UNROLL = 1U<<15 /**< Unroll the longitude */ }; #if defined(__cplusplus) } #endif #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Linux/include/projects.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Primary (private) include file for PROJ.4 library. * Author: Gerald Evenden * ****************************************************************************** * Copyright (c) 2000, Frank Warmerdam * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ /* General projections header file */ #ifndef PROJECTS_H #define PROJECTS_H #ifdef _MSC_VER # ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE # endif # ifndef _CRT_NONSTDC_NO_DEPRECATE # define _CRT_NONSTDC_NO_DEPRECATE # endif /* enable predefined math constants M_* for MS Visual Studio workaround */ # ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES # endif #endif /* standard inclusions */ #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef __cplusplus #define C_NAMESPACE extern "C" #define C_NAMESPACE_VAR extern "C" extern "C" { #else #define C_NAMESPACE extern #define C_NAMESPACE_VAR #endif #ifndef NULL # define NULL 0 #endif #ifndef FALSE # define FALSE 0 #endif #ifndef TRUE # define TRUE 1 #endif #ifndef MAX # define MIN(a,b) ((a<b) ? a : b) # define MAX(a,b) ((a>b) ? a : b) #endif #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif #if INT_MAX == 2147483647 typedef int pj_int32; #elif LONG_MAX == 2147483647 typedef long pj_int32; #else #warning It seems no 32-bit integer type is available #endif /* maximum path/filename */ #ifndef MAX_PATH_FILENAME #define MAX_PATH_FILENAME 1024 #endif /* If we still haven't got M_PI*, we rely on our own defines. * For example, this is necessary when compiling with gcc and * the -ansi flag. */ #ifndef M_PI #define M_PI 3.14159265358979323846 #define M_PI_2 1.57079632679489661923 #define M_PI_4 0.78539816339744830962 #define M_2_PI 0.63661977236758134308 #endif /* M_SQRT2 might be missing */ #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 #endif /* some more useful math constants and aliases */ #define M_FORTPI M_PI_4 /* pi/4 */ #define M_HALFPI M_PI_2 /* pi/2 */ #define M_PI_HALFPI 4.71238898038468985769 /* 1.5*pi */ #define M_TWOPI 6.28318530717958647693 /* 2*pi */ #define M_TWO_D_PI M_2_PI /* 2/pi */ #define M_TWOPI_HALFPI 7.85398163397448309616 /* 2.5*pi */ /* maximum tag id length for +init and default files */ #ifndef ID_TAG_MAX #define ID_TAG_MAX 50 #endif /* Use WIN32 as a standard windows 32 bit declaration */ #if defined(_WIN32) && !defined(WIN32) # define WIN32 #endif #if defined(_WINDOWS) && !defined(WIN32) # define WIN32 #endif /* directory delimiter for DOS support */ #ifdef WIN32 #define DIR_CHAR '\\' #else #define DIR_CHAR '/' #endif #define USE_PROJUV typedef struct { double u, v; } projUV; typedef struct { double r, i; } COMPLEX; typedef struct { double u, v, w; } projUVW; /* If user explicitly includes proj.h, before projects.h, then avoid implicit type-punning */ #ifndef PROJ_H #ifndef PJ_LIB__ #define XY projUV #define LP projUV #define XYZ projUVW #define LPZ projUVW #else typedef struct { double x, y; } XY; typedef struct { double x, y, z; } XYZ; typedef struct { double lam, phi; } LP; typedef struct { double lam, phi, z; } LPZ; typedef struct { double u, v; } UV; typedef struct { double u, v, w; } UVW; #endif /* ndef PJ_LIB__ */ #else typedef PJ_XY XY; typedef PJ_LP LP; typedef PJ_UV UV; typedef PJ_XYZ XYZ; typedef PJ_LPZ LPZ; typedef PJ_UVW UVW; #endif /* ndef PROJ_H */ /* Forward declarations and typedefs for stuff needed inside the PJ object */ struct PJconsts; union PJ_COORD; struct geod_geodesic; struct pj_opaque; struct ARG_list; struct PJ_REGION_S; typedef struct PJ_REGION_S PJ_Region; typedef struct ARG_list paralist; /* parameter list */ #ifndef PROJ_INTERNAL_H enum pj_io_units { PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */ PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */ PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */ PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */ PJ_IO_UNITS_ANGULAR = 4 /* Radians */ }; #endif #ifndef PROJ_H typedef struct PJconsts PJ; /* the PJ object herself */ typedef union PJ_COORD PJ_COORD; #endif struct PJ_REGION_S { double ll_long; /* lower left corner coordinates (radians) */ double ll_lat; double ur_long; /* upper right corner coordinates (radians) */ double ur_lat; }; struct PJ_AREA { int id; /* Area ID in the EPSG database */ LP ll; /* Lower left corner of bounding box */ LP ur; /* Upper right corner of bounding box */ char descr[64]; /* text representation of area */ }; struct projCtx_t; typedef struct projCtx_t projCtx_t; /***************************************************************************** Some function types that are especially useful when working with PJs ****************************************************************************** PJ_CONSTRUCTOR: A function taking a pointer-to-PJ as arg, and returning a pointer-to-PJ. Historically called twice: First with a 0 argument, to allocate memory, second with the first return value as argument, for actual setup. PJ_DESTRUCTOR: A function taking a pointer-to-PJ and an integer as args, then first handling the deallocation of the PJ, afterwards handing the integer over to the error reporting subsystem, and finally returning a null pointer in support of the "return free (P)" (aka "get the hell out of here") idiom. PJ_OPERATOR: A function taking a PJ_COORD and a pointer-to-PJ as args, applying the PJ to the PJ_COORD, and returning the resulting PJ_COORD. *****************************************************************************/ typedef PJ *(* PJ_CONSTRUCTOR) (PJ *); typedef void *(* PJ_DESTRUCTOR) (PJ *, int); typedef PJ_COORD (* PJ_OPERATOR) (PJ_COORD, PJ *); /****************************************************************************/ /* base projection data structure */ struct PJconsts { /************************************************************************************* G E N E R A L P A R A M E T E R S T R U C T ************************************************************************************** TODO: Need some description here - especially about the thread context... This is the struct behind the PJ typedef **************************************************************************************/ projCtx_t *ctx; const char *descr; /* From pj_list.h or individual PJ_*.c file */ paralist *params; /* Parameter list */ char *def_full; /* Full textual definition (usually 0 - set by proj_pj_info) */ char *def_size; /* Shape and size parameters extracted from params */ char *def_shape; char *def_spherification; char *def_ellps; struct geod_geodesic *geod; /* For geodesic computations */ struct pj_opaque *opaque; /* Projection specific parameters, Defined in PJ_*.c */ int inverted; /* Tell high level API functions to swap inv/fwd */ /************************************************************************************* F U N C T I O N P O I N T E R S ************************************************************************************** For projection xxx, these are pointers to functions in the corresponding PJ_xxx.c file. pj_init() delegates the setup of these to pj_projection_specific_setup_xxx(), a name which is currently hidden behind the magic curtain of the PROJECTION macro. **************************************************************************************/ XY (*fwd)(LP, PJ *); LP (*inv)(XY, PJ *); XYZ (*fwd3d)(LPZ, PJ *); LPZ (*inv3d)(XYZ, PJ *); PJ_OPERATOR fwd4d; PJ_OPERATOR inv4d; PJ_DESTRUCTOR destructor; /************************************************************************************* E L L I P S O I D P A R A M E T E R S ************************************************************************************** Despite YAGNI, we add a large number of ellipsoidal shape parameters, which are not yet set up in pj_init. They are, however, inexpensive to compute, compared to the overall time taken for setting up the complex PJ object (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity). But during single point projections it will often be a useful thing to have these readily available without having to recompute at every pj_fwd / pj_inv call. With this wide selection, we should be ready for quite a number of geodetic algorithms, without having to incur further ABI breakage. **************************************************************************************/ /* The linear parameters */ double a; /* semimajor axis (radius if eccentricity==0) */ double b; /* semiminor axis */ double ra; /* 1/a */ double rb; /* 1/b */ /* The eccentricities */ double alpha; /* angular eccentricity */ double e; /* first eccentricity */ double es; /* first eccentricity squared */ double e2; /* second eccentricity */ double e2s; /* second eccentricity squared */ double e3; /* third eccentricity */ double e3s; /* third eccentricity squared */ double one_es; /* 1 - e^2 */ double rone_es; /* 1/one_es */ /* The flattenings */ double f; /* first flattening */ double f2; /* second flattening */ double n; /* third flattening */ double rf; /* 1/f */ double rf2; /* 1/f2 */ double rn; /* 1/n */ /* This one's for GRS80 */ double J; /* "Dynamic form factor" */ double es_orig, a_orig; /* es and a before any +proj related adjustment */ /************************************************************************************* C O O R D I N A T E H A N D L I N G **************************************************************************************/ int over; /* Over-range flag */ int geoc; /* Geocentric latitude flag */ int is_latlong; /* proj=latlong ... not really a projection at all */ int is_geocent; /* proj=geocent ... not really a projection at all */ int is_pipeline; /* 1 if PJ represents a pipeline */ int need_ellps; /* 0 for operations that are purely cartesian */ int skip_fwd_prepare; int skip_fwd_finalize; int skip_inv_prepare; int skip_inv_finalize; enum pj_io_units left; /* Flags for input/output coordinate types */ enum pj_io_units right; /* These PJs are used for implementing cs2cs style coordinate handling in the 4D API */ PJ *axisswap; PJ *cart; PJ *cart_wgs84; PJ *helmert; PJ *hgridshift; PJ *vgridshift; /************************************************************************************* C A R T O G R A P H I C O F F S E T S **************************************************************************************/ double lam0, phi0; /* central meridian, parallel */ double x0, y0, z0, t0; /* false easting and northing (and height and time) */ /************************************************************************************* S C A L I N G **************************************************************************************/ double k0; /* General scaling factor - e.g. the 0.9996 of UTM */ double to_meter, fr_meter; /* Plane coordinate scaling. Internal unit [m] */ double vto_meter, vfr_meter; /* Vertical scaling. Internal unit [m] */ /************************************************************************************* D A T U M S A N D H E I G H T S Y S T E M S ************************************************************************************** It may be possible, and meaningful, to move the list parts of this up to the PJ_CONTEXT level. **************************************************************************************/ int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ double datum_params[7]; /* Parameters for 3PARAM and 7PARAM */ struct _pj_gi **gridlist; /* TODO: Description needed */ int gridlist_count; int has_geoid_vgrids; /* TODO: Description needed */ struct _pj_gi **vgridlist_geoid; /* TODO: Description needed */ int vgridlist_geoid_count; double from_greenwich; /* prime meridian offset (in radians) */ double long_wrap_center; /* 0.0 for -180 to 180, actually in radians*/ int is_long_wrap_set; char axis[4]; /* Axis order, pj_transform/pj_adjust_axis */ /* New Datum Shift Grid Catalogs */ char *catalog_name; struct _PJ_GridCatalog *catalog; double datum_date; /* TODO: Description needed */ struct _pj_gi *last_before_grid; /* TODO: Description needed */ PJ_Region last_before_region; /* TODO: Description needed */ double last_before_date; /* TODO: Description needed */ struct _pj_gi *last_after_grid; /* TODO: Description needed */ PJ_Region last_after_region; /* TODO: Description needed */ double last_after_date; /* TODO: Description needed */ /************************************************************************************* E N D O F G E N E R A L P A R A M E T E R S T R U C T **************************************************************************************/ }; /* Parameter list (a copy of the +proj=... etc. parameters) */ struct ARG_list { paralist *next; char used; #if defined(__GNUC__) && __GNUC__ >= 8 char param[]; /* variable-length member */ /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */ /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */ #else char param[1]; /* variable-length member */ #endif }; typedef union { double f; int i; char *s; } PROJVALUE; struct PJ_ELLPS { char *id; /* ellipse keyword name */ char *major; /* a= value */ char *ell; /* elliptical parameter */ char *name; /* comments */ }; struct PJ_UNITS { char *id; /* units keyword */ char *to_meter; /* multiply by value to get meters */ char *name; /* comments */ double factor; /* to_meter factor in actual numbers */ }; struct PJ_DATUMS { char *id; /* datum keyword */ char *defn; /* ie. "to_wgs84=..." */ char *ellipse_id; /* ie from ellipse table */ char *comments; /* EPSG code, etc */ }; struct PJ_PRIME_MERIDIANS { char *id; /* prime meridian keyword */ char *defn; /* offset from greenwich in DMS format. */ }; struct DERIVS { double x_l, x_p; /* derivatives of x for lambda-phi */ double y_l, y_p; /* derivatives of y for lambda-phi */ }; struct FACTORS { struct DERIVS der; double h, k; /* meridional, parallel scales */ double omega, thetap; /* angular distortion, theta prime */ double conv; /* convergence */ double s; /* areal scale factor */ double a, b; /* max-min scale error */ int code; /* always 0 */ }; enum deprecated_constants_for_now_dropped_analytical_factors { IS_ANAL_XL_YL = 01, /* derivatives of lon analytic */ IS_ANAL_XP_YP = 02, /* derivatives of lat analytic */ IS_ANAL_HK = 04, /* h and k analytic */ IS_ANAL_CONV = 010 /* convergence analytic */ }; /* datum_type values */ #define PJD_UNKNOWN 0 #define PJD_3PARAM 1 #define PJD_7PARAM 2 #define PJD_GRIDSHIFT 3 #define PJD_WGS84 4 /* WGS84 (or anything considered equivalent) */ /* library errors */ #define PJD_ERR_NO_ARGS -1 #define PJD_ERR_NO_OPTION_IN_INIT_FILE -2 #define PJD_ERR_NO_COLON_IN_INIT_STRING -3 #define PJD_ERR_PROJ_NOT_NAMED -4 #define PJD_ERR_UNKNOWN_PROJECTION_ID -5 #define PJD_ERR_ECCENTRICITY_IS_ONE -6 #define PJD_ERR_UNKNOW_UNIT_ID -7 /* deprecated: typo */ #define PJD_ERR_UNKNOWN_UNIT_ID -7 #define PJD_ERR_INVALID_BOOLEAN_PARAM -8 #define PJD_ERR_UNKNOWN_ELLP_PARAM -9 #define PJD_ERR_REV_FLATTENING_IS_ZERO -10 #define PJD_ERR_REF_RAD_LARGER_THAN_90 -11 #define PJD_ERR_ES_LESS_THAN_ZERO -12 #define PJD_ERR_MAJOR_AXIS_NOT_GIVEN -13 #define PJD_ERR_LAT_OR_LON_EXCEED_LIMIT -14 #define PJD_ERR_INVALID_X_OR_Y -15 #define PJD_ERR_WRONG_FORMAT_DMS_VALUE -16 #define PJD_ERR_NON_CONV_INV_MERI_DIST -17 #define PJD_ERR_NON_CON_INV_PHI2 -18 #define PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE -19 #define PJD_ERR_TOLERANCE_CONDITION -20 #define PJD_ERR_CONIC_LAT_EQUAL -21 #define PJD_ERR_LAT_LARGER_THAN_90 -22 #define PJD_ERR_LAT1_IS_ZERO -23 #define PJD_ERR_LAT_TS_LARGER_THAN_90 -24 #define PJD_ERR_CONTROL_POINT_NO_DIST -25 #define PJD_ERR_NO_ROTATION_PROJ -26 #define PJD_ERR_W_OR_M_ZERO_OR_LESS -27 #define PJD_ERR_LSAT_NOT_IN_RANGE -28 #define PJD_ERR_PATH_NOT_IN_RANGE -29 #define PJD_ERR_H_LESS_THAN_ZERO -30 #define PJD_ERR_K_LESS_THAN_ZERO -31 #define PJD_ERR_LAT_1_OR_2_ZERO_OR_90 -32 #define PJD_ERR_LAT_0_OR_ALPHA_EQ_90 -33 #define PJD_ERR_ELLIPSOID_USE_REQUIRED -34 #define PJD_ERR_INVALID_UTM_ZONE -35 #define PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE -36 #define PJD_ERR_FAILED_TO_FIND_PROJ -37 #define PJD_ERR_FAILED_TO_LOAD_GRID -38 #define PJD_ERR_INVALID_M_OR_N -39 #define PJD_ERR_N_OUT_OF_RANGE -40 #define PJD_ERR_LAT_1_2_UNSPECIFIED -41 #define PJD_ERR_ABS_LAT1_EQ_ABS_LAT2 -42 #define PJD_ERR_LAT_0_HALF_PI_FROM_MEAN -43 #define PJD_ERR_UNPARSEABLE_CS_DEF -44 #define PJD_ERR_GEOCENTRIC -45 #define PJD_ERR_UNKNOWN_PRIME_MERIDIAN -46 #define PJD_ERR_AXIS -47 #define PJD_ERR_GRID_AREA -48 #define PJD_ERR_INVALID_SWEEP_AXIS -49 #define PJD_ERR_MALFORMED_PIPELINE -50 #define PJD_ERR_UNIT_FACTOR_LESS_THAN_0 -51 #define PJD_ERR_INVALID_SCALE -52 #define PJD_ERR_NON_CONVERGENT -53 #define PJD_ERR_MISSING_ARGS -54 #define PJD_ERR_LAT_0_IS_ZERO -55 #define PJD_ERR_ELLIPSOIDAL_UNSUPPORTED -56 #define PJD_ERR_TOO_MANY_INITS -57 #define PJD_ERR_INVALID_ARG -58 #define PJD_ERR_INCONSISTENT_UNIT -59 /* NOTE: Remember to update pj_strerrno.c and transient_error in */ /* pj_transform.c when adding new value */ struct projFileAPI_t; /* proj thread context */ struct projCtx_t { int last_errno; int debug_level; void (*logger)(void *, int, const char *); void *app_data; struct projFileAPI_t *fileapi; }; /* classic public API */ #include "proj_api.h" /* Generate pj_list external or make list from include file */ struct PJ_LIST { char *id; /* projection keyword */ PJ *(*proj)(PJ *); /* projection entry point */ char * const *descr; /* description text */ }; #ifndef USE_PJ_LIST_H extern struct PJ_LIST pj_list[]; #endif #ifndef PJ_ELLPS__ extern struct PJ_ELLPS pj_ellps[]; #endif #ifndef PJ_UNITS__ extern struct PJ_UNITS pj_units[]; #endif #ifndef PJ_DATUMS__ extern struct PJ_DATUMS pj_datums[]; extern struct PJ_PRIME_MERIDIANS pj_prime_meridians[]; #endif #ifdef PJ_LIB__ #define PROJ_HEAD(name, desc) static const char des_##name [] = desc #define OPERATION(name, NEED_ELLPS) \ \ pj_projection_specific_setup_##name (PJ *P); \ C_NAMESPACE PJ *pj_##name (PJ *P); \ \ C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \ \ C_NAMESPACE PJ *pj_##name (PJ *P) { \ if (P) \ return pj_projection_specific_setup_##name (P); \ P = (PJ*) pj_calloc (1, sizeof(PJ)); \ if (0==P) \ return 0; \ P->destructor = pj_default_destructor; \ P->descr = des_##name; \ P->need_ellps = NEED_ELLPS; \ P->left = PJ_IO_UNITS_ANGULAR; \ P->right = PJ_IO_UNITS_CLASSIC; \ return P; \ } \ \ PJ *pj_projection_specific_setup_##name (PJ *P) /* In ISO19000 lingo, an operation is either a conversion or a transformation */ #define CONVERSION(name, need_ellps) OPERATION (name, need_ellps) #define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps) /* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */ #define PROJECTION(name) CONVERSION (name, 1) #endif /* def PJ_LIB__ */ #define MAX_TAB_ID 80 typedef struct { float lam, phi; } FLP; typedef struct { pj_int32 lam, phi; } ILP; struct CTABLE { char id[MAX_TAB_ID]; /* ascii info */ LP ll; /* lower left corner coordinates */ LP del; /* size of cells */ ILP lim; /* limits of conversion matrix */ FLP *cvs; /* conversion matrix */ }; typedef struct _pj_gi { char *gridname; /* identifying name of grid, eg "conus" or ntv2_0.gsb */ char *filename; /* full path to filename */ const char *format; /* format of this grid, ie "ctable", "ntv1", "ntv2" or "missing". */ long grid_offset; /* offset in file, for delayed loading */ int must_swap; /* only for NTv2 */ struct CTABLE *ct; struct _pj_gi *next; struct _pj_gi *child; } PJ_GRIDINFO; typedef struct { PJ_Region region; int priority; /* higher used before lower */ double date; /* year.fraction */ char *definition; /* usually the gridname */ PJ_GRIDINFO *gridinfo; int available; /* 0=unknown, 1=true, -1=false */ } PJ_GridCatalogEntry; typedef struct _PJ_GridCatalog { char *catalog_name; PJ_Region region; /* maximum extent of catalog data */ int entry_count; PJ_GridCatalogEntry *entries; struct _PJ_GridCatalog *next; } PJ_GridCatalog; /* procedure prototypes */ double dmstor(const char *, char **); double dmstor_ctx(projCtx ctx, const char *, char **); void set_rtodms(int, int); char *rtodms(char *, double, int, int); double adjlon(double); double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double); PROJVALUE pj_param(projCtx ctx, paralist *, const char *); paralist *pj_param_exists (paralist *list, const char *parameter); paralist *pj_mkparam(char *); paralist *pj_mkparam_ws (char *str); int pj_ell_set(projCtx ctx, paralist *, double *, double *); int pj_datum_set(projCtx,paralist *, PJ *); int pj_prime_meridian_set(paralist *, PJ *); int pj_angular_units_set(paralist *, PJ *); paralist *pj_clone_paralist( const paralist* ); paralist *pj_search_initcache( const char *filekey ); void pj_insert_initcache( const char *filekey, const paralist *list); paralist *pj_expand_init(projCtx ctx, paralist *init); void *pj_dealloc_params (projCtx ctx, paralist *start, int errlev); double *pj_enfn(double); double pj_mlfn(double, double, double, double *); double pj_inv_mlfn(projCtx, double, double, double *); double pj_qsfn(double, double, double); double pj_tsfn(double, double, double); double pj_msfn(double, double, double); double pj_phi2(projCtx, double, double); double pj_qsfn_(double, PJ *); double *pj_authset(double); double pj_authlat(double, double *); COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int); COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *); int pj_deriv(LP, double, const PJ *, struct DERIVS *); int pj_factors(LP, const PJ *, double, struct FACTORS *); struct PW_COEF { /* row coefficient structure */ int m; /* number of c coefficients (=0 for none) */ double *c; /* power coefficients */ }; /* Approximation structures and procedures */ typedef struct { /* Chebyshev or Power series structure */ projUV a, b; /* power series range for evaluation */ /* or Chebyshev argument shift/scaling */ struct PW_COEF *cu, *cv; int mu, mv; /* maximum cu and cv index (+1 for count) */ int power; /* != 0 if power series, else Chebyshev */ } Tseries; Tseries *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int); projUV bpseval(projUV, Tseries *); projUV bcheval(projUV, Tseries *); projUV biveval(projUV, Tseries *); void *vector1(int, int); void **vector2(int, int, int); void freev2(void **v, int nrows); int bchgen(projUV, projUV, int, int, projUV **, projUV(*)(projUV)); int bch2bps(projUV, projUV, projUV **, int, int); /* nadcon related protos */ LP nad_intr(LP, struct CTABLE *); LP nad_cvt(LP, int, struct CTABLE *); struct CTABLE *nad_init(projCtx ctx, char *); struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid ); int nad_ctable_load( projCtx ctx, struct CTABLE *, PAFile fid ); struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid ); int nad_ctable2_load( projCtx ctx, struct CTABLE *, PAFile fid ); void nad_free(struct CTABLE *); /* higher level handling of datum grid shift files */ int pj_apply_vgridshift( PJ *defn, const char *listname, PJ_GRIDINFO ***gridlist_p, int *gridlist_count_p, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_apply_gridshift_2( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **gridlist, int gridlist_count, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * ); void pj_deallocate_grids(); PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * ); int pj_gridinfo_load( projCtx, PJ_GRIDINFO * ); void pj_gridinfo_free( projCtx, PJ_GRIDINFO * ); PJ_GridCatalog *pj_gc_findcatalog( projCtx, const char * ); PJ_GridCatalog *pj_gc_readcatalog( projCtx, const char * ); void pj_gc_unloadall( projCtx ); int pj_gc_apply_gridshift( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_gc_apply_gridshift( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx, PJ_GridCatalog *catalog, int after, LP location, double date, PJ_Region *optional_region, double *grid_date ); double pj_gc_parsedate( projCtx, const char * ); void *proj_mdist_ini(double); double proj_mdist(double, double, double, const void *); double proj_inv_mdist(projCtx ctx, double, const void *); void *pj_gauss_ini(double, double, double *,double *); LP pj_gauss(projCtx, LP, const void *); LP pj_inv_gauss(projCtx, LP, const void *); extern char const pj_release[]; struct PJ_ELLPS *pj_get_ellps_ref( void ); struct PJ_DATUMS *pj_get_datums_ref( void ); struct PJ_UNITS *pj_get_units_ref( void ); struct PJ_LIST *pj_get_list_ref( void ); struct PJ_PRIME_MERIDIANS *pj_get_prime_meridians_ref( void ); void *pj_default_destructor (PJ *P, int errlev); double pj_atof( const char* nptr ); double pj_strtod( const char *nptr, char **endptr ); void pj_freeup_plain (PJ *P); #ifdef __cplusplus } #endif #ifndef PROJECTS_H_ATEND #define PROJECTS_H_ATEND #endif #endif /* end of basic projections header */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win64/include/proj.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Revised, experimental API for PROJ.4, intended as the foundation * for added geodetic functionality. * * The original proj API (defined in projects.h) has grown organically * over the years, but it has also grown somewhat messy. * * The same has happened with the newer high level API (defined in * proj_api.h): To support various historical objectives, proj_api.h * contains a rather complex combination of conditional defines and * typedefs. Probably for good (historical) reasons, which are not * always evident from today's perspective. * * This is an evolving attempt at creating a re-rationalized API * with primary design goals focused on sanitizing the namespaces. * Hence, all symbols exposed are being moved to the proj_ namespace, * while all data types are being moved to the PJ_ namespace. * * Please note that this API is *orthogonal* to the previous APIs: * Apart from some inclusion guards, projects.h and proj_api.h are not * touched - if you do not include proj.h, the projects and proj_api * APIs should work as they always have. * * A few implementation details: * * Apart from the namespacing efforts, I'm trying to eliminate three * proj_api elements, which I have found especially confusing. * * FIRST and foremost, I try to avoid typedef'ing away pointer * semantics. I agree that it can be occasionally useful, but I * prefer having the pointer nature of function arguments being * explicitly visible. * * Hence, projCtx has been replaced by PJ_CONTEXT *. * and projPJ has been replaced by PJ * * * SECOND, I try to eliminate cases of information hiding implemented * by redefining data types to void pointers. * * I prefer using a combination of forward declarations and typedefs. * Hence: * typedef void *projCtx; * Has been replaced by: * struct projCtx_t; * typedef struct projCtx_t PJ_CONTEXT; * This makes it possible for the calling program to know that the * PJ_CONTEXT data type exists, and handle pointers to that data type * without having any idea about its internals. * * (obviously, in this example, struct projCtx_t should also be * renamed struct pj_ctx some day, but for backwards compatibility * it remains as-is for now). * * THIRD, I try to eliminate implicit type punning. Hence this API * introduces the PJ_COORD union data type, for generic 4D coordinate * handling. * * PJ_COORD makes it possible to make explicit the previously used * "implicit type punning", where a XY is turned into a LP by * re#defining both as UV, behind the back of the user. * * The PJ_COORD union is used for storing 1D, 2D, 3D and 4D coordinates. * * The bare essentials API presented here follows the PROJ.4 * convention of sailing the coordinate to be reprojected, up on * the stack ("call by value"), and symmetrically returning the * result on the stack. Although the PJ_COORD object is twice as large * as the traditional XY and LP objects, timing results have shown the * overhead to be very reasonable. * * Contexts and thread safety * -------------------------- * * After a year of experiments (and previous experience from the * trlib transformation library) it has become clear that the * context subsystem is unavoidable in a multi-threaded world. * Hence, instead of hiding it away, we move it into the limelight, * highly recommending (but not formally requiring) the bracketing * of any code block calling PROJ.4 functions with calls to * proj_context_create(...)/proj_context_destroy() * * Legacy single threaded code need not do anything, but *may* * implement a bit of future compatibility by using the backward * compatible call proj_context_create(0), which will not create * a new context, but simply provide a pointer to the default one. * * See proj_4D_api_test.c for examples of how to use the API. * * Author: Thomas Knudsen, <thokn@sdfe.dk> * Benefitting from a large number of comments and suggestions * by (primarily) Kristian Evers and Even Rouault. * ****************************************************************************** * Copyright (c) 2016, 2017, Thomas Knudsen / SDFE * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO COORD SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ #include <stddef.h> /* For size_t */ #ifdef PROJECTS_H #error proj.h must be included before projects.h #endif #ifdef PROJ_API_H #error proj.h must be included before proj_api.h #endif #ifndef PROJ_H #define PROJ_H #ifdef __cplusplus extern "C" { #endif /* The version numbers should be updated with every release! **/ #define PROJ_VERSION_MAJOR 5 #define PROJ_VERSION_MINOR 2 #define PROJ_VERSION_PATCH 0 extern char const pj_release[]; /* global release id string */ /* first forward declare everything needed */ /* Data type for generic geodetic 3D data plus epoch information */ union PJ_COORD; typedef union PJ_COORD PJ_COORD; struct PJ_AREA; typedef struct PJ_AREA PJ_AREA; struct P5_FACTORS { /* Common designation */ double meridional_scale; /* h */ double parallel_scale; /* k */ double areal_scale; /* s */ double angular_distortion; /* omega */ double meridian_parallel_angle; /* theta-prime */ double meridian_convergence; /* alpha */ double tissot_semimajor; /* a */ double tissot_semiminor; /* b */ double dx_dlam, dx_dphi; double dy_dlam, dy_dphi; }; typedef struct P5_FACTORS PJ_FACTORS; /* Data type for projection/transformation information */ struct PJconsts; typedef struct PJconsts PJ; /* the PJ object herself */ /* Data type for library level information */ struct PJ_INFO; typedef struct PJ_INFO PJ_INFO; struct PJ_PROJ_INFO; typedef struct PJ_PROJ_INFO PJ_PROJ_INFO; struct PJ_GRID_INFO; typedef struct PJ_GRID_INFO PJ_GRID_INFO; struct PJ_INIT_INFO; typedef struct PJ_INIT_INFO PJ_INIT_INFO; /* Data types for list of operations, ellipsoids, datums and units used in PROJ.4 */ struct PJ_LIST; typedef struct PJ_LIST PJ_OPERATIONS; struct PJ_ELLPS; typedef struct PJ_ELLPS PJ_ELLPS; struct PJ_UNITS; typedef struct PJ_UNITS PJ_UNITS; struct PJ_PRIME_MERIDIANS; typedef struct PJ_PRIME_MERIDIANS PJ_PRIME_MERIDIANS; /* Geodetic, mostly spatiotemporal coordinate types */ typedef struct { double x, y, z, t; } PJ_XYZT; typedef struct { double u, v, w, t; } PJ_UVWT; typedef struct { double lam, phi, z, t; } PJ_LPZT; typedef struct { double o, p, k; } PJ_OPK; /* Rotations: omega, phi, kappa */ typedef struct { double e, n, u; } PJ_ENU; /* East, North, Up */ typedef struct { double s, a1, a2; } PJ_GEOD; /* Geodesic length, fwd azi, rev azi */ /* Classic proj.4 pair/triplet types - moved into the PJ_ name space */ typedef struct { double u, v; } PJ_UV; typedef struct { double x, y; } PJ_XY; typedef struct { double lam, phi; } PJ_LP; typedef struct { double x, y, z; } PJ_XYZ; typedef struct { double u, v, w; } PJ_UVW; typedef struct { double lam, phi, z; } PJ_LPZ; /* Avoid preprocessor renaming and implicit type-punning: Use a union to make it explicit */ union PJ_COORD { double v[4]; /* First and foremost, it really is "just 4 numbers in a vector" */ PJ_XYZT xyzt; PJ_UVWT uvwt; PJ_LPZT lpzt; PJ_GEOD geod; PJ_OPK opk; PJ_ENU enu; PJ_XYZ xyz; PJ_UVW uvw; PJ_LPZ lpz; PJ_XY xy; PJ_UV uv; PJ_LP lp; }; struct PJ_INFO { int major; /* Major release number */ int minor; /* Minor release number */ int patch; /* Patch level */ const char *release; /* Release info. Version + date */ const char *version; /* Full version number */ const char *searchpath; /* Paths where init and grid files are */ /* looked for. Paths are separated by */ /* semi-colons. */ const char * const *paths; size_t path_count; }; struct PJ_PROJ_INFO { const char *id; /* Name of the projection in question */ const char *description; /* Description of the projection */ const char *definition; /* Projection definition */ int has_inverse; /* 1 if an inverse mapping exists, 0 otherwise */ double accuracy; /* Expected accuracy of the transformation. -1 if unknown. */ }; struct PJ_GRID_INFO { char gridname[32]; /* name of grid */ char filename[260]; /* full path to grid */ char format[8]; /* file format of grid */ PJ_LP lowerleft; /* Coordinates of lower left corner */ PJ_LP upperright; /* Coordinates of upper right corner */ int n_lon, n_lat; /* Grid size */ double cs_lon, cs_lat; /* Cell size of grid */ }; struct PJ_INIT_INFO { char name[32]; /* name of init file */ char filename[260]; /* full path to the init file. */ char version[32]; /* version of the init file */ char origin[32]; /* origin of the file, e.g. EPSG */ char lastupdate[16]; /* Date of last update in YYYY-MM-DD format */ }; typedef enum PJ_LOG_LEVEL { PJ_LOG_NONE = 0, PJ_LOG_ERROR = 1, PJ_LOG_DEBUG = 2, PJ_LOG_TRACE = 3, PJ_LOG_TELL = 4, PJ_LOG_DEBUG_MAJOR = 2, /* for proj_api.h compatibility */ PJ_LOG_DEBUG_MINOR = 3 /* for proj_api.h compatibility */ } PJ_LOG_LEVEL; typedef void (*PJ_LOG_FUNCTION)(void *, int, const char *); /* The context type - properly namespaced synonym for projCtx */ struct projCtx_t; typedef struct projCtx_t PJ_CONTEXT; /* A P I */ /* Functionality for handling thread contexts */ #define PJ_DEFAULT_CTX 0 PJ_CONTEXT *proj_context_create (void); PJ_CONTEXT *proj_context_destroy (PJ_CONTEXT *ctx); /* Manage the transformation definition object PJ */ PJ *proj_create (PJ_CONTEXT *ctx, const char *definition); PJ *proj_create_argv (PJ_CONTEXT *ctx, int argc, char **argv); PJ *proj_create_crs_to_crs(PJ_CONTEXT *ctx, const char *srid_from, const char *srid_to, PJ_AREA *area); PJ *proj_destroy (PJ *P); /* Setter-functions for the opaque PJ_AREA struct */ /* Uncomment these when implementing support for area-based transformations. void proj_area_bbox(PJ_AREA *area, LP ll, LP ur); void proj_area_description(PJ_AREA *area, const char *descr); */ /* Apply transformation to observation - in forward or inverse direction */ enum PJ_DIRECTION { PJ_FWD = 1, /* Forward */ PJ_IDENT = 0, /* Do nothing */ PJ_INV = -1 /* Inverse */ }; typedef enum PJ_DIRECTION PJ_DIRECTION; int proj_angular_input (PJ *P, enum PJ_DIRECTION dir); int proj_angular_output (PJ *P, enum PJ_DIRECTION dir); PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD coord); int proj_trans_array (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord); size_t proj_trans_generic ( PJ *P, PJ_DIRECTION direction, double *x, size_t sx, size_t nx, double *y, size_t sy, size_t ny, double *z, size_t sz, size_t nz, double *t, size_t st, size_t nt ); /* Initializers */ PJ_COORD proj_coord (double x, double y, double z, double t); /* Measure internal consistency - in forward or inverse direction */ double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coord); /* Geodesic distance between two points with angular 2D coordinates */ double proj_lp_dist (const PJ *P, PJ_COORD a, PJ_COORD b); /* The geodesic distance AND the vertical offset */ double proj_lpz_dist (const PJ *P, PJ_COORD a, PJ_COORD b); /* Euclidean distance between two points with linear 2D coordinates */ double proj_xy_dist (PJ_COORD a, PJ_COORD b); /* Euclidean distance between two points with linear 3D coordinates */ double proj_xyz_dist (PJ_COORD a, PJ_COORD b); /* Geodesic distance (in meter) + fwd and rev azimuth between two points on the ellipsoid */ PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b); /* Set or read error level */ int proj_context_errno (PJ_CONTEXT *ctx); int proj_errno (const PJ *P); int proj_errno_set (const PJ *P, int err); int proj_errno_reset (const PJ *P); int proj_errno_restore (const PJ *P, int err); const char* proj_errno_string (int err); PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL log_level); void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf); /* Scaling and angular distortion factors */ PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp); /* Info functions - get information about various PROJ.4 entities */ PJ_INFO proj_info(void); PJ_PROJ_INFO proj_pj_info(PJ *P); PJ_GRID_INFO proj_grid_info(const char *gridname); PJ_INIT_INFO proj_init_info(const char *initname); /* List functions: */ /* Get lists of operations, ellipsoids, units and prime meridians. */ const PJ_OPERATIONS *proj_list_operations(void); const PJ_ELLPS *proj_list_ellps(void); const PJ_UNITS *proj_list_units(void); const PJ_PRIME_MERIDIANS *proj_list_prime_meridians(void); /* These are trivial, and while occasionally useful in real code, primarily here to */ /* simplify demo code, and in acknowledgement of the proj-internal discrepancy between */ /* angular units expected by classical proj, and by Charles Karney's geodesics subsystem */ double proj_torad (double angle_in_degrees); double proj_todeg (double angle_in_radians); /* Geographical to geocentric latitude - another of the "simple, but useful" */ PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD coord); double proj_dmstor(const char *is, char **rs); char* proj_rtodms(char *s, double r, int pos, int neg); #ifdef __cplusplus } #endif #endif /* ndef PROJ_H */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win64/include/proj_api.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Public (application) include file for PROJ.4 API, and constants. * Author: Frank Warmerdam, <warmerdam@pobox.com> * ****************************************************************************** * Copyright (c) 2001, Frank Warmerdam <warmerdam@pobox.com> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ /* * This version number should be updated with every release! * * This file is expected to be removed from the PROJ distribution * when a few minor-version releases has been made. * */ #ifndef PJ_VERSION #define PJ_VERSION 520 #endif /* If we're not asked for PJ_VERSION only, give them everything */ #ifndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY /* General projections header file */ #ifndef PROJ_API_H #define PROJ_API_H /* standard inclusions */ #include <math.h> #include <stddef.h> #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* pj_init() and similar functions can be used with a non-C locale */ /* Can be detected too at runtime if the symbol pj_atof exists */ #define PJ_LOCALE_SAFE 1 #define RAD_TO_DEG 57.295779513082321 #define DEG_TO_RAD .017453292519943296 #if defined(PROJECTS_H) || defined(PROJ_H) #define PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API #endif extern char const pj_release[]; /* global release id string */ extern int pj_errno; /* global error return code */ #ifndef PROJ_INTERNAL_H /* replaced by enum proj_log_level in proj_internal.h */ #define PJ_LOG_NONE 0 #define PJ_LOG_ERROR 1 #define PJ_LOG_DEBUG_MAJOR 2 #define PJ_LOG_DEBUG_MINOR 3 #endif #ifdef PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API /* These make the function declarations below conform with classic proj */ typedef PJ *projPJ; /* projPJ is a pointer to PJ */ typedef struct projCtx_t *projCtx; /* projCtx is a pointer to projCtx_t */ #ifdef PROJ_H # define projXY PJ_XY # define projLP PJ_LP # define projXYZ PJ_XYZ # define projLPZ PJ_LPZ #else # define projXY XY # define projLP LP # define projXYZ XYZ # define projLPZ LPZ #endif #else /* i.e. proj_api invoked as primary API */ typedef struct { double u, v; } projUV; typedef struct { double u, v, w; } projUVW; typedef void *projPJ; #define projXY projUV #define projLP projUV #define projXYZ projUVW #define projLPZ projUVW typedef void *projCtx; #endif /* If included *after* proj.h finishes, we have alternative names */ /* file reading api, like stdio */ typedef int *PAFile; typedef struct projFileAPI_t { PAFile (*FOpen)(projCtx ctx, const char *filename, const char *access); size_t (*FRead)(void *buffer, size_t size, size_t nmemb, PAFile file); int (*FSeek)(PAFile file, long offset, int whence); long (*FTell)(PAFile file); void (*FClose)(PAFile); } projFileAPI; /* procedure prototypes */ projCtx pj_get_default_ctx(void); projCtx pj_get_ctx( projPJ ); projXY pj_fwd(projLP, projPJ); projLP pj_inv(projXY, projPJ); projXYZ pj_fwd3d(projLPZ, projPJ); projLPZ pj_inv3d(projXYZ, projPJ); int pj_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); int pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); int pj_geocentric_to_geodetic( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); int pj_geodetic_to_geocentric( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); int pj_compare_datums( projPJ srcdefn, projPJ dstdefn ); int pj_apply_gridshift( projCtx, const char *, int, long point_count, int point_offset, double *x, double *y, double *z ); void pj_deallocate_grids(void); void pj_clear_initcache(void); int pj_is_latlong(projPJ); int pj_is_geocent(projPJ); void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared); void pj_pr_list(projPJ); void pj_free(projPJ); void pj_set_finder( const char *(*)(const char *) ); void pj_set_searchpath ( int count, const char **path ); projPJ pj_init(int, char **); projPJ pj_init_plus(const char *); projPJ pj_init_ctx( projCtx, int, char ** ); projPJ pj_init_plus_ctx( projCtx, const char * ); char *pj_get_def(projPJ, int); projPJ pj_latlong_from_proj( projPJ ); int pj_has_inverse(projPJ); void *pj_malloc(size_t); void pj_dalloc(void *); void *pj_calloc (size_t n, size_t size); void *pj_dealloc (void *ptr); char *pj_strdup(const char *str); char *pj_strerrno(int); int *pj_get_errno_ref(void); const char *pj_get_release(void); void pj_acquire_lock(void); void pj_release_lock(void); void pj_cleanup_lock(void); void pj_set_ctx( projPJ, projCtx ); projCtx pj_ctx_alloc(void); void pj_ctx_free( projCtx ); int pj_ctx_get_errno( projCtx ); void pj_ctx_set_errno( projCtx, int ); void pj_ctx_set_debug( projCtx, int ); void pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) ); void pj_ctx_set_app_data( projCtx, void * ); void *pj_ctx_get_app_data( projCtx ); void pj_ctx_set_fileapi( projCtx, projFileAPI *); projFileAPI *pj_ctx_get_fileapi( projCtx ); void pj_log( projCtx ctx, int level, const char *fmt, ... ); void pj_stderr_logger( void *, int, const char * ); /* file api */ projFileAPI *pj_get_default_fileapi(void); PAFile pj_ctx_fopen(projCtx ctx, const char *filename, const char *access); size_t pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file); int pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence); long pj_ctx_ftell(projCtx ctx, PAFile file); void pj_ctx_fclose(projCtx ctx, PAFile file); char *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file); PAFile pj_open_lib(projCtx, const char *, const char *); int pj_find_file(projCtx ctx, const char *short_filename, char* out_full_filename, size_t out_full_filename_size); #ifdef __cplusplus } #endif #endif /* ndef PROJ_API_H */ #endif /* ndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win64/include/geodesic.h
/** * \file geodesic.h * \brief API for the geodesic routines in C * * This an implementation in C of the geodesic algorithms described in * - C. F. F. Karney, * <a href="https://doi.org/10.1007/s00190-012-0578-z"> * Algorithms for geodesics</a>, * J. Geodesy <b>87</b>, 43--55 (2013); * DOI: <a href="https://doi.org/10.1007/s00190-012-0578-z"> * 10.1007/s00190-012-0578-z</a>; * addenda: <a href="https://geographiclib.sourceforge.io/geod-addenda.html"> * geod-addenda.html</a>. * . * The principal advantages of these algorithms over previous ones (e.g., * Vincenty, 1975) are * - accurate to round off for |<i>f</i>| &lt; 1/50; * - the solution of the inverse problem is always found; * - differential and integral properties of geodesics are computed. * * The shortest path between two points on the ellipsoid at (\e lat1, \e * lon1) and (\e lat2, \e lon2) is called the geodesic. Its length is * \e s12 and the geodesic from point 1 to point 2 has forward azimuths * \e azi1 and \e azi2 at the two end points. * * Traditionally two geodesic problems are considered: * - the direct problem -- given \e lat1, \e lon1, \e s12, and \e azi1, * determine \e lat2, \e lon2, and \e azi2. This is solved by the function * geod_direct(). * - the inverse problem -- given \e lat1, \e lon1, and \e lat2, \e lon2, * determine \e s12, \e azi1, and \e azi2. This is solved by the function * geod_inverse(). * * The ellipsoid is specified by its equatorial radius \e a (typically in * meters) and flattening \e f. The routines are accurate to round off with * double precision arithmetic provided that |<i>f</i>| &lt; 1/50; for the * WGS84 ellipsoid, the errors are less than 15 nanometers. (Reasonably * accurate results are obtained for |<i>f</i>| &lt; 1/5.) For a prolate * ellipsoid, specify \e f &lt; 0. * * The routines also calculate several other quantities of interest * - \e S12 is the area between the geodesic from point 1 to point 2 and the * equator; i.e., it is the area, measured counter-clockwise, of the * quadrilateral with corners (\e lat1,\e lon1), (0,\e lon1), (0,\e lon2), * and (\e lat2,\e lon2). * - \e m12, the reduced length of the geodesic is defined such that if * the initial azimuth is perturbed by \e dazi1 (radians) then the * second point is displaced by \e m12 \e dazi1 in the direction * perpendicular to the geodesic. On a curved surface the reduced * length obeys a symmetry relation, \e m12 + \e m21 = 0. On a flat * surface, we have \e m12 = \e s12. * - \e M12 and \e M21 are geodesic scales. If two geodesics are * parallel at point 1 and separated by a small distance \e dt, then * they are separated by a distance \e M12 \e dt at point 2. \e M21 * is defined similarly (with the geodesics being parallel to one * another at point 2). On a flat surface, we have \e M12 = \e M21 * = 1. * - \e a12 is the arc length on the auxiliary sphere. This is a * construct for converting the problem to one in spherical * trigonometry. \e a12 is measured in degrees. The spherical arc * length from one equator crossing to the next is always 180&deg;. * * If points 1, 2, and 3 lie on a single geodesic, then the following * addition rules hold: * - \e s13 = \e s12 + \e s23 * - \e a13 = \e a12 + \e a23 * - \e S13 = \e S12 + \e S23 * - \e m13 = \e m12 \e M23 + \e m23 \e M21 * - \e M13 = \e M12 \e M23 &minus; (1 &minus; \e M12 \e M21) \e * m23 / \e m12 * - \e M31 = \e M32 \e M21 &minus; (1 &minus; \e M23 \e M32) \e * m12 / \e m23 * * The shortest distance returned by the solution of the inverse problem is * (obviously) uniquely defined. However, in a few special cases there are * multiple azimuths which yield the same shortest distance. Here is a * catalog of those cases: * - \e lat1 = &minus;\e lat2 (with neither point at a pole). If \e azi1 = \e * azi2, the geodesic is unique. Otherwise there are two geodesics and the * second one is obtained by setting [\e azi1, \e azi2] &rarr; [\e azi2, \e * azi1], [\e M12, \e M21] &rarr; [\e M21, \e M12], \e S12 &rarr; &minus;\e * S12. (This occurs when the longitude difference is near &plusmn;180&deg; * for oblate ellipsoids.) * - \e lon2 = \e lon1 &plusmn; 180&deg; (with neither point at a pole). If \e * azi1 = 0&deg; or &plusmn;180&deg;, the geodesic is unique. Otherwise * there are two geodesics and the second one is obtained by setting [\e * azi1, \e azi2] &rarr; [&minus;\e azi1, &minus;\e azi2], \e S12 &rarr; * &minus;\e S12. (This occurs when \e lat2 is near &minus;\e lat1 for * prolate ellipsoids.) * - Points 1 and 2 at opposite poles. There are infinitely many geodesics * which can be generated by setting [\e azi1, \e azi2] &rarr; [\e azi1, \e * azi2] + [\e d, &minus;\e d], for arbitrary \e d. (For spheres, this * prescription applies when points 1 and 2 are antipodal.) * - \e s12 = 0 (coincident points). There are infinitely many geodesics which * can be generated by setting [\e azi1, \e azi2] &rarr; [\e azi1, \e azi2] + * [\e d, \e d], for arbitrary \e d. * * These routines are a simple transcription of the corresponding C++ classes * in <a href="https://geographiclib.sourceforge.io"> GeographicLib</a>. The * "class data" is represented by the structs geod_geodesic, geod_geodesicline, * geod_polygon and pointers to these objects are passed as initial arguments * to the member functions. Most of the internal comments have been retained. * However, in the process of transcription some documentation has been lost * and the documentation for the C++ classes, GeographicLib::Geodesic, * GeographicLib::GeodesicLine, and GeographicLib::PolygonAreaT, should be * consulted. The C++ code remains the "reference implementation". Think * twice about restructuring the internals of the C code since this may make * porting fixes from the C++ code more difficult. * * Copyright (c) Charles Karney (2012-2018) <charles@karney.com> and licensed * under the MIT/X11 License. For more information, see * https://geographiclib.sourceforge.io/ * * This library was distributed with * <a href="../index.html">GeographicLib</a> 1.49. **********************************************************************/ #if !defined(GEODESIC_H) #define GEODESIC_H 1 /** * The major version of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_MAJOR 1 /** * The minor version of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_MINOR 49 /** * The patch level of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_PATCH 3 /** * Pack the version components into a single integer. Users should not rely on * this particular packing of the components of the version number; see the * documentation for GEODESIC_VERSION, below. **********************************************************************/ #define GEODESIC_VERSION_NUM(a,b,c) ((((a) * 10000 + (b)) * 100) + (c)) /** * The version of the geodesic library as a single integer, packed as MMmmmmpp * where MM is the major version, mmmm is the minor version, and pp is the * patch level. Users should not rely on this particular packing of the * components of the version number. Instead they should use a test such as * @code{.c} #if GEODESIC_VERSION >= GEODESIC_VERSION_NUM(1,40,0) ... #endif * @endcode **********************************************************************/ #define GEODESIC_VERSION \ GEODESIC_VERSION_NUM(GEODESIC_VERSION_MAJOR, \ GEODESIC_VERSION_MINOR, \ GEODESIC_VERSION_PATCH) #if defined(__cplusplus) extern "C" { #endif /** * The struct containing information about the ellipsoid. This must be * initialized by geod_init() before use. **********************************************************************/ struct geod_geodesic { double a; /**< the equatorial radius */ double f; /**< the flattening */ /**< @cond SKIP */ double f1, e2, ep2, n, b, c2, etol2; double A3x[6], C3x[15], C4x[21]; /**< @endcond */ }; /** * The struct containing information about a single geodesic. This must be * initialized by geod_lineinit(), geod_directline(), geod_gendirectline(), * or geod_inverseline() before use. **********************************************************************/ struct geod_geodesicline { double lat1; /**< the starting latitude */ double lon1; /**< the starting longitude */ double azi1; /**< the starting azimuth */ double a; /**< the equatorial radius */ double f; /**< the flattening */ double salp1; /**< sine of \e azi1 */ double calp1; /**< cosine of \e azi1 */ double a13; /**< arc length to reference point */ double s13; /**< distance to reference point */ /**< @cond SKIP */ double b, c2, f1, salp0, calp0, k2, ssig1, csig1, dn1, stau1, ctau1, somg1, comg1, A1m1, A2m1, A3c, B11, B21, B31, A4, B41; double C1a[6+1], C1pa[6+1], C2a[6+1], C3a[6], C4a[6]; /**< @endcond */ unsigned caps; /**< the capabilities */ }; /** * The struct for accumulating information about a geodesic polygon. This is * used for computing the perimeter and area of a polygon. This must be * initialized by geod_polygon_init() before use. **********************************************************************/ struct geod_polygon { double lat; /**< the current latitude */ double lon; /**< the current longitude */ /**< @cond SKIP */ double lat0; double lon0; double A[2]; double P[2]; int polyline; int crossings; /**< @endcond */ unsigned num; /**< the number of points so far */ }; /** * Initialize a geod_geodesic object. * * @param[out] g a pointer to the object to be initialized. * @param[in] a the equatorial radius (meters). * @param[in] f the flattening. **********************************************************************/ void geod_init(struct geod_geodesic* g, double a, double f); /** * Solve the direct geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. The values of \e lon2 * and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;]. Any of * the "return" arguments \e plat2, etc., may be replaced by 0, if you do not * need some quantities computed. * * If either point is at a pole, the azimuth is defined by keeping the * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and * taking the limit &epsilon; &rarr; 0+. An arc length greater that 180&deg; * signifies a geodesic which is not a shortest path. (For a prolate * ellipsoid, an additional condition is necessary for a shortest path: the * longitudinal extent must not exceed of 180&deg;.) * * Example, determine the point 10000 km NE of JFK: @code{.c} struct geod_geodesic g; double lat, lon; geod_init(&g, 6378137, 1/298.257223563); geod_direct(&g, 40.64, -73.78, 45.0, 10e6, &lat, &lon, 0); printf("%.5f %.5f\n", lat, lon); @endcode **********************************************************************/ void geod_direct(const struct geod_geodesic* g, double lat1, double lon1, double azi1, double s12, double* plat2, double* plon2, double* pazi2); /** * The general direct geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] flags bitor'ed combination of geod_flags(); \e flags & * GEOD_ARCMODE determines the meaning of \e s12_a12 and \e flags & * GEOD_LONG_UNROLL "unrolls" \e lon2. * @param[in] s12_a12 if \e flags & GEOD_ARCMODE is 0, this is the distance * from point 1 to point 2 (meters); otherwise it is the arc length * from point 1 to point 2 (degrees); it can be negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pm12 pointer to the reduced length of geodesic (meters). * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless). * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless). * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>). * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. The function value \e * a12 equals \e s12_a12 if \e flags & GEOD_ARCMODE. Any of the "return" * arguments, \e plat2, etc., may be replaced by 0, if you do not need some * quantities computed. * * With \e flags & GEOD_LONG_UNROLL bit set, the longitude is "unrolled" so * that the quantity \e lon2 &minus; \e lon1 indicates how many times and in * what sense the geodesic encircles the ellipsoid. **********************************************************************/ double geod_gendirect(const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned flags, double s12_a12, double* plat2, double* plon2, double* pazi2, double* ps12, double* pm12, double* pM12, double* pM21, double* pS12); /** * Solve the inverse geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 and * \e lat2 should be in the range [&minus;90&deg;, 90&deg;]. The values of * \e azi1 and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;]. * Any of the "return" arguments, \e ps12, etc., may be replaced by 0, if you * do not need some quantities computed. * * If either point is at a pole, the azimuth is defined by keeping the * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and * taking the limit &epsilon; &rarr; 0+. * * The solution to the inverse problem is found using Newton's method. If * this fails to converge (this is very unlikely in geodetic applications * but does occur for very eccentric ellipsoids), then the bisection method * is used to refine the solution. * * Example, determine the distance between JFK and Singapore Changi Airport: @code{.c} struct geod_geodesic g; double s12; geod_init(&g, 6378137, 1/298.257223563); geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, 0, 0); printf("%.3f\n", s12); @endcode **********************************************************************/ void geod_inverse(const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, double* ps12, double* pazi1, double* pazi2); /** * The general inverse geodesic calculation. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] pm12 pointer to the reduced length of geodesic (meters). * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless). * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless). * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>). * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 and * \e lat2 should be in the range [&minus;90&deg;, 90&deg;]. Any of the * "return" arguments \e ps12, etc., may be replaced by 0, if you do not need * some quantities computed. **********************************************************************/ double geod_geninverse(const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, double* ps12, double* pazi1, double* pazi2, double* pm12, double* pM12, double* pM21, double* pS12); /** * Initialize a geod_geodesicline object. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. * * The geod_mask values are [see geod_mask()]: * - \e caps |= GEOD_LATITUDE for the latitude \e lat2; this is * added automatically, * - \e caps |= GEOD_LONGITUDE for the latitude \e lon2, * - \e caps |= GEOD_AZIMUTH for the latitude \e azi2; this is * added automatically, * - \e caps |= GEOD_DISTANCE for the distance \e s12, * - \e caps |= GEOD_REDUCEDLENGTH for the reduced length \e m12, * - \e caps |= GEOD_GEODESICSCALE for the geodesic scales \e M12 * and \e M21, * - \e caps |= GEOD_AREA for the area \e S12, * - \e caps |= GEOD_DISTANCE_IN permits the length of the * geodesic to be given in terms of \e s12; without this capability the * length can only be specified in terms of arc length. * . * A value of \e caps = 0 is treated as GEOD_LATITUDE | GEOD_LONGITUDE | * GEOD_AZIMUTH | GEOD_DISTANCE_IN (to support the solution of the "standard" * direct problem). * * When initialized by this function, point 3 is undefined (l->s13 = l->a13 = * NaN). **********************************************************************/ void geod_lineinit(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the direct geodesic * problem. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the direct geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_directline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, double s12, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the direct geodesic * problem spacified in terms of either distance or arc length. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] flags either GEOD_NOFLAGS or GEOD_ARCMODE to determining the * meaning of the \e s12_a12. * @param[in] s12_a12 if \e flags = GEOD_NOFLAGS, this is the distance * from point 1 to point 2 (meters); if \e flags = GEOD_ARCMODE, it is * the arc length from point 1 to point 2 (degrees); it can be * negative. * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the direct geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_gendirectline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned flags, double s12_a12, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the inverse geodesic * problem. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the inverse geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_inverseline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, unsigned caps); /** * Compute the position along a geod_geodesicline. * * @param[in] l a pointer to the geod_geodesicline object specifying the * geodesic line. * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires * that \e l was initialized with \e caps |= GEOD_LONGITUDE. * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e l must have been initialized with a call, e.g., to geod_lineinit(), * with \e caps |= GEOD_DISTANCE_IN. The values of \e lon2 and \e azi2 * returned are in the range [&minus;180&deg;, 180&deg;]. Any of the * "return" arguments \e plat2, etc., may be replaced by 0, if you do not * need some quantities computed. * * Example, compute way points between JFK and Singapore Changi Airport * the "obvious" way using geod_direct(): @code{.c} struct geod_geodesic g; double s12, azi1, lat[101],lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0); for (i = 0; i < 101; ++i) { geod_direct(&g, 40.64, -73.78, azi1, i * s12 * 0.01, lat + i, lon + i, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode * A faster way using geod_position(): @code{.c} struct geod_geodesic g; struct geod_geodesicline l; double lat[101],lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverseline(&l, &g, 40.64, -73.78, 1.36, 103.99, 0); for (i = 0; i <= 100; ++i) { geod_position(&l, i * l.s13 * 0.01, lat + i, lon + i, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode **********************************************************************/ void geod_position(const struct geod_geodesicline* l, double s12, double* plat2, double* plon2, double* pazi2); /** * The general position function. * * @param[in] l a pointer to the geod_geodesicline object specifying the * geodesic line. * @param[in] flags bitor'ed combination of geod_flags(); \e flags & * GEOD_ARCMODE determines the meaning of \e s12_a12 and \e flags & * GEOD_LONG_UNROLL "unrolls" \e lon2; if \e flags & GEOD_ARCMODE is 0, * then \e l must have been initialized with \e caps |= GEOD_DISTANCE_IN. * @param[in] s12_a12 if \e flags & GEOD_ARCMODE is 0, this is the * distance from point 1 to point 2 (meters); otherwise it is the * arc length from point 1 to point 2 (degrees); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires * that \e l was initialized with \e caps |= GEOD_LONGITUDE. * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters); requires that \e l was initialized with \e caps |= * GEOD_DISTANCE. * @param[out] pm12 pointer to the reduced length of geodesic (meters); * requires that \e l was initialized with \e caps |= GEOD_REDUCEDLENGTH. * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless); requires that \e l was initialized with \e caps * |= GEOD_GEODESICSCALE. * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless); requires that \e l was initialized with \e caps * |= GEOD_GEODESICSCALE. * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>); requires that \e l was initialized with \e caps |= * GEOD_AREA. * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e l must have been initialized with a call to geod_lineinit() with \e * caps |= GEOD_DISTANCE_IN. The value \e azi2 returned is in the range * [&minus;180&deg;, 180&deg;]. Any of the "return" arguments \e plat2, * etc., may be replaced by 0, if you do not need some quantities * computed. Requesting a value which \e l is not capable of computing * is not an error; the corresponding argument will not be altered. * * With \e flags & GEOD_LONG_UNROLL bit set, the longitude is "unrolled" so * that the quantity \e lon2 &minus; \e lon1 indicates how many times and in * what sense the geodesic encircles the ellipsoid. * * Example, compute way points between JFK and Singapore Changi Airport using * geod_genposition(). In this example, the points are evenly space in arc * length (and so only approximately equally spaced in distance). This is * faster than using geod_position() and would be appropriate if drawing the * path on a map. @code{.c} struct geod_geodesic g; struct geod_geodesicline l; double lat[101], lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverseline(&l, &g, 40.64, -73.78, 1.36, 103.99, GEOD_LATITUDE | GEOD_LONGITUDE); for (i = 0; i <= 100; ++i) { geod_genposition(&l, GEOD_ARCMODE, i * l.a13 * 0.01, lat + i, lon + i, 0, 0, 0, 0, 0, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode **********************************************************************/ double geod_genposition(const struct geod_geodesicline* l, unsigned flags, double s12_a12, double* plat2, double* plon2, double* pazi2, double* ps12, double* pm12, double* pM12, double* pM21, double* pS12); /** * Specify position of point 3 in terms of distance. * * @param[in,out] l a pointer to the geod_geodesicline object. * @param[in] s13 the distance from point 1 to point 3 (meters); it * can be negative. * * This is only useful if the geod_geodesicline object has been constructed * with \e caps |= GEOD_DISTANCE_IN. **********************************************************************/ void geod_setdistance(struct geod_geodesicline* l, double s13); /** * Specify position of point 3 in terms of either distance or arc length. * * @param[in,out] l a pointer to the geod_geodesicline object. * @param[in] flags either GEOD_NOFLAGS or GEOD_ARCMODE to determining the * meaning of the \e s13_a13. * @param[in] s13_a13 if \e flags = GEOD_NOFLAGS, this is the distance * from point 1 to point 3 (meters); if \e flags = GEOD_ARCMODE, it is * the arc length from point 1 to point 3 (degrees); it can be * negative. * * If flags = GEOD_NOFLAGS, this calls geod_setdistance(). If flags = * GEOD_ARCMODE, the \e s13 is only set if the geod_geodesicline object has * been constructed with \e caps |= GEOD_DISTANCE. **********************************************************************/ void geod_gensetdistance(struct geod_geodesicline* l, unsigned flags, double s13_a13); /** * Initialize a geod_polygon object. * * @param[out] p a pointer to the object to be initialized. * @param[in] polylinep non-zero if a polyline instead of a polygon. * * If \e polylinep is zero, then the sequence of vertices and edges added by * geod_polygon_addpoint() and geod_polygon_addedge() define a polygon and * the perimeter and area are returned by geod_polygon_compute(). If \e * polylinep is non-zero, then the vertices and edges define a polyline and * only the perimeter is returned by geod_polygon_compute(). * * The area and perimeter are accumulated at two times the standard floating * point precision to guard against the loss of accuracy with many-sided * polygons. At any point you can ask for the perimeter and area so far. * * An example of the use of this function is given in the documentation for * geod_polygon_compute(). **********************************************************************/ void geod_polygon_init(struct geod_polygon* p, int polylinep); /** * Clear the polygon, allowing a new polygon to be started. * * @param[in,out] p a pointer to the object to be cleared. **********************************************************************/ void geod_polygon_clear(struct geod_polygon* p); /** * Add a point to the polygon or polyline. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in,out] p a pointer to the geod_polygon object specifying the * polygon. * @param[in] lat the latitude of the point (degrees). * @param[in] lon the longitude of the point (degrees). * * \e g and \e p must have been initialized with calls to geod_init() and * geod_polygon_init(), respectively. The same \e g must be used for all the * points and edges in a polygon. \e lat should be in the range * [&minus;90&deg;, 90&deg;]. * * An example of the use of this function is given in the documentation for * geod_polygon_compute(). **********************************************************************/ void geod_polygon_addpoint(const struct geod_geodesic* g, struct geod_polygon* p, double lat, double lon); /** * Add an edge to the polygon or polyline. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in,out] p a pointer to the geod_polygon object specifying the * polygon. * @param[in] azi azimuth at current point (degrees). * @param[in] s distance from current point to next point (meters). * * \e g and \e p must have been initialized with calls to geod_init() and * geod_polygon_init(), respectively. The same \e g must be used for all the * points and edges in a polygon. This does nothing if no points have been * added yet. The \e lat and \e lon fields of \e p give the location of the * new vertex. **********************************************************************/ void geod_polygon_addedge(const struct geod_geodesic* g, struct geod_polygon* p, double azi, double s); /** * Return the results for a polygon. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. * * The area and perimeter are accumulated at two times the standard floating * point precision to guard against the loss of accuracy with many-sided * polygons. Only simple polygons (which are not self-intersecting) are * allowed. There's no need to "close" the polygon by repeating the first * vertex. Set \e pA or \e pP to zero, if you do not want the corresponding * quantity returned. * * More points can be added to the polygon after this call. * * Example, compute the perimeter and area of the geodesic triangle with * vertices (0&deg;N,0&deg;E), (0&deg;N,90&deg;E), (90&deg;N,0&deg;E). @code{.c} double A, P; int n; struct geod_geodesic g; struct geod_polygon p; geod_init(&g, 6378137, 1/298.257223563); geod_polygon_init(&p, 0); geod_polygon_addpoint(&g, &p, 0, 0); geod_polygon_addpoint(&g, &p, 0, 90); geod_polygon_addpoint(&g, &p, 90, 0); n = geod_polygon_compute(&g, &p, 0, 1, &A, &P); printf("%d %.8f %.3f\n", n, P, A); @endcode **********************************************************************/ unsigned geod_polygon_compute(const struct geod_geodesic* g, const struct geod_polygon* p, int reverse, int sign, double* pA, double* pP); /** * Return the results assuming a tentative final test point is added; * however, the data for the test point is not saved. This lets you report a * running result for the perimeter and area as the user moves the mouse * cursor. Ordinary floating point arithmetic is used to accumulate the data * for the test point; thus the area and perimeter returned are less accurate * than if geod_polygon_addpoint() and geod_polygon_compute() are used. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] lat the latitude of the test point (degrees). * @param[in] lon the longitude of the test point (degrees). * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. * * \e lat should be in the range [&minus;90&deg;, 90&deg;]. **********************************************************************/ unsigned geod_polygon_testpoint(const struct geod_geodesic* g, const struct geod_polygon* p, double lat, double lon, int reverse, int sign, double* pA, double* pP); /** * Return the results assuming a tentative final test point is added via an * azimuth and distance; however, the data for the test point is not saved. * This lets you report a running result for the perimeter and area as the * user moves the mouse cursor. Ordinary floating point arithmetic is used * to accumulate the data for the test point; thus the area and perimeter * returned are less accurate than if geod_polygon_addedge() and * geod_polygon_compute() are used. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] azi azimuth at current point (degrees). * @param[in] s distance from current point to final test point (meters). * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. **********************************************************************/ unsigned geod_polygon_testedge(const struct geod_geodesic* g, const struct geod_polygon* p, double azi, double s, int reverse, int sign, double* pA, double* pP); /** * A simple interface for computing the area of a geodesic polygon. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lats an array of latitudes of the polygon vertices (degrees). * @param[in] lons an array of longitudes of the polygon vertices (degrees). * @param[in] n the number of vertices. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>). * @param[out] pP pointer to the perimeter of the polygon (meters). * * \e lats should be in the range [&minus;90&deg;, 90&deg;]. * * Only simple polygons (which are not self-intersecting) are allowed. * There's no need to "close" the polygon by repeating the first vertex. The * area returned is signed with counter-clockwise traversal being treated as * positive. * * Example, compute the area of Antarctica: @code{.c} double lats[] = {-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7, -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7}, lons[] = {-74, -102, -102, -131, -163, 163, 172, 140, 113, 88, 59, 25, -4, -14, -33, -46, -61}; struct geod_geodesic g; double A, P; geod_init(&g, 6378137, 1/298.257223563); geod_polygonarea(&g, lats, lons, (sizeof lats) / (sizeof lats[0]), &A, &P); printf("%.0f %.2f\n", A, P); @endcode **********************************************************************/ void geod_polygonarea(const struct geod_geodesic* g, double lats[], double lons[], int n, double* pA, double* pP); /** * mask values for the \e caps argument to geod_lineinit(). **********************************************************************/ enum geod_mask { GEOD_NONE = 0U, /**< Calculate nothing */ GEOD_LATITUDE = 1U<<7 | 0U, /**< Calculate latitude */ GEOD_LONGITUDE = 1U<<8 | 1U<<3, /**< Calculate longitude */ GEOD_AZIMUTH = 1U<<9 | 0U, /**< Calculate azimuth */ GEOD_DISTANCE = 1U<<10 | 1U<<0, /**< Calculate distance */ GEOD_DISTANCE_IN = 1U<<11 | 1U<<0 | 1U<<1,/**< Allow distance as input */ GEOD_REDUCEDLENGTH= 1U<<12 | 1U<<0 | 1U<<2,/**< Calculate reduced length */ GEOD_GEODESICSCALE= 1U<<13 | 1U<<0 | 1U<<2,/**< Calculate geodesic scale */ GEOD_AREA = 1U<<14 | 1U<<4, /**< Calculate reduced length */ GEOD_ALL = 0x7F80U| 0x1FU /**< Calculate everything */ }; /** * flag values for the \e flags argument to geod_gendirect() and * geod_genposition() **********************************************************************/ enum geod_flags { GEOD_NOFLAGS = 0U, /**< No flags */ GEOD_ARCMODE = 1U<<0, /**< Position given in terms of arc distance */ GEOD_LONG_UNROLL = 1U<<15 /**< Unroll the longitude */ }; #if defined(__cplusplus) } #endif #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win64/include/projects.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Primary (private) include file for PROJ.4 library. * Author: Gerald Evenden * ****************************************************************************** * Copyright (c) 2000, Frank Warmerdam * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ /* General projections header file */ #ifndef PROJECTS_H #define PROJECTS_H #ifdef _MSC_VER # ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE # endif # ifndef _CRT_NONSTDC_NO_DEPRECATE # define _CRT_NONSTDC_NO_DEPRECATE # endif /* enable predefined math constants M_* for MS Visual Studio workaround */ # ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES # endif #endif /* standard inclusions */ #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef __cplusplus #define C_NAMESPACE extern "C" #define C_NAMESPACE_VAR extern "C" extern "C" { #else #define C_NAMESPACE extern #define C_NAMESPACE_VAR #endif #ifndef NULL # define NULL 0 #endif #ifndef FALSE # define FALSE 0 #endif #ifndef TRUE # define TRUE 1 #endif #ifndef MAX # define MIN(a,b) ((a<b) ? a : b) # define MAX(a,b) ((a>b) ? a : b) #endif #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif #if INT_MAX == 2147483647 typedef int pj_int32; #elif LONG_MAX == 2147483647 typedef long pj_int32; #else #warning It seems no 32-bit integer type is available #endif /* maximum path/filename */ #ifndef MAX_PATH_FILENAME #define MAX_PATH_FILENAME 1024 #endif /* If we still haven't got M_PI*, we rely on our own defines. * For example, this is necessary when compiling with gcc and * the -ansi flag. */ #ifndef M_PI #define M_PI 3.14159265358979323846 #define M_PI_2 1.57079632679489661923 #define M_PI_4 0.78539816339744830962 #define M_2_PI 0.63661977236758134308 #endif /* M_SQRT2 might be missing */ #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 #endif /* some more useful math constants and aliases */ #define M_FORTPI M_PI_4 /* pi/4 */ #define M_HALFPI M_PI_2 /* pi/2 */ #define M_PI_HALFPI 4.71238898038468985769 /* 1.5*pi */ #define M_TWOPI 6.28318530717958647693 /* 2*pi */ #define M_TWO_D_PI M_2_PI /* 2/pi */ #define M_TWOPI_HALFPI 7.85398163397448309616 /* 2.5*pi */ /* maximum tag id length for +init and default files */ #ifndef ID_TAG_MAX #define ID_TAG_MAX 50 #endif /* Use WIN32 as a standard windows 32 bit declaration */ #if defined(_WIN32) && !defined(WIN32) # define WIN32 #endif #if defined(_WINDOWS) && !defined(WIN32) # define WIN32 #endif /* directory delimiter for DOS support */ #ifdef WIN32 #define DIR_CHAR '\\' #else #define DIR_CHAR '/' #endif #define USE_PROJUV typedef struct { double u, v; } projUV; typedef struct { double r, i; } COMPLEX; typedef struct { double u, v, w; } projUVW; /* If user explicitly includes proj.h, before projects.h, then avoid implicit type-punning */ #ifndef PROJ_H #ifndef PJ_LIB__ #define XY projUV #define LP projUV #define XYZ projUVW #define LPZ projUVW #else typedef struct { double x, y; } XY; typedef struct { double x, y, z; } XYZ; typedef struct { double lam, phi; } LP; typedef struct { double lam, phi, z; } LPZ; typedef struct { double u, v; } UV; typedef struct { double u, v, w; } UVW; #endif /* ndef PJ_LIB__ */ #else typedef PJ_XY XY; typedef PJ_LP LP; typedef PJ_UV UV; typedef PJ_XYZ XYZ; typedef PJ_LPZ LPZ; typedef PJ_UVW UVW; #endif /* ndef PROJ_H */ /* Forward declarations and typedefs for stuff needed inside the PJ object */ struct PJconsts; union PJ_COORD; struct geod_geodesic; struct pj_opaque; struct ARG_list; struct PJ_REGION_S; typedef struct PJ_REGION_S PJ_Region; typedef struct ARG_list paralist; /* parameter list */ #ifndef PROJ_INTERNAL_H enum pj_io_units { PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */ PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */ PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */ PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */ PJ_IO_UNITS_ANGULAR = 4 /* Radians */ }; #endif #ifndef PROJ_H typedef struct PJconsts PJ; /* the PJ object herself */ typedef union PJ_COORD PJ_COORD; #endif struct PJ_REGION_S { double ll_long; /* lower left corner coordinates (radians) */ double ll_lat; double ur_long; /* upper right corner coordinates (radians) */ double ur_lat; }; struct PJ_AREA { int id; /* Area ID in the EPSG database */ LP ll; /* Lower left corner of bounding box */ LP ur; /* Upper right corner of bounding box */ char descr[64]; /* text representation of area */ }; struct projCtx_t; typedef struct projCtx_t projCtx_t; /***************************************************************************** Some function types that are especially useful when working with PJs ****************************************************************************** PJ_CONSTRUCTOR: A function taking a pointer-to-PJ as arg, and returning a pointer-to-PJ. Historically called twice: First with a 0 argument, to allocate memory, second with the first return value as argument, for actual setup. PJ_DESTRUCTOR: A function taking a pointer-to-PJ and an integer as args, then first handling the deallocation of the PJ, afterwards handing the integer over to the error reporting subsystem, and finally returning a null pointer in support of the "return free (P)" (aka "get the hell out of here") idiom. PJ_OPERATOR: A function taking a PJ_COORD and a pointer-to-PJ as args, applying the PJ to the PJ_COORD, and returning the resulting PJ_COORD. *****************************************************************************/ typedef PJ *(* PJ_CONSTRUCTOR) (PJ *); typedef void *(* PJ_DESTRUCTOR) (PJ *, int); typedef PJ_COORD (* PJ_OPERATOR) (PJ_COORD, PJ *); /****************************************************************************/ /* base projection data structure */ struct PJconsts { /************************************************************************************* G E N E R A L P A R A M E T E R S T R U C T ************************************************************************************** TODO: Need some description here - especially about the thread context... This is the struct behind the PJ typedef **************************************************************************************/ projCtx_t *ctx; const char *descr; /* From pj_list.h or individual PJ_*.c file */ paralist *params; /* Parameter list */ char *def_full; /* Full textual definition (usually 0 - set by proj_pj_info) */ char *def_size; /* Shape and size parameters extracted from params */ char *def_shape; char *def_spherification; char *def_ellps; struct geod_geodesic *geod; /* For geodesic computations */ struct pj_opaque *opaque; /* Projection specific parameters, Defined in PJ_*.c */ int inverted; /* Tell high level API functions to swap inv/fwd */ /************************************************************************************* F U N C T I O N P O I N T E R S ************************************************************************************** For projection xxx, these are pointers to functions in the corresponding PJ_xxx.c file. pj_init() delegates the setup of these to pj_projection_specific_setup_xxx(), a name which is currently hidden behind the magic curtain of the PROJECTION macro. **************************************************************************************/ XY (*fwd)(LP, PJ *); LP (*inv)(XY, PJ *); XYZ (*fwd3d)(LPZ, PJ *); LPZ (*inv3d)(XYZ, PJ *); PJ_OPERATOR fwd4d; PJ_OPERATOR inv4d; PJ_DESTRUCTOR destructor; /************************************************************************************* E L L I P S O I D P A R A M E T E R S ************************************************************************************** Despite YAGNI, we add a large number of ellipsoidal shape parameters, which are not yet set up in pj_init. They are, however, inexpensive to compute, compared to the overall time taken for setting up the complex PJ object (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity). But during single point projections it will often be a useful thing to have these readily available without having to recompute at every pj_fwd / pj_inv call. With this wide selection, we should be ready for quite a number of geodetic algorithms, without having to incur further ABI breakage. **************************************************************************************/ /* The linear parameters */ double a; /* semimajor axis (radius if eccentricity==0) */ double b; /* semiminor axis */ double ra; /* 1/a */ double rb; /* 1/b */ /* The eccentricities */ double alpha; /* angular eccentricity */ double e; /* first eccentricity */ double es; /* first eccentricity squared */ double e2; /* second eccentricity */ double e2s; /* second eccentricity squared */ double e3; /* third eccentricity */ double e3s; /* third eccentricity squared */ double one_es; /* 1 - e^2 */ double rone_es; /* 1/one_es */ /* The flattenings */ double f; /* first flattening */ double f2; /* second flattening */ double n; /* third flattening */ double rf; /* 1/f */ double rf2; /* 1/f2 */ double rn; /* 1/n */ /* This one's for GRS80 */ double J; /* "Dynamic form factor" */ double es_orig, a_orig; /* es and a before any +proj related adjustment */ /************************************************************************************* C O O R D I N A T E H A N D L I N G **************************************************************************************/ int over; /* Over-range flag */ int geoc; /* Geocentric latitude flag */ int is_latlong; /* proj=latlong ... not really a projection at all */ int is_geocent; /* proj=geocent ... not really a projection at all */ int is_pipeline; /* 1 if PJ represents a pipeline */ int need_ellps; /* 0 for operations that are purely cartesian */ int skip_fwd_prepare; int skip_fwd_finalize; int skip_inv_prepare; int skip_inv_finalize; enum pj_io_units left; /* Flags for input/output coordinate types */ enum pj_io_units right; /* These PJs are used for implementing cs2cs style coordinate handling in the 4D API */ PJ *axisswap; PJ *cart; PJ *cart_wgs84; PJ *helmert; PJ *hgridshift; PJ *vgridshift; /************************************************************************************* C A R T O G R A P H I C O F F S E T S **************************************************************************************/ double lam0, phi0; /* central meridian, parallel */ double x0, y0, z0, t0; /* false easting and northing (and height and time) */ /************************************************************************************* S C A L I N G **************************************************************************************/ double k0; /* General scaling factor - e.g. the 0.9996 of UTM */ double to_meter, fr_meter; /* Plane coordinate scaling. Internal unit [m] */ double vto_meter, vfr_meter; /* Vertical scaling. Internal unit [m] */ /************************************************************************************* D A T U M S A N D H E I G H T S Y S T E M S ************************************************************************************** It may be possible, and meaningful, to move the list parts of this up to the PJ_CONTEXT level. **************************************************************************************/ int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ double datum_params[7]; /* Parameters for 3PARAM and 7PARAM */ struct _pj_gi **gridlist; /* TODO: Description needed */ int gridlist_count; int has_geoid_vgrids; /* TODO: Description needed */ struct _pj_gi **vgridlist_geoid; /* TODO: Description needed */ int vgridlist_geoid_count; double from_greenwich; /* prime meridian offset (in radians) */ double long_wrap_center; /* 0.0 for -180 to 180, actually in radians*/ int is_long_wrap_set; char axis[4]; /* Axis order, pj_transform/pj_adjust_axis */ /* New Datum Shift Grid Catalogs */ char *catalog_name; struct _PJ_GridCatalog *catalog; double datum_date; /* TODO: Description needed */ struct _pj_gi *last_before_grid; /* TODO: Description needed */ PJ_Region last_before_region; /* TODO: Description needed */ double last_before_date; /* TODO: Description needed */ struct _pj_gi *last_after_grid; /* TODO: Description needed */ PJ_Region last_after_region; /* TODO: Description needed */ double last_after_date; /* TODO: Description needed */ /************************************************************************************* E N D O F G E N E R A L P A R A M E T E R S T R U C T **************************************************************************************/ }; /* Parameter list (a copy of the +proj=... etc. parameters) */ struct ARG_list { paralist *next; char used; #if defined(__GNUC__) && __GNUC__ >= 8 char param[]; /* variable-length member */ /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */ /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */ #else char param[1]; /* variable-length member */ #endif }; typedef union { double f; int i; char *s; } PROJVALUE; struct PJ_ELLPS { char *id; /* ellipse keyword name */ char *major; /* a= value */ char *ell; /* elliptical parameter */ char *name; /* comments */ }; struct PJ_UNITS { char *id; /* units keyword */ char *to_meter; /* multiply by value to get meters */ char *name; /* comments */ double factor; /* to_meter factor in actual numbers */ }; struct PJ_DATUMS { char *id; /* datum keyword */ char *defn; /* ie. "to_wgs84=..." */ char *ellipse_id; /* ie from ellipse table */ char *comments; /* EPSG code, etc */ }; struct PJ_PRIME_MERIDIANS { char *id; /* prime meridian keyword */ char *defn; /* offset from greenwich in DMS format. */ }; struct DERIVS { double x_l, x_p; /* derivatives of x for lambda-phi */ double y_l, y_p; /* derivatives of y for lambda-phi */ }; struct FACTORS { struct DERIVS der; double h, k; /* meridional, parallel scales */ double omega, thetap; /* angular distortion, theta prime */ double conv; /* convergence */ double s; /* areal scale factor */ double a, b; /* max-min scale error */ int code; /* always 0 */ }; enum deprecated_constants_for_now_dropped_analytical_factors { IS_ANAL_XL_YL = 01, /* derivatives of lon analytic */ IS_ANAL_XP_YP = 02, /* derivatives of lat analytic */ IS_ANAL_HK = 04, /* h and k analytic */ IS_ANAL_CONV = 010 /* convergence analytic */ }; /* datum_type values */ #define PJD_UNKNOWN 0 #define PJD_3PARAM 1 #define PJD_7PARAM 2 #define PJD_GRIDSHIFT 3 #define PJD_WGS84 4 /* WGS84 (or anything considered equivalent) */ /* library errors */ #define PJD_ERR_NO_ARGS -1 #define PJD_ERR_NO_OPTION_IN_INIT_FILE -2 #define PJD_ERR_NO_COLON_IN_INIT_STRING -3 #define PJD_ERR_PROJ_NOT_NAMED -4 #define PJD_ERR_UNKNOWN_PROJECTION_ID -5 #define PJD_ERR_ECCENTRICITY_IS_ONE -6 #define PJD_ERR_UNKNOW_UNIT_ID -7 /* deprecated: typo */ #define PJD_ERR_UNKNOWN_UNIT_ID -7 #define PJD_ERR_INVALID_BOOLEAN_PARAM -8 #define PJD_ERR_UNKNOWN_ELLP_PARAM -9 #define PJD_ERR_REV_FLATTENING_IS_ZERO -10 #define PJD_ERR_REF_RAD_LARGER_THAN_90 -11 #define PJD_ERR_ES_LESS_THAN_ZERO -12 #define PJD_ERR_MAJOR_AXIS_NOT_GIVEN -13 #define PJD_ERR_LAT_OR_LON_EXCEED_LIMIT -14 #define PJD_ERR_INVALID_X_OR_Y -15 #define PJD_ERR_WRONG_FORMAT_DMS_VALUE -16 #define PJD_ERR_NON_CONV_INV_MERI_DIST -17 #define PJD_ERR_NON_CON_INV_PHI2 -18 #define PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE -19 #define PJD_ERR_TOLERANCE_CONDITION -20 #define PJD_ERR_CONIC_LAT_EQUAL -21 #define PJD_ERR_LAT_LARGER_THAN_90 -22 #define PJD_ERR_LAT1_IS_ZERO -23 #define PJD_ERR_LAT_TS_LARGER_THAN_90 -24 #define PJD_ERR_CONTROL_POINT_NO_DIST -25 #define PJD_ERR_NO_ROTATION_PROJ -26 #define PJD_ERR_W_OR_M_ZERO_OR_LESS -27 #define PJD_ERR_LSAT_NOT_IN_RANGE -28 #define PJD_ERR_PATH_NOT_IN_RANGE -29 #define PJD_ERR_H_LESS_THAN_ZERO -30 #define PJD_ERR_K_LESS_THAN_ZERO -31 #define PJD_ERR_LAT_1_OR_2_ZERO_OR_90 -32 #define PJD_ERR_LAT_0_OR_ALPHA_EQ_90 -33 #define PJD_ERR_ELLIPSOID_USE_REQUIRED -34 #define PJD_ERR_INVALID_UTM_ZONE -35 #define PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE -36 #define PJD_ERR_FAILED_TO_FIND_PROJ -37 #define PJD_ERR_FAILED_TO_LOAD_GRID -38 #define PJD_ERR_INVALID_M_OR_N -39 #define PJD_ERR_N_OUT_OF_RANGE -40 #define PJD_ERR_LAT_1_2_UNSPECIFIED -41 #define PJD_ERR_ABS_LAT1_EQ_ABS_LAT2 -42 #define PJD_ERR_LAT_0_HALF_PI_FROM_MEAN -43 #define PJD_ERR_UNPARSEABLE_CS_DEF -44 #define PJD_ERR_GEOCENTRIC -45 #define PJD_ERR_UNKNOWN_PRIME_MERIDIAN -46 #define PJD_ERR_AXIS -47 #define PJD_ERR_GRID_AREA -48 #define PJD_ERR_INVALID_SWEEP_AXIS -49 #define PJD_ERR_MALFORMED_PIPELINE -50 #define PJD_ERR_UNIT_FACTOR_LESS_THAN_0 -51 #define PJD_ERR_INVALID_SCALE -52 #define PJD_ERR_NON_CONVERGENT -53 #define PJD_ERR_MISSING_ARGS -54 #define PJD_ERR_LAT_0_IS_ZERO -55 #define PJD_ERR_ELLIPSOIDAL_UNSUPPORTED -56 #define PJD_ERR_TOO_MANY_INITS -57 #define PJD_ERR_INVALID_ARG -58 #define PJD_ERR_INCONSISTENT_UNIT -59 /* NOTE: Remember to update pj_strerrno.c and transient_error in */ /* pj_transform.c when adding new value */ struct projFileAPI_t; /* proj thread context */ struct projCtx_t { int last_errno; int debug_level; void (*logger)(void *, int, const char *); void *app_data; struct projFileAPI_t *fileapi; }; /* classic public API */ #include "proj_api.h" /* Generate pj_list external or make list from include file */ struct PJ_LIST { char *id; /* projection keyword */ PJ *(*proj)(PJ *); /* projection entry point */ char * const *descr; /* description text */ }; #ifndef USE_PJ_LIST_H extern struct PJ_LIST pj_list[]; #endif #ifndef PJ_ELLPS__ extern struct PJ_ELLPS pj_ellps[]; #endif #ifndef PJ_UNITS__ extern struct PJ_UNITS pj_units[]; #endif #ifndef PJ_DATUMS__ extern struct PJ_DATUMS pj_datums[]; extern struct PJ_PRIME_MERIDIANS pj_prime_meridians[]; #endif #ifdef PJ_LIB__ #define PROJ_HEAD(name, desc) static const char des_##name [] = desc #define OPERATION(name, NEED_ELLPS) \ \ pj_projection_specific_setup_##name (PJ *P); \ C_NAMESPACE PJ *pj_##name (PJ *P); \ \ C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \ \ C_NAMESPACE PJ *pj_##name (PJ *P) { \ if (P) \ return pj_projection_specific_setup_##name (P); \ P = (PJ*) pj_calloc (1, sizeof(PJ)); \ if (0==P) \ return 0; \ P->destructor = pj_default_destructor; \ P->descr = des_##name; \ P->need_ellps = NEED_ELLPS; \ P->left = PJ_IO_UNITS_ANGULAR; \ P->right = PJ_IO_UNITS_CLASSIC; \ return P; \ } \ \ PJ *pj_projection_specific_setup_##name (PJ *P) /* In ISO19000 lingo, an operation is either a conversion or a transformation */ #define CONVERSION(name, need_ellps) OPERATION (name, need_ellps) #define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps) /* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */ #define PROJECTION(name) CONVERSION (name, 1) #endif /* def PJ_LIB__ */ #define MAX_TAB_ID 80 typedef struct { float lam, phi; } FLP; typedef struct { pj_int32 lam, phi; } ILP; struct CTABLE { char id[MAX_TAB_ID]; /* ascii info */ LP ll; /* lower left corner coordinates */ LP del; /* size of cells */ ILP lim; /* limits of conversion matrix */ FLP *cvs; /* conversion matrix */ }; typedef struct _pj_gi { char *gridname; /* identifying name of grid, eg "conus" or ntv2_0.gsb */ char *filename; /* full path to filename */ const char *format; /* format of this grid, ie "ctable", "ntv1", "ntv2" or "missing". */ long grid_offset; /* offset in file, for delayed loading */ int must_swap; /* only for NTv2 */ struct CTABLE *ct; struct _pj_gi *next; struct _pj_gi *child; } PJ_GRIDINFO; typedef struct { PJ_Region region; int priority; /* higher used before lower */ double date; /* year.fraction */ char *definition; /* usually the gridname */ PJ_GRIDINFO *gridinfo; int available; /* 0=unknown, 1=true, -1=false */ } PJ_GridCatalogEntry; typedef struct _PJ_GridCatalog { char *catalog_name; PJ_Region region; /* maximum extent of catalog data */ int entry_count; PJ_GridCatalogEntry *entries; struct _PJ_GridCatalog *next; } PJ_GridCatalog; /* procedure prototypes */ double dmstor(const char *, char **); double dmstor_ctx(projCtx ctx, const char *, char **); void set_rtodms(int, int); char *rtodms(char *, double, int, int); double adjlon(double); double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double); PROJVALUE pj_param(projCtx ctx, paralist *, const char *); paralist *pj_param_exists (paralist *list, const char *parameter); paralist *pj_mkparam(char *); paralist *pj_mkparam_ws (char *str); int pj_ell_set(projCtx ctx, paralist *, double *, double *); int pj_datum_set(projCtx,paralist *, PJ *); int pj_prime_meridian_set(paralist *, PJ *); int pj_angular_units_set(paralist *, PJ *); paralist *pj_clone_paralist( const paralist* ); paralist *pj_search_initcache( const char *filekey ); void pj_insert_initcache( const char *filekey, const paralist *list); paralist *pj_expand_init(projCtx ctx, paralist *init); void *pj_dealloc_params (projCtx ctx, paralist *start, int errlev); double *pj_enfn(double); double pj_mlfn(double, double, double, double *); double pj_inv_mlfn(projCtx, double, double, double *); double pj_qsfn(double, double, double); double pj_tsfn(double, double, double); double pj_msfn(double, double, double); double pj_phi2(projCtx, double, double); double pj_qsfn_(double, PJ *); double *pj_authset(double); double pj_authlat(double, double *); COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int); COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *); int pj_deriv(LP, double, const PJ *, struct DERIVS *); int pj_factors(LP, const PJ *, double, struct FACTORS *); struct PW_COEF { /* row coefficient structure */ int m; /* number of c coefficients (=0 for none) */ double *c; /* power coefficients */ }; /* Approximation structures and procedures */ typedef struct { /* Chebyshev or Power series structure */ projUV a, b; /* power series range for evaluation */ /* or Chebyshev argument shift/scaling */ struct PW_COEF *cu, *cv; int mu, mv; /* maximum cu and cv index (+1 for count) */ int power; /* != 0 if power series, else Chebyshev */ } Tseries; Tseries *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int); projUV bpseval(projUV, Tseries *); projUV bcheval(projUV, Tseries *); projUV biveval(projUV, Tseries *); void *vector1(int, int); void **vector2(int, int, int); void freev2(void **v, int nrows); int bchgen(projUV, projUV, int, int, projUV **, projUV(*)(projUV)); int bch2bps(projUV, projUV, projUV **, int, int); /* nadcon related protos */ LP nad_intr(LP, struct CTABLE *); LP nad_cvt(LP, int, struct CTABLE *); struct CTABLE *nad_init(projCtx ctx, char *); struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid ); int nad_ctable_load( projCtx ctx, struct CTABLE *, PAFile fid ); struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid ); int nad_ctable2_load( projCtx ctx, struct CTABLE *, PAFile fid ); void nad_free(struct CTABLE *); /* higher level handling of datum grid shift files */ int pj_apply_vgridshift( PJ *defn, const char *listname, PJ_GRIDINFO ***gridlist_p, int *gridlist_count_p, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_apply_gridshift_2( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **gridlist, int gridlist_count, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * ); void pj_deallocate_grids(); PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * ); int pj_gridinfo_load( projCtx, PJ_GRIDINFO * ); void pj_gridinfo_free( projCtx, PJ_GRIDINFO * ); PJ_GridCatalog *pj_gc_findcatalog( projCtx, const char * ); PJ_GridCatalog *pj_gc_readcatalog( projCtx, const char * ); void pj_gc_unloadall( projCtx ); int pj_gc_apply_gridshift( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_gc_apply_gridshift( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx, PJ_GridCatalog *catalog, int after, LP location, double date, PJ_Region *optional_region, double *grid_date ); double pj_gc_parsedate( projCtx, const char * ); void *proj_mdist_ini(double); double proj_mdist(double, double, double, const void *); double proj_inv_mdist(projCtx ctx, double, const void *); void *pj_gauss_ini(double, double, double *,double *); LP pj_gauss(projCtx, LP, const void *); LP pj_inv_gauss(projCtx, LP, const void *); extern char const pj_release[]; struct PJ_ELLPS *pj_get_ellps_ref( void ); struct PJ_DATUMS *pj_get_datums_ref( void ); struct PJ_UNITS *pj_get_units_ref( void ); struct PJ_LIST *pj_get_list_ref( void ); struct PJ_PRIME_MERIDIANS *pj_get_prime_meridians_ref( void ); void *pj_default_destructor (PJ *P, int errlev); double pj_atof( const char* nptr ); double pj_strtod( const char *nptr, char **endptr ); void pj_freeup_plain (PJ *P); #ifdef __cplusplus } #endif #ifndef PROJECTS_H_ATEND #define PROJECTS_H_ATEND #endif #endif /* end of basic projections header */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win32/include/proj.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Revised, experimental API for PROJ.4, intended as the foundation * for added geodetic functionality. * * The original proj API (defined in projects.h) has grown organically * over the years, but it has also grown somewhat messy. * * The same has happened with the newer high level API (defined in * proj_api.h): To support various historical objectives, proj_api.h * contains a rather complex combination of conditional defines and * typedefs. Probably for good (historical) reasons, which are not * always evident from today's perspective. * * This is an evolving attempt at creating a re-rationalized API * with primary design goals focused on sanitizing the namespaces. * Hence, all symbols exposed are being moved to the proj_ namespace, * while all data types are being moved to the PJ_ namespace. * * Please note that this API is *orthogonal* to the previous APIs: * Apart from some inclusion guards, projects.h and proj_api.h are not * touched - if you do not include proj.h, the projects and proj_api * APIs should work as they always have. * * A few implementation details: * * Apart from the namespacing efforts, I'm trying to eliminate three * proj_api elements, which I have found especially confusing. * * FIRST and foremost, I try to avoid typedef'ing away pointer * semantics. I agree that it can be occasionally useful, but I * prefer having the pointer nature of function arguments being * explicitly visible. * * Hence, projCtx has been replaced by PJ_CONTEXT *. * and projPJ has been replaced by PJ * * * SECOND, I try to eliminate cases of information hiding implemented * by redefining data types to void pointers. * * I prefer using a combination of forward declarations and typedefs. * Hence: * typedef void *projCtx; * Has been replaced by: * struct projCtx_t; * typedef struct projCtx_t PJ_CONTEXT; * This makes it possible for the calling program to know that the * PJ_CONTEXT data type exists, and handle pointers to that data type * without having any idea about its internals. * * (obviously, in this example, struct projCtx_t should also be * renamed struct pj_ctx some day, but for backwards compatibility * it remains as-is for now). * * THIRD, I try to eliminate implicit type punning. Hence this API * introduces the PJ_COORD union data type, for generic 4D coordinate * handling. * * PJ_COORD makes it possible to make explicit the previously used * "implicit type punning", where a XY is turned into a LP by * re#defining both as UV, behind the back of the user. * * The PJ_COORD union is used for storing 1D, 2D, 3D and 4D coordinates. * * The bare essentials API presented here follows the PROJ.4 * convention of sailing the coordinate to be reprojected, up on * the stack ("call by value"), and symmetrically returning the * result on the stack. Although the PJ_COORD object is twice as large * as the traditional XY and LP objects, timing results have shown the * overhead to be very reasonable. * * Contexts and thread safety * -------------------------- * * After a year of experiments (and previous experience from the * trlib transformation library) it has become clear that the * context subsystem is unavoidable in a multi-threaded world. * Hence, instead of hiding it away, we move it into the limelight, * highly recommending (but not formally requiring) the bracketing * of any code block calling PROJ.4 functions with calls to * proj_context_create(...)/proj_context_destroy() * * Legacy single threaded code need not do anything, but *may* * implement a bit of future compatibility by using the backward * compatible call proj_context_create(0), which will not create * a new context, but simply provide a pointer to the default one. * * See proj_4D_api_test.c for examples of how to use the API. * * Author: Thomas Knudsen, <thokn@sdfe.dk> * Benefitting from a large number of comments and suggestions * by (primarily) Kristian Evers and Even Rouault. * ****************************************************************************** * Copyright (c) 2016, 2017, Thomas Knudsen / SDFE * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO COORD SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ #include <stddef.h> /* For size_t */ #ifdef PROJECTS_H #error proj.h must be included before projects.h #endif #ifdef PROJ_API_H #error proj.h must be included before proj_api.h #endif #ifndef PROJ_H #define PROJ_H #ifdef __cplusplus extern "C" { #endif /* The version numbers should be updated with every release! **/ #define PROJ_VERSION_MAJOR 5 #define PROJ_VERSION_MINOR 2 #define PROJ_VERSION_PATCH 0 extern char const pj_release[]; /* global release id string */ /* first forward declare everything needed */ /* Data type for generic geodetic 3D data plus epoch information */ union PJ_COORD; typedef union PJ_COORD PJ_COORD; struct PJ_AREA; typedef struct PJ_AREA PJ_AREA; struct P5_FACTORS { /* Common designation */ double meridional_scale; /* h */ double parallel_scale; /* k */ double areal_scale; /* s */ double angular_distortion; /* omega */ double meridian_parallel_angle; /* theta-prime */ double meridian_convergence; /* alpha */ double tissot_semimajor; /* a */ double tissot_semiminor; /* b */ double dx_dlam, dx_dphi; double dy_dlam, dy_dphi; }; typedef struct P5_FACTORS PJ_FACTORS; /* Data type for projection/transformation information */ struct PJconsts; typedef struct PJconsts PJ; /* the PJ object herself */ /* Data type for library level information */ struct PJ_INFO; typedef struct PJ_INFO PJ_INFO; struct PJ_PROJ_INFO; typedef struct PJ_PROJ_INFO PJ_PROJ_INFO; struct PJ_GRID_INFO; typedef struct PJ_GRID_INFO PJ_GRID_INFO; struct PJ_INIT_INFO; typedef struct PJ_INIT_INFO PJ_INIT_INFO; /* Data types for list of operations, ellipsoids, datums and units used in PROJ.4 */ struct PJ_LIST; typedef struct PJ_LIST PJ_OPERATIONS; struct PJ_ELLPS; typedef struct PJ_ELLPS PJ_ELLPS; struct PJ_UNITS; typedef struct PJ_UNITS PJ_UNITS; struct PJ_PRIME_MERIDIANS; typedef struct PJ_PRIME_MERIDIANS PJ_PRIME_MERIDIANS; /* Geodetic, mostly spatiotemporal coordinate types */ typedef struct { double x, y, z, t; } PJ_XYZT; typedef struct { double u, v, w, t; } PJ_UVWT; typedef struct { double lam, phi, z, t; } PJ_LPZT; typedef struct { double o, p, k; } PJ_OPK; /* Rotations: omega, phi, kappa */ typedef struct { double e, n, u; } PJ_ENU; /* East, North, Up */ typedef struct { double s, a1, a2; } PJ_GEOD; /* Geodesic length, fwd azi, rev azi */ /* Classic proj.4 pair/triplet types - moved into the PJ_ name space */ typedef struct { double u, v; } PJ_UV; typedef struct { double x, y; } PJ_XY; typedef struct { double lam, phi; } PJ_LP; typedef struct { double x, y, z; } PJ_XYZ; typedef struct { double u, v, w; } PJ_UVW; typedef struct { double lam, phi, z; } PJ_LPZ; /* Avoid preprocessor renaming and implicit type-punning: Use a union to make it explicit */ union PJ_COORD { double v[4]; /* First and foremost, it really is "just 4 numbers in a vector" */ PJ_XYZT xyzt; PJ_UVWT uvwt; PJ_LPZT lpzt; PJ_GEOD geod; PJ_OPK opk; PJ_ENU enu; PJ_XYZ xyz; PJ_UVW uvw; PJ_LPZ lpz; PJ_XY xy; PJ_UV uv; PJ_LP lp; }; struct PJ_INFO { int major; /* Major release number */ int minor; /* Minor release number */ int patch; /* Patch level */ const char *release; /* Release info. Version + date */ const char *version; /* Full version number */ const char *searchpath; /* Paths where init and grid files are */ /* looked for. Paths are separated by */ /* semi-colons. */ const char * const *paths; size_t path_count; }; struct PJ_PROJ_INFO { const char *id; /* Name of the projection in question */ const char *description; /* Description of the projection */ const char *definition; /* Projection definition */ int has_inverse; /* 1 if an inverse mapping exists, 0 otherwise */ double accuracy; /* Expected accuracy of the transformation. -1 if unknown. */ }; struct PJ_GRID_INFO { char gridname[32]; /* name of grid */ char filename[260]; /* full path to grid */ char format[8]; /* file format of grid */ PJ_LP lowerleft; /* Coordinates of lower left corner */ PJ_LP upperright; /* Coordinates of upper right corner */ int n_lon, n_lat; /* Grid size */ double cs_lon, cs_lat; /* Cell size of grid */ }; struct PJ_INIT_INFO { char name[32]; /* name of init file */ char filename[260]; /* full path to the init file. */ char version[32]; /* version of the init file */ char origin[32]; /* origin of the file, e.g. EPSG */ char lastupdate[16]; /* Date of last update in YYYY-MM-DD format */ }; typedef enum PJ_LOG_LEVEL { PJ_LOG_NONE = 0, PJ_LOG_ERROR = 1, PJ_LOG_DEBUG = 2, PJ_LOG_TRACE = 3, PJ_LOG_TELL = 4, PJ_LOG_DEBUG_MAJOR = 2, /* for proj_api.h compatibility */ PJ_LOG_DEBUG_MINOR = 3 /* for proj_api.h compatibility */ } PJ_LOG_LEVEL; typedef void (*PJ_LOG_FUNCTION)(void *, int, const char *); /* The context type - properly namespaced synonym for projCtx */ struct projCtx_t; typedef struct projCtx_t PJ_CONTEXT; /* A P I */ /* Functionality for handling thread contexts */ #define PJ_DEFAULT_CTX 0 PJ_CONTEXT *proj_context_create (void); PJ_CONTEXT *proj_context_destroy (PJ_CONTEXT *ctx); /* Manage the transformation definition object PJ */ PJ *proj_create (PJ_CONTEXT *ctx, const char *definition); PJ *proj_create_argv (PJ_CONTEXT *ctx, int argc, char **argv); PJ *proj_create_crs_to_crs(PJ_CONTEXT *ctx, const char *srid_from, const char *srid_to, PJ_AREA *area); PJ *proj_destroy (PJ *P); /* Setter-functions for the opaque PJ_AREA struct */ /* Uncomment these when implementing support for area-based transformations. void proj_area_bbox(PJ_AREA *area, LP ll, LP ur); void proj_area_description(PJ_AREA *area, const char *descr); */ /* Apply transformation to observation - in forward or inverse direction */ enum PJ_DIRECTION { PJ_FWD = 1, /* Forward */ PJ_IDENT = 0, /* Do nothing */ PJ_INV = -1 /* Inverse */ }; typedef enum PJ_DIRECTION PJ_DIRECTION; int proj_angular_input (PJ *P, enum PJ_DIRECTION dir); int proj_angular_output (PJ *P, enum PJ_DIRECTION dir); PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD coord); int proj_trans_array (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord); size_t proj_trans_generic ( PJ *P, PJ_DIRECTION direction, double *x, size_t sx, size_t nx, double *y, size_t sy, size_t ny, double *z, size_t sz, size_t nz, double *t, size_t st, size_t nt ); /* Initializers */ PJ_COORD proj_coord (double x, double y, double z, double t); /* Measure internal consistency - in forward or inverse direction */ double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coord); /* Geodesic distance between two points with angular 2D coordinates */ double proj_lp_dist (const PJ *P, PJ_COORD a, PJ_COORD b); /* The geodesic distance AND the vertical offset */ double proj_lpz_dist (const PJ *P, PJ_COORD a, PJ_COORD b); /* Euclidean distance between two points with linear 2D coordinates */ double proj_xy_dist (PJ_COORD a, PJ_COORD b); /* Euclidean distance between two points with linear 3D coordinates */ double proj_xyz_dist (PJ_COORD a, PJ_COORD b); /* Geodesic distance (in meter) + fwd and rev azimuth between two points on the ellipsoid */ PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b); /* Set or read error level */ int proj_context_errno (PJ_CONTEXT *ctx); int proj_errno (const PJ *P); int proj_errno_set (const PJ *P, int err); int proj_errno_reset (const PJ *P); int proj_errno_restore (const PJ *P, int err); const char* proj_errno_string (int err); PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL log_level); void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf); /* Scaling and angular distortion factors */ PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp); /* Info functions - get information about various PROJ.4 entities */ PJ_INFO proj_info(void); PJ_PROJ_INFO proj_pj_info(PJ *P); PJ_GRID_INFO proj_grid_info(const char *gridname); PJ_INIT_INFO proj_init_info(const char *initname); /* List functions: */ /* Get lists of operations, ellipsoids, units and prime meridians. */ const PJ_OPERATIONS *proj_list_operations(void); const PJ_ELLPS *proj_list_ellps(void); const PJ_UNITS *proj_list_units(void); const PJ_PRIME_MERIDIANS *proj_list_prime_meridians(void); /* These are trivial, and while occasionally useful in real code, primarily here to */ /* simplify demo code, and in acknowledgement of the proj-internal discrepancy between */ /* angular units expected by classical proj, and by Charles Karney's geodesics subsystem */ double proj_torad (double angle_in_degrees); double proj_todeg (double angle_in_radians); /* Geographical to geocentric latitude - another of the "simple, but useful" */ PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD coord); double proj_dmstor(const char *is, char **rs); char* proj_rtodms(char *s, double r, int pos, int neg); #ifdef __cplusplus } #endif #endif /* ndef PROJ_H */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win32/include/proj_api.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Public (application) include file for PROJ.4 API, and constants. * Author: Frank Warmerdam, <warmerdam@pobox.com> * ****************************************************************************** * Copyright (c) 2001, Frank Warmerdam <warmerdam@pobox.com> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ /* * This version number should be updated with every release! * * This file is expected to be removed from the PROJ distribution * when a few minor-version releases has been made. * */ #ifndef PJ_VERSION #define PJ_VERSION 520 #endif /* If we're not asked for PJ_VERSION only, give them everything */ #ifndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY /* General projections header file */ #ifndef PROJ_API_H #define PROJ_API_H /* standard inclusions */ #include <math.h> #include <stddef.h> #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* pj_init() and similar functions can be used with a non-C locale */ /* Can be detected too at runtime if the symbol pj_atof exists */ #define PJ_LOCALE_SAFE 1 #define RAD_TO_DEG 57.295779513082321 #define DEG_TO_RAD .017453292519943296 #if defined(PROJECTS_H) || defined(PROJ_H) #define PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API #endif extern char const pj_release[]; /* global release id string */ extern int pj_errno; /* global error return code */ #ifndef PROJ_INTERNAL_H /* replaced by enum proj_log_level in proj_internal.h */ #define PJ_LOG_NONE 0 #define PJ_LOG_ERROR 1 #define PJ_LOG_DEBUG_MAJOR 2 #define PJ_LOG_DEBUG_MINOR 3 #endif #ifdef PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API /* These make the function declarations below conform with classic proj */ typedef PJ *projPJ; /* projPJ is a pointer to PJ */ typedef struct projCtx_t *projCtx; /* projCtx is a pointer to projCtx_t */ #ifdef PROJ_H # define projXY PJ_XY # define projLP PJ_LP # define projXYZ PJ_XYZ # define projLPZ PJ_LPZ #else # define projXY XY # define projLP LP # define projXYZ XYZ # define projLPZ LPZ #endif #else /* i.e. proj_api invoked as primary API */ typedef struct { double u, v; } projUV; typedef struct { double u, v, w; } projUVW; typedef void *projPJ; #define projXY projUV #define projLP projUV #define projXYZ projUVW #define projLPZ projUVW typedef void *projCtx; #endif /* If included *after* proj.h finishes, we have alternative names */ /* file reading api, like stdio */ typedef int *PAFile; typedef struct projFileAPI_t { PAFile (*FOpen)(projCtx ctx, const char *filename, const char *access); size_t (*FRead)(void *buffer, size_t size, size_t nmemb, PAFile file); int (*FSeek)(PAFile file, long offset, int whence); long (*FTell)(PAFile file); void (*FClose)(PAFile); } projFileAPI; /* procedure prototypes */ projCtx pj_get_default_ctx(void); projCtx pj_get_ctx( projPJ ); projXY pj_fwd(projLP, projPJ); projLP pj_inv(projXY, projPJ); projXYZ pj_fwd3d(projLPZ, projPJ); projLPZ pj_inv3d(projXYZ, projPJ); int pj_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); int pj_datum_transform( projPJ src, projPJ dst, long point_count, int point_offset, double *x, double *y, double *z ); int pj_geocentric_to_geodetic( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); int pj_geodetic_to_geocentric( double a, double es, long point_count, int point_offset, double *x, double *y, double *z ); int pj_compare_datums( projPJ srcdefn, projPJ dstdefn ); int pj_apply_gridshift( projCtx, const char *, int, long point_count, int point_offset, double *x, double *y, double *z ); void pj_deallocate_grids(void); void pj_clear_initcache(void); int pj_is_latlong(projPJ); int pj_is_geocent(projPJ); void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared); void pj_pr_list(projPJ); void pj_free(projPJ); void pj_set_finder( const char *(*)(const char *) ); void pj_set_searchpath ( int count, const char **path ); projPJ pj_init(int, char **); projPJ pj_init_plus(const char *); projPJ pj_init_ctx( projCtx, int, char ** ); projPJ pj_init_plus_ctx( projCtx, const char * ); char *pj_get_def(projPJ, int); projPJ pj_latlong_from_proj( projPJ ); int pj_has_inverse(projPJ); void *pj_malloc(size_t); void pj_dalloc(void *); void *pj_calloc (size_t n, size_t size); void *pj_dealloc (void *ptr); char *pj_strdup(const char *str); char *pj_strerrno(int); int *pj_get_errno_ref(void); const char *pj_get_release(void); void pj_acquire_lock(void); void pj_release_lock(void); void pj_cleanup_lock(void); void pj_set_ctx( projPJ, projCtx ); projCtx pj_ctx_alloc(void); void pj_ctx_free( projCtx ); int pj_ctx_get_errno( projCtx ); void pj_ctx_set_errno( projCtx, int ); void pj_ctx_set_debug( projCtx, int ); void pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) ); void pj_ctx_set_app_data( projCtx, void * ); void *pj_ctx_get_app_data( projCtx ); void pj_ctx_set_fileapi( projCtx, projFileAPI *); projFileAPI *pj_ctx_get_fileapi( projCtx ); void pj_log( projCtx ctx, int level, const char *fmt, ... ); void pj_stderr_logger( void *, int, const char * ); /* file api */ projFileAPI *pj_get_default_fileapi(void); PAFile pj_ctx_fopen(projCtx ctx, const char *filename, const char *access); size_t pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file); int pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence); long pj_ctx_ftell(projCtx ctx, PAFile file); void pj_ctx_fclose(projCtx ctx, PAFile file); char *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file); PAFile pj_open_lib(projCtx, const char *, const char *); int pj_find_file(projCtx ctx, const char *short_filename, char* out_full_filename, size_t out_full_filename_size); #ifdef __cplusplus } #endif #endif /* ndef PROJ_API_H */ #endif /* ndef PROJ_API_INCLUDED_FOR_PJ_VERSION_ONLY */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win32/include/geodesic.h
/** * \file geodesic.h * \brief API for the geodesic routines in C * * This an implementation in C of the geodesic algorithms described in * - C. F. F. Karney, * <a href="https://doi.org/10.1007/s00190-012-0578-z"> * Algorithms for geodesics</a>, * J. Geodesy <b>87</b>, 43--55 (2013); * DOI: <a href="https://doi.org/10.1007/s00190-012-0578-z"> * 10.1007/s00190-012-0578-z</a>; * addenda: <a href="https://geographiclib.sourceforge.io/geod-addenda.html"> * geod-addenda.html</a>. * . * The principal advantages of these algorithms over previous ones (e.g., * Vincenty, 1975) are * - accurate to round off for |<i>f</i>| &lt; 1/50; * - the solution of the inverse problem is always found; * - differential and integral properties of geodesics are computed. * * The shortest path between two points on the ellipsoid at (\e lat1, \e * lon1) and (\e lat2, \e lon2) is called the geodesic. Its length is * \e s12 and the geodesic from point 1 to point 2 has forward azimuths * \e azi1 and \e azi2 at the two end points. * * Traditionally two geodesic problems are considered: * - the direct problem -- given \e lat1, \e lon1, \e s12, and \e azi1, * determine \e lat2, \e lon2, and \e azi2. This is solved by the function * geod_direct(). * - the inverse problem -- given \e lat1, \e lon1, and \e lat2, \e lon2, * determine \e s12, \e azi1, and \e azi2. This is solved by the function * geod_inverse(). * * The ellipsoid is specified by its equatorial radius \e a (typically in * meters) and flattening \e f. The routines are accurate to round off with * double precision arithmetic provided that |<i>f</i>| &lt; 1/50; for the * WGS84 ellipsoid, the errors are less than 15 nanometers. (Reasonably * accurate results are obtained for |<i>f</i>| &lt; 1/5.) For a prolate * ellipsoid, specify \e f &lt; 0. * * The routines also calculate several other quantities of interest * - \e S12 is the area between the geodesic from point 1 to point 2 and the * equator; i.e., it is the area, measured counter-clockwise, of the * quadrilateral with corners (\e lat1,\e lon1), (0,\e lon1), (0,\e lon2), * and (\e lat2,\e lon2). * - \e m12, the reduced length of the geodesic is defined such that if * the initial azimuth is perturbed by \e dazi1 (radians) then the * second point is displaced by \e m12 \e dazi1 in the direction * perpendicular to the geodesic. On a curved surface the reduced * length obeys a symmetry relation, \e m12 + \e m21 = 0. On a flat * surface, we have \e m12 = \e s12. * - \e M12 and \e M21 are geodesic scales. If two geodesics are * parallel at point 1 and separated by a small distance \e dt, then * they are separated by a distance \e M12 \e dt at point 2. \e M21 * is defined similarly (with the geodesics being parallel to one * another at point 2). On a flat surface, we have \e M12 = \e M21 * = 1. * - \e a12 is the arc length on the auxiliary sphere. This is a * construct for converting the problem to one in spherical * trigonometry. \e a12 is measured in degrees. The spherical arc * length from one equator crossing to the next is always 180&deg;. * * If points 1, 2, and 3 lie on a single geodesic, then the following * addition rules hold: * - \e s13 = \e s12 + \e s23 * - \e a13 = \e a12 + \e a23 * - \e S13 = \e S12 + \e S23 * - \e m13 = \e m12 \e M23 + \e m23 \e M21 * - \e M13 = \e M12 \e M23 &minus; (1 &minus; \e M12 \e M21) \e * m23 / \e m12 * - \e M31 = \e M32 \e M21 &minus; (1 &minus; \e M23 \e M32) \e * m12 / \e m23 * * The shortest distance returned by the solution of the inverse problem is * (obviously) uniquely defined. However, in a few special cases there are * multiple azimuths which yield the same shortest distance. Here is a * catalog of those cases: * - \e lat1 = &minus;\e lat2 (with neither point at a pole). If \e azi1 = \e * azi2, the geodesic is unique. Otherwise there are two geodesics and the * second one is obtained by setting [\e azi1, \e azi2] &rarr; [\e azi2, \e * azi1], [\e M12, \e M21] &rarr; [\e M21, \e M12], \e S12 &rarr; &minus;\e * S12. (This occurs when the longitude difference is near &plusmn;180&deg; * for oblate ellipsoids.) * - \e lon2 = \e lon1 &plusmn; 180&deg; (with neither point at a pole). If \e * azi1 = 0&deg; or &plusmn;180&deg;, the geodesic is unique. Otherwise * there are two geodesics and the second one is obtained by setting [\e * azi1, \e azi2] &rarr; [&minus;\e azi1, &minus;\e azi2], \e S12 &rarr; * &minus;\e S12. (This occurs when \e lat2 is near &minus;\e lat1 for * prolate ellipsoids.) * - Points 1 and 2 at opposite poles. There are infinitely many geodesics * which can be generated by setting [\e azi1, \e azi2] &rarr; [\e azi1, \e * azi2] + [\e d, &minus;\e d], for arbitrary \e d. (For spheres, this * prescription applies when points 1 and 2 are antipodal.) * - \e s12 = 0 (coincident points). There are infinitely many geodesics which * can be generated by setting [\e azi1, \e azi2] &rarr; [\e azi1, \e azi2] + * [\e d, \e d], for arbitrary \e d. * * These routines are a simple transcription of the corresponding C++ classes * in <a href="https://geographiclib.sourceforge.io"> GeographicLib</a>. The * "class data" is represented by the structs geod_geodesic, geod_geodesicline, * geod_polygon and pointers to these objects are passed as initial arguments * to the member functions. Most of the internal comments have been retained. * However, in the process of transcription some documentation has been lost * and the documentation for the C++ classes, GeographicLib::Geodesic, * GeographicLib::GeodesicLine, and GeographicLib::PolygonAreaT, should be * consulted. The C++ code remains the "reference implementation". Think * twice about restructuring the internals of the C code since this may make * porting fixes from the C++ code more difficult. * * Copyright (c) Charles Karney (2012-2018) <charles@karney.com> and licensed * under the MIT/X11 License. For more information, see * https://geographiclib.sourceforge.io/ * * This library was distributed with * <a href="../index.html">GeographicLib</a> 1.49. **********************************************************************/ #if !defined(GEODESIC_H) #define GEODESIC_H 1 /** * The major version of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_MAJOR 1 /** * The minor version of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_MINOR 49 /** * The patch level of the geodesic library. (This tracks the version of * GeographicLib.) **********************************************************************/ #define GEODESIC_VERSION_PATCH 3 /** * Pack the version components into a single integer. Users should not rely on * this particular packing of the components of the version number; see the * documentation for GEODESIC_VERSION, below. **********************************************************************/ #define GEODESIC_VERSION_NUM(a,b,c) ((((a) * 10000 + (b)) * 100) + (c)) /** * The version of the geodesic library as a single integer, packed as MMmmmmpp * where MM is the major version, mmmm is the minor version, and pp is the * patch level. Users should not rely on this particular packing of the * components of the version number. Instead they should use a test such as * @code{.c} #if GEODESIC_VERSION >= GEODESIC_VERSION_NUM(1,40,0) ... #endif * @endcode **********************************************************************/ #define GEODESIC_VERSION \ GEODESIC_VERSION_NUM(GEODESIC_VERSION_MAJOR, \ GEODESIC_VERSION_MINOR, \ GEODESIC_VERSION_PATCH) #if defined(__cplusplus) extern "C" { #endif /** * The struct containing information about the ellipsoid. This must be * initialized by geod_init() before use. **********************************************************************/ struct geod_geodesic { double a; /**< the equatorial radius */ double f; /**< the flattening */ /**< @cond SKIP */ double f1, e2, ep2, n, b, c2, etol2; double A3x[6], C3x[15], C4x[21]; /**< @endcond */ }; /** * The struct containing information about a single geodesic. This must be * initialized by geod_lineinit(), geod_directline(), geod_gendirectline(), * or geod_inverseline() before use. **********************************************************************/ struct geod_geodesicline { double lat1; /**< the starting latitude */ double lon1; /**< the starting longitude */ double azi1; /**< the starting azimuth */ double a; /**< the equatorial radius */ double f; /**< the flattening */ double salp1; /**< sine of \e azi1 */ double calp1; /**< cosine of \e azi1 */ double a13; /**< arc length to reference point */ double s13; /**< distance to reference point */ /**< @cond SKIP */ double b, c2, f1, salp0, calp0, k2, ssig1, csig1, dn1, stau1, ctau1, somg1, comg1, A1m1, A2m1, A3c, B11, B21, B31, A4, B41; double C1a[6+1], C1pa[6+1], C2a[6+1], C3a[6], C4a[6]; /**< @endcond */ unsigned caps; /**< the capabilities */ }; /** * The struct for accumulating information about a geodesic polygon. This is * used for computing the perimeter and area of a polygon. This must be * initialized by geod_polygon_init() before use. **********************************************************************/ struct geod_polygon { double lat; /**< the current latitude */ double lon; /**< the current longitude */ /**< @cond SKIP */ double lat0; double lon0; double A[2]; double P[2]; int polyline; int crossings; /**< @endcond */ unsigned num; /**< the number of points so far */ }; /** * Initialize a geod_geodesic object. * * @param[out] g a pointer to the object to be initialized. * @param[in] a the equatorial radius (meters). * @param[in] f the flattening. **********************************************************************/ void geod_init(struct geod_geodesic* g, double a, double f); /** * Solve the direct geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. The values of \e lon2 * and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;]. Any of * the "return" arguments \e plat2, etc., may be replaced by 0, if you do not * need some quantities computed. * * If either point is at a pole, the azimuth is defined by keeping the * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and * taking the limit &epsilon; &rarr; 0+. An arc length greater that 180&deg; * signifies a geodesic which is not a shortest path. (For a prolate * ellipsoid, an additional condition is necessary for a shortest path: the * longitudinal extent must not exceed of 180&deg;.) * * Example, determine the point 10000 km NE of JFK: @code{.c} struct geod_geodesic g; double lat, lon; geod_init(&g, 6378137, 1/298.257223563); geod_direct(&g, 40.64, -73.78, 45.0, 10e6, &lat, &lon, 0); printf("%.5f %.5f\n", lat, lon); @endcode **********************************************************************/ void geod_direct(const struct geod_geodesic* g, double lat1, double lon1, double azi1, double s12, double* plat2, double* plon2, double* pazi2); /** * The general direct geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] flags bitor'ed combination of geod_flags(); \e flags & * GEOD_ARCMODE determines the meaning of \e s12_a12 and \e flags & * GEOD_LONG_UNROLL "unrolls" \e lon2. * @param[in] s12_a12 if \e flags & GEOD_ARCMODE is 0, this is the distance * from point 1 to point 2 (meters); otherwise it is the arc length * from point 1 to point 2 (degrees); it can be negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pm12 pointer to the reduced length of geodesic (meters). * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless). * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless). * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>). * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. The function value \e * a12 equals \e s12_a12 if \e flags & GEOD_ARCMODE. Any of the "return" * arguments, \e plat2, etc., may be replaced by 0, if you do not need some * quantities computed. * * With \e flags & GEOD_LONG_UNROLL bit set, the longitude is "unrolled" so * that the quantity \e lon2 &minus; \e lon1 indicates how many times and in * what sense the geodesic encircles the ellipsoid. **********************************************************************/ double geod_gendirect(const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned flags, double s12_a12, double* plat2, double* plon2, double* pazi2, double* ps12, double* pm12, double* pM12, double* pM21, double* pS12); /** * Solve the inverse geodesic problem. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 and * \e lat2 should be in the range [&minus;90&deg;, 90&deg;]. The values of * \e azi1 and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;]. * Any of the "return" arguments, \e ps12, etc., may be replaced by 0, if you * do not need some quantities computed. * * If either point is at a pole, the azimuth is defined by keeping the * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and * taking the limit &epsilon; &rarr; 0+. * * The solution to the inverse problem is found using Newton's method. If * this fails to converge (this is very unlikely in geodetic applications * but does occur for very eccentric ellipsoids), then the bisection method * is used to refine the solution. * * Example, determine the distance between JFK and Singapore Changi Airport: @code{.c} struct geod_geodesic g; double s12; geod_init(&g, 6378137, 1/298.257223563); geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, 0, 0); printf("%.3f\n", s12); @endcode **********************************************************************/ void geod_inverse(const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, double* ps12, double* pazi1, double* pazi2); /** * The general inverse geodesic calculation. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters). * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] pm12 pointer to the reduced length of geodesic (meters). * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless). * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless). * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>). * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e g must have been initialized with a call to geod_init(). \e lat1 and * \e lat2 should be in the range [&minus;90&deg;, 90&deg;]. Any of the * "return" arguments \e ps12, etc., may be replaced by 0, if you do not need * some quantities computed. **********************************************************************/ double geod_geninverse(const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, double* ps12, double* pazi1, double* pazi2, double* pm12, double* pM12, double* pM21, double* pS12); /** * Initialize a geod_geodesicline object. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * \e g must have been initialized with a call to geod_init(). \e lat1 * should be in the range [&minus;90&deg;, 90&deg;]. * * The geod_mask values are [see geod_mask()]: * - \e caps |= GEOD_LATITUDE for the latitude \e lat2; this is * added automatically, * - \e caps |= GEOD_LONGITUDE for the latitude \e lon2, * - \e caps |= GEOD_AZIMUTH for the latitude \e azi2; this is * added automatically, * - \e caps |= GEOD_DISTANCE for the distance \e s12, * - \e caps |= GEOD_REDUCEDLENGTH for the reduced length \e m12, * - \e caps |= GEOD_GEODESICSCALE for the geodesic scales \e M12 * and \e M21, * - \e caps |= GEOD_AREA for the area \e S12, * - \e caps |= GEOD_DISTANCE_IN permits the length of the * geodesic to be given in terms of \e s12; without this capability the * length can only be specified in terms of arc length. * . * A value of \e caps = 0 is treated as GEOD_LATITUDE | GEOD_LONGITUDE | * GEOD_AZIMUTH | GEOD_DISTANCE_IN (to support the solution of the "standard" * direct problem). * * When initialized by this function, point 3 is undefined (l->s13 = l->a13 = * NaN). **********************************************************************/ void geod_lineinit(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the direct geodesic * problem. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the direct geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_directline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, double s12, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the direct geodesic * problem spacified in terms of either distance or arc length. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees). * @param[in] flags either GEOD_NOFLAGS or GEOD_ARCMODE to determining the * meaning of the \e s12_a12. * @param[in] s12_a12 if \e flags = GEOD_NOFLAGS, this is the distance * from point 1 to point 2 (meters); if \e flags = GEOD_ARCMODE, it is * the arc length from point 1 to point 2 (degrees); it can be * negative. * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the direct geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_gendirectline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double azi1, unsigned flags, double s12_a12, unsigned caps); /** * Initialize a geod_geodesicline object in terms of the inverse geodesic * problem. * * @param[out] l a pointer to the object to be initialized. * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lat1 latitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees). * @param[in] lat2 latitude of point 2 (degrees). * @param[in] lon2 longitude of point 2 (degrees). * @param[in] caps bitor'ed combination of geod_mask() values specifying the * capabilities the geod_geodesicline object should possess, i.e., which * quantities can be returned in calls to geod_position() and * geod_genposition(). * * This function sets point 3 of the geod_geodesicline to correspond to point * 2 of the inverse geodesic problem. See geod_lineinit() for more * information. **********************************************************************/ void geod_inverseline(struct geod_geodesicline* l, const struct geod_geodesic* g, double lat1, double lon1, double lat2, double lon2, unsigned caps); /** * Compute the position along a geod_geodesicline. * * @param[in] l a pointer to the geod_geodesicline object specifying the * geodesic line. * @param[in] s12 distance from point 1 to point 2 (meters); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires * that \e l was initialized with \e caps |= GEOD_LONGITUDE. * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * * \e l must have been initialized with a call, e.g., to geod_lineinit(), * with \e caps |= GEOD_DISTANCE_IN. The values of \e lon2 and \e azi2 * returned are in the range [&minus;180&deg;, 180&deg;]. Any of the * "return" arguments \e plat2, etc., may be replaced by 0, if you do not * need some quantities computed. * * Example, compute way points between JFK and Singapore Changi Airport * the "obvious" way using geod_direct(): @code{.c} struct geod_geodesic g; double s12, azi1, lat[101],lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0); for (i = 0; i < 101; ++i) { geod_direct(&g, 40.64, -73.78, azi1, i * s12 * 0.01, lat + i, lon + i, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode * A faster way using geod_position(): @code{.c} struct geod_geodesic g; struct geod_geodesicline l; double lat[101],lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverseline(&l, &g, 40.64, -73.78, 1.36, 103.99, 0); for (i = 0; i <= 100; ++i) { geod_position(&l, i * l.s13 * 0.01, lat + i, lon + i, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode **********************************************************************/ void geod_position(const struct geod_geodesicline* l, double s12, double* plat2, double* plon2, double* pazi2); /** * The general position function. * * @param[in] l a pointer to the geod_geodesicline object specifying the * geodesic line. * @param[in] flags bitor'ed combination of geod_flags(); \e flags & * GEOD_ARCMODE determines the meaning of \e s12_a12 and \e flags & * GEOD_LONG_UNROLL "unrolls" \e lon2; if \e flags & GEOD_ARCMODE is 0, * then \e l must have been initialized with \e caps |= GEOD_DISTANCE_IN. * @param[in] s12_a12 if \e flags & GEOD_ARCMODE is 0, this is the * distance from point 1 to point 2 (meters); otherwise it is the * arc length from point 1 to point 2 (degrees); it can be * negative. * @param[out] plat2 pointer to the latitude of point 2 (degrees). * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires * that \e l was initialized with \e caps |= GEOD_LONGITUDE. * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). * @param[out] ps12 pointer to the distance from point 1 to point 2 * (meters); requires that \e l was initialized with \e caps |= * GEOD_DISTANCE. * @param[out] pm12 pointer to the reduced length of geodesic (meters); * requires that \e l was initialized with \e caps |= GEOD_REDUCEDLENGTH. * @param[out] pM12 pointer to the geodesic scale of point 2 relative to * point 1 (dimensionless); requires that \e l was initialized with \e caps * |= GEOD_GEODESICSCALE. * @param[out] pM21 pointer to the geodesic scale of point 1 relative to * point 2 (dimensionless); requires that \e l was initialized with \e caps * |= GEOD_GEODESICSCALE. * @param[out] pS12 pointer to the area under the geodesic * (meters<sup>2</sup>); requires that \e l was initialized with \e caps |= * GEOD_AREA. * @return \e a12 arc length from point 1 to point 2 (degrees). * * \e l must have been initialized with a call to geod_lineinit() with \e * caps |= GEOD_DISTANCE_IN. The value \e azi2 returned is in the range * [&minus;180&deg;, 180&deg;]. Any of the "return" arguments \e plat2, * etc., may be replaced by 0, if you do not need some quantities * computed. Requesting a value which \e l is not capable of computing * is not an error; the corresponding argument will not be altered. * * With \e flags & GEOD_LONG_UNROLL bit set, the longitude is "unrolled" so * that the quantity \e lon2 &minus; \e lon1 indicates how many times and in * what sense the geodesic encircles the ellipsoid. * * Example, compute way points between JFK and Singapore Changi Airport using * geod_genposition(). In this example, the points are evenly space in arc * length (and so only approximately equally spaced in distance). This is * faster than using geod_position() and would be appropriate if drawing the * path on a map. @code{.c} struct geod_geodesic g; struct geod_geodesicline l; double lat[101], lon[101]; int i; geod_init(&g, 6378137, 1/298.257223563); geod_inverseline(&l, &g, 40.64, -73.78, 1.36, 103.99, GEOD_LATITUDE | GEOD_LONGITUDE); for (i = 0; i <= 100; ++i) { geod_genposition(&l, GEOD_ARCMODE, i * l.a13 * 0.01, lat + i, lon + i, 0, 0, 0, 0, 0, 0); printf("%.5f %.5f\n", lat[i], lon[i]); } @endcode **********************************************************************/ double geod_genposition(const struct geod_geodesicline* l, unsigned flags, double s12_a12, double* plat2, double* plon2, double* pazi2, double* ps12, double* pm12, double* pM12, double* pM21, double* pS12); /** * Specify position of point 3 in terms of distance. * * @param[in,out] l a pointer to the geod_geodesicline object. * @param[in] s13 the distance from point 1 to point 3 (meters); it * can be negative. * * This is only useful if the geod_geodesicline object has been constructed * with \e caps |= GEOD_DISTANCE_IN. **********************************************************************/ void geod_setdistance(struct geod_geodesicline* l, double s13); /** * Specify position of point 3 in terms of either distance or arc length. * * @param[in,out] l a pointer to the geod_geodesicline object. * @param[in] flags either GEOD_NOFLAGS or GEOD_ARCMODE to determining the * meaning of the \e s13_a13. * @param[in] s13_a13 if \e flags = GEOD_NOFLAGS, this is the distance * from point 1 to point 3 (meters); if \e flags = GEOD_ARCMODE, it is * the arc length from point 1 to point 3 (degrees); it can be * negative. * * If flags = GEOD_NOFLAGS, this calls geod_setdistance(). If flags = * GEOD_ARCMODE, the \e s13 is only set if the geod_geodesicline object has * been constructed with \e caps |= GEOD_DISTANCE. **********************************************************************/ void geod_gensetdistance(struct geod_geodesicline* l, unsigned flags, double s13_a13); /** * Initialize a geod_polygon object. * * @param[out] p a pointer to the object to be initialized. * @param[in] polylinep non-zero if a polyline instead of a polygon. * * If \e polylinep is zero, then the sequence of vertices and edges added by * geod_polygon_addpoint() and geod_polygon_addedge() define a polygon and * the perimeter and area are returned by geod_polygon_compute(). If \e * polylinep is non-zero, then the vertices and edges define a polyline and * only the perimeter is returned by geod_polygon_compute(). * * The area and perimeter are accumulated at two times the standard floating * point precision to guard against the loss of accuracy with many-sided * polygons. At any point you can ask for the perimeter and area so far. * * An example of the use of this function is given in the documentation for * geod_polygon_compute(). **********************************************************************/ void geod_polygon_init(struct geod_polygon* p, int polylinep); /** * Clear the polygon, allowing a new polygon to be started. * * @param[in,out] p a pointer to the object to be cleared. **********************************************************************/ void geod_polygon_clear(struct geod_polygon* p); /** * Add a point to the polygon or polyline. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in,out] p a pointer to the geod_polygon object specifying the * polygon. * @param[in] lat the latitude of the point (degrees). * @param[in] lon the longitude of the point (degrees). * * \e g and \e p must have been initialized with calls to geod_init() and * geod_polygon_init(), respectively. The same \e g must be used for all the * points and edges in a polygon. \e lat should be in the range * [&minus;90&deg;, 90&deg;]. * * An example of the use of this function is given in the documentation for * geod_polygon_compute(). **********************************************************************/ void geod_polygon_addpoint(const struct geod_geodesic* g, struct geod_polygon* p, double lat, double lon); /** * Add an edge to the polygon or polyline. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in,out] p a pointer to the geod_polygon object specifying the * polygon. * @param[in] azi azimuth at current point (degrees). * @param[in] s distance from current point to next point (meters). * * \e g and \e p must have been initialized with calls to geod_init() and * geod_polygon_init(), respectively. The same \e g must be used for all the * points and edges in a polygon. This does nothing if no points have been * added yet. The \e lat and \e lon fields of \e p give the location of the * new vertex. **********************************************************************/ void geod_polygon_addedge(const struct geod_geodesic* g, struct geod_polygon* p, double azi, double s); /** * Return the results for a polygon. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. * * The area and perimeter are accumulated at two times the standard floating * point precision to guard against the loss of accuracy with many-sided * polygons. Only simple polygons (which are not self-intersecting) are * allowed. There's no need to "close" the polygon by repeating the first * vertex. Set \e pA or \e pP to zero, if you do not want the corresponding * quantity returned. * * More points can be added to the polygon after this call. * * Example, compute the perimeter and area of the geodesic triangle with * vertices (0&deg;N,0&deg;E), (0&deg;N,90&deg;E), (90&deg;N,0&deg;E). @code{.c} double A, P; int n; struct geod_geodesic g; struct geod_polygon p; geod_init(&g, 6378137, 1/298.257223563); geod_polygon_init(&p, 0); geod_polygon_addpoint(&g, &p, 0, 0); geod_polygon_addpoint(&g, &p, 0, 90); geod_polygon_addpoint(&g, &p, 90, 0); n = geod_polygon_compute(&g, &p, 0, 1, &A, &P); printf("%d %.8f %.3f\n", n, P, A); @endcode **********************************************************************/ unsigned geod_polygon_compute(const struct geod_geodesic* g, const struct geod_polygon* p, int reverse, int sign, double* pA, double* pP); /** * Return the results assuming a tentative final test point is added; * however, the data for the test point is not saved. This lets you report a * running result for the perimeter and area as the user moves the mouse * cursor. Ordinary floating point arithmetic is used to accumulate the data * for the test point; thus the area and perimeter returned are less accurate * than if geod_polygon_addpoint() and geod_polygon_compute() are used. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] lat the latitude of the test point (degrees). * @param[in] lon the longitude of the test point (degrees). * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. * * \e lat should be in the range [&minus;90&deg;, 90&deg;]. **********************************************************************/ unsigned geod_polygon_testpoint(const struct geod_geodesic* g, const struct geod_polygon* p, double lat, double lon, int reverse, int sign, double* pA, double* pP); /** * Return the results assuming a tentative final test point is added via an * azimuth and distance; however, the data for the test point is not saved. * This lets you report a running result for the perimeter and area as the * user moves the mouse cursor. Ordinary floating point arithmetic is used * to accumulate the data for the test point; thus the area and perimeter * returned are less accurate than if geod_polygon_addedge() and * geod_polygon_compute() are used. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] p a pointer to the geod_polygon object specifying the polygon. * @param[in] azi azimuth at current point (degrees). * @param[in] s distance from current point to final test point (meters). * @param[in] reverse if non-zero then clockwise (instead of * counter-clockwise) traversal counts as a positive area. * @param[in] sign if non-zero then return a signed result for the area if * the polygon is traversed in the "wrong" direction instead of returning * the area for the rest of the earth. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>); * only set if \e polyline is non-zero in the call to geod_polygon_init(). * @param[out] pP pointer to the perimeter of the polygon or length of the * polyline (meters). * @return the number of points. **********************************************************************/ unsigned geod_polygon_testedge(const struct geod_geodesic* g, const struct geod_polygon* p, double azi, double s, int reverse, int sign, double* pA, double* pP); /** * A simple interface for computing the area of a geodesic polygon. * * @param[in] g a pointer to the geod_geodesic object specifying the * ellipsoid. * @param[in] lats an array of latitudes of the polygon vertices (degrees). * @param[in] lons an array of longitudes of the polygon vertices (degrees). * @param[in] n the number of vertices. * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>). * @param[out] pP pointer to the perimeter of the polygon (meters). * * \e lats should be in the range [&minus;90&deg;, 90&deg;]. * * Only simple polygons (which are not self-intersecting) are allowed. * There's no need to "close" the polygon by repeating the first vertex. The * area returned is signed with counter-clockwise traversal being treated as * positive. * * Example, compute the area of Antarctica: @code{.c} double lats[] = {-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7, -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7}, lons[] = {-74, -102, -102, -131, -163, 163, 172, 140, 113, 88, 59, 25, -4, -14, -33, -46, -61}; struct geod_geodesic g; double A, P; geod_init(&g, 6378137, 1/298.257223563); geod_polygonarea(&g, lats, lons, (sizeof lats) / (sizeof lats[0]), &A, &P); printf("%.0f %.2f\n", A, P); @endcode **********************************************************************/ void geod_polygonarea(const struct geod_geodesic* g, double lats[], double lons[], int n, double* pA, double* pP); /** * mask values for the \e caps argument to geod_lineinit(). **********************************************************************/ enum geod_mask { GEOD_NONE = 0U, /**< Calculate nothing */ GEOD_LATITUDE = 1U<<7 | 0U, /**< Calculate latitude */ GEOD_LONGITUDE = 1U<<8 | 1U<<3, /**< Calculate longitude */ GEOD_AZIMUTH = 1U<<9 | 0U, /**< Calculate azimuth */ GEOD_DISTANCE = 1U<<10 | 1U<<0, /**< Calculate distance */ GEOD_DISTANCE_IN = 1U<<11 | 1U<<0 | 1U<<1,/**< Allow distance as input */ GEOD_REDUCEDLENGTH= 1U<<12 | 1U<<0 | 1U<<2,/**< Calculate reduced length */ GEOD_GEODESICSCALE= 1U<<13 | 1U<<0 | 1U<<2,/**< Calculate geodesic scale */ GEOD_AREA = 1U<<14 | 1U<<4, /**< Calculate reduced length */ GEOD_ALL = 0x7F80U| 0x1FU /**< Calculate everything */ }; /** * flag values for the \e flags argument to geod_gendirect() and * geod_genposition() **********************************************************************/ enum geod_flags { GEOD_NOFLAGS = 0U, /**< No flags */ GEOD_ARCMODE = 1U<<0, /**< Position given in terms of arc distance */ GEOD_LONG_UNROLL = 1U<<15 /**< Unroll the longitude */ }; #if defined(__cplusplus) } #endif #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/proj-5.2/Win32/include/projects.h
/****************************************************************************** * Project: PROJ.4 * Purpose: Primary (private) include file for PROJ.4 library. * Author: Gerald Evenden * ****************************************************************************** * Copyright (c) 2000, Frank Warmerdam * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ /* General projections header file */ #ifndef PROJECTS_H #define PROJECTS_H #ifdef _MSC_VER # ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE # endif # ifndef _CRT_NONSTDC_NO_DEPRECATE # define _CRT_NONSTDC_NO_DEPRECATE # endif /* enable predefined math constants M_* for MS Visual Studio workaround */ # ifndef _USE_MATH_DEFINES # define _USE_MATH_DEFINES # endif #endif /* standard inclusions */ #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef __cplusplus #define C_NAMESPACE extern "C" #define C_NAMESPACE_VAR extern "C" extern "C" { #else #define C_NAMESPACE extern #define C_NAMESPACE_VAR #endif #ifndef NULL # define NULL 0 #endif #ifndef FALSE # define FALSE 0 #endif #ifndef TRUE # define TRUE 1 #endif #ifndef MAX # define MIN(a,b) ((a<b) ? a : b) # define MAX(a,b) ((a>b) ? a : b) #endif #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif #if INT_MAX == 2147483647 typedef int pj_int32; #elif LONG_MAX == 2147483647 typedef long pj_int32; #else #warning It seems no 32-bit integer type is available #endif /* maximum path/filename */ #ifndef MAX_PATH_FILENAME #define MAX_PATH_FILENAME 1024 #endif /* If we still haven't got M_PI*, we rely on our own defines. * For example, this is necessary when compiling with gcc and * the -ansi flag. */ #ifndef M_PI #define M_PI 3.14159265358979323846 #define M_PI_2 1.57079632679489661923 #define M_PI_4 0.78539816339744830962 #define M_2_PI 0.63661977236758134308 #endif /* M_SQRT2 might be missing */ #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 #endif /* some more useful math constants and aliases */ #define M_FORTPI M_PI_4 /* pi/4 */ #define M_HALFPI M_PI_2 /* pi/2 */ #define M_PI_HALFPI 4.71238898038468985769 /* 1.5*pi */ #define M_TWOPI 6.28318530717958647693 /* 2*pi */ #define M_TWO_D_PI M_2_PI /* 2/pi */ #define M_TWOPI_HALFPI 7.85398163397448309616 /* 2.5*pi */ /* maximum tag id length for +init and default files */ #ifndef ID_TAG_MAX #define ID_TAG_MAX 50 #endif /* Use WIN32 as a standard windows 32 bit declaration */ #if defined(_WIN32) && !defined(WIN32) # define WIN32 #endif #if defined(_WINDOWS) && !defined(WIN32) # define WIN32 #endif /* directory delimiter for DOS support */ #ifdef WIN32 #define DIR_CHAR '\\' #else #define DIR_CHAR '/' #endif #define USE_PROJUV typedef struct { double u, v; } projUV; typedef struct { double r, i; } COMPLEX; typedef struct { double u, v, w; } projUVW; /* If user explicitly includes proj.h, before projects.h, then avoid implicit type-punning */ #ifndef PROJ_H #ifndef PJ_LIB__ #define XY projUV #define LP projUV #define XYZ projUVW #define LPZ projUVW #else typedef struct { double x, y; } XY; typedef struct { double x, y, z; } XYZ; typedef struct { double lam, phi; } LP; typedef struct { double lam, phi, z; } LPZ; typedef struct { double u, v; } UV; typedef struct { double u, v, w; } UVW; #endif /* ndef PJ_LIB__ */ #else typedef PJ_XY XY; typedef PJ_LP LP; typedef PJ_UV UV; typedef PJ_XYZ XYZ; typedef PJ_LPZ LPZ; typedef PJ_UVW UVW; #endif /* ndef PROJ_H */ /* Forward declarations and typedefs for stuff needed inside the PJ object */ struct PJconsts; union PJ_COORD; struct geod_geodesic; struct pj_opaque; struct ARG_list; struct PJ_REGION_S; typedef struct PJ_REGION_S PJ_Region; typedef struct ARG_list paralist; /* parameter list */ #ifndef PROJ_INTERNAL_H enum pj_io_units { PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */ PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */ PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */ PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */ PJ_IO_UNITS_ANGULAR = 4 /* Radians */ }; #endif #ifndef PROJ_H typedef struct PJconsts PJ; /* the PJ object herself */ typedef union PJ_COORD PJ_COORD; #endif struct PJ_REGION_S { double ll_long; /* lower left corner coordinates (radians) */ double ll_lat; double ur_long; /* upper right corner coordinates (radians) */ double ur_lat; }; struct PJ_AREA { int id; /* Area ID in the EPSG database */ LP ll; /* Lower left corner of bounding box */ LP ur; /* Upper right corner of bounding box */ char descr[64]; /* text representation of area */ }; struct projCtx_t; typedef struct projCtx_t projCtx_t; /***************************************************************************** Some function types that are especially useful when working with PJs ****************************************************************************** PJ_CONSTRUCTOR: A function taking a pointer-to-PJ as arg, and returning a pointer-to-PJ. Historically called twice: First with a 0 argument, to allocate memory, second with the first return value as argument, for actual setup. PJ_DESTRUCTOR: A function taking a pointer-to-PJ and an integer as args, then first handling the deallocation of the PJ, afterwards handing the integer over to the error reporting subsystem, and finally returning a null pointer in support of the "return free (P)" (aka "get the hell out of here") idiom. PJ_OPERATOR: A function taking a PJ_COORD and a pointer-to-PJ as args, applying the PJ to the PJ_COORD, and returning the resulting PJ_COORD. *****************************************************************************/ typedef PJ *(* PJ_CONSTRUCTOR) (PJ *); typedef void *(* PJ_DESTRUCTOR) (PJ *, int); typedef PJ_COORD (* PJ_OPERATOR) (PJ_COORD, PJ *); /****************************************************************************/ /* base projection data structure */ struct PJconsts { /************************************************************************************* G E N E R A L P A R A M E T E R S T R U C T ************************************************************************************** TODO: Need some description here - especially about the thread context... This is the struct behind the PJ typedef **************************************************************************************/ projCtx_t *ctx; const char *descr; /* From pj_list.h or individual PJ_*.c file */ paralist *params; /* Parameter list */ char *def_full; /* Full textual definition (usually 0 - set by proj_pj_info) */ char *def_size; /* Shape and size parameters extracted from params */ char *def_shape; char *def_spherification; char *def_ellps; struct geod_geodesic *geod; /* For geodesic computations */ struct pj_opaque *opaque; /* Projection specific parameters, Defined in PJ_*.c */ int inverted; /* Tell high level API functions to swap inv/fwd */ /************************************************************************************* F U N C T I O N P O I N T E R S ************************************************************************************** For projection xxx, these are pointers to functions in the corresponding PJ_xxx.c file. pj_init() delegates the setup of these to pj_projection_specific_setup_xxx(), a name which is currently hidden behind the magic curtain of the PROJECTION macro. **************************************************************************************/ XY (*fwd)(LP, PJ *); LP (*inv)(XY, PJ *); XYZ (*fwd3d)(LPZ, PJ *); LPZ (*inv3d)(XYZ, PJ *); PJ_OPERATOR fwd4d; PJ_OPERATOR inv4d; PJ_DESTRUCTOR destructor; /************************************************************************************* E L L I P S O I D P A R A M E T E R S ************************************************************************************** Despite YAGNI, we add a large number of ellipsoidal shape parameters, which are not yet set up in pj_init. They are, however, inexpensive to compute, compared to the overall time taken for setting up the complex PJ object (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity). But during single point projections it will often be a useful thing to have these readily available without having to recompute at every pj_fwd / pj_inv call. With this wide selection, we should be ready for quite a number of geodetic algorithms, without having to incur further ABI breakage. **************************************************************************************/ /* The linear parameters */ double a; /* semimajor axis (radius if eccentricity==0) */ double b; /* semiminor axis */ double ra; /* 1/a */ double rb; /* 1/b */ /* The eccentricities */ double alpha; /* angular eccentricity */ double e; /* first eccentricity */ double es; /* first eccentricity squared */ double e2; /* second eccentricity */ double e2s; /* second eccentricity squared */ double e3; /* third eccentricity */ double e3s; /* third eccentricity squared */ double one_es; /* 1 - e^2 */ double rone_es; /* 1/one_es */ /* The flattenings */ double f; /* first flattening */ double f2; /* second flattening */ double n; /* third flattening */ double rf; /* 1/f */ double rf2; /* 1/f2 */ double rn; /* 1/n */ /* This one's for GRS80 */ double J; /* "Dynamic form factor" */ double es_orig, a_orig; /* es and a before any +proj related adjustment */ /************************************************************************************* C O O R D I N A T E H A N D L I N G **************************************************************************************/ int over; /* Over-range flag */ int geoc; /* Geocentric latitude flag */ int is_latlong; /* proj=latlong ... not really a projection at all */ int is_geocent; /* proj=geocent ... not really a projection at all */ int is_pipeline; /* 1 if PJ represents a pipeline */ int need_ellps; /* 0 for operations that are purely cartesian */ int skip_fwd_prepare; int skip_fwd_finalize; int skip_inv_prepare; int skip_inv_finalize; enum pj_io_units left; /* Flags for input/output coordinate types */ enum pj_io_units right; /* These PJs are used for implementing cs2cs style coordinate handling in the 4D API */ PJ *axisswap; PJ *cart; PJ *cart_wgs84; PJ *helmert; PJ *hgridshift; PJ *vgridshift; /************************************************************************************* C A R T O G R A P H I C O F F S E T S **************************************************************************************/ double lam0, phi0; /* central meridian, parallel */ double x0, y0, z0, t0; /* false easting and northing (and height and time) */ /************************************************************************************* S C A L I N G **************************************************************************************/ double k0; /* General scaling factor - e.g. the 0.9996 of UTM */ double to_meter, fr_meter; /* Plane coordinate scaling. Internal unit [m] */ double vto_meter, vfr_meter; /* Vertical scaling. Internal unit [m] */ /************************************************************************************* D A T U M S A N D H E I G H T S Y S T E M S ************************************************************************************** It may be possible, and meaningful, to move the list parts of this up to the PJ_CONTEXT level. **************************************************************************************/ int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ double datum_params[7]; /* Parameters for 3PARAM and 7PARAM */ struct _pj_gi **gridlist; /* TODO: Description needed */ int gridlist_count; int has_geoid_vgrids; /* TODO: Description needed */ struct _pj_gi **vgridlist_geoid; /* TODO: Description needed */ int vgridlist_geoid_count; double from_greenwich; /* prime meridian offset (in radians) */ double long_wrap_center; /* 0.0 for -180 to 180, actually in radians*/ int is_long_wrap_set; char axis[4]; /* Axis order, pj_transform/pj_adjust_axis */ /* New Datum Shift Grid Catalogs */ char *catalog_name; struct _PJ_GridCatalog *catalog; double datum_date; /* TODO: Description needed */ struct _pj_gi *last_before_grid; /* TODO: Description needed */ PJ_Region last_before_region; /* TODO: Description needed */ double last_before_date; /* TODO: Description needed */ struct _pj_gi *last_after_grid; /* TODO: Description needed */ PJ_Region last_after_region; /* TODO: Description needed */ double last_after_date; /* TODO: Description needed */ /************************************************************************************* E N D O F G E N E R A L P A R A M E T E R S T R U C T **************************************************************************************/ }; /* Parameter list (a copy of the +proj=... etc. parameters) */ struct ARG_list { paralist *next; char used; #if defined(__GNUC__) && __GNUC__ >= 8 char param[]; /* variable-length member */ /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */ /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */ #else char param[1]; /* variable-length member */ #endif }; typedef union { double f; int i; char *s; } PROJVALUE; struct PJ_ELLPS { char *id; /* ellipse keyword name */ char *major; /* a= value */ char *ell; /* elliptical parameter */ char *name; /* comments */ }; struct PJ_UNITS { char *id; /* units keyword */ char *to_meter; /* multiply by value to get meters */ char *name; /* comments */ double factor; /* to_meter factor in actual numbers */ }; struct PJ_DATUMS { char *id; /* datum keyword */ char *defn; /* ie. "to_wgs84=..." */ char *ellipse_id; /* ie from ellipse table */ char *comments; /* EPSG code, etc */ }; struct PJ_PRIME_MERIDIANS { char *id; /* prime meridian keyword */ char *defn; /* offset from greenwich in DMS format. */ }; struct DERIVS { double x_l, x_p; /* derivatives of x for lambda-phi */ double y_l, y_p; /* derivatives of y for lambda-phi */ }; struct FACTORS { struct DERIVS der; double h, k; /* meridional, parallel scales */ double omega, thetap; /* angular distortion, theta prime */ double conv; /* convergence */ double s; /* areal scale factor */ double a, b; /* max-min scale error */ int code; /* always 0 */ }; enum deprecated_constants_for_now_dropped_analytical_factors { IS_ANAL_XL_YL = 01, /* derivatives of lon analytic */ IS_ANAL_XP_YP = 02, /* derivatives of lat analytic */ IS_ANAL_HK = 04, /* h and k analytic */ IS_ANAL_CONV = 010 /* convergence analytic */ }; /* datum_type values */ #define PJD_UNKNOWN 0 #define PJD_3PARAM 1 #define PJD_7PARAM 2 #define PJD_GRIDSHIFT 3 #define PJD_WGS84 4 /* WGS84 (or anything considered equivalent) */ /* library errors */ #define PJD_ERR_NO_ARGS -1 #define PJD_ERR_NO_OPTION_IN_INIT_FILE -2 #define PJD_ERR_NO_COLON_IN_INIT_STRING -3 #define PJD_ERR_PROJ_NOT_NAMED -4 #define PJD_ERR_UNKNOWN_PROJECTION_ID -5 #define PJD_ERR_ECCENTRICITY_IS_ONE -6 #define PJD_ERR_UNKNOW_UNIT_ID -7 /* deprecated: typo */ #define PJD_ERR_UNKNOWN_UNIT_ID -7 #define PJD_ERR_INVALID_BOOLEAN_PARAM -8 #define PJD_ERR_UNKNOWN_ELLP_PARAM -9 #define PJD_ERR_REV_FLATTENING_IS_ZERO -10 #define PJD_ERR_REF_RAD_LARGER_THAN_90 -11 #define PJD_ERR_ES_LESS_THAN_ZERO -12 #define PJD_ERR_MAJOR_AXIS_NOT_GIVEN -13 #define PJD_ERR_LAT_OR_LON_EXCEED_LIMIT -14 #define PJD_ERR_INVALID_X_OR_Y -15 #define PJD_ERR_WRONG_FORMAT_DMS_VALUE -16 #define PJD_ERR_NON_CONV_INV_MERI_DIST -17 #define PJD_ERR_NON_CON_INV_PHI2 -18 #define PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE -19 #define PJD_ERR_TOLERANCE_CONDITION -20 #define PJD_ERR_CONIC_LAT_EQUAL -21 #define PJD_ERR_LAT_LARGER_THAN_90 -22 #define PJD_ERR_LAT1_IS_ZERO -23 #define PJD_ERR_LAT_TS_LARGER_THAN_90 -24 #define PJD_ERR_CONTROL_POINT_NO_DIST -25 #define PJD_ERR_NO_ROTATION_PROJ -26 #define PJD_ERR_W_OR_M_ZERO_OR_LESS -27 #define PJD_ERR_LSAT_NOT_IN_RANGE -28 #define PJD_ERR_PATH_NOT_IN_RANGE -29 #define PJD_ERR_H_LESS_THAN_ZERO -30 #define PJD_ERR_K_LESS_THAN_ZERO -31 #define PJD_ERR_LAT_1_OR_2_ZERO_OR_90 -32 #define PJD_ERR_LAT_0_OR_ALPHA_EQ_90 -33 #define PJD_ERR_ELLIPSOID_USE_REQUIRED -34 #define PJD_ERR_INVALID_UTM_ZONE -35 #define PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE -36 #define PJD_ERR_FAILED_TO_FIND_PROJ -37 #define PJD_ERR_FAILED_TO_LOAD_GRID -38 #define PJD_ERR_INVALID_M_OR_N -39 #define PJD_ERR_N_OUT_OF_RANGE -40 #define PJD_ERR_LAT_1_2_UNSPECIFIED -41 #define PJD_ERR_ABS_LAT1_EQ_ABS_LAT2 -42 #define PJD_ERR_LAT_0_HALF_PI_FROM_MEAN -43 #define PJD_ERR_UNPARSEABLE_CS_DEF -44 #define PJD_ERR_GEOCENTRIC -45 #define PJD_ERR_UNKNOWN_PRIME_MERIDIAN -46 #define PJD_ERR_AXIS -47 #define PJD_ERR_GRID_AREA -48 #define PJD_ERR_INVALID_SWEEP_AXIS -49 #define PJD_ERR_MALFORMED_PIPELINE -50 #define PJD_ERR_UNIT_FACTOR_LESS_THAN_0 -51 #define PJD_ERR_INVALID_SCALE -52 #define PJD_ERR_NON_CONVERGENT -53 #define PJD_ERR_MISSING_ARGS -54 #define PJD_ERR_LAT_0_IS_ZERO -55 #define PJD_ERR_ELLIPSOIDAL_UNSUPPORTED -56 #define PJD_ERR_TOO_MANY_INITS -57 #define PJD_ERR_INVALID_ARG -58 #define PJD_ERR_INCONSISTENT_UNIT -59 /* NOTE: Remember to update pj_strerrno.c and transient_error in */ /* pj_transform.c when adding new value */ struct projFileAPI_t; /* proj thread context */ struct projCtx_t { int last_errno; int debug_level; void (*logger)(void *, int, const char *); void *app_data; struct projFileAPI_t *fileapi; }; /* classic public API */ #include "proj_api.h" /* Generate pj_list external or make list from include file */ struct PJ_LIST { char *id; /* projection keyword */ PJ *(*proj)(PJ *); /* projection entry point */ char * const *descr; /* description text */ }; #ifndef USE_PJ_LIST_H extern struct PJ_LIST pj_list[]; #endif #ifndef PJ_ELLPS__ extern struct PJ_ELLPS pj_ellps[]; #endif #ifndef PJ_UNITS__ extern struct PJ_UNITS pj_units[]; #endif #ifndef PJ_DATUMS__ extern struct PJ_DATUMS pj_datums[]; extern struct PJ_PRIME_MERIDIANS pj_prime_meridians[]; #endif #ifdef PJ_LIB__ #define PROJ_HEAD(name, desc) static const char des_##name [] = desc #define OPERATION(name, NEED_ELLPS) \ \ pj_projection_specific_setup_##name (PJ *P); \ C_NAMESPACE PJ *pj_##name (PJ *P); \ \ C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \ \ C_NAMESPACE PJ *pj_##name (PJ *P) { \ if (P) \ return pj_projection_specific_setup_##name (P); \ P = (PJ*) pj_calloc (1, sizeof(PJ)); \ if (0==P) \ return 0; \ P->destructor = pj_default_destructor; \ P->descr = des_##name; \ P->need_ellps = NEED_ELLPS; \ P->left = PJ_IO_UNITS_ANGULAR; \ P->right = PJ_IO_UNITS_CLASSIC; \ return P; \ } \ \ PJ *pj_projection_specific_setup_##name (PJ *P) /* In ISO19000 lingo, an operation is either a conversion or a transformation */ #define CONVERSION(name, need_ellps) OPERATION (name, need_ellps) #define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps) /* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */ #define PROJECTION(name) CONVERSION (name, 1) #endif /* def PJ_LIB__ */ #define MAX_TAB_ID 80 typedef struct { float lam, phi; } FLP; typedef struct { pj_int32 lam, phi; } ILP; struct CTABLE { char id[MAX_TAB_ID]; /* ascii info */ LP ll; /* lower left corner coordinates */ LP del; /* size of cells */ ILP lim; /* limits of conversion matrix */ FLP *cvs; /* conversion matrix */ }; typedef struct _pj_gi { char *gridname; /* identifying name of grid, eg "conus" or ntv2_0.gsb */ char *filename; /* full path to filename */ const char *format; /* format of this grid, ie "ctable", "ntv1", "ntv2" or "missing". */ long grid_offset; /* offset in file, for delayed loading */ int must_swap; /* only for NTv2 */ struct CTABLE *ct; struct _pj_gi *next; struct _pj_gi *child; } PJ_GRIDINFO; typedef struct { PJ_Region region; int priority; /* higher used before lower */ double date; /* year.fraction */ char *definition; /* usually the gridname */ PJ_GRIDINFO *gridinfo; int available; /* 0=unknown, 1=true, -1=false */ } PJ_GridCatalogEntry; typedef struct _PJ_GridCatalog { char *catalog_name; PJ_Region region; /* maximum extent of catalog data */ int entry_count; PJ_GridCatalogEntry *entries; struct _PJ_GridCatalog *next; } PJ_GridCatalog; /* procedure prototypes */ double dmstor(const char *, char **); double dmstor_ctx(projCtx ctx, const char *, char **); void set_rtodms(int, int); char *rtodms(char *, double, int, int); double adjlon(double); double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double); PROJVALUE pj_param(projCtx ctx, paralist *, const char *); paralist *pj_param_exists (paralist *list, const char *parameter); paralist *pj_mkparam(char *); paralist *pj_mkparam_ws (char *str); int pj_ell_set(projCtx ctx, paralist *, double *, double *); int pj_datum_set(projCtx,paralist *, PJ *); int pj_prime_meridian_set(paralist *, PJ *); int pj_angular_units_set(paralist *, PJ *); paralist *pj_clone_paralist( const paralist* ); paralist *pj_search_initcache( const char *filekey ); void pj_insert_initcache( const char *filekey, const paralist *list); paralist *pj_expand_init(projCtx ctx, paralist *init); void *pj_dealloc_params (projCtx ctx, paralist *start, int errlev); double *pj_enfn(double); double pj_mlfn(double, double, double, double *); double pj_inv_mlfn(projCtx, double, double, double *); double pj_qsfn(double, double, double); double pj_tsfn(double, double, double); double pj_msfn(double, double, double); double pj_phi2(projCtx, double, double); double pj_qsfn_(double, PJ *); double *pj_authset(double); double pj_authlat(double, double *); COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int); COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *); int pj_deriv(LP, double, const PJ *, struct DERIVS *); int pj_factors(LP, const PJ *, double, struct FACTORS *); struct PW_COEF { /* row coefficient structure */ int m; /* number of c coefficients (=0 for none) */ double *c; /* power coefficients */ }; /* Approximation structures and procedures */ typedef struct { /* Chebyshev or Power series structure */ projUV a, b; /* power series range for evaluation */ /* or Chebyshev argument shift/scaling */ struct PW_COEF *cu, *cv; int mu, mv; /* maximum cu and cv index (+1 for count) */ int power; /* != 0 if power series, else Chebyshev */ } Tseries; Tseries *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int); projUV bpseval(projUV, Tseries *); projUV bcheval(projUV, Tseries *); projUV biveval(projUV, Tseries *); void *vector1(int, int); void **vector2(int, int, int); void freev2(void **v, int nrows); int bchgen(projUV, projUV, int, int, projUV **, projUV(*)(projUV)); int bch2bps(projUV, projUV, projUV **, int, int); /* nadcon related protos */ LP nad_intr(LP, struct CTABLE *); LP nad_cvt(LP, int, struct CTABLE *); struct CTABLE *nad_init(projCtx ctx, char *); struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid ); int nad_ctable_load( projCtx ctx, struct CTABLE *, PAFile fid ); struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid ); int nad_ctable2_load( projCtx ctx, struct CTABLE *, PAFile fid ); void nad_free(struct CTABLE *); /* higher level handling of datum grid shift files */ int pj_apply_vgridshift( PJ *defn, const char *listname, PJ_GRIDINFO ***gridlist_p, int *gridlist_count_p, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_apply_gridshift_2( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **gridlist, int gridlist_count, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * ); void pj_deallocate_grids(); PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * ); int pj_gridinfo_load( projCtx, PJ_GRIDINFO * ); void pj_gridinfo_free( projCtx, PJ_GRIDINFO * ); PJ_GridCatalog *pj_gc_findcatalog( projCtx, const char * ); PJ_GridCatalog *pj_gc_readcatalog( projCtx, const char * ); void pj_gc_unloadall( projCtx ); int pj_gc_apply_gridshift( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); int pj_gc_apply_gridshift( PJ *defn, int inverse, long point_count, int point_offset, double *x, double *y, double *z ); PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx, PJ_GridCatalog *catalog, int after, LP location, double date, PJ_Region *optional_region, double *grid_date ); double pj_gc_parsedate( projCtx, const char * ); void *proj_mdist_ini(double); double proj_mdist(double, double, double, const void *); double proj_inv_mdist(projCtx ctx, double, const void *); void *pj_gauss_ini(double, double, double *,double *); LP pj_gauss(projCtx, LP, const void *); LP pj_inv_gauss(projCtx, LP, const void *); extern char const pj_release[]; struct PJ_ELLPS *pj_get_ellps_ref( void ); struct PJ_DATUMS *pj_get_datums_ref( void ); struct PJ_UNITS *pj_get_units_ref( void ); struct PJ_LIST *pj_get_list_ref( void ); struct PJ_PRIME_MERIDIANS *pj_get_prime_meridians_ref( void ); void *pj_default_destructor (PJ *P, int errlev); double pj_atof( const char* nptr ); double pj_strtod( const char *nptr, char **endptr ); void pj_freeup_plain (PJ *P); #ifdef __cplusplus } #endif #ifndef PROJECTS_H_ATEND #define PROJECTS_H_ATEND #endif #endif /* end of basic projections header */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #ifndef TRACK_GENERATOR_H #define TRACK_GENERATOR_H #include <vector> #include <queue> // ------------------------------------------------------------------------- // // // Track Generator Classes: // This file contains classes and structures used by the "track generator" // the track generator is an example that sends fake track information // from a radar at SFO. The tracks are all within 80 KM of SFO, and follow // flight paths that are somewhat similar to real flight paths to SFO. // This is not intended to be entirely correct, but instead is example data // that can be used to populate an example. // // ------------------------------------------------------------------------- // // Flight paths around SFO enum FlightState { INITIAL, ON_APPROACH, LANDED }; // Structure containing latitude and longitude. struct LatLong { double latitude; double longitude; }; // ------------------------------------------------------------------------- // // // GeneratorTrack: // This class contains the track data that the radar generator provides. // In this example, we could have forced the "radar generator" to use the // same data type we generated for the middleware, but typically your sensor // will be providing its own data types that you will be using. // // So, we are converting back and forth between this radar-provided track // and the middleware track in the GeneratorAdapter.h file. // // ------------------------------------------------------------------------- // struct GeneratorTrack { // --- Constructor --- GeneratorTrack(/*OSMutex *mutex*/) { id = 0; latLong.latitude = 0; latLong.longitude = 0; altitudeInFeet = 3000; bearing = 0; state = INITIAL; // Assuming a fairly typical speed when circling speedInKnots = 145; memset(flightId, 0, 8); //_mutex = mutex; } // --- Getter and setter for the flight ID --- void SetFlightId(std::string id) { //_mutex->Lock(); if (id.size() < 8) { strcpy(flightId, id.c_str()); } //_mutex->Unlock(); } const char* GetFlightId() const { return flightId; } // --- Public members --- long id; LatLong latLong; double altitudeInFeet; double bearing; double speedInKnots; FlightState state; private: // --- Private members --- char flightId[8]; // OSMutex *_mutex; }; // ------------------------------------------------------------------------- // // // GeneratorFlightPlan: // Flight plan class used by the generator. The only thing it cares about // in this example is the flight ID and the estimated landing time. // // This "radar" does a really simple merge between the flight ID from the // first flight plan it receives from the middleware, and the first track that // it is sending. // // This is just to illustrate an application that is sending rapid track data, // and receiving state data, and in the real world would do a correlation // between the two types and send out the merged data. // // ------------------------------------------------------------------------- // struct GeneratorFlightPlan { // --- Constructor --- GeneratorFlightPlan() { } // --- Copy constructor --- GeneratorFlightPlan(GeneratorFlightPlan* plan) { estimatedHours = plan->estimatedHours; estimatedMinute = plan->estimatedMinute; strcpy(flightID, plan->flightID); } // --- Public members --- char flightID[8]; short estimatedHours; short estimatedMinute; }; // ------------------------------------------------------------------------- // // // TrackListener: // Abstract base class for listeners that will receive data from the radar // generator. // // ------------------------------------------------------------------------- // class TrackListener { public: // --- Track update and delete callbacks --- virtual bool TrackUpdate(const GeneratorTrack& track) = 0; virtual bool TrackDelete(const GeneratorTrack& track) = 0; // --- Virtual destructor --- virtual ~TrackListener() {}; }; // ------------------------------------------------------------------------- // // // TrackGenerator: // Class that creates a thread and then "generates" simple track data landing // in SFO. This is based loosely on air traffic patterns that land in SFO, // but is not meant to take the place of a flight simulator. This is used // for generating example data. // // This is intended to illustrate the concept of track data coming from a // radar and being sent over the middleware. // // ------------------------------------------------------------------------- // class TrackGenerator { public: // --- Constructor --- // radarID: this should be unique for each running radar app // startTracks: How many tracks should be generated at startup? // maxTracks: What is the maximum number of tracks the app can publish? // creationRateSec: How fast should new tracks be added? (In seconds in // clock time. If you have increased the run rate, these will be added // at creation time / run rate // runRate: How fast should this be running? Normal speeds, 2x speeds, etc // Note that the "sample rate" is hard-coded. This determines how fast the // radar is theoretically getting updates about each aircraft, and // determines how much an aircraft has moved during each update. To make // data rates faster, increase the run rate, which makes the clock run // faster. Increasing the clock rate makes the track generator sleep less, // and generate data faster. TrackGenerator( int radarID, int startTracks, int maxTracks, int creationRateSec, double runRate) : _shuttingDown(false), _currentTrackId(0), _startTracks(startTracks), _maxTracks(maxTracks), _radarID(radarID), _sampleRateSec(0), _sampleRateNanosec(100000000), _runRate(runRate), _creationRateSec(creationRateSec) { } // --- Destructor --- ~TrackGenerator(); // --- Adding a listener to generated radar track events --- // Add a listener that listens for track updates from the radar void AddListener(TrackListener* listener) { _listeners.push_back(listener); } // --- Removing a listener to stop listening to radar track events --- // Remove listener that listens for track updates from the radar. Note that // in this example, the DDSRadarListener must be removed from the // track generator before the RadarInterface is deleted. void RemoveListener(const TrackListener* listener); // --- Start generating tracks --- // Starts the thread that generates tracks void Start(); // --- Stop generating tracks --- // Marks the thread as ready to shut down void Shutdown(); // --- Add a flight plan to a track or the generator's list --- // Adds a flight plan to the track generator. Will "correlate" the flight // plan with an existing track, if one exists, or else will store the // flight plan. void AddFlightPlan(GeneratorFlightPlan* flightPlan); // --- Update a track with a flight plan --- void UpdateTrackWithFlightData( GeneratorTrack& track, GeneratorFlightPlan& flightPlan); // --- Delete a track --- void DeleteTrack(GeneratorTrack& track); protected: // --- Internal generate method --- void GenerateTracks(); // --- "Correlate" flight plan to track --- // This example does nothing special for "correlating" a flight plan with // a track - it just associates a flight plan with the first track that // does not have a flight plan associate with it already. bool CorrelateFlightPlanWithTrack( GeneratorFlightPlan* flightPlan, GeneratorTrack* track); private: // --- Generate the tracks --- static void* GenerateTracksFunc(void* arg); // --- Notify listeners of track updates --- void NotifyListenersUpdateTrack(const GeneratorTrack& track); // --- Notify listeners of track deletions --- void NotifyListenersDeleteTrack(const GeneratorTrack& track); // --- Create a new track --- GeneratorTrack* AddTrack(bool randomLocation); // --- Fly to SFO --- // // NOTE: This code is purely to generate interesting-looking data. // The following methods are not required to use RTI Connext DDS // but are included only to create interesting-looking dummy data. void CalculatePathToSFO( LatLong* currentLatLong, double* bearing, FlightState* state, double sampleRate); void FlyToPosition( LatLong* latLong, double* bearing, FlightState* state, double sampleMillisec, LatLong endPositionLatLong, double speed); bool PassedPoint( LatLong origLatLong, LatLong newLatLong, LatLong destination, FlightState state); void CalculateNextPosition( LatLong* latLong, double bearing, double sampleMillisec, double speedInKnots); void CalculateBearing( double* bearing, LatLong initLatLong, LatLong finalLatLong); double KnotsToKph(double knots); void CalculateRandomPoint80KmFromSFO(LatLong* latLong, bool randomLocation); void UpdateTrackPositionState(FlightState* state); // --- Track getter and setter --- GeneratorTrack* GetTrack(int i) const { return _trackList[i]; } int GetMaxTracks() { return _maxTracks; } // --- Getter for number of active tracks --- int GetActiveTrackNumber() { return (int) _trackList.size(); } // --- Is the application shutting down? --- bool IsShuttingDown() const { return _shuttingDown; } // --- Private members --- // The list of currently-updating tracks that the generator is keeping // updates about std::vector<GeneratorTrack*> _trackList; // The list of flight plans that the generator is "correlating" with the // track data. In this case, correlation really is just associating the // first flight plan in the queue with the first track that does not // have a flight plan associated with it. std::queue<GeneratorFlightPlan*> _flightPlans; // Used to signal to the track generator that it should stop generating // track data, and should shut down. bool _shuttingDown; // The ID of the next new track created. Recycle this number when we hit // the max int _currentTrackId; // The number of tracks to start with int _startTracks; // Maximum number of tracks this radar can produce at once. int _maxTracks; // ID of the radar sensor - this is part of the unique ID of the data int _radarID; // How quickly the radar is sampling the data int _sampleRateSec; int _sampleRateNanosec; // If you want to send faster or slower than real time double _runRate; // How often new tracks are created double _creationRateSec; // Listeners that are notified of track events std::vector<TrackListener*> _listeners; }; #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/RadarGenerator/TrackGenerator.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include <math.h> #include <sstream> #include <iostream> #include "dds/dds.hpp" #include "TrackGenerator.h" // ------------------------------------------------------------------------- // // // Note that this file generates interesting-looking data, but this is not the // core value that RTI Connext DDS provides, which is the efficient transport // of data over one or more transports to all interested parties. // // None of this is required to send data over DDS! This is simply a data // source that is sending radar data. // // This class generates example track data that is sent to illustrate how RTI // can send track data over DDS. This example data is not intended to be // complete or accurate, and there may be errors in the generated data. This // roughly simulates an air traffic control radar that can detect aircraft // flying within 80 Km of SFO, using some of the typical flight paths. // It does not include radar tracks of aircraft landing at other nearby // airports, and it does not prevent (or accurately simulate) collisions of // aircraft. Note that this example currently does not set the altitude, // though we may add that in the future. // // ------------------------------------------------------------------------- // // Pre-defined lat/longs where the flight paths may go. These are all rough // estimates except for the position of SFO. // SFO's position #define SFO_LAT 37.619 #define SFO_LONG -122.3749 // Planes arriving from the north will approach from here #define APPROACH_BEGIN_LAT 37.5586 #define APPROACH_BEGIN_LONG -122.2700 // Defines to help generate semi-accurate positional information about // aircraft. #define SEC_PER_HOUR (60 * 60) #define MILLISEC_PER_SEC 1000 #define M_PI 3.14159265358979323846 #define EARTH_MEAN_RADIUS_KM 6371 // ------------------------------------------------------------------------- // // Destructor for the track generator. Deletes all listeners, // all tracks, and all flight plans TrackGenerator::~TrackGenerator() { // Remove all listeners for (std::vector<TrackListener*>::iterator it = _listeners.begin(); it != _listeners.end(); ++it) { delete (*it); } _listeners.clear(); // If I have been storing flightplan data, remove it while (!_flightPlans.empty()) { GeneratorFlightPlan* plan = _flightPlans.front(); delete plan; _flightPlans.pop(); } // Remove all tracks I have generated for (std::vector<GeneratorTrack*>::iterator it = _trackList.begin(); it != _trackList.end(); ++it) { delete (*it); } _trackList.clear(); } // ------------------------------------------------------------------------- // // Removes a listener from the generator. The listeners receive updates about // the tracks, and can do whatever is necessary when a track is updated. void TrackGenerator::RemoveListener(const TrackListener* listener) { std::vector<TrackListener*>::iterator toErase; // Search for listener to remove for (std::vector<TrackListener*>::iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if ((*it) == listener) { toErase = it; } } _listeners.erase(toErase); } // ------------------------------------------------------------------------- // // Using an observer pattern to notify observers that a track has been deleted. void TrackGenerator::NotifyListenersDeleteTrack(const GeneratorTrack& track) { for (std::vector<TrackListener*>::iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if (false == (*it)->TrackDelete(track)) { std::stringstream errss; errss << "NotifyListenersDeleteTrack(): error deleting track."; throw errss.str(); } } } // ------------------------------------------------------------------------- // // Using an observer pattern to notify observers that a track has been updated. void TrackGenerator::NotifyListenersUpdateTrack(const GeneratorTrack& track) { for (std::vector<TrackListener*>::iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if (false == (*it)->TrackUpdate(track)) { std::stringstream errss; errss << "NotifyListenersUpdateTrack(): error updating track."; throw errss.str(); } } } // ------------------------------------------------------------------------- // // Function that is called by the generator's thread, and calls the // generator method that periodically generates tracks. void* TrackGenerator::GenerateTracksFunc(void* arg) { TrackGenerator* gen = (TrackGenerator*) arg; try { gen->GenerateTracks(); } catch (std::string message) { std::cout << "Application exception: " << message << std::endl; } return NULL; } // Creates a track in the TrackGenerator. Note that this recycles track IDs // over time. Called from spawned TrackGenerator thread GeneratorTrack* TrackGenerator::AddTrack(bool randomLocation) { // Cannot create more tracks than the generator is // supposed to handle if (_trackList.size() == _maxTracks) { return NULL; } GeneratorTrack* track = new GeneratorTrack(); // Recycle track ID when it gets to the max if (_currentTrackId == GetMaxTracks()) { _currentTrackId = 0; } track->id = _currentTrackId; CalculateRandomPoint80KmFromSFO(&track->latLong, randomLocation); if (!_flightPlans.empty()) { GeneratorFlightPlan* plan = _flightPlans.front(); // This is pretty much a dummy call here, because this example does not // actually do real correlation - instead it simply checks if the track // has an empty flight ID, and considers the flight plan to be // "correlated" when the track has no flight ID. However, this logic // is here to represent a real application. if (CorrelateFlightPlanWithTrack(plan, track)) { // Copies data from the flight plan, does not keep a reference to // the flight plan UpdateTrackWithFlightData(*track, *plan); // No longer need to store the flight plan since the required data // is now stored with the track. delete plan; _flightPlans.pop(); } } _currentTrackId++; _trackList.push_back(track); return track; } // ------------------------------------------------------------------------- // // Copies data from the flight plan, does not keep a reference to the flight // plan void TrackGenerator::UpdateTrackWithFlightData( GeneratorTrack& track, GeneratorFlightPlan& flightPlan) { // Copies the flight ID track.SetFlightId(flightPlan.flightID); } // Deletes the track from the list. void TrackGenerator::DeleteTrack(GeneratorTrack& track) { for (std::vector<GeneratorTrack*>::iterator it = _trackList.begin(); it != _trackList.end(); ++it) { if ((*it)->id == track.id) { _trackList.erase(it); break; } } } // ------------------------------------------------------------------------- // // Creates and starts a thread that starts "generating track data" void TrackGenerator::Start() { #if defined RTI_WIN32 HANDLE hThread; DWORD id; hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TrackGenerator::GenerateTracksFunc, this, 0, &id); #elif defined RTI_LINUX pthread_t tid; pthread_create(&tid, NULL, TrackGenerator::GenerateTracksFunc, this); #else #error Uknow Architecture #endif } // ------------------------------------------------------------------------- // // Marks itself as shutting down so the thread will break after the next sleep // time. void TrackGenerator::Shutdown() { _shuttingDown = true; } // ------------------------------------------------------------------------- // // CorrelateFlightPlanWithTrack: // We are not doing any actual correlation logic here - this is literally // checking that the track that does not have a flight ID set, and copying // the flight ID from the flight plan into the track. // // In a real application, this should be replaced with your own logic that // correlates a particular flight plan with a particular track. // ------------------------------------------------------------------------- // bool TrackGenerator::CorrelateFlightPlanWithTrack( GeneratorFlightPlan* flightPlan, GeneratorTrack* track) { if (0 == strcmp(track->GetFlightId(), "")) { return true; } return false; } // ------------------------------------------------------------------------- // // Either adds the flight plan's relevant information to the track, or stores // the flight plan until a new track is created later. void TrackGenerator::AddFlightPlan(GeneratorFlightPlan* flightPlan) { bool storeFlightPlan = true; // For all tracks, check if they are "correlated" with the new flight plan. // If yes, add the flight plan information to the track. If no, store the // flight plan information. for (unsigned int i = 0; i < _trackList.size(); i++) { // This example does not actually do real correlation - instead it // simply checks if the track has an empty flight ID, and considers the // flight plan to be "correlated" when the track has no flight ID. // However, this logic is here to represent a real application. if (CorrelateFlightPlanWithTrack(flightPlan, _trackList[i])) { UpdateTrackWithFlightData(*_trackList[i], *flightPlan); storeFlightPlan = false; break; } } if (storeFlightPlan) { // Only keep flight plans that will be associated with future tracks _flightPlans.push(new GeneratorFlightPlan(flightPlan)); } } // ------------------------------------------------------------------------- // // This generates tracks at a given rate that was specified in the startup // parameters. void TrackGenerator::GenerateTracks() { dds::core::Duration clockUpdatePeriod(_sampleRateSec, _sampleRateNanosec); double timeToCreateTrack = 0; double sendRateSec = _sampleRateSec / _runRate; double sendRateNanosec = _sampleRateNanosec / _runRate; dds::core::Duration actualSleepTime( (long) sendRateSec, (unsigned long) sendRateNanosec); if (_startTracks > _maxTracks) { std::stringstream errss; errss << "Trying to create a generator with more starting tracks " << "than the maximum number of tracks."; throw errss.str(); } while (!IsShuttingDown()) { double sampleRateInMs = clockUpdatePeriod.nanosec() / 1000000; sampleRateInMs += 1000 * clockUpdatePeriod.sec(); // If I need to create more tracks because either 1) I have just // started, and I must create the number requested for startup or, // I am adding incremental tracks. if (GetActiveTrackNumber() < _startTracks) { // Add the track at a random location within the bounding circle AddTrack(true); timeToCreateTrack = 0; } else if ( (timeToCreateTrack > _creationRateSec) && (GetActiveTrackNumber() < GetMaxTracks())) { AddTrack(false); timeToCreateTrack = 0; } timeToCreateTrack++; for (int i = 0; i < GetActiveTrackNumber(); i++) { GeneratorTrack* track = GetTrack(i); CalculatePathToSFO( &track->latLong, &track->bearing, &track->state, sampleRateInMs); if (track->altitudeInFeet < 0) { track->altitudeInFeet = 0; } // 3. Notify the listeners so they can do stuff with the track data if (track->state != LANDED) { NotifyListenersUpdateTrack(*track); } else { NotifyListenersDeleteTrack(*track); DeleteTrack(*track); } } rti::util::sleep(actualSleepTime); // NDDSUtility::sleep(actualSleepTime); } } // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // // NOTE: This code is purely to generate interesting-looking data. // // Everything below this point is track generation code that is completely // irrelevant to the usage of RTI Connext DDS middleware. This generates some // dummy data showing flights approaching SFO. // // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // Calculate the bearing of the aircraft, given its current location and the // latitude and longitude that it is heading to. void TrackGenerator::CalculateBearing( double* bearing, LatLong initLatLong, LatLong finalLatLong) { double differenceLong = finalLatLong.longitude - initLatLong.longitude; double differenceLongInRads = differenceLong * M_PI / 180; double finalLatInRads = finalLatLong.latitude * M_PI / 180; double initLatInRads = initLatLong.latitude * M_PI / 180; double y = sin(differenceLongInRads) * cos(finalLatInRads); double x = cos(initLatInRads) * sin(finalLatInRads) - sin(initLatInRads) * cos(finalLatInRads) * cos(differenceLongInRads); // bearing is in rads here *bearing = atan2(y, x); // Back to degrees *bearing = *bearing / M_PI * 180; // Ensure this is between 0 and 360 *bearing = fmod((*bearing + 360), 360); } // Translate between knots and kilometers per hour double TrackGenerator::KnotsToKph(double knots) { return knots * 1.852; } // Forcing all flights to approach from the south, to look // interesting void TrackGenerator::UpdateTrackPositionState(FlightState* state) { if (*state == INITIAL) { *state = ON_APPROACH; return; } if (*state == ON_APPROACH) { *state = LANDED; return; } } // Calculates the next latitude and longitude of the flight, given the // lat/long, the bearing, the amount of time that has passed since the last // update. void TrackGenerator::CalculateNextPosition( LatLong* latLong, double bearing, double sampleMillisec, double speedInKnots) { double kph = KnotsToKph(speedInKnots); double kpsec = kph / SEC_PER_HOUR; double kpmillisec = kpsec / MILLISEC_PER_SEC; double distanceMovedPerPeriod = sampleMillisec * kpmillisec; double distInRads = distanceMovedPerPeriod / EARTH_MEAN_RADIUS_KM; double latInRads = latLong->latitude * M_PI / 180; double longInRads = latLong->longitude * M_PI / 180; double bearingInRads = bearing * M_PI / 180; double newLat = asin(sin(latInRads) * cos(distInRads) + cos(latInRads) * sin(distInRads) * cos(bearingInRads)); double newLong = longInRads + atan2(sin(bearingInRads) * sin(distInRads) * cos(latInRads), cos(distInRads) - sin(latInRads) * sin(newLat)); newLong = fmod((newLong + 3 * M_PI), 2 * M_PI) - M_PI; latLong->latitude = newLat / M_PI * 180; latLong->longitude = newLong / M_PI * 180; } // Each flight will start at some random point 80 Km from SFO. This is // not the way that real flight traffic works, but it is good for an example of // flights near SFO. void TrackGenerator::CalculateRandomPoint80KmFromSFO( LatLong* latLong, bool randomDistanceWithin) { double randDegrees = rand() % 360; double randRads = randDegrees * M_PI / 180; double finalKm = 80; if (randomDistanceWithin) { finalKm = rand() % 80; } double latInRads = SFO_LAT * M_PI / 180; double longInRads = SFO_LONG * M_PI / 180; double distInRads = finalKm / EARTH_MEAN_RADIUS_KM; double bearing = randRads; double temp1 = sin(latInRads) * cos(distInRads); double temp2 = cos(latInRads) * sin(distInRads) * cos(bearing); double newLatInRads = asin(temp1 + temp2); double newLongInRads = longInRads + atan2(sin(bearing) * sin(distInRads) * cos(latInRads), cos(distInRads) - (sin(latInRads) * sin(newLatInRads))); // Normalize to -180 - 180 newLongInRads = fmod((newLongInRads + 3 * M_PI), (2 * M_PI)) - M_PI; latLong->latitude = newLatInRads / M_PI * 180; latLong->longitude = newLongInRads / M_PI * 180; std::cout << "New aircraft being updated. Lat, Long: " << latLong->latitude << latLong->longitude << std::endl; } // Fly to a particular position, and check if the flight may have passed the // intended position. void TrackGenerator::FlyToPosition( LatLong* latLong, double* bearing, FlightState* state, double sampleMillisec, LatLong endPositionLatLong, double speed) { double currBearing = *bearing; LatLong current = *latLong; CalculateBearing(bearing, *latLong, endPositionLatLong); CalculateNextPosition(latLong, *bearing, sampleMillisec, speed); // If we have passed the point if (PassedPoint(current, *latLong, endPositionLatLong, *state)) { *bearing = currBearing; UpdateTrackPositionState(state); return; } } // Flights go to a location southeast of SFO and then line up to // land. This does no checking to avoid collisions. void TrackGenerator::CalculatePathToSFO( LatLong* currentLatLong, double* bearing, FlightState* state, double sampleRate) { double approachBearing = 0; LatLong approach; approach.latitude = APPROACH_BEGIN_LAT; approach.longitude = APPROACH_BEGIN_LONG; LatLong finalDestination; finalDestination.latitude = SFO_LAT; finalDestination.longitude = SFO_LONG; CalculateBearing(&approachBearing, approach, finalDestination); double turnRadius = 9.656; if (*state == INITIAL) { // Make slightly dumb assumption that bearing is directly toward // SFO when flight is arriving in the airspace int speedInKnots = 220; CalculateBearing(bearing, *currentLatLong, finalDestination); LatLong approachLatLong; approachLatLong.latitude = APPROACH_BEGIN_LAT; approachLatLong.longitude = APPROACH_BEGIN_LONG; FlyToPosition( currentLatLong, bearing, state, sampleRate, approachLatLong, speedInKnots); } else if (*state == ON_APPROACH) { int speedInKnots = 140; FlyToPosition( currentLatLong, bearing, state, sampleRate, finalDestination, speedInKnots); } } // Since the algorithms may not be exact due to rounding errors, it is possible // that we will pass the intended point. If the aircraft is at about the right // position, move to the next state bool TrackGenerator::PassedPoint( LatLong origLatLong, LatLong newLatLong, LatLong destination, FlightState state) { if ((fabs(newLatLong.latitude - destination.latitude) < .0005) && (fabs(newLatLong.longitude - destination.longitude) < .0005)) { return true; } return false; }
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/RadarGenerator/RadarApp.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include <iostream> #include "TrackGenerator.h" #include "RadarInterface.h" // ------------------------------------------------------------------------- // // // This contains the glue code that ties the radar generator // to the DDS network middleware layer. // // This inherits from a listener class provided by the Radar. // // It takes in a RadarWriter object and uses that to write data. (The // RadarWriter object is created as part of the RadarInterface). This is not // responsible for deleting the RadarWriter object. // // You must ensure that the thread that calls this class is shut down before // the RadarInterface (and the RadarWriter) are deleted. // // ------------------------------------------------------------------------- // // A listener that is receiving updates about new generated tracks // and sending them out over DDS class DDSRadarListener : public TrackListener { public: // --- Constructor --- // Initializes the RadarWriter object, and sets the // Radar Id that becomes part of the data. DDSRadarListener(RadarWriter* writer, long radarId) : _writer(writer), _radarId(radarId) { // com::atc::generated::TrackTypeSupport::initialize_data(&_track); } // --- Destructor --- ~DDSRadarListener() { } // --- Update track over network --- // Converts from the radar's data type to the data type that will be sent // over the middleware, and then sends the radar data. It is not // strictly necessary in this example that we maintain multiple data types // for track data, but it is fairly common that your sensor will provide one // set of data types, and you will be using a slightly (or sometimes very) // different data type over the network virtual bool TrackUpdate(const GeneratorTrack& track) { // Convert from generator format to network format RadarAdapter::AdaptToTrack(_track, track); _track.radarId(_radarId); try { // Send the data over the network _writer->PublishTrack(_track); } catch (std::string str) { std::cout << "Failure to write track data: " << str.c_str() << std::endl; return false; } return true; } // --- Delete track over network --- // Sends an update saying that a track has been dropped. This uses the // same RadarWriter to notify other applications that the track has // been dropped that is used to send track updates. virtual bool TrackDelete(const GeneratorTrack& track) { // Convert from generator format to network format RadarAdapter::AdaptToTrack(_track, track); _track.radarId(_radarId); try { // Send the track deletion over the network _writer->DeleteTrack(_track); } catch (std::string str) { std::cout << "Failure to delete track data: " << str.c_str() << std::endl; return false; } return true; } private: // --- Private members --- // Writes track data over network RadarWriter* _writer; // Network data type of a track com::atc::generated::Track _track; // The ID of this radar long _radarId; };
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include <vector> #include <sstream> #include "../Generated/AirTrafficControl.hpp" #include "RadarInterface.h" #include "GeneratorAdapter.h" // ------------------------------------------------------------------------- // // The RadarInterface is the network interface to the whole application. This // creates DataReaders and DataWriters in order to receive and send data. // // This interface is built from: // 1. Network data types and topic names defined in the IDL file // 2. XML configuration files that describe the QoS profiles that should be // used by individual DataWriters and DataReaders. These describe the // movement and persistence characteristics of the data (how reliable should // this be?), as well as other QoS such as resource limits. // 3. The code itself creates DataReaders and DataWriters, and selects which // profile to use when creating the DataReaders and DataWriters. // // Writing radar data: // ------------------- // This application sends radar data, either with the lowest possible latency // or with higher throughput at a slight cost in latency. // // For information on the radar data type, please see the AirTrafficControl.idl // file. // // For information on the quality of service for throughput vs. latency, please // see the radar_profiles_multicast.xml file. // // Reading flight plan data: // ------------------------- // This application receives flight plan data. This data is sent less // frequently, and if it was sent before the radar application was started, it // must be automatically delivered to the radar at startup. Becasue of these // requirements, it has different QoS than the radar data. This QoS is // generally described as the QoS for "state data" // // For information on the flight plan data type, please see the // AirTrafficControl.idl file. // // For information on the quality of service for flight plan state data, please // see the flight_plan_profiles.xml file. // ------------------------------------------------------------------------- // RadarInterface::RadarInterface( long radarId, int maxFlights, enum RadarProfile profile, std::vector<std::string> qosFileNames) { _radarId = radarId; _maxFlightsToHandle = maxFlights; std::string libName; std::string profileName; // Depending on what is passed in, choose one of two XML profiles to // use - either for best latency or higher throughput. Note that the // profile string is a constant defined in the .idl file. libName = com::atc::generated::QOS_LIBRARY; if (profile == LOW_LATENCY) { profileName = com::atc::generated::QOS_PROFILE_RADAR_LOW_LATENCY; } else if (profile == HIGH_THROUGHPUT) { profileName = com::atc::generated::QOS_PROFILE_RADAR_HIGH_THROUGHPUT; } // This creates the DomainParticpant, the first step in creating a DDS // application. This starts the discovery process. rti::core::QosProviderParams provider_name; provider_name.url_profile(qosFileNames); dds::core::QosProvider::Default().extensions().default_provider_params( provider_name); dds::core::QosProvider::Default()->default_profile( libName + "::" + profileName); // Creating the application's RadarWriter object. // This could use the RTI Connext DDS writer directly as a way to write, // but this example assumes that you are converting between an internal // data structure and the network data structure. If you are not doing // this, you can simplifythe logic a bit by giving the applications direct // access to the DDS DataWriter class. // Note that this might be created with one of two separate XML QoS // profiles depending on the requirement for lowest latency or higher // throughput at the cost of latency. To see the individual QoS tuning, // refer to the XML file. _radarWriter = new RadarWriter(this, libName, profileName); if (_radarWriter == NULL) { std::stringstream errss; errss << "Failed to create RadarWriter object"; throw errss.str(); } // Creating the FlightPlanReader object. // We could give the application access to the DataReader directly, but // this simplifies the application's access - in this case, we can choose // to let the application store the data in the DataReader's queue, and // query it directly from the DataReader but we create an object to hide // that decision from the user. // Initialize the receiver with the QoS profile defined in the // flight_plan_profiles_multicast.xml file _flightPlanReader = new FlightPlanReader( this, com::atc::generated::QOS_LIBRARY, com::atc::generated::QOS_PROFILE_FLIGHT_PLAN); if (_flightPlanReader == NULL) { std::stringstream errss; errss << "Failed to create FlightPlanReader object"; throw errss.str(); } } // ------------------------------------------------------------------------- // // Deleting the Radar Writer, the Flight Plan Reader, and the communicator // infrastructure. RadarInterface::~RadarInterface() { } // ------------------------------------------------------------------------- // // Create the Radar DataWriter. RadarWriter::RadarWriter( RadarInterface* netInterface, const std::string& qosLibrary, const std::string& qosProfile) { if (netInterface == NULL) { std::stringstream errss; errss << "RadarWriter(): Bad parameter \"netInterface\""; throw errss.str(); } _communicator = netInterface; dds::domain::DomainParticipant participant = dds::domain::find(0); if (participant == dds::core::null) { participant = dds::domain::DomainParticipant(0); } // The topic object is the description of the data that you will be // sending. It associates a particular data type with a name that // describes the meaning of the data. Along with the data types, and // whether your application is reading or writing particular data, this // is the data interface of your application. // This topic has the name AIR_TRACK_TOPIC - a constant string that is // defined in the .idl file. (It is not required that you define your // topic name in IDL, but it is a best practice for ensuring the data // interface of an application is all defined in one place. // Generally you can register all topics and types up-front if // necessary. // This can be done at any time before creating the DataWriters and // DataReaders. In some systems, this is done in a separate initialization // all at once - especially in applications that read and write the same // topic auto topic = dds::topic::Topic<com::atc::generated::Track>( participant, com::atc::generated::AIR_TRACK_TOPIC); // Create a DataWriter // The topic object is the description of the data that you will be // sending. It associates a particular data type with a name that // describes the meaning of the data. Along with the data types, and // whether your application is reading or writing particular data, this // is the data interface of your application. // This topic has the name AIR_TRACK_TOPIC - a constant string that was // defined in the .idl file. (It is not required that you define your // topic name in IDL, but it is a best practice for ensuring the data // interface of an application is all defined in one place. // Generally you can register all topics and types up-front if // necessary. // Start with QoS gathered from the XML file, then update the value of // the max_samples and max_instances before creating the DataWriter dds::pub::qos::DataWriterQos qos = dds::core::QosProvider::Default()->datawriter_qos( qosLibrary + "::" + qosProfile); qos << dds::core::policy::ResourceLimits().max_instances( _communicator->GetMaxFlightsToHandle()); qos << dds::core::policy::ResourceLimits().max_samples( _communicator->GetMaxFlightsToHandle()); qos << dds::core::policy::ResourceLimits()->initial_samples( _communicator->GetMaxFlightsToHandle()); qos << dds::core::policy::ResourceLimits()->initial_instances( _communicator->GetMaxFlightsToHandle()); if (_communicator->GetMaxFlightsToHandle() < rti::core::policy::RtpsReliableWriterProtocol() .heartbeats_per_max_samples()) { qos << rti::core::policy::DataWriterProtocol().rtps_reliable_writer( rti::core::policy::RtpsReliableWriterProtocol() .heartbeats_per_max_samples( _communicator->GetMaxFlightsToHandle())); } _trackWriter = dds::pub::DataWriter<com::atc::generated::Track>( dds::pub::Publisher(participant), topic, qos); } // ------------------------------------------------------------------------- // // Delete the RadarWriter, and the DDS entities using DDS mechanisms - use // the factory that created the DataWriter to delete the DataWriter RadarWriter::~RadarWriter() { } // ------------------------------------------------------------------------- // // Write the data into the DDS "cloud" - in other words, write the data, // within the numbered domain that the DomainParticipant was created with, // to whichever DataReaders of the same topic were discovered over the // available transports. void RadarWriter::PublishTrack(com::atc::generated::Track& track) { // Write the track data onto the network (or over shared memory) _trackWriter.write(track); } // ------------------------------------------------------------------------- // // Deletes the track from the DDS system - this is used to indicate that it // has landed, and the system does not need to keep track of it any more. void RadarWriter::DeleteTrack(com::atc::generated::Track& track) { // Retrieve the handle of the instance we were disposing // handle = _trackWriter->lookup_instance(track); dds::core::InstanceHandle handle = _trackWriter.lookup_instance(track); // Note that DDS has two ways to indicate that an instance has gone away // it can unregister the instance or dispose it. Also, by default when // the DataWriter unregisters an instance, it also disposes it. If you // dispose and instance, the memory for the instance is not cleaned up, // with the expectation that it will be reused. In this case, the // instance IDs will always be recycled, so it is okay to dispose the // instance instead of unregistering it. _trackWriter.dispose_instance(handle); } // ------------------------------------------------------------------------- // // This creates the DDS DataReader that receives updates about flight plans. FlightPlanReader::FlightPlanReader( RadarInterface* comm, // Subscriber *sub, const std::string& qosLibrary, const std::string& qosProfile) { if (comm == NULL) { std::stringstream errss; errss << "FlightPlanReader(): bad parameter \"comm\""; throw errss.str(); } _communicator = comm; dds::domain::DomainParticipant participant = dds::domain::find(0); if (participant == dds::core::null) { participant = dds::domain::DomainParticipant(0); } // Creating a Topic // The topic object is the description of the data that you will be // sending. It associates a particular data type with a name that // describes the meaning of the data. Along with the data types, and // whether your application is reading or writing particular data, this // is the data interface of your application. // This topic has the name AIRCRAFT_FLIGHT_PLAN_TOPIC - a constant string // that is defined in the .idl file. (It is not required that you define // your topic name in IDL, but it is a best practice for ensuring the data // interface of an application is all defined in one place. // Generally you can register all topics and types up-front if // necessary. auto topic = dds::topic::Topic<com::atc::generated::FlightPlan>( participant, com::atc::generated::AIRCRAFT_FLIGHT_PLAN_TOPIC); // Creating a DataReader // This DataReader will receive the flight plan. The application will // remove the flight plan data from the middleware's queue as it attaches // the flight ID to a particular radar track. dds::sub::qos::DataReaderQos qos = dds::core::QosProvider::Default()->datareader_qos( qosLibrary + "::" + qosProfile); _reader = dds::sub::DataReader<com::atc::generated::FlightPlan>( dds::sub::Subscriber(participant), topic, qos); // Use this status condition to wake up the thread when data becomes // available status_cond = new dds::core::cond::StatusCondition(_reader); status_cond->enabled_statuses(dds::core::status::StatusMask( dds::core::status::StatusMask::data_available())); // Attaching the condition to the WaitSet _waitSet += *status_cond; } // ------------------------------------------------------------------------- // // Destory the flight plan DataReader and WaitSet. Note that this uses // the DDS factories that created various objects to later delete them. FlightPlanReader::~FlightPlanReader() { } // This example is using an application thread to be notified when flight plans // arrive. // // There are three options for getting data from RTI Connext DDS: // 1. Being notified in the application's thread of data arriving (as here). // This mechanism has slightly higher latency than option #2, but low // latency is not important for this use case. In addition, this is safer // than using option #2, because you do not have to worry about the effect // on the middleware's thread. // 2. Being notified in a listener callback of data arriving. // This has lower latency than using a WaitSet, but is more dangerous // because you have to worry about not blocking the middleware's thread. // 3. Polling for data. // You can call read() or take() at any time to view or remove the data that // is currently in the queue. void FlightPlanReader::WaitForFlightPlans( std::vector<com::atc::generated::FlightPlan>* plans) { // Process flight plans if they exist, and do not wait for another // notification of new data if (true == ProcessFlightPlans(plans)) { return; } // Block thread for flight plan data to arrive dds::core::cond::WaitSet::ConditionSeq active_conditions = _waitSet.wait(dds::core::Duration::from_secs(1)); for (uint32_t i = 0; i < active_conditions.size(); i++) { if (active_conditions[i] == *status_cond) { // If we have been woken up and notified that there was an event, we // can try to process flight plans. Errors in processing flight // plans will throw an exception ProcessFlightPlans(plans); } } } // This method is taking data from the middleware's queue. // // In this example, we remove the data from the middleware's queue by calling // take(). We do this to illustrate the common case where the data must be // changed from one format (the network format) to another (the format that the // radar library expects to receive its flight plan data). // If the application is able to use the data directly without converting it to // a different format, you can call read(). This leaves the data in the queue, // and lets the application access it without having to copy it. bool FlightPlanReader::ProcessFlightPlans( std::vector<com::atc::generated::FlightPlan>* plans) { bool havePlans = false; // This call removes the data from the middleware's queue dds::sub::LoanedSamples<com::atc::generated::FlightPlan> samples = _reader.take(); // Note, based on the QoS profile (history = keep last, depth = 1) and the // fact that we modeled flights as separate instances, we can assume there // is only one entry per flight. So if a flight plan for a particular // flight has been changed 10 times, we will only be maintaining the most // recent update to that flight plan in the middleware queue. for (dds::sub::LoanedSamples<com::atc::generated::FlightPlan>::iterator sample_it = samples.begin(); sample_it != samples.end(); ++sample_it) { // Data may not be valid if this is a notification that an instance // has changed state. In other words, this could be a notification // that a writer called "dispose" to notify the other applications // that the flight plan has moved to a dispose state. if (sample_it->info().valid()) { // Return a value of true that flight plans have been received havePlans = true; plans->push_back(sample_it->data()); } } return havePlans; }
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/RadarGenerator/RadarInterface.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #ifndef RADAR_INTERFACE_H #define RADAR_INTERFACE_H #include "dds/dds.hpp" //#include "ndds/ndds_namespace_cpp.h" //#include "../CommonInfrastructure/DDSCommunicator.h" #include "../Generated/AirTrafficControl.hpp" //#include "../Generated/AirTrafficControlSupport.h" #include "TrackGenerator.h" #include "GeneratorAdapter.h" #include <map> class FlightPlanReader; class RadarWriter; class RadarInterface; // ---------------------------------------------------------------------------- // The radar interface is composed of two parts: // // Writing radar data: // ------------------- // This application sends radar data, either with the lowest possible latency // or with higher throughput at a slight cost in latency. // // For information on the radar data type, please see the AirTrafficControl.idl // file. // // For information on the quality of service for throughput vs. latency, please // see the radar_profiles_multicast.xml file. // // Reading flight plan data: // ------------------------- // This application receives flight plan data. This data is sent less // frequently, and if it was sent before the radar application was started, it // must be automatically delivered to the radar at startup. Becasue of these // requirements, it has different QoS than the radar data. This QoS is // generally described as the QoS for "state data" // // For information on the flight plan data type, please see the // AirTrafficControl.idl file. // // For information on the quality of service for flight plan state data, please // see the flight_plan_profiles.xml file. // This enumeration is passed in when creating the interface, to choose whether // to send with lowest latency, or with best throughput. // These map in the source to two different QoS profiles that are described in // the USER_QOS_PROFILES.xml file. The XML contains different tunings for how // to send or receive data. enum RadarProfile { LOW_LATENCY, HIGH_THROUGHPUT }; // ------------------------------------------------------------------------- // // // RadarInterface: // A class that sets up the DDS interface (the network interface) of this // radar application, including creating appropriate DDS DataWriters, DDS // DataReaders, and all other DDS objects. // // ------------------------------------------------------------------------- // class RadarInterface { public: // This takes in the ID of the radar which becomes part of the data when // sending information over the network. This allows a real-world // application to differentiate between different sources of track data, // which is commonly necessary. // This also takes in a parameter for the maximum flights that the // radar application can generate. This gets used both for generating the // radar tracks, and for setting up resource limits in the middleware, // which the middleware uses as the maximum amount of queue size to // allocate // --- Constructor --- // Note that the radar may have two separate profiles depending in whether // the requirement is for lowest latency or highest throughput. Flight // plan data has only one profile, so it is not part of the interface RadarInterface( long radarId, int maxFlights, RadarProfile profile, std::vector<std::string> qosFileNames); // --- Destructor --- ~RadarInterface(); // --- Getter for the RadarWriter --- // This returns a RadarWriter object, which is the part of the network // interface that sends the radar data over the network. Look at the // RadarWriter class to see how to write data in RTI Connext DDS. This // RadarWriter class has some logic for writing efficiently for low latency RadarWriter* GetRadarWriter() { return _radarWriter; } // This returns the FlightPlan receiver - a small wrapper around the // FlightPlanDataReader that initializes the reader and uses the // DDS "WaitSet" object to wait for flight plans FlightPlanReader* GetFlightPlanReader() { return _flightPlanReader; } // --- How many flights should the middleware handle at once? --- // This is the maximum number of flights the middleware is expected to // handle at one time. This could be set up as unlimited, but in a real // system that must preallocate memory, this is one way to tell the // middleware the maximum amount of memory to allocate int GetMaxFlightsToHandle() { return _maxFlightsToHandle; } // --- Getter for Communicator --- // Accessor for the communicator (the class that sets up the basic // DDS infrastructure like the DomainParticipant). // This allows access to the DDS DomainParticipant/Publisher/Subscriber // classes // DDSCommunicator *GetCommunicator() //{ // return _communicator; //} private: // --- Private members --- // This contains the calls that allow the interface to create a // "DomainParticipant", the first object that must be created to // communicate over a DDS middleware. // DDSCommunicator *_communicator; // Used to identify which radar this is sending the flight plan information // This example is not focused on how to fuse radar tracks from multiple // radar, but in a real system this information is valuable for fusing // data from multiple radar. Typically when you have duplicate sensors // that are providing the same or similar information, the sensor ID will // be a part of the data model. long _radarId; // Wrapper class around RTI Connext DDS for writing radar tracks. This has // some logic to write with the lowest possible latency. RadarWriter* _radarWriter; // Used for receiving flight plan data, and being notified about the // arrival of flight plan data. FlightPlanReader* _flightPlanReader; // This maximum number is used in the middleware in several places int _maxFlightsToHandle; }; // ------------------------------------------------------------------------- // // // FlightPlanReader: // Used for receiving flight plans. This encapsulates the concepts of a DDS // type-specific DataReader (for type FlightPlan), along with the mechanisms // for accessing data - in this case, this allows the application to block one // of its threads to wait for data from the FlightPlanReader. // // ------------------------------------------------------------------------- // class FlightPlanReader { public: // --- Constructor --- // This creates a DDS DataReader that subscribes to flight plan information. // This uses the app object to access the DomainParticipant, and it uses the // QoS profiles specified when creating the DataReader. The XML QoS files // were previously configured when the RadarInterface's DDSCommunicator was // created. FlightPlanReader( RadarInterface* comm, // DDS::Subscriber *sub, const std::string& qosLibrary, const std::string& qosProfile); // --- Destructor --- ~FlightPlanReader(); // --- Receive flight plans --- // This example is looking up all flight plans, and leaving them // in the middleware's queue. it does this because it does not need // to do any transformation on the flight plan data. This example does // not care about when the flight plans arrive, it simply queries which // flight plans are in the queue (polling for data) // See the other example application for alternatives - being notified // that data is available. void WaitForFlightPlans( std::vector<com::atc::generated::FlightPlan>* plans); private: // --- Private methods --- // --- Process flight plans in queue --- bool ProcessFlightPlans( std::vector<com::atc::generated::FlightPlan>* plans); // --- Private members --- // Contains all the components needed to create the DataReader RadarInterface* _communicator; // Application-specific DDS DataReader for receiving flight plan data dds::sub::DataReader<com::atc::generated::FlightPlan> _reader = dds::core::null; // Objects to block a thread until flight plan data arrives dds::core::cond::WaitSet _waitSet; dds::core::cond::StatusCondition* status_cond; }; // ------------------------------------------------------------------------- // // // RadarWriter: // This class is used to create a very efficient low-latency DataWriter. // // In particular, it sends data efficiently by pre-registering the DDS instance // and storing the instance handle in a map. (It is not necesary to pre- // register an instance, but it makes the write() call more efficient.) class RadarWriter { public: // --- Constructor --- // This creates a DDS DataWriter that publishes to track information. // This uses the app object to access the DomainParticipant, and it uses the // QoS profiles specified when creating the DataWriter. The XML QoS files // were previously configured when the RadarInterface's DDSCommunicator was // created. RadarWriter( RadarInterface* comm, // DDS::Publisher *pub, const std::string& qosLibrary, const std::string& qosProfile); // --- Destructor --- ~RadarWriter(); // --- Sends the Track Data --- // Uses DDS interface to send a flight plan efficiently over the network // or shared memory to interested applications subscribing to flight plan // information. void PublishTrack(com::atc::generated::Track& track); // --- Deletes the Track Data --- // "Deletes" the flight plan from the system - removing the DDS instance // from all applications. void DeleteTrack(com::atc::generated::Track& track); private: // --- Private members --- // Contains all the components needed to create the DataWriter RadarInterface* _communicator; // The application-specific DDS DataWriter that sends track data updates // over the network or shared memory dds::pub::DataWriter<com::atc::generated::Track> _trackWriter = dds::core::null; // com::atc::generated::TrackDataWriter *_trackWriter; }; #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/RadarGenerator/GeneratorAdapter.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #ifndef GENERATOR_ADAPTER_H #define GENERATOR_ADAPTER_H #include "../Generated/AirTrafficControl.hpp" #include "TrackGenerator.h" #include "RadarInterface.h" // ------------------------------------------------------------------------- // // // Generator Adapter: // This class converts between the data types of the "generator" and the // network. This is a typical pattern - that you will need to adapt between // your application's data types and the data types that are sent over the // network. // // ------------------------------------------------------------------------- // class RadarAdapter { public: // --- Adapting types --- // Common pattern for converting between internal "radar" data types and // network data types. In other words, this converts between GeneratorTrack // and GeneratorFlightPlan to Track and FlightPlan data types. static void AdaptToGeneratorTrack( GeneratorTrack& genTrack, const com::atc::generated::Track& track) { genTrack.altitudeInFeet = track.altitude(); genTrack.latLong.latitude = track.latitude(); genTrack.latLong.longitude = track.longitude(); genTrack.id = track.trackId(); genTrack.SetFlightId(track.flightId()); } // --- Adapting types --- // Common pattern for converting between internal "radar" data types and // network data types. In other words, this converts between GeneratorTrack // and GeneratorFlightPlan to Track and FlightPlan data types. static void AdaptToTrack( com::atc::generated::Track& track, const GeneratorTrack& genTrack) { track.altitude(genTrack.altitudeInFeet); track.latitude(genTrack.latLong.latitude); track.longitude(genTrack.latLong.longitude); track.trackId(genTrack.id); track.flightId(genTrack.GetFlightId()); } // --- Adapting types --- // Common pattern for converting between internal "radar" data types and // network data types. In other words, this converts between GeneratorTrack // and GeneratorFlightPlan to Track and FlightPlan data types. static void AdaptToGeneratorFlightPlan( GeneratorFlightPlan& genPlan, const com::atc::generated::FlightPlan& plan) { genPlan.estimatedHours = plan.estimatedHours(); genPlan.estimatedMinute = plan.estimatedMinutes(); sprintf(genPlan.flightID, "%s", plan.flightId().c_str()); } // --- Adapting types --- // Common pattern for converting between internal "radar" data types and // network data types. In other words, this converts between GeneratorTrack // and GeneratorFlightPlan to Track and FlightPlan data types. static void AdaptToFlightPlan( com::atc::generated::FlightPlan& plan, const GeneratorFlightPlan& genPlan) { plan.estimatedHours(genPlan.estimatedHours); plan.estimatedMinutes(genPlan.estimatedMinute); plan.flightId(genPlan.flightID); } }; #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/RadarGenerator/RadarGenerator.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include <stdio.h> #include <stdlib.h> #include <iostream> #ifdef WIN32 #include <direct.h> #endif #include "RadarInterface.h" #include "TrackGenerator.h" #include "RadarApp.h" // using namespace DDS; using namespace std; // using namespace com::atc::generated; void PrintHelp(); // ------------------------------------------------------------------------- // // // Radar Generator Application: // This application is composed of two main parts: // 1. The radar generator, which provides example (fake) track data to the // application, and can be given flight plans that it will "correlate" // with individual tracks // 2. The network interface which: // 2.1 receives flight plan information and // 2.2 sends the track data // // This application can be started with several parameters to indicate: // 1. The ID of the radar, which becomes a part of the data, and in the real // world would allow receiving applications to correlate the data between // multiple sensors. If unspecified, this is 0 // 2. The maximum number of tracks this application can use at once. If // unspecified, this is 64. // 3. The sample rate for how fast this should publish tracks, in // milliseconds. Default is 100. // // ------------------------------------------------------------------------- // int main(int argc, char* argv[]) { int radarId = 42; // Run in real time, faster, or slower double runRate = 1; // How often are new tracks added? int creationRateSec = 120; // How many tracks should I start generating initially? int startTracks = 20; int maxTracks = 64; string setting; RadarProfile profileToUse = LOW_LATENCY; bool multicastAvailable = true; for (int i = 0; i < argc; i++) { if (0 == strcmp(argv[i], "--high-throughput")) { profileToUse = HIGH_THROUGHPUT; } else if (0 == strcmp(argv[i], "--low-latency")) { profileToUse = LOW_LATENCY; } else if (0 == strcmp(argv[i], "--radar-id")) { ++i; if (i == argc) { cout << "Bad parameter: Did not pass a radar ID" << endl; return -1; } radarId = atoi(argv[i]); } else if (0 == strcmp(argv[i], "--start-tracks")) { // How many tracks can I handle? Increasing this number will allow // the generator and the middleware to process more tracks. ++i; if (i == argc) { cout << "Bad parameter: Did not pass a number of tracks to " << "generate at startup." << endl; return -1; } startTracks = atoi(argv[i]); } else if (0 == strcmp(argv[i], "--max-tracks")) { // How many tracks can I handle? Increasing this number will allow // the generator and the middleware to process more tracks. ++i; if (i == argc) { cout << "Bad parameter: Did not pass a maximum number of tracks" << endl; return -1; } maxTracks = atoi(argv[i]); } else if (0 == strcmp(argv[i], "--run-rate")) { // Should I be sending these in real time, faster, or slower? ++i; if (i == argc) { cout << "Bad parameter: Did not pass a run rate" << endl; return -1; } runRate = atof(argv[i]); } else if (0 == strcmp(argv[i], "--creation-rate")) { ++i; if (i == argc) { cout << "Bad parameter: Did not pass creation rate" << endl; return -1; } creationRateSec = atoi(argv[i]); } else if (0 == strcmp(argv[i], "--no-multicast")) { multicastAvailable = false; } else if (0 == strcmp(argv[i], "--help")) { PrintHelp(); return 0; } else if (i > 0) { // If we have a parameter that is not the first one, and is not // recognized, return an error. cout << "Bad parameter: " << argv[i] << endl; PrintHelp(); return -1; } } // Set up paths for XML files. The profiles are for applications that // have no multicast available at all, or that have multicast available // on the network. vector<string> xmlFiles; if (multicastAvailable) { // Adding the XML files that contain profiles used by this application xmlFiles.push_back("file://../src/Config/base_profile_multicast.xml"); xmlFiles.push_back("file://../src/Config/radar_profiles_multicast.xml"); xmlFiles.push_back( "file://../src/Config/flight_plan_profiles_multicast.xml"); } else { // Adding the XML files that contain profiles used by this application xmlFiles.push_back( "file://../src/Config/base_profile_no_multicast.xml"); xmlFiles.push_back( "file://../src/Config/radar_profiles_no_multicast.xml"); xmlFiles.push_back( "file://../src/Config/flight_plan_profiles_no_multicast.xml"); } TrackGenerator* trackGenerator = NULL; try { // This sets up the data interface for the radar - what data it sends // and receives over the network, along with the quality of service RadarInterface* radarNetInterface = new RadarInterface(radarId, maxTracks, profileToUse, xmlFiles); // Create a new track generator, with a unique ID, a number of tracks // to start generating, a maximum number of tracks to generate at a // time, a creation rate (how quickly new tracks are added), and a run // rate (real-time, faster, slower) trackGenerator = new TrackGenerator( radarId, startTracks, maxTracks, creationRateSec, runRate); // Create a listener that will react when the track generator gives us // track data. In this case, the listener will use the radar writer to // write data when track data becomes available. DDSRadarListener* radarListener = new DDSRadarListener( radarNetInterface->GetRadarWriter(), radarId); // Adding a listener to the "track generator" that gets updates about // tracks being generated trackGenerator->AddListener(radarListener); // Start generating tracks trackGenerator->Start(); while (1) { // Listen for updates to flight plans, and add them to the track // generator as they arrive vector<com::atc::generated::FlightPlan> flightPlans; radarNetInterface->GetFlightPlanReader()->WaitForFlightPlans( &flightPlans); for (vector<com::atc::generated::FlightPlan>::iterator it = flightPlans.begin(); it != flightPlans.end(); it++) { // Get flight plan data, and add it to the GeneratorFlightPlan flightPlan; // Adapt between the network format of data and the generator // format for flight plan data (in this example, we use only // the flight ID from the flight plan) RadarAdapter::AdaptToGeneratorFlightPlan(flightPlan, (*it)); // Tell the track generator that this flight plan exists trackGenerator->AddFlightPlan(&flightPlan); } } // Remove the listener from the track generator to prevent crashes trackGenerator->RemoveListener(radarListener); // Shut down the track generator trackGenerator->Shutdown(); // Delete the track generator delete trackGenerator; delete radarNetInterface; } catch (string message) { cout << "Application exception " << message << endl; } return 0; } void PrintHelp() { cout << "Valid options are: " << endl; cout << " --high-throughput" << " Use the high throughput XML configuration" << endl; cout << " --low-latency " << " Use the low latency XML configuration (default)" << endl; cout << " --radar-id [number]" << " ID of the radar used to differentiate if there" << "" << endl << " " << "are multiple radar generator applications" << endl; cout << " --start-tracks [number]" << " Number of tracks the generator should generate at " << " " << "startup" << endl; cout << " --max-tracks [number]" << " Maximum tracks the generator sends at once" << endl; cout << " --run-rate [number]" << " Run in real time, faster, or slower. At default" << endl << " " << "rate, all tracks are updated every 100ms. If " << endl << " " << "you set this to 2 the generator will run twice" << endl << " " << "as fast, updating all tracks every 50ms." << endl; cout << " --creation-rate [number]" << " How fast to create new tracks in seconds." << endl; cout << " --no-multicast" << " Do not use multicast " << "(note you must edit XML" << endl << " " << "config to include IP addresses)" << endl; }
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/FlightPlanGenerator/FlightPlanGenerator.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include <vector> #include <list> #include <iostream> #include <dds/dds.hpp> #include "../Generated/AirTrafficControl.hpp" using namespace std; #define SECONDS_PER_DAY 86400 #define SECONDS_PER_HOUR 3600 #define SECONDS_PER_MIN 60 #define HOURS_PER_DAY 24 void PrintHelp(); // ------------------------------------------------------------------------- // // // // The way that ATC works in the real world, a flight plan is registered // hours in advance of a flight, and it is sent to the appropriate interested // applications. It is updated if the plan needs to change for some reason. // // This application creates a number of flight plans, based on the argument to // the application. It creates the flight plans for a variety of airlines, and // sends them. // // The flight plan data is modeled as RTI Connext DDS "state data," meaning: // 1) the data is modeled to have a key field which differentiates individual // flight plans. This key field is the flight ID. // ...and that it is sent: // 1) Reliably // 2) Durably - meaning that this application can write a flight plan, and // even if the subscribing applications do not exist, yet, they will be // notified of all flight plans as soon as they create the corresponding // DataReader. // 3) With a history set to: kind = keep last, depth = 1. This means that // just the most recent update to each flight plan will be sent to // DataReaders at startup. // Note: THIS HISTORY SETTING IS NOT APPROPRIATE FOR STRICT RELIABLITY. // If you were to rapidly update the same flight plan many times, it is // possible that some updates would be overwritten. This guarantees // delivery of the _most recent_ update to the flight plan. // // ------------------------------------------------------------------------- // int main(int argc, char* argv[]) { int numFlightPlans = 200; int timeBetweenLandings = 5; // Five minutes bool multicastAvailable = true; for (int i = 0; i < argc; i++) { if (0 == strcmp(argv[i], "--num-plans")) { ++i; if (i == argc) { cout << "Bad parameter: Did not pass number of plans" << endl; return -1; } numFlightPlans = atoi(argv[i]); } else if (0 == strcmp(argv[i], "--time-between")) { ++i; if (i == argc) { cout << "Bad parameter: Did not pass time between landing" << endl; return -1; } timeBetweenLandings = atoi(argv[i]); } else if (0 == strcmp(argv[i], "--no-multicast")) { multicastAvailable = false; } else if (0 == strcmp(argv[i], "--help")) { PrintHelp(); return 0; } else if (i > 0) { // If we have a parameter that is not the first one, and is not // recognized, return an error. cout << "Bad parameter: " << argv[i] << endl; PrintHelp(); return -1; } } int airlineNum = 35; const std::string airlines[] = { "SWA", "VIR", "ACA", "CCA", "SWR", "AAL", "TRS", "ASA", "ANA", "BAW", "CPA", "CAL", "CES", "KLM", "JAL", "KAL", "UAL", "DAL", "EVA", "FFT", "HAL", "LAN", "DLH", "PAL", "SAS", "UAE", "JBU", "SCX", "VRD", "ANZ", "SIA", "LRC", "AMX", "THO", "AFR" }; const std::string departureAerodromes[] = { "KDAL", "KLAX", "KSEA", "KEWR", "KBOS", "KDFW", "KDEN", "KJFK" }; // Tune the radar for low latency. The two QoS profiles are // defined in radar_profiles_multicast.xml and // radar_profiles_no_multicast.xml vector<string> xmlFiles; if (multicastAvailable) { // Adding the XML files that contain profiles used by this application xmlFiles.push_back("file://../src/Config/base_profile_multicast.xml"); xmlFiles.push_back("file://../src/Config/radar_profiles_multicast.xml"); xmlFiles.push_back( "file://../src/Config/flight_plan_profiles_multicast.xml"); } else { // Adding the XML files that contain profiles used by this application xmlFiles.push_back( "file://../src/Config/base_profile_no_multicast.xml"); xmlFiles.push_back( "file://../src/Config/radar_profiles_no_multicast.xml"); xmlFiles.push_back( "file://../src/Config/flight_plan_profiles_no_multicast.xml"); } try { // Create a DomainParticipant // Start by creating a DomainParticipant. Generally you will have only // one DomainParticipant per application. A DomainParticipant is // responsible for starting the discovery process, allocating resources, // and being the factory class used to create Publishers, Subscribers, // Topics, etc. Note: The string constants with the QoS library name // and the QoS profile name are configured as constants in the .idl // file. The profiles themselves are configured in the .xml file. rti::core::QosProviderParams provider_name; provider_name.url_profile(xmlFiles); dds::core::QosProvider::Default().extensions().default_provider_params( provider_name); dds::core::QosProvider::Default()->default_profile( com::atc::generated::QOS_LIBRARY + "::" + com::atc::generated::QOS_PROFILE_FLIGHT_PLAN); dds::domain::DomainParticipant participant(0); // Creating a Topic // The Topic object is the description of the data that you will be // sending. It associates a particular data type with a name that // describes the meaning of the data. Along with the data types, and // whether your application is reading or writing particular data, this // is the data interface of your application. // This topic has the name AIRCRAFT_FLIGHT_PLAN_TOPIC - a constant // string that is defined in the .idl file. (It is not required that // you define your topic name in IDL, but it is a best practice for // ensuring the data interface of an application is all defined in one // place. You can register all topics and types up-front, if you nee auto topic = dds::topic::Topic<com::atc::generated::FlightPlan>( participant, com::atc::generated::AIRCRAFT_FLIGHT_PLAN_TOPIC); // Create a DataWriter. // This creates a single DataWriter that writes flight plan data, with // QoS // that is used for State Data. Note: The string constants with the QoS // library name and the QoS profile name are configured as constants in // the .idl file. The profiles themselves are configured in the .xml // file. dds::pub::qos::DataWriterQos qos = dds::core::QosProvider::Default()->datawriter_qos( com::atc::generated::QOS_LIBRARY + "::" + com::atc::generated::QOS_PROFILE_FLIGHT_PLAN); dds::pub::DataWriter<com::atc::generated::FlightPlan> writer = dds::pub::DataWriter<com::atc::generated::FlightPlan>( dds::pub::Publisher(participant), topic, qos); dds::core::Duration send_period(0, 100000000); cout << "Sending flight plans over RTI Connext DDS" << endl; // Write all flight plans up to the number specified for (int i = 0; i < numFlightPlans; i++) { // Allocate a flight plan structure com::atc::generated::FlightPlan flightPlan; // Give it a random airline and flight ID based on airlines // that fly into SFO flightPlan.flightId( airlines[i % airlineNum] + std::to_string(i + 1)); // Give it a departure aerodrome flightPlan.departureAerodrome(departureAerodromes[i % 8].c_str()); // Destination aerodrome is always SFO flightPlan.destinationAerodrome("KSFO"); // Use the current time as a starting point for the expected // landing time of the aircraft dds::core::Time time = participant.current_time(); unsigned long currDay = time.sec() % SECONDS_PER_DAY; short currHour = (short) (currDay / SECONDS_PER_HOUR); short currMin = (short) ((currDay % SECONDS_PER_HOUR) / SECONDS_PER_MIN); // In this example, each flight lands 5 minutes after the // previous flight short minToLanding = (currMin + (timeBetweenLandings * (i + 1))); flightPlan.estimatedMinutes(minToLanding % SECONDS_PER_MIN); long hourTemp = currHour + (minToLanding / SECONDS_PER_MIN); hourTemp = hourTemp % HOURS_PER_DAY; flightPlan.estimatedHours((short) hourTemp); // Write the data to the network. This is a thin wrapper // around the RTI Connext DDS DataWriter that writes data to // the network. writer.write(flightPlan); rti::util::sleep(send_period); } while (1) { rti::util::sleep(send_period); } } catch (string message) { cout << "Application exception: " << message << endl; } return 0; } void PrintHelp() { cout << "Valid options are: " << endl; cout << " --num-plans [num]" << " Number of flight plans to send" << endl; cout << " --time-between [time in ms]" << " Time between sending flight plans" << endl; cout << " --no-multicast" << " Do not use multicast " << "(note you must edit XML" << endl << " " << "config to include IP addresses)" << endl; }
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/TrackGuiApp.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include <string> #include "TrackApp.h" #include "TrackPresenter.h" #include "TrackGUI.h" using namespace std; // ------------------------------------------------------------------------- // // Starting point for a wxWidgets application. // // This creates the frames that are needed for the GUI, (including specifying // the map that is displayed in the track display), creates the network // interface, initializes the listeners that update the display with new // data that has arrived from the network. // bool TrackApp::OnInit() { _shuttingDown = false; bool multicastAvailable = true; for (int i = 0; i < argc; i++) { if (0 == strcmp(argv[i], "--no-multicast")) { multicastAvailable = false; } } // --- Setting the map file path --- // string filePath; #ifdef RTI_WIN32 filePath = "..\\resource\\bayarea_county2000\\bayarea_county2000"; #else filePath = "../resource/bayarea_county2000/bayarea_county2000"; #endif _frame = new AppFrame( this, "ATC Flight Viewer", wxPoint(0, 0), wxSize(450, 700), filePath); wxPoint point(300, 300); _frame->SetPosition(point); _frame->Show(true); SetTopWindow(_frame); // Tune the radar for low latency. The two QoS profiles are // defined in USER_QOS_PROFILES.xml vector<string> xmlFiles; if (multicastAvailable) { // Adding the XML files that contain profiles used by this application xmlFiles.push_back("file://../src/Config/base_profile_multicast.xml"); xmlFiles.push_back("file://../src/Config/radar_profiles_multicast.xml"); xmlFiles.push_back( "file://../src/Config/flight_plan_profiles_multicast.xml"); } else { // Adding the XML files that contain profiles used by this application xmlFiles.push_back( "file://../src/Config/base_profile_no_multicast.xml"); xmlFiles.push_back( "file://../src/Config/radar_profiles_no_multicast.xml"); xmlFiles.push_back( "file://../src/Config/flight_plan_profiles_no_multicast.xml"); } // If the DDS network interface fails to run (due to mising XML files or // a missing license) catch the exception here instead of letting the GUI // framework handle it. try { _netInterface = new NetworkInterface(xmlFiles); } catch (string message) { cout << message << endl; return false; } // This class accesses the data that arrives over the network. This // creates a thread, and uses it so periodically poll the network interface // for the current track data that it has received. _networkFlightInfoReceiver = new FlightInfoNetworkReceiver(this); _trackViewListener = new TrackViewListener(_frame->GetTrackPanel()); _networkFlightInfoReceiver->AddListener(_trackViewListener); _tablePanelListener = new TablePanelListener(_frame->GetTablePanel()); _networkFlightInfoReceiver->AddListener(_tablePanelListener); // This associates the listeners with the panels that they are updating. // This is necessary because the listeners must be removed before the // frames are deleted - or else the application may crash at shutdown. _dataSources[(wxPanel*) _frame->GetTrackPanel()] = _trackViewListener; _dataSources[(wxPanel*) _frame->GetTablePanel()] = _tablePanelListener; // This starts the thread that accesses the data from the network. _networkFlightInfoReceiver->StartReceiving(); return true; } // ------------------------------------------------------------------------- // // This disassociates a listener from a panel, allowing the panel to be deleted // separately from the listener. bool TrackApp::RemoveDataSource(wxPanel* panel) { FlightInfoListener* listener = _dataSources[panel]; // This can be null if an error occurs while initializing if (listener != NULL) { _networkFlightInfoReceiver->RemoveListener(listener); } return true; } // ------------------------------------------------------------------------- // // This cleans up memory as the application is shutting down. int TrackApp::OnExit() { delete _trackViewListener; _trackViewListener = NULL; delete _tablePanelListener; _tablePanelListener = NULL; _shuttingDown = true; delete _netInterface; _netInterface = NULL; delete _networkFlightInfoReceiver; _networkFlightInfoReceiver = NULL; return 0; } // ------------------------------------------------------------------------- // // wxWidgets macro for an application class IMPLEMENT_APP(TrackApp)
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include "TrackPresenter.h" #include "TrackApp.h" #include "TrackGUI.h" #include <vector> #include <sstream> using namespace std; // ------------------------------------------------------------------------- // // Class FlightInfoNetworkReceiver // // A class that is the Presenter part of a model-view-presenter architecture. // This is responsible for checking for changes to the model. It contains a // thread that checks for the current state of the flight data, and notifies // the UI that the data has changed. // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // Create a new network receiver class. This class is the glue between // the UI and the data source - in this case, the DDS network data // that is arriving asynchronously. FlightInfoNetworkReceiver::FlightInfoNetworkReceiver(TrackApp* parent) : _shuttingDown(false), _app(parent) { } // ------------------------------------------------------------------------- // // Destructor FlightInfoNetworkReceiver::~FlightInfoNetworkReceiver() { } // ------------------------------------------------------------------------- // // Observer pattern for notifications. The track presenter will notify various // UI listeners that a track has been deleted, and the UI listeners can redraw // the UI as necessary. This allows a single update to notify multiple windows // or panels that a track has been deleted. void FlightInfoNetworkReceiver::NotifyListenersDeleteTrack( const std::vector<FlightInfo*> flights) { for (std::vector<FlightInfoListener*>::iterator it = _listeners.begin(); it != _listeners.end(); ++it) { // Notify the UI listeners that the track has been deleted if (false == (*it)->TrackDelete(flights)) { std::stringstream errss; errss << "NotifyListenersDeleteTrack(): error deleting track."; throw errss.str(); } } } // ------------------------------------------------------------------------- // // Observer pattern for notifications. The track presenter will notify various // UI listeners that a track has been updated, and the UI listeners can redraw // the UI as necessary. This allows a single update to notify multiple windows // or panels that a track has been updated. void FlightInfoNetworkReceiver::NotifyListenersUpdateTrack( const std::vector<FlightInfo*> flights) { for (std::vector<FlightInfoListener*>::iterator it = _listeners.begin(); it != _listeners.end(); ++it) { // Notify the UI listeners that tracks have been updated if (false == (*it)->TrackUpdate(flights)) { std::stringstream errss; errss << "NotifyListenersUpdateTrack(): error updating track."; throw errss.str(); } } } // ------------------------------------------------------------------------- // // Remove listeners. This must be called before shutdown, because the frames // that are updating may be deleted before the data source. So, the listeners // must be removed from the UI before it shuts down. void FlightInfoNetworkReceiver::RemoveListener( const FlightInfoListener* listener) { std::vector<FlightInfoListener*>::iterator toErase; for (std::vector<FlightInfoListener*>::iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if ((*it) == listener) { toErase = it; } } _listeners.erase(toErase); } // ------------------------------------------------------------------------- // // This starts receiving the network data - or, more accurately, this starts // the process of accessing data that is already being received asynchronously // over the network as soon as the DDS discovery process is complete. void FlightInfoNetworkReceiver::StartReceiving() { #if defined RTI_WIN32 HANDLE hThread; DWORD id; hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)FlightInfoNetworkReceiver::ReceiveTracks, _app, 0, &id); #elif defined RTI_LINUX pthread_t tid; pthread_create(&tid, NULL, FlightInfoNetworkReceiver::ReceiveTracks, _app); #else #error Uknow Architecture #endif } // ------------------------------------------------------------------------- // // 1. Retrieves the latest flight plan information from the model // 2. Converts the TrackData / FlightPlan data from the network form of the // data to the form that is used by the UI. void FlightInfoNetworkReceiver::PrepareUpdate( TrackApp* app, vector<com::atc::generated::Track> updateData, vector<FlightInfo*>* flightData) { FlightPlanReader* planReader = app->GetNetworkInterface()->GetFlightPlanReader(); for (unsigned int i = 0; i < updateData.size(); i++) { // Allocate a flight info object. This will be filled in with // the flight plan information. FlightInfo* flightInfo = new FlightInfo; flightInfo->_track = updateData[i]; // This copies a flight plan from the middleware into // the object passed in planReader->GetFlightPlan( updateData[i].flightId().c_str(), &flightInfo->_plan); flightData->push_back(flightInfo); } } // ------------------------------------------------------------------------- // // Update UI when track data changes. void* FlightInfoNetworkReceiver::ReceiveTracks(void* param) { TrackApp* app = (TrackApp*) param; // Get access to the data reader objects that are receiving data over the // network asynchronously. NetworkInterface* netInterface = app->GetNetworkInterface(); TrackReader* reader = netInterface->GetTrackReader(); FlightPlanReader* planReader = netInterface->GetFlightPlanReader(); vector<com::atc::generated::Track> tracks; vector<com::atc::generated::Track> tracksDeleted; vector<FlightInfo*> flights; vector<FlightInfo*> flightsDeleted; // This periodically wakes up and updates the UI with the latest track // information that is available from the middleware, which has been // collecting it asynchronously. dds::core::Duration uiUpdatePeriod(0, 200000000); while (!app->ShuttingDown()) { // Note that this API allocates tracks that are a copy of tracks // in the queue. This allows us to pass in an empty vector and // use the data in it however we want. reader->GetCurrentTracks(tracks, tracksDeleted); if (app->ShuttingDown()) { return NULL; } if (!tracks.empty()) { // Convert the data type from the network type to the type expected // by the UI listeners. PrepareUpdate(app, tracks, &flights); // Notify the listeners that there is an upate to the track list app->GetPresenter()->NotifyListenersUpdateTrack(flights); } if (!tracksDeleted.empty()) { // Convert the data type from the network type to the type expected // by the UI listeners. PrepareUpdate(app, tracksDeleted, &flightsDeleted); // Notify the listeners that there is an deletion from the track // list app->GetPresenter()->NotifyListenersDeleteTrack(flightsDeleted); } tracks.clear(); tracksDeleted.clear(); // Delete the "FlightInfo" structures we have just generated. There // are more efficient ways to do this by preallocating, but this is okay // for this simple use case for (unsigned int i = 0; i < flights.size(); i++) { delete flights[i]; } flights.clear(); // Delete the "FlightInfo" structures we have just generated. There // are more efficient ways to do this by preallocating, but this is okay // for this simple use case for (unsigned int i = 0; i < flightsDeleted.size(); i++) { delete flightsDeleted[i]; } flightsDeleted.clear(); // Sleep until the next UI refresh rti::util::sleep(uiUpdatePeriod); } return NULL; }
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include "TrackGUI.h" #include "TrackPresenter.h" #include "TrackApp.h" using namespace std; class TrackApp; enum { ID_Quit = 1, ID_About, }; #define SFO_LAT 37.6190 #define SFO_LONG -122.3749 #define EARTH_MEAN_RADIUS_KM 6371 // ------------------------------------------------------------------------- // // Class AppFrame // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // Constructor that creates the menu, frame, and panels of the application. AppFrame::AppFrame( TrackApp* app, const wxString& title, const wxPoint& pos, const wxSize& size, const string filePath) : wxFrame(NULL, -1, title, pos, size), _app(app) { wxMenu* menuFile = new wxMenu; menuFile->Append(ID_About, _("&About...")); menuFile->AppendSeparator(); menuFile->Append(ID_Quit, _("E&xit")); wxMenuBar* menuBar = new wxMenuBar; menuBar->Append(menuFile, _("&File")); SetMenuBar(menuBar); CreateStatusBar(); SetStatusText(_("Track Viewer")); // Note: // May want to parse shape file earlier and set the panel size based on the // relative size of the geography, or change the radar circle to an ellipse // to match the view. wxSplitterWindow* splitter = new wxSplitterWindow( this, -1, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE); splitter->SetSashGravity(0.5); // Open up the panel that shows tracks, and the panel that shows a grid of // flight data. _panel = new TrackPanel( splitter, 1, _("Track Viewer"), wxPoint(0, 0), wxSize(450, 480), filePath); _tablePanel = new TablePanel( splitter, 2, _("Flight Info"), wxPoint(0, _panel->GetSize().GetY()), wxSize(450, 100)); // Make the panels resize when the window resizes wxSizer* sizerMain = new wxBoxSizer(wxVERTICAL); sizerMain->Add(splitter, 1, wxEXPAND, 0); splitter->SplitHorizontally(_panel, _tablePanel); SetSizer(sizerMain); sizerMain->SetSizeHints(this); } // ------------------------------------------------------------------------- // // Destructor that removes the data sources from the panels before the panels // are deleted. AppFrame::~AppFrame() { // Stop the update thread as soon as we get the message that the windows // are shutting down GetApp()->SetShuttingDown(true); // The data sources must be removed before the child panels are destroyed, // or the application may hang at shutdown as it tries to send a command to // update a window that is in process of being deleted. GetApp()->RemoveDataSource(_tablePanel); GetApp()->RemoveDataSource(_panel); } // ------------------------------------------------------------------------- // // Handle the quit menu event. Removes the data sources from the panels before // the panels are deleted. void AppFrame::OnQuit(wxCommandEvent& event) { // Stop the update thread as soon as we get the message that the windows // are shutting down GetApp()->SetShuttingDown(true); // The data sources must be removed before the child panels are destroyed, // or the application may hang at shutdown as it tries to send a command to // update a window that is in process of being deleted. GetApp()->RemoveDataSource(_tablePanel); GetApp()->RemoveDataSource(_panel); } // ------------------------------------------------------------------------- // // Class TrackViewListener // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // Updates the track view's list of points. Converts between lat/long and // UTM values, adds the point to the panel, and then makes the panel update // its view to cause a paint event. bool TrackViewListener::TrackUpdate(const std::vector<FlightInfo*> flights) { for (unsigned int i = 0; i < flights.size(); i++) { double x, y; _panel->ConvertLatLongToUTM( &y, &x, flights[i]->_track.latitude(), flights[i]->_track.longitude()); _panel->AddOrUpdatePoint( flights[i]->_track.trackId(), wxRealPoint(x, y)); } _panel->Refresh(); return true; } // ------------------------------------------------------------------------- // // Deletes a point from the track view bool TrackViewListener::TrackDelete(const std::vector<FlightInfo*> flights) { for (unsigned int i = 0; i < flights.size(); i++) { _panel->DeletePoint(flights[i]->_track.trackId()); } return true; } // ------------------------------------------------------------------------- // // Class TablePanelListener // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // Updates the table panel with new flight information that will be shown in // the grid. bool TablePanelListener::TrackUpdate(const std::vector<FlightInfo*> flights) { _panel->PrepareUpdate(); for (unsigned int i = 0; i < flights.size(); i++) { _panel->UpdateRow(*flights[i]); } _panel->UpdateComplete(); return true; } // ------------------------------------------------------------------------- // // Deletes a point from the grid panel bool TablePanelListener::TrackDelete(const std::vector<FlightInfo*> flights) { _panel->PrepareUpdate(); for (unsigned int i = 0; i < flights.size(); i++) { _panel->DeleteRow(*flights[i]); } _panel->UpdateComplete(); return true; } // ------------------------------------------------------------------------- // // Class TrackPanel // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // Constructor for the track panel. Opens a shapefile that contains map data. // Stores points representing the geography points. TrackPanel::TrackPanel( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, std::string filePath) : wxPanel(parent, -1, pos, size) { SetBackgroundStyle(wxBG_STYLE_CUSTOM); _latlongProjection = NULL; _mercatorProjection = NULL; _handle = SHPOpen(filePath.c_str(), "r+b"); int numEntities = 0; int shapeType = 0; double minBound[4], maxBound[4]; SHPGetInfo(_handle, &numEntities, &shapeType, minBound, maxBound); for (int i = 0; i < numEntities; i++) { SHPObject* shapeObject = SHPReadObject(_handle, i); _shapeObjects.push_back(shapeObject); } CalculateGeoMinMax(); CalculateCoordinateForWindowSize(); } // ------------------------------------------------------------------------- // // Clears the current list of points, since they are likely to all change // before the next repainting. void TrackPanel::ClearPointsLists() { for (unsigned int i = 0; i < _pointsLists.size(); i++) { wxPointList* list = _pointsLists[i]; for (unsigned int j = 0; j < list->size(); j++) { delete (*list)[j]; } delete list; } _pointsLists.clear(); } // ------------------------------------------------------------------------- // // Calculating a point that is 80Km north of SFO to draw the radius around SFO. // 80Km is hard coded in this example, and matches the value that is being // generated by the RadarGenerator application. It represents the radius in // which the radar can track a flight. void TrackPanel::Calculate80KmNorthFromSFO(wxRealPoint* latLong) { double finalKm = 80; double degreesInRads = 0; double latInRads = SFO_LAT * M_PI / 180; double longInRads = SFO_LONG * M_PI / 180; double distInRads = finalKm / EARTH_MEAN_RADIUS_KM; double bearing = degreesInRads; double temp1 = sin(latInRads) * cos(distInRads); double temp2 = cos(latInRads) * sin(distInRads) * cos(bearing); double newLatInRads = asin(temp1 + temp2); double newLongInRads = longInRads + atan2(sin(bearing) * sin(distInRads) * cos(latInRads), cos(distInRads) - (sin(latInRads) * sin(newLatInRads))); // Normalize to -180 - 180 newLongInRads = fmod((newLongInRads + 3 * M_PI), (2 * M_PI)) - M_PI; // Calculate a latitude and longitude 80 Km away from SFO latLong->y = newLatInRads / M_PI * 180; latLong->x = newLongInRads / M_PI * 180; } // ------------------------------------------------------------------------- // // Draw a circle centered on SFO to indicate the distance that the radar can // display void TrackPanel::DrawRadarCircleSFO(wxBufferedPaintDC& dc) { double y1, x1; // Convert the coordinates to UTM from Lat/Long ConvertLatLongToUTM(&y1, &x1, SFO_LAT, SFO_LONG); wxRealPoint coord; // Convert between the UTM coordinates of SFO to the window coordinates. ConvertMapCoordToWindow( &coord, wxRealPoint(x1, y1), _maxX, _maxY, _minX, _minY, GetClientRect().width, GetClientRect().height); // Radar range: estimating ~80 km - a reasonable range for surveillance // radar. This number is hard-coded throughout this example. wxRealPoint northLatLong; Calculate80KmNorthFromSFO(&northLatLong); // Convert from the lat/long values of the point on the circle to UTM double y2, x2; ConvertLatLongToUTM(&y2, &x2, northLatLong.y, northLatLong.x); // Convert the point on the circle to window coordinates wxRealPoint coord2; ConvertMapCoordToWindow( &coord2, wxRealPoint(x2, y2), _maxX, _maxY, _minX, _minY, GetClientRect().width, GetClientRect().height); // Get the circle height double circleHeight = coord.y - coord2.y; // Draw the circle wxBrush oldBrush = dc.GetBrush(); wxPen oldPen = dc.GetPen(); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetPen(*wxCYAN_PEN); dc.DrawCircle(coord, circleHeight); dc.SetBrush(oldBrush); dc.SetPen(oldPen); } // ------------------------------------------------------------------------- // // Repaint the polygons and the points indicating aircraft on the map. This // might be more efficient if we invalidate only the parts of the rectangle // that actuall change. void TrackPanel::OnPaint(wxPaintEvent& paintEvt) { wxBufferedPaintDC dc(this); wxBrush brush; brush.SetColour(0, 50, 150); dc.SetBackground(brush); dc.Clear(); // Draw the map in the background for (unsigned int i = 0; i < _pointsLists.size(); i++) { dc.DrawPolygon(_pointsLists[i]); } // Draw the boundary circle DrawRadarCircleSFO(dc); // Draw the aircraft as circles for (std::map<long, wxPoint>::iterator it = _trackPoints.begin(); it != _trackPoints.end(); ++it) { wxPen pen(*wxRED); wxPen prevPen = dc.GetPen(); dc.SetPen(pen); dc.DrawCircle((*it).second, 3); dc.SetPen(prevPen); } } // ------------------------------------------------------------------------- // // Calculate the minimum and maximum points in the geometry that is being // displayed. void TrackPanel::CalculateGeoMinMax() { vector<wxRealPoint*> realPoints; if (_shapeObjects.size() == 0) { return; } double xMax = _shapeObjects[0]->padfX[0]; double yMax = _shapeObjects[0]->padfY[0]; double xMin = _shapeObjects[0]->padfX[0]; double yMin = _shapeObjects[0]->padfY[0]; for (unsigned int i = 0; i < _shapeObjects.size(); i++) { for (int j = 0; j < _shapeObjects[i]->nVertices; j++) { if (_shapeObjects[i]->padfX[j] > xMax) { xMax = _shapeObjects[i]->padfX[j]; } if (_shapeObjects[i]->padfY[j] > yMax) { yMax = _shapeObjects[i]->padfY[j]; } if (_shapeObjects[i]->padfX[j] < xMin) { xMin = _shapeObjects[i]->padfX[j]; } if (_shapeObjects[i]->padfY[j] < yMin) { yMin = _shapeObjects[i]->padfY[j]; } } } _maxX = xMax; _maxY = yMax; _minX = xMin; _minY = yMin; } // ------------------------------------------------------------------------- // // Map from the coordinates in UTM or Lat/Long into a set of points that are // used when drawing in the actual window. // This is only called initially, or when resizing the window. void TrackPanel::CalculateCoordinateForWindowSize() { // Iterate over all the shape objects that make up the map geometry for (unsigned int i = 0; i < _shapeObjects.size(); i++) { // Iterate over the parts of the shape objects. Shape objects may have // multiple parts, if they have inner and outer circles. for (int j = 0; j < _shapeObjects[i]->nParts; j++) { // A list of points that will be used to draw the polygons of the // map in the background wxPointList* points = new wxPointList; int nVerticesPerPart = 0; // The parts of multiple shapes are kept in a single array, so this // must determine which points are part of which shape. // If this is the end of the array, it is easy to determine the // number of the vertices for this part: number of vertices - // the beginning of this last shape. if (j == _shapeObjects[i]->nParts - 1) { int startOfPart = _shapeObjects[i]->panPartStart[j]; nVerticesPerPart = _shapeObjects[i]->nVertices - _shapeObjects[i]->panPartStart[j]; } else { // If this is not the end of the array, the number of vertices // is the beginning of the next shape - the beginning of this // shape nVerticesPerPart = _shapeObjects[i]->panPartStart[j + 1] - _shapeObjects[i]->panPartStart[j]; } // Iterate over each of the parts of the shape, and convert the // vertices of the shape into window coordinates. for (int k = _shapeObjects[i]->panPartStart[j]; k < _shapeObjects[i]->panPartStart[j] + nVerticesPerPart; k++) { wxRealPoint coord; ConvertMapCoordToWindow( &coord, wxRealPoint( _shapeObjects[i]->padfX[k], _shapeObjects[i]->padfY[k]), _maxX, _maxY, _minX, _minY, GetClientRect().width, GetClientRect().height); // Append the vertex to the list of points. points->Append(new wxPoint(coord)); } // Maintain one list of points per shape in the shapefile. Each // of these shapes will be a separate polygon. _pointsLists.push_back(points); } } } // ------------------------------------------------------------------------- // // Use the proj library to convert between latitude/longitude and mercator // projections. This allows us to receive flight information in lat/long and // to draw it on a map that is in mercator (UTM) coordinates. void TrackPanel::ConvertLatLongToUTM( double* northing, double* easting, double latitude, double longitude) { *northing = latitude * DEG_TO_RAD; *easting = longitude * DEG_TO_RAD; if (_mercatorProjection == NULL) { _mercatorProjection = pj_init_plus("+proj=utm +zone=10 +ellps=WGS84"); if (_mercatorProjection == NULL) { int error = pj_ctx_get_errno(pj_get_default_ctx()); std::stringstream errss; errss << "ConvertLatLongToUTM(): unable to create the map " "projection." << " Error: " << error; throw errss.str(); } } if (_latlongProjection == NULL) { _latlongProjection = pj_init_plus("+proj=latlong +ellps=clrk66"); if (_latlongProjection == NULL) { int error = pj_ctx_get_errno(pj_get_default_ctx()); std::stringstream errss; errss << "ConvertLatLongToUTM(): unable to create the map " "projection." << " Error: " << error; throw errss.str(); } } pj_transform( _latlongProjection, _mercatorProjection, 1, 1, easting, northing, NULL); } // ------------------------------------------------------------------------- // // This does the actual conversion from map coordinates to window coordinates, // which: // a) assume that 0,0 is in the upper-left-hand corner of the window. // b) may be distorted based on the size of the window void TrackPanel::ConvertMapCoordToWindow( wxRealPoint* coord, wxRealPoint latLong, double maxX, double maxY, double minX, double minY, int windowSizeX, int windowSizeY) { double xZeroBased = latLong.x - minX; double yShift = 0 - maxY; double yZeroBasedReversed = latLong.y + yShift; double xDistance = maxX - minX; double xSize = maxX - minX; double yDistance = maxY - minY; coord->x = ((xZeroBased) *windowSizeX) / xDistance; double yAspectRatio = yDistance / xDistance * windowSizeX; coord->y = -yZeroBasedReversed * yAspectRatio / yDistance; } // ------------------------------------------------------------------------- // // When the window is resized, we remove all points, we calculate the points // for the new window size, and we refresh the window void TrackPanel::OnSize(wxSizeEvent& event) { ClearPointsLists(); CalculateCoordinateForWindowSize(); Refresh(); } // ------------------------------------------------------------------------- // // // Delete the track panel, and clear the list of points that it has been // storing that indicate the geometry of the map. Free the mercator // projection data, and free the map data itself. TrackPanel::~TrackPanel() { AppFrame* appFrame = (AppFrame*) GetParent()->GetParent(); appFrame->GetApp()->SetShuttingDown(true); for (unsigned int i = 0; i < _pointsLists.size(); i++) { wxPointList* list = _pointsLists[i]; for (unsigned int j = 0; j < _pointsLists[i]->size(); j++) { delete (*list)[j]; } list->Clear(); delete list; } _pointsLists.clear(); for (unsigned int i = 0; i < _shapeObjects.size(); i++) { SHPDestroyObject(_shapeObjects[i]); } _shapeObjects.clear(); SHPClose(_handle); _trackPoints.clear(); pj_free(_latlongProjection); pj_free(_mercatorProjection); Close(true); } // ------------------------------------------------------------------------- // // Update the position of an existing aircraft in the Track window void TrackPanel::UpdatePoint(long trackId, wxRealPoint point) { wxRealPoint coord(0, 0); wxRealPoint latLong(point.x, point.y); ConvertMapCoordToWindow( &coord, latLong, _maxX, _maxY, _minX, _minY, GetClientRect().width, GetClientRect().height); _trackPoints[trackId] = coord; } // ------------------------------------------------------------------------- // // Check if this track update represents an existing track. If so, update the // track (point) position. If not, add a new point (representing a new // aircraft). void TrackPanel::AddOrUpdatePoint(long trackId, wxRealPoint point) { wxRealPoint coord(0, 0); if (_trackPoints.find(trackId) != _trackPoints.end()) { UpdatePoint(trackId, point); return; } wxRealPoint latLong(point.x, point.y); ConvertMapCoordToWindow( &coord, latLong, _maxX, _maxY, _minX, _minY, GetClientRect().width, GetClientRect().height); _trackPoints[trackId] = coord; } // ------------------------------------------------------------------------- // // Delete a point in the track panel void TrackPanel::DeletePoint(long trackId) { if (_trackPoints.find(trackId) != _trackPoints.end()) { _trackPoints.erase(trackId); } } // ------------------------------------------------------------------------- // // Class TablePanel // ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- // // A panel that displays a table (grid) view of all the existing flights, // including the airline, lat/long, departure aerodrome, destination aerodrome TablePanel::TablePanel( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size) : wxPanel(parent, -1, pos, size) { _grid = new wxGrid(this, -1, wxPoint(0, 0), wxSize(400, 300)); // Then we call CreateGrid to set the dimensions of the grid // (64 rows and 8 columns in this example) _grid->CreateGrid(64, 10); // We can set the sizes of individual rows and columns // in pixels _grid->SetRowSize(0, 60); _grid->SetColSize(0, 80); // Set the column headers _grid->SetColLabelValue(0, "Radar ID"); _grid->SetColLabelValue(1, "Track ID"); _grid->SetColLabelValue(2, "Flight ID"); _grid->SetColLabelValue(3, "Latitude"); // Specify that latitude and longitude columns are numeric. _grid->SetColFormatFloat(3, 6, 4); _grid->SetColFormatFloat(4, 6, 4); // Specify that latitude and longitude columns are numeric. _grid->SetColLabelValue(4, "Longitude"); _grid->SetColLabelValue(5, "Departed From"); _grid->SetColLabelValue(6, "Destination"); _grid->SetColLabelValue(7, "Estimated Arrival"); } // ------------------------------------------------------------------------- // // Delete the table panel, and remove the data source so it can be // cleaned up nicely. If you do not detach the data source before this // panel is deleted, it can lead to bad pointers. TablePanel::~TablePanel() { AppFrame* appFrame = (AppFrame*) GetParent()->GetParent(); delete _grid; } // ------------------------------------------------------------------------- // // Resize the grid when it receives an on size event. void TablePanel::OnSize(wxSizeEvent& event) { _grid->SetSize(event.GetSize().GetX(), event.GetSize().GetY()); } // ------------------------------------------------------------------------- // // Update a row of the table when the data values of the flight information // has changed. void TablePanel::UpdateRow(const FlightInfo& flight) { _grid->BeginBatch(); bool exists = false; for (int i = 0; i < _grid->GetNumberRows(); i++) { long radarIdCell = -1; if (!_grid->GetCellValue(i, 0).IsEmpty()) { _grid->GetCellValue(i, 0).ToLong(&radarIdCell); } long trackIdCell = -1; if (!_grid->GetCellValue(i, 1).IsEmpty()) { _grid->GetCellValue(i, 1).ToLong(&trackIdCell); } if (radarIdCell == flight._track.radarId() && trackIdCell == flight._track.trackId()) { exists = true; // Only update the cell value if this has changed if (0 != strcmp( _grid->GetCellValue(i, 2).c_str(), flight._track.flightId().c_str())) { _grid->SetCellValue(i, 2, wxString(flight._track.flightId())); } _grid->SetCellValue( i, 3, wxString::Format(wxT("%f"), flight._track.latitude())); _grid->SetCellValue( i, 4, wxString::Format(wxT("%f"), flight._track.longitude())); std::string s = std::string(_grid->GetCellValue(i, 5)); s = flight._plan.departureAerodrome(); if (_grid->GetCellValue(i, 5) != flight._plan.departureAerodrome()) { _grid->SetCellValue( i, 5, wxString(flight._plan.departureAerodrome())); } s = _grid->GetCellValue(i, 6); s = flight._plan.destinationAerodrome(); if (_grid->GetCellValue(i, 6) != flight._plan.destinationAerodrome()) { _grid->SetCellValue( i, 6, wxString(flight._plan.destinationAerodrome())); } char date[6]; sprintf(date, "%02i:%02i", flight._plan.estimatedHours(), flight._plan.estimatedMinutes()); if (_grid->GetCellValue(i, 7) != date) { _grid->SetCellValue(i, 7, wxString(date)); } break; } } if (!exists) { for (int i = 0; i < _grid->GetNumberRows(); i++) { if (_grid->GetCellValue(i, 0).IsEmpty() && _grid->GetCellValue(i, 1).IsEmpty()) { _grid->SetCellValue( i, 0, wxString::Format(wxT("%i"), flight._track.radarId())); _grid->SetCellValue( i, 1, wxString::Format(wxT("%i"), flight._track.trackId())); _grid->SetCellValue(i, 2, wxString(flight._track.flightId())); _grid->SetCellValue( i, 3, wxString::Format(wxT("%f"), flight._track.latitude())); _grid->SetCellValue( i, 4, wxString::Format(wxT("%f"), flight._track.longitude())); _grid->SetCellValue( i, 5, wxString(flight._plan.departureAerodrome())); _grid->SetCellValue( i, 6, wxString(flight._plan.destinationAerodrome())); char date[6]; sprintf(date, "%02i:%02i", flight._plan.estimatedHours(), flight._plan.estimatedMinutes()); _grid->SetCellValue(i, 7, wxString(date)); break; } } } _grid->EndBatch(); } // ------------------------------------------------------------------------- // // Delete a row from the grid void TablePanel::DeleteRow(const FlightInfo& flight) { for (int i = 0; i < _grid->GetNumberRows(); i++) { long radarIdCell = -1; if (!_grid->GetCellValue(i, 0).IsEmpty()) { _grid->GetCellValue(i, 0).ToLong(&radarIdCell); } long trackIdCell = -1; if (!_grid->GetCellValue(i, 1).IsEmpty()) { _grid->GetCellValue(i, 1).ToLong(&trackIdCell); } if (radarIdCell == flight._track.radarId() && trackIdCell == flight._track.trackId()) { _grid->DeleteRows(i); _grid->AppendRows(); break; } } } // WxWidgets event table declarations. BEGIN_EVENT_TABLE(TablePanel, wxPanel) EVT_SIZE(TablePanel::OnSize) END_EVENT_TABLE() BEGIN_EVENT_TABLE(TrackPanel, wxPanel) EVT_PAINT(TrackPanel::OnPaint) EVT_SIZE(TrackPanel::OnSize) END_EVENT_TABLE() BEGIN_EVENT_TABLE(AppFrame, wxFrame) EVT_MENU(ID_Quit, AppFrame::OnQuit) END_EVENT_TABLE()
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #ifndef NETWORK_INTERFACE_H #define NETWORK_INTERFACE_H #include <vector> #include <dds/dds.hpp> #include "../Generated/AirTrafficControl.hpp" class FlightPlanReader; class TrackReader; // ------------------------------------------------------------------------- // // // NetworkInterface: // A class that sets up the DDS interface (the network interface) of this // GUI application, including creating appropriate DDS DataWriters, DDS // DataReaders, and all other DDS objects. // // In this example, the GUI is only subscribing to data, so this class creates // two DDS DataReaders and no DDS DataWriters. // // ------------------------------------------------------------------------- // class NetworkInterface { public: // --- Constructor --- // The constructor creates all the necessary DDS objects (in this case, // a DomainParticipant, a Subscriber, and objects wrapping two DDS // DataReaders.) This also configures the XML QoS configuration files that // should be used by the application. NetworkInterface(std::vector<std::string> qosFileNames); // --- Destructor --- ~NetworkInterface(); // --- Getter for the flight plan reader --- // Accessor for the object that receives flight plans from the network FlightPlanReader* GetFlightPlanReader() { return _flightPlanReader; } // --- Getter for the track reader --- // Accessor for the object that receives track updates from the network TrackReader* GetTrackReader() { return _trackReader; } private: // --- Private members --- // Flight plan receiver specific to this application FlightPlanReader* _flightPlanReader; // Track receiver specific to this application TrackReader* _trackReader; }; // ------------------------------------------------------------------------- // // // FlightPlanReader: // A wrapper for a DDS DataReader, that receives flight plan data, leaves it // in the middleware queue, and queries the flight plan when a track updates. // // ------------------------------------------------------------------------- // class FlightPlanReader { public: // --- Constructor --- // Subscribes to flight plan information FlightPlanReader( NetworkInterface* app, const std::string& qosLibrary, const std::string& qosProfile); // --- Destructor --- ~FlightPlanReader(); // --- Wake up the reader thread if it is waiting on data --- void NotifyWakeup(); // --- Retrieve flight plan --- // This example is not being notified when new flight plans arrive, and // instead queries the middleware for a particular flight plan update // when it is interested in it. It queries the middleware queue by // flight ID. void GetFlightPlan( const char* flightId, com::atc::generated::FlightPlan* plan); private: // --- Private members --- // Contains all the components needed to create the DataReader NetworkInterface* _app; // The DDS DataReader of flight plans dds::sub::DataReader<com::atc::generated::FlightPlan> _fpReader = dds::core::null; ; // The mechanisms that cause a thread to wait until flight plan data // becomes available, and to be woken up when the data arrives dds::core::cond::WaitSet _waitSet; dds::core::cond::GuardCondition _shutDownNotifyCondition; }; // ------------------------------------------------------------------------- // // // TrackReader: // A wrapper for a DDS DataReader, that blocks an application thread, waiting // to receive notifications of track data. // // ------------------------------------------------------------------------- // class TrackReader { public: // --- Constructor --- // Subscribes to flight plan information TrackReader( NetworkInterface* app, const std::string& qosLibrary, const std::string& qosProfile); // --- Destructor --- ~TrackReader(); // --- Waiting for tracks --- // This waits for new tracks to become available, and notifies the // application that there are new tracks or deleted tracks. void WaitForTracks( std::vector<com::atc::generated::Track>& tracksUpdated, std::vector<com::atc::generated::Track>& tracksDeleted); // --- Retreiving current track updates --- // This retrieves track updates from the middleware queue. This is used // to poll for all the current track updates from the middleware. This // keeps a second vector that includes all tracks that have been deleted. void GetCurrentTracks( std::vector<com::atc::generated::Track>& tracksUpdated, std::vector<com::atc::generated::Track>& tracksDeleted); // --- Wake up the reader thread if it is waiting on data --- void NotifyWakeup(); private: // --- Private members --- // Contains all the components needed to create the DataReader NetworkInterface* _app; // The DDS DataReader of tracks dds::sub::DataReader<com::atc::generated::Track> _reader = dds::core::null; // The mechanisms that cause a thread to wait until flight plan data // becomes available, and to be woken up when the data arrives dds::core::cond::WaitSet _waitset; dds::core::cond::GuardCondition _shutDownNotifyCondition; dds::core::cond::StatusCondition* status_cond; }; #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/TrackGUI.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #ifndef TRACK_GUI_H #define TRACK_GUI_H #include <string.h> #include <vector> #include <map> // Must be inclued before wxWidgets headers #include "NetworkInterface.h" #include "TrackPresenter.h" #include "FlightInfo.h" #include "wx/setup.h" #include "wx/wx.h" #include "wx/dcbuffer.h" #include "wx/grid.h" #include "wx/splitter.h" #include "shapefil.h" #include "proj_api.h" class FlightInfoNetworkReceiver; // ------------------------------------------------------------------------- // // // TrackPanel: // A class that draws a map, and aircraft positions on a wxWidgets panel // // ------------------------------------------------------------------------- // class TrackPanel : public wxPanel { public: // --- Constructor and Destructor --- TrackPanel( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, std::string filePath); ~TrackPanel(); // --- Update the position of a point (aircraft) --- void UpdatePoint(long trackId, wxRealPoint point); // --- Add/Update the position of a point (aircraft) --- // // If the point already exists, update its position. If it does not, add // a new point to the list. void AddOrUpdatePoint(long trackId, wxRealPoint point); // --- Delete a point (aircraft) --- void DeletePoint(long trackId); // --- Paint events for drawing aircraft movement --- void OnPaint(wxPaintEvent& paintEvt); void OnSize(wxSizeEvent& event); // --- Draw a circle around a radius of SFO --- void DrawRadarCircleSFO(wxBufferedPaintDC& dc); // --- Translate from lat/long to window position --- void CalculateCoordinateForWindowSize(); // --- Clear the lists of points of the map --- void ClearPointsLists(); // --- Decide the max and minimum lat/long or UTM in the view --- void CalculateGeoMinMax(); // --- Convert between lat/long values and UTM values --- // The map is in UTM, so must do a conversion between lat/long and UTM void ConvertLatLongToUTM( double* northing, double* easting, double latitude, double longitude); // --- Convert between lat/long or UTM values and window points --- void ConvertMapCoordToWindow( wxRealPoint* coord, wxRealPoint latLong, double maxX, double maxY, double minX, double minY, int windowSizeX, int windowSizeY); // --- Calculate point representing 80 KM from SFO --- // Have chosen the radius around SFO as 80KM. This is hard-coded // for the example. void Calculate80KmNorthFromSFO(wxRealPoint* latLong); // --- Private members --- // Mutex for handling multi-threaded access to the GUI drawing // OSMutex *_mutex; // The shape objects read from a shapefile that are used to draw a map std::vector<SHPObject*> _shapeObjects; // The points where each aircraft is currently located, in window // coordinates std::map<long, wxPoint> _trackPoints; // The points representing the geometry of the map, in window coordinates std::vector<wxPointList*> _pointsLists; // Maximum X/Y values of the map double _minX, _minY, _maxX, _maxY; // Information about the projection used for the map projPJ _latlongProjection; projPJ _mercatorProjection; // Handle to the shapes within the shapefile SHPHandle _handle; // wxWidgets macro for events DECLARE_EVENT_TABLE() }; // ------------------------------------------------------------------------- // // // TablePanel: // A class that fills in a table panel with information about tracks and flight // plan data, such as expected arrival time. // // ------------------------------------------------------------------------- // class TablePanel : public wxPanel { public: // --- Constructor and Destructor --- TablePanel( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size); ~TablePanel(); // --- Size event --- void OnSize(wxSizeEvent& event); // --- Quit event --- void OnQuit(wxCommandEvent& event); // --- Grid update methods --- void PrepareUpdate() { _grid->BeginBatch(); } void UpdateComplete() { _grid->EndBatch(); } void UpdateRow(const FlightInfo& track); void DeleteRow(const FlightInfo& track); void AddPoint(wxRealPoint point); private: // --- Private members --- wxGrid* _grid; // wxWidgets macro for events DECLARE_EVENT_TABLE() }; // ------------------------------------------------------------------------- // // // AppFrame: // Application window frame that contains the TrackPanel and the TablePanel. // // ------------------------------------------------------------------------- // class AppFrame : public wxFrame { public: // --- Constructor and Destructor --- --- AppFrame( TrackApp* app, const wxString& title, const wxPoint& pos, const wxSize& size, std::string filePath); ~AppFrame(); // --- Accessor for panels --- TrackPanel* GetTrackPanel() { return _panel; } TablePanel* GetTablePanel() { return _tablePanel; } // --- Accessor for TrackApp --- TrackApp* GetApp() { return _app; } // --- Size event --- void OnSize(wxSizeEvent& event); // --- Quit event --- void OnQuit(wxCommandEvent& event); private: // --- Private members --- TrackPanel* _panel; TablePanel* _tablePanel; TrackApp* _app; // wxWidgets macro for events DECLARE_EVENT_TABLE() }; // ------------------------------------------------------------------------- // // // TrackViewListener: // This listener class is installed on the TrackPresenter, and it updates the // Track view UI whenever the presenter calls it back to announce that there // is a new update of track data. This causes the track viewer to refresh its // view and repaint. // // ------------------------------------------------------------------------- // class TrackViewListener : public FlightInfoListener { public: // --- Constructor --- TrackViewListener(TrackPanel* panel) { _panel = panel; } // --- Callback to update track data when it changes --- // This accesses the track drawing panel and notifies the panel // that the points have been updated. This also forces it to // redraw. virtual bool TrackUpdate(const std::vector<FlightInfo*> flights); // --- Callback to delete track data when it changes --- virtual bool TrackDelete(const std::vector<FlightInfo*> flights); private: // --- Private members --- TrackPanel* _panel; }; class TablePanelListener : public FlightInfoListener { public: // --- Constructor --- TablePanelListener(TablePanel* panel) { _panel = panel; } // --- Callback to update track data when it changes --- // This accesses the track grid panel and notifies the panel // that the track data have been updated. This also forces it to // redraw. virtual bool TrackUpdate(const std::vector<FlightInfo*> flights); // --- Callback to delete track data when it changes --- virtual bool TrackDelete(const std::vector<FlightInfo*> flights); private: // --- Private members --- TablePanel* _panel; }; #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/TrackPresenter.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #ifndef TRACK_PRESENTER_H #define TRACK_PRESENTER_H #include <vector> #include "FlightInfo.h" // ------------------------------------------------------------------------- // // // Classes that are used to present data from the network interface to the // application. This is the connection between what happens in the network // and the UI. // // ------------------------------------------------------------------------- // class TrackApp; // class OSMutex; // ------------------------------------------------------------------------- // // // Listener interface for classes that will receive updates from the // presentation classes, and will notify the UI that it needs to update. // ------------------------------------------------------------------------- // class FlightInfoListener { public: virtual bool TrackUpdate(const std::vector<FlightInfo*> flights) = 0; virtual bool TrackDelete(const std::vector<FlightInfo*> flights) = 0; virtual ~FlightInfoListener() { } }; // ------------------------------------------------------------------------- // // // FlightInfoNetworkReceiver: // The model in this case is stored in the middleware, so this class is the // presenter of a Model-View-Presenter pattern. This receives notifications // of changes to the model - when track data arrives. // // This notifies the view of updates to the model by using TrackListeners // // ------------------------------------------------------------------------- // class FlightInfoNetworkReceiver { public: // --- Constructor and destructor --- FlightInfoNetworkReceiver(TrackApp* parent); ~FlightInfoNetworkReceiver(); // --- Create thread for receiving --- // Creates a new thread that will call ReceiveTracks() void StartReceiving(); // --- Check for receipt of track data --- // // This loops until the application is shutting down, and checks for // updates to track data. If there is new track data, it notifies // any listeners (observers) that the track information has been // updated. static void* ReceiveTracks(void* param); // --- Add or remove listeners --- // Adds a listener that will be notified of track updates void AddListener(FlightInfoListener* listener) { _listeners.push_back(listener); } // Removes a listener that will no longer be notified of track updates void RemoveListener(const FlightInfoListener* listener); // --- Notify listeners of track state updates --- void NotifyListenersUpdateTrack(const std::vector<FlightInfo*> flights); void NotifyListenersDeleteTrack(const std::vector<FlightInfo*> flights); // --- Is shutting down? --- bool IsShuttingDown() const { return _shuttingDown; } private: // --- Private methods --- // Convert from network formats of data to the formats expected by the // GUI that uses the data. static void PrepareUpdate( TrackApp* app, std::vector<com::atc::generated::Track> updateData, std::vector<FlightInfo*>* flightData); // --- Private members --- bool _shuttingDown; TrackApp* _app; std::vector<FlightInfoListener*> _listeners; }; #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/NetworkInterface.cxx
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #include "NetworkInterface.h" // ---------------------------------------------------------------------------- // This creates the NetworkInterface object. // The NetworkInterface is comprised of: // 1) One DDSCommunicator object - which is responsible for creating all // objects that may be shared by multiple DataWriters and DataReaders - // essentially all the objects that are (usually) created only once, // regardless of how many data streams the application is sending or // receiving. // The objects that are (usually) created once generally include: // 1) DomainParticipant objects. Typically an application has only one, // unless it must communicate in multiple domains. // 2) Publisher and/or Subscriber. Typically an application has at most // one of each. // 3) Topics. A topic with a particular name may be created only once per // DomainParticipant, and can be shared between multiple DataWriters // and DataReaders. // 4) Types. These must be registered and unregistered exactly once with // the DomainParticipant. // 2) Any DataWriters and DataReaders that comprise the network interface // of the application. NetworkInterface::NetworkInterface(std::vector<std::string> qosFileNames) { // This creates the DomainParticpant, the first step in creating a DDS // application. This starts the discovery process. rti::core::QosProviderParams provider_name; provider_name.url_profile(qosFileNames); dds::core::QosProvider::Default().extensions().default_provider_params( provider_name); dds::core::QosProvider::Default()->default_profile( com::atc::generated::QOS_LIBRARY + "::" + com::atc::generated::QOS_PROFILE_RADAR_HIGH_THROUGHPUT); dds::domain::DomainParticipant participant(0); // Create the DataReader that receives flight plan data. The profiles // that are passed in define how the application will receive data, // and how much data will be kept by the middleware. Look at the // associated XML files for details. (Profile names are constant // strings pre-defined in the .idl file) _flightPlanReader = new FlightPlanReader( this, com::atc::generated::QOS_LIBRARY, com::atc::generated::QOS_PROFILE_FLIGHT_PLAN); // Create the DataReader that receives track data. The profiles // that are passed in define how the application will receive data, // and how much data will be kept by the middleware. Look at the // associated XML files for details. (Profile names are constant // strings pre-defined in the .idl file) _trackReader = new TrackReader( this, com::atc::generated::QOS_LIBRARY, com::atc::generated::QOS_PROFILE_RADAR_HIGH_THROUGHPUT); } // ---------------------------------------------------------------------------- // Destructor for the network interface. This deletes the readers, and the // communicator. Notice that the DDS-specific cleanup code is in the // destructors of the individual reader and communicator objects. NetworkInterface::~NetworkInterface() { // Wake the reader up in case it is waiting for data _trackReader->NotifyWakeup(); _flightPlanReader->NotifyWakeup(); delete _flightPlanReader; delete _trackReader; } // ---------------------------------------------------------------------------- // Creating the FlightPlanReader object. // This creates the DDS DataReader object that receives flight plan data over // one or more transports, and makes it available to the application. When the // DataReader object is first created, it starts the discovery process. The // DataReader will start to receive data from DataWriters that are: // 1) In the same domain // 2) Have the same topic // 3) Have compatible types // 4) Have compatible QoS // as soon as the discovery process has completed. FlightPlanReader::FlightPlanReader( NetworkInterface* app, // Subscriber *sub, const std::string& qosLibrary, const std::string& qosProfile) { if (app == NULL) { std::stringstream errss; errss << "FlightPlanReader(): bad parameter \"app\""; throw errss.str(); } _app = app; dds::domain::DomainParticipant participant = dds::domain::find(0); // Creating a Topic // The topic object is the description of the data that you will be // sending. It associates a particular data type with a name that // describes the meaning of the data. Along with the data types, and // whether your application is reading or writing particular data, this // is the data interface of your application. // This topic has the name AIRCRAFT_FLIGHT_PLAN_TOPIC - a constant string // that is defined in the .idl file. (It is not required that you define // your topic name in IDL, but it is a best practice for ensuring the data // interface of an application is all defined in one place. // Generally you can register all topics and types up-front if // necessary. auto topic = dds::topic::Topic<com::atc::generated::FlightPlan>( participant, com::atc::generated::AIRCRAFT_FLIGHT_PLAN_TOPIC); // Creating a DataReader // This DataReader will receive the flight plan, and will store that flight // plan data in the middleware's queue to be queried by the application dds::sub::qos::DataReaderQos qos = dds::core::QosProvider::Default()->datareader_qos( qosLibrary + "::" + qosProfile); _fpReader = dds::sub::DataReader<com::atc::generated::FlightPlan>( dds::sub::Subscriber(participant), topic, qos); // Use this guard condition to wake up the thread waiting for data to // notify it that the application is being shut down. _waitSet += _shutDownNotifyCondition; // Use this status condition to wake up the thread when data becomes // available dds::core::cond::StatusCondition status_cond(_fpReader); status_cond.enabled_statuses(dds::core::status::StatusMask( dds::core::status::StatusMask::data_available())); _waitSet += status_cond; } // ---------------------------------------------------------------------------- // Destroying the FlightPlanReader. FlightPlanReader::~FlightPlanReader() { } // ---------------------------------------------------------------------------- // This call: // 1) Queries the queue for flight plan data for flights with the ID equal to // flightId // 2) Copies the value of a single flight plan into the the object that is // passed in. Due to the QoS settings, we know this has a history depth // of one, so only the latest flight plan information will be in the // DataReader's queue. void FlightPlanReader::GetFlightPlan( const char* flightId, com::atc::generated::FlightPlan* plan) { // Create a placeholder with only the key field filled in. This will be // used to retrieve the flight plan instance (if it exists). com::atc::generated::FlightPlan flightPlan; flightPlan.flightId(flightId); // Look up the particular instance dds::core::InstanceHandle handle = _fpReader.lookup_instance(flightPlan); // Not having a flight plan associated with this radar track is a normal // case in this example application. In a real-world application you may // want to throw an exception or return an error in the case where a flight // appears that has no associated flight plan. if (handle.is_nil()) { return; } // Reading just the data for the flight plan we are interested in dds::sub::LoanedSamples<com::atc::generated::FlightPlan> samples = _fpReader.select().instance(handle).read(); for (dds::sub::LoanedSamples<com::atc::generated::FlightPlan>::iterator sample_it = samples.begin(); sample_it != samples.end(); ++sample_it) { if (sample_it->info().valid()) { *plan = sample_it->data(); } } } // ---------------------------------------------------------------------------- // This wakes up the WaitSet for the FlightPlan DataReader, in case it is being // used to wait until data is available. This is used when shutting down to // ensure that a thread that is querying data from the middleware will be woken // up to shut down nicely. void FlightPlanReader::NotifyWakeup() { _shutDownNotifyCondition.trigger_value(true); //->set_trigger_value(true); } // ---------------------------------------------------------------------------- // Creating the TrackReader object. // This creates the DDS DataReader object that receives track data over one or // more transports, and makes it available to the application. When the // DataReader object is first created, it starts the discovery process. The // DataReader will start to receive data from DataWriters that are: // 1) In the same domain // 2) Have the same topic // 3) Have compatible types // 4) Have compatible QoS // as soon as the discovery process has completed. TrackReader::TrackReader( NetworkInterface* app, // Subscriber *sub, const std::string& qosLibrary, const std::string& qosProfile) { dds::domain::DomainParticipant participant = dds::domain::find(0); if (participant == dds::core::null) { participant = dds::domain::DomainParticipant(0); } // Creating a Topic // The topic object is the description of the data that you will be // sending. It associates a particular data type with a name that // describes the meaning of the data. Along with the data types, and // whether your application is reading or writing particular data, this // is the data interface of your application. // This topic has the name AIRCRAFT_FLIGHT_PLAN_TOPIC - a constant string // that is defined in the .idl file. (It is not required that you define // your topic name in IDL, but it is a best practice for ensuring the data // interface of an application is all defined in one place. // Generally you can register all topics and types up-front if // necessary. auto topic = dds::topic::Topic<com::atc::generated::Track>( participant, com::atc::generated::AIR_TRACK_TOPIC); // Creating a DataReader // This DataReader will receive the track data, and will make it available // for the application to query (read) or remove (take) from the reader's // queue dds::sub::qos::DataReaderQos qos = dds::core::QosProvider::Default()->datareader_qos( qosLibrary + "::" + qosProfile); _reader = dds::sub::DataReader<com::atc::generated::Track>( dds::sub::Subscriber(participant), topic, qos); // Use this status condition to wake up the thread when data becomes // available status_cond = new dds::core::cond::StatusCondition(_reader); status_cond->enabled_statuses(dds::core::status::StatusMask( dds::core::status::StatusMask::data_available())); _waitset += *status_cond; // Use this guard condition to wake up the thread waiting for data to // notify it that the application is being shut down. _waitset += _shutDownNotifyCondition; } // ---------------------------------------------------------------------------- // Destroying the TrackReader and the objects that are being used to // access it, such as the WaitSet and conditions. Notice that we call // the DDS API delete_contained_entities() to ensure that all conditions // associated with the DataReader are destroyed. Topics are not destroyed by // this call, because they may be shared across multiple DataReaders and // DataWriters. TrackReader::~TrackReader() { } // ---------------------------------------------------------------------------- // This example is using an application thread to be notified when tracks // arrive. // // In this example, we leave the data from the middleware's queue by calling // read(). We do this to illustrate a case where an object that represents // the flight information (flight plan + track) can be created from data // that remains in the middleware's queue. The middleware is configured // with QoS that allow old updates of track data to be overwritten, so the // queue does not grow forever. // // There are three options for getting data from RTI Connext DDS: // 1. Being notified in the application's thread of data arriving (as here). // This mechanism has slightly higher latency than option #2, but low // latency is not important for this use case. In addition, this is safer // than using option #2, because you do not have to worry about the effect // on the middleware's thread. // 2. Being notified in a listener callback of data arriving. // This has lower latency than using a WaitSet, but is more dangerous // because you have to worry about not blocking the middleware's thread. // 3. Polling for data. // You can call read() or take() at any time to view or remove the data that // is currently in the queue. void TrackReader::WaitForTracks( std::vector<com::atc::generated::Track>& tracksUpdated, std::vector<com::atc::generated::Track>& tracksDeleted) { dds::core::cond::WaitSet::ConditionSeq active_conditions = _waitset.wait(dds::core::Duration::from_millisecs(300)); for (uint32_t i = 0; i < active_conditions.size(); i++) { if (active_conditions[i] == *status_cond) { // This leaves the data in the DataReader's queue. Alternately, can // call take() which will remove it from the queue. Leaving data in // the makes sense in this application for two reasons: // 1) the QoS allows the overwriting of data in the queue // 2) the application wants to always see the latest update of each // instance dds::sub::LoanedSamples<com::atc::generated::Track> samples = _reader.read(); for (dds::sub::LoanedSamples<com::atc::generated::Track>::iterator sample_it = samples.begin(); sample_it != samples.end(); ++sample_it) { // Note, based on the QoS profile (history = keep last, depth = // 1) and the fact that we modeled flights as separate // instances, we can assume there is only one entry per flight. // So if a flight plan for a particular flight has been changed // 10 times, we will only be maintaining the most recent update // to that flight plan in the middleware queue. if (sample_it->info().valid()) { // DdsAutoType<Track> trackType = trackSeq[i]; tracksUpdated.push_back(sample_it->data()); std::cout << "Received: " << sample_it->data() << std::endl; } else if ( sample_it->info().state().instance_state() != dds::sub::status::InstanceState::alive()) { com::atc::generated::Track t; _reader.key_value(t, sample_it->info().instance_handle()); tracksDeleted.push_back(t); } } } } } // ---------------------------------------------------------------------------- // This example is using an application thread to poll for all the existing // track data inside the middleware's queue. // // This goes through two steps: // 1) read() all ALIVE data from the DataReader. These are the updates of all // the flights that have not landed. By calling read() we leave the data in // the queue, and can access it again later if it is not updated. After // reading the data, we return the loan to the DataReader() // 2) take() all the NOT_ALIVE data from the DataReader. These are the updates // of flights that have landed. This removes the deletion notices from the // queue. After taking the data, we return the loan to the DataReader() // void TrackReader::GetCurrentTracks( std::vector<com::atc::generated::Track>& tracksUpdated, std::vector<com::atc::generated::Track>& tracksDeleted) { // This reads all ALIVE track data from the queue. dds::sub::LoanedSamples<com::atc::generated::Track> samples = _reader.select() .state(dds::sub::status::DataState( dds::sub::status::SampleState::any(), dds::sub::status::ViewState::any(), dds::sub::status::InstanceState::alive())) .read(); // Note, based on the QoS profile (history = keep last, depth = 1) and the // fact that we modeled flights as separate instances, we can assume there // is only one entry per flight. So if a flight plan for a particular // flight has been changed 10 times, we will only be maintaining the most // recent update to that flight plan in the middleware queue. for (dds::sub::LoanedSamples<com::atc::generated::Track>::iterator sample_it = samples.begin(); sample_it != samples.end(); ++sample_it) { if (sample_it->info().valid()) { tracksUpdated.push_back(sample_it->data()); } } // Now we access the queue to look for notifications that tracks have been // deleted. We do not leave this in the queue, but remove the deletion // notifications. samples = _reader.select() .state(dds::sub::status::DataState( dds::sub::status::SampleState::any(), dds::sub::status::ViewState::any(), dds::sub::status::InstanceState:: not_alive_no_writers() | dds::sub::status::InstanceState:: not_alive_disposed())) .read(); for (dds::sub::LoanedSamples<com::atc::generated::Track>::iterator sample_it = samples.begin(); sample_it != samples.end(); ++sample_it) { // Note, based on the QoS profile (history = keep last, depth = 1) and // the fact that we modeled flights as separate instances, we can assume // there is only one entry per flight. So if a flight plan for a // particular flight has been changed 10 times, we will only be // maintaining the most recent update to that flight plan in the // middleware queue. if (sample_it->info().state().instance_state() != dds::sub::status::InstanceState::alive()) { com::atc::generated::Track t; _reader.key_value(t, sample_it->info().instance_handle()); tracksDeleted.push_back(t); } } } // ---------------------------------------------------------------------------- // This wakes up the WaitSet for the Track DataReader, in case it is being // used to wait until data is available. This is used when shutting down to // ensure that a thread that is querying data from the middleware will be woken // up to shut down nicely. void TrackReader::NotifyWakeup() { _shutDownNotifyCondition.trigger_value(true); }
cxx
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/src/TrackGui/TrackApp.h
/* * (c) 2021 Copyright, Real-Time Innovations, Inc. (RTI) All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are * subject to this license. The software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the software. */ #ifndef TRACK_APP_H #define TRACK_APP_H #include "NetworkInterface.h" #include "wx/setup.h" #include "wx/wx.h" #include "wx/dcbuffer.h" #include "wx/grid.h" #include "shapefil.h" #include <map> class TrackViewListener; class TablePanelListener; class FlightInfoNetworkReceiver; class AppFrame; class FlightInfoListener; // ------------------------------------------------------------------------- // // // Starting point for a wxWidgets application. // // This creates the frames that are needed for the GUI, (including specifying // the map that is displayed in the track display), creates the network // interface, initializes the listeners that update the display with new // data that has arrived from the network. // // ------------------------------------------------------------------------- // class TrackApp : public wxApp { // --- Handle initialization and shutdown events --- // virtual bool OnInit(); virtual int OnExit(); public: // --- Getter for the network interface --- // // Accessor for the network interface class that has the flight plan // and track reader classes. NetworkInterface* GetNetworkInterface() { return _netInterface; } // --- Getter for the main frame --- // // Returns the main frame of the application AppFrame* GetFrame() { return _frame; } // --- Query for shutdown --- // // Query whether the application is shutting down. The presenter thread // can use this to detect that the application is closing, to shut down // nicely. bool ShuttingDown() { return _shuttingDown; } // --- Set shutdown --- // // Set the application's shutting down state . void SetShuttingDown(bool shutDown) { _shuttingDown = shutDown; } // --- Getter for the presenter --- // // Returns the FlightInfoNetworkReceiver - the "presenter" in a model-view // -presenter pattern. FlightInfoNetworkReceiver* GetPresenter() { return _networkFlightInfoReceiver; } // --- Removes a data source from the application --- // // Called back from the application's windows to remove the data source, // because they are deleted before the application is notified that it is // shutting down. Without this, the data source will have bad pointers // to the windows, and can crash. bool RemoveDataSource(wxPanel* panel); private: // --- Private members --- // This is the interface that receives track data over the all available // transports (such as shared memory or UDP) NetworkInterface* _netInterface; // This is the main frame of the application. AppFrame* _frame; // This queries the network and presents updates to the UI frames using // the two listeners, which update the data belonging to the panels, and // force them to refresh their UI. These classes can be considered the // "presenter" classes in a model-view-presenter model. FlightInfoNetworkReceiver* _networkFlightInfoReceiver; TrackViewListener* _trackViewListener; TablePanelListener* _tablePanelListener; // This maps from panels to listeners, and is used to detach the listeners // from the panels because the panels are deleted by the wxWidgets // framework befor the application is notified of shutdown. std::map<wxPanel*, FlightInfoListener*> _dataSources; // Used to tell the presentation layer that the application is shutting // down, so the thread should be cleaned up. bool _shuttingDown; }; #endif
h