123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566 |
- //
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2015 Autodesk, Inc. All rights reserved.
- //
- // Use of this software is subject to the terms of the Autodesk license
- // agreement provided at the time of installation or download, or which
- // otherwise accompanies this software in either electronic or hard copy form.
- //
- //////////////////////////////////////////////////////////////////////////////
- //
- // Name: core_rxmfcapi.h
- //
- //////////////////////////////////////////////////////////////////////////////
- #ifndef AD_CORE_RXMFCAPI_H
- #define AD_CORE_RXMFCAPI_H 1
- #pragma pack (push, 8)
- #include "AcCoreDefs.h"
- #include "AcHeapOpers.h"
- class AcCommandToolTipInfo;
- struct AcColorSettings {
- /* Solid background color for various contexts */
- DWORD dwGfxModelBkColor;
- DWORD dwGfxLayoutBkColor;
- DWORD dwPaperBkColor;
- DWORD dwParallelBkColor;
- DWORD dwBEditBkColor;
- DWORD dwCmdLineBkColor;
- DWORD dwPlotPrevBkColor;
- /* Background color for 3D perspective projection */
- DWORD dwSkyGradientZenithColor;
- DWORD dwSkyGradientHorizonColor;
- DWORD dwGroundGradientOriginColor;
- DWORD dwGroundGradientHorizonColor;
- DWORD dwEarthGradientAzimuthColor;
- DWORD dwEarthGradientHorizonColor;
- /* Crosshair color for various contexts */
- DWORD dwModelCrossHairColor;
- DWORD dwLayoutCrossHairColor;
- DWORD dwParallelCrossHairColor;
- DWORD dwPerspectiveCrossHairColor;
- DWORD dwBEditCrossHairColor;
- /* Ground plane grid major lines for various contexts */
- DWORD dwParallelGridMajorLines;
- DWORD dwPerspectiveGridMajorLines;
- /* Ground plane grid minor lines for various contexts */
- DWORD dwParallelGridMinorLines;
- DWORD dwPerspectiveGridMinorLines;
- /* Ground plane grid axis lines for various contexts */
- DWORD dwParallelGridAxisLines;
- DWORD dwPerspectiveGridAxisLines;
- /* Text window color */
- DWORD dwTextForeColor, dwTextBkColor;
- /* Command line text color */
- DWORD dwCmdLineForeColor;
- DWORD dwCmdLineTempPromptBkColor;
- DWORD dwCmdLineTempPromptTextColor;
- DWORD dwCmdLineCmdOptKeywordColor;
- DWORD dwCmdLineCmdOptBkColor;
- DWORD dwCmdLineCmdOptHighlightedColor;
- /* AutoTrack vector color for various contexts */
- // Note: dwAutoTrackingVecColor indicates autotrack vector color in model space.
- // We didn't change its name to dwModelATrackVecColor because that might break
- // existing arx app.
- DWORD dwAutoTrackingVecColor;
- DWORD dwLayoutATrackVecColor;
- DWORD dwParallelATrackVecColor;
- DWORD dwPerspectiveATrackVecColor;
- DWORD dwBEditATrackVecColor;
- /* Autosnap Marker color for various contexts */
- DWORD dwModelASnapMarkerColor;
- DWORD dwLayoutASnapMarkerColor;
- DWORD dwParallelASnapMarkerColor;
- DWORD dwPerspectiveASnapMarkerColor;
- DWORD dwBEditASnapMarkerColor;
-
- /* Drafting Tool tip color for various contexts */
- DWORD dwModelDftingTooltipColor;
- DWORD dwLayoutDftingTooltipColor;
- DWORD dwParallelDftingTooltipColor;
- DWORD dwPerspectiveDftingTooltipColor;
- DWORD dwBEditDftingTooltipColor;
-
- /* Drafting Tool tip background color for various contexts */
- DWORD dwModelDftingTooltipBkColor;
- DWORD dwLayoutDftingTooltipBkColor;
- DWORD dwParallelDftingTooltipBkColor;
- DWORD dwPerspectiveDftingTooltipBkColor;
- DWORD dwBEditDftingTooltipBkColor;
- /* Light glyphs color for various contexts */
- DWORD dwModelLightGlyphs;
- DWORD dwLayoutLightGlyphs;
- DWORD dwParallelLightGlyphs;
- DWORD dwPerspectiveLightGlyphs;
- DWORD dwBEditLightGlyphs;
- /* Light Hotspot color for various contexts */
- DWORD dwModelLightHotspot;
- DWORD dwLayoutLightHotspot;
- DWORD dwParallelLightHotspot;
- DWORD dwPerspectiveLightHotspot;
- DWORD dwBEditLightHotspot;
- /* Light Falloff color for various contexts */
- DWORD dwModelLightFalloff;
- DWORD dwLayoutLightFalloff;
- DWORD dwParallelLightFalloff;
- DWORD dwPerspectiveLightFalloff;
- DWORD dwBEditLightFalloff;
- /* Light start limit color for various contexts */
- DWORD dwModelLightStartLimit;
- DWORD dwLayoutLightStartLimit;
- DWORD dwParallelLightStartLimit;
- DWORD dwPerspectiveLightStartLimit;
- DWORD dwBEditLightStartLimit;
- /* Light end limit color for various contexts */
- DWORD dwModelLightEndLimit;
- DWORD dwLayoutLightEndLimit;
- DWORD dwParallelLightEndLimit;
- DWORD dwPerspectiveLightEndLimit;
- DWORD dwBEditLightEndLimit;
- /* Camera glyphs color for various contexts */
- DWORD dwModelCameraGlyphs;
- DWORD dwLayoutCameraGlyphs;
- DWORD dwParallelCameraGlyphs;
- DWORD dwPerspectiveCameraGlyphs;
- /* Camera frustrum plane color for various contexts */
- DWORD dwModelCameraFrustrum;
- DWORD dwLayoutCameraFrustrum;
- DWORD dwParallelCameraFrustrum;
- DWORD dwPerspectiveCameraFrustrum;
- /* Camera clipping plane color for various contexts */
- DWORD dwModelCameraClipping;
- DWORD dwLayoutCameraClipping;
- DWORD dwParallelCameraClipping;
- DWORD dwPerspectiveCameraClipping;
- /* Flags - set if true */
- /* Flags for use tint X, Y, Z for crosshair */
- int nModelCrosshairUseTintXYZ;
- int nLayoutCrosshairUseTintXYZ;
- int nParallelCrosshairUseTintXYZ;
- int nPerspectiveCrosshairUseTintXYZ;
- int nBEditCrossHairUseTintXYZ;
- /* Flags for use tint X, Y, Z for AutoTrack Vector */
- int nModelATrackVecUseTintXYZ;
- int nLayoutATrackVecUseTintXYZ;
- int nParallelATrackVecUseTintXYZ;
- int nPerspectiveATrackVecUseTintXYZ;
- int nBEditATrackVecUseTintXYZ;
- /* Flags for use tint X, Y, Z for Drafting Tooltip Bk tint */
- int nModelDftingTooltipBkUseTintXYZ;
- int nLayoutDftingTooltipBkUseTintXYZ;
- int nParallelDftingTooltipBkUseTintXYZ;
- int nPerspectiveDftingTooltipBkUseTintXYZ;
- int nBEditDftingTooltipBkUseTintXYZ;
- /* Flags for use tint X, Y, Z for Ground plane grid major lines */
- int nParallelGridMajorLineTintXYZ;
- int nPerspectiveGridMajorLineTintXYZ;
- /* Flags for use tint X, Y, Z for Ground plane grid minor lines */
- int nParallelGridMinorLineTintXYZ;
- int nPerspectiveGridMinorLineTintXYZ;
- /* Flags for use tint X, Y, Z for Ground plane grid axis lines */
- int nParallelGridAxisLineTintXYZ;
- int nPerspectiveGridAxisLineTintXYZ;
- };
- // AutoCAD windows' colors
- BOOL acedGetCurrentColors(AcColorSettings* pColorSettings);
- BOOL acedSetCurrentColors(AcColorSettings* pColorSettings);
- BOOL acedGetSystemColors(AcColorSettings* pColorSettings);
- // More color settings.
- struct AcColorSettingsEx
- {
- // Light Web color for various contexts
- DWORD dwModelLightWeb;
- DWORD dwLayoutLightWeb;
- DWORD dwParallelLightWeb;
- DWORD dwPerspectiveLightWeb;
- DWORD dwBEditLightWeb;
- // Light Web(missingfile) color for various contexts
- DWORD dwModelLightWebMissingFile;
- DWORD dwLayoutLightWebMissingFile;
- DWORD dwParallelLightWebMissingFile;
- DWORD dwPerspectiveLightWebMissingFile;
- DWORD dwBEditLightWebMissingFile;
- // Light Web shape(extend source) color for various contexts
- DWORD dwModelLightWebShape;
- DWORD dwLayoutLightWebShape;
- DWORD dwParallelLightWebShape;
- DWORD dwPerspectiveLightWebShape;
- DWORD dwBEditLightWebShape;
- // Light Web lux at distance color for various contexts
- DWORD dwModelLightWebLuxAtDist;
- DWORD dwLayoutLightWebLuxAtDist;
- DWORD dwParallelLightWebLuxAtDist;
- DWORD dwPerspectiveLightWebLuxAtDist;
- DWORD dwBEditLightWebLuxAtDist;
- /* Block editor constraints colors */
- DWORD dwBEditUnconstrainedColor;
- DWORD dwBEditPartiallyConstrainedColor;
- DWORD dwBEditFullyConstrainedColor;
- DWORD dwBEditOverConstrainedColor;
- };
- // AutoCAD windows' colors
- BOOL acedGetCurrentColorsEx(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx);
- BOOL acedSetCurrentColorsEx(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx);
- BOOL acedGetSystemColorsEx(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx);
- // More and More color settings.
- struct AcColorSettingsEx2
- {
- /* Ground plane grid major lines for various contexts */
- DWORD dw2DModelGridMajorLines;
- DWORD dwLayoutGridMajorLines;
- DWORD dwBEditGridMajorLines;
- /* Ground plane grid minor lines for various contexts */
- DWORD dw2DModelGridMinorLines;
- DWORD dwLayoutGridMinorLines;
- DWORD dwBEditGridMinorLines;
- /* Ground plane grid axis lines for various contexts */
- DWORD dw2DModelGridAxisLines;
- DWORD dwLayoutGridAxisLines;
- DWORD dwBEditGridAxisLines;
- /* Dynamic Dimension Line color for various contexts */
- DWORD dwModelDynamicDimensionLineColor;
- DWORD dwLayoutDynamicDimensionLineColor;
- DWORD dwParallelDynamicDimensionLineColor;
- DWORD dwPerspectiveDynamicDimensionLineColor;
- DWORD dwBEditDynamicDimensionLineColor;
- /* Drafting Tool tip contour color for various contexts */
- DWORD dwModelDftingTooltipContourColor;
- DWORD dwLayoutDftingTooltipContourColor;
- DWORD dwParallelDftingTooltipContourColor;
- DWORD dwPerspectiveDftingTooltipContourColor;
- DWORD dwBEditDftingTooltipContourColor;
- /* Flags for use tint X, Y, Z for Ground plane grid major lines */
- int n2DModelGridMajorLineTintXYZ;
- int nLayoutGridMajorLineTintXYZ;
- int nBEditGridMajorLineTintXYZ;
- /* Flags for use tint X, Y, Z for Ground plane grid minor lines */
- int n2DModelGridMinorLineTintXYZ;
- int nLayoutGridMinorLineTintXYZ;
- int nBEditGridMinorLineTintXYZ;
- /* Flags for use tint X, Y, Z for Ground plane grid axis lines */
- int n2DModelGridAxisLineTintXYZ;
- int nLayoutGridAxisLineTintXYZ;
- int nBEditGridAxisLineTintXYZ;
- /* Control vertices hull color for various contexts */
- DWORD dwControlVerticesHullColor;
- };
- // AutoCAD windows' colors
- BOOL acedGetCurrentColorsEx2(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx,
- AcColorSettingsEx2* pColorSettingsEx2);
- BOOL acedSetCurrentColorsEx2(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx,
- AcColorSettingsEx2* pColorSettingsEx2);
- BOOL acedGetSystemColorsEx2(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx,
- AcColorSettingsEx2* pColorSettingsEx2);
- // More, more and More color settings
- // AutoCAD 2012
- struct AcColorSettingsEx3
- {
- /* 3d autosnap Marker color for various contexts */
- DWORD dwModel3dASnapMarkerColor;
- DWORD dwLayout3dASnapMarkerColor;
- DWORD dwParallel3dASnapMarkerColor;
- DWORD dwPerspective3dASnapMarkerColor;
- DWORD dwBEdit3dASnapMarkerColor;
- /* Viewport control for various contexts */
- DWORD dw2DModelVportControl;
- DWORD dwParallelVportControl;
- DWORD dwPerspectiveVportControl;
- };
- ACCORE_PORT
- BOOL acedGetCurrentColorsEx3(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx,
- AcColorSettingsEx2* pColorSettingsEx2,
- AcColorSettingsEx3* pColorSettingsEx3);
- ACCORE_PORT
- BOOL acedSetCurrentColorsEx3(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx,
- AcColorSettingsEx2* pColorSettingsEx2,
- AcColorSettingsEx3* pColorSettingsEx3);
- ACCORE_PORT
- BOOL acedGetSystemColorsEx3(AcColorSettings* pColorSettings,
- AcColorSettingsEx* pColorSettingsEx,
- AcColorSettingsEx2* pColorSettingsEx2,
- AcColorSettingsEx3* pColorSettingsEx3);
- /* acedDwgPoint
- * used in acedCoordinate function :
- */
- typedef double acedDwgPoint[3];
- // AutoCAD coordinates and viewports
- /* acedCoordFromPixelToWorld
- * Takes a coordinate in Window's coordinate (mouse coordinate)
- * and converts it to current viewport world coordinate
- */
- void acedCoordFromPixelToWorld(const CPoint &ptIn, acedDwgPoint ptOut);
- /* acedCoordFromPixelToWorld
- * Takes a coordinate in Windows' coordinate (mouse coordinate) and
- * a viewport number; and converts it to current viewport world coordinate
- */
- BOOL acedCoordFromPixelToWorld(int windnum, CPoint ptIn, acedDwgPoint ptOut);
- /* acedCoordFromWorldToPixel
- * Takes a coordinate in AutoCAD world coordinate and a viewport number;
- * and converts it to Windows' coordinate.
- */
- BOOL acedCoordFromWorldToPixel(int windnum, const acedDwgPoint ptIn, CPoint& ptOut);
- // Progress Bar API
- /* acedSetStatusBarProgressMeter
- * Creates a progress meter on AutoCAD status bar.
- * Returns 0 if it successfully creates the label and progress meter.
- * Otherwise -1
- */
- int acedSetStatusBarProgressMeter(const ACHAR* pszLabel, int nMinPos,
- int nMaxPos);
- /* acedSetStatusBarProgressMeter
- * Call this with a positive value within the range specified to set
- * the current position of the status bar.
- * Pass a negative number to add an amount to the current position (relative).
- */
- int acedSetStatusBarProgressMeterPos(int nPos);
- /* acedRestoreStatusBar
- * Resets AutoCAD status bar
- */
- void acedRestoreStatusBar();
- /* acedGetWinNum
- * Takes a Windows' client coordinate and return the viewport number where
- * the point is on
- * Returns 0 for no viewport, 1 if tilemode is off.
- * It's used with acedCoordFromWorldToPixel/acedCoordFromPixelToWorld
- */
- int acedGetWinNum(int ptx, int pty);
- // Define callback function for apps that want windows messages
- typedef void (* AcedWatchWinMsgFn)(const MSG*);
- typedef BOOL (* AcedFilterWinMsgFn)(MSG*);
- typedef void (* AcedOnIdleMsgFn) ();
- typedef void (* AcedOnModalFn) (bool bModal);
- // Windows messages hooks
- /* Register a filter message hook into AutoCAD's Windows message loop.
- * The message passed to your application can be changed and can be blocked out.
- * If the function returns TRUE, the message WON'T be passed to other hook
- * functions or AutoCAD at all. The message is terminated.
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- */
- BOOL acedRegisterFilterWinMsg(const AcedFilterWinMsgFn pfn);
- /* acedRemoveFilterWinMsg
- * Takes a message hook function pointer and remove it
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- */
- BOOL acedRemoveFilterWinMsg(const AcedFilterWinMsgFn pfn);
- /* acedRegisterWatchWinMsg
- * Register a hook function into AutoCAD message loop.
- * The function can only look up AutoCAD's Windows message.
- * It can't change or block message.
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- */
- BOOL acedRegisterWatchWinMsg(const AcedWatchWinMsgFn pfn);
- /* acedRemoveWatchWinMsg
- * Takes a message hook function pointer and remove it
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- *
- */
- BOOL acedRemoveWatchWinMsg(const AcedWatchWinMsgFn pfn);
- /* acedRegisterOnIdleWinMsg
- * Register a hook function to be notified when AutoCAD is on idle
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- */
- BOOL acedRegisterOnIdleWinMsg(const AcedOnIdleMsgFn pfn);
- /* acedRemoveOnIdleWinMsg
- * Takes a message on idle hook function pointer and remove it
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- *
- */
- BOOL acedRemoveOnIdleWinMsg(const AcedOnIdleMsgFn pfn);
- /* acedRegisterOnModal
- * Register a hook function to be notified when AutoCAD displays a modal dialog.
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- */
- BOOL acedRegisterOnModal(const AcedOnModalFn pfn);
- /* acedRemoveOnModal
- * Takes a hook function pointer and removes it
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- *
- */
- BOOL acedRemoveOnModal(const AcedOnModalFn pfn);
- // Defines the callback function that needs to be executed on AutoCAD main thread.
- typedef void (*AcedRunLoopFn)(void* pContext);
- // Defines the data type of the task id
- typedef long long TaskId;
- /* acedExecuteOnMainThread
- * Dispatches a function to be executed on AutoCAD main thread.
- *
- * Returns the task id if bWaitUntilDone == false. Otherwise, the return value is undefined.
- * The task id indicates the order in which the queued tasks will be executed.
- * Given two tasks, the task with the lower task id will be executed first.
- */
- ACCORE_PORT TaskId acedExecuteOnMainThread(const AcedRunLoopFn pfn, void* pContext, bool bWaitUntilDone = false);
- // Defines the base type IAcEdRunLoopTask for tasks that can be dispatched and executed on
- // AutoCAD main thread.
- class IAcEdRunLoopTask : public AcHeapOperators
- {
- public:
- virtual ~IAcEdRunLoopTask() {}
- virtual void execute() = 0;
- };
- /* acedExecuteOnMainThread
- * Dispatches a task to be executed on AutoCAD main thread.
- *
- * This function takes the ownership of the pTask instance, and deletes the instance
- * once the task has completed execution on main thread.
- *
- * Returns the task id if bWaitUntilDone = false. Otherwise, the return value is undefined.
- * The task id indicates the order in which the queued tasks will be executed.
- * Given two tasks, the task with the lower task id will be executed first.
- */
- ACCORE_PORT TaskId acedExecuteOnMainThread(IAcEdRunLoopTask* pTask, bool bWaitUntilDone = false);
- /* acedRemoveRunLoopTask
- * Removes a task that has been queued previously using any variant of the
- * acedExecuteOnMainThread() function.
- *
- */
- ACCORE_PORT void acedRemoveRunLoopTask(TaskId taskId);
- /* acedGetAcadResourceInstance()
- * Returns the Instance of AutoCAD's resource
- */
- HINSTANCE acedGetAcadResourceInstance();
- // Define callback function for apps that want bitmap query.
- typedef HBITMAP (* AcedCommandBitmapQueryFn)(const TCHAR* cmdName,
- const COLORREF& backgroundColor);
- /* acedRemoveCommandBitmapQuery
- * Takes a bitmap query hook function pointer and remove it
- * Returns TRUE if successfully removes the hook. Otherwise FALSE.
- *
- */
- ACCORE_PORT BOOL acedRemoveCommandBitmapQuery (const AcedCommandBitmapQueryFn pfn);
- /* acedRegisterCommandBitmapQuery
- * Register a bitmap query function to be notified when AutoCAD queries
- * for a bitmap for a given command.
- * Returns TRUE if successfully registers the hook. Otherwise FALSE.
- */
- ACCORE_PORT BOOL acedRegisterCommandBitmapQuery (const AcedCommandBitmapQueryFn pfn);
- // Currently this is used to query bitmap associated with a command in the AutoComplete
- // Suggestion List pop-up window.
- //
- // By default a bitmap/icon in the CUI menu macro can be associated with a command/sysvar.
- // In the CUI dialog, the 'Command Display Name' property points to a command/sysvar name.
- // This is how to link a bitmap to a command.
- //
- // It's recommended that the bitmap to command association is done thought CUI. If this is
- // not possible or there is a need for override behavior, please use the callback function
- // mentioned above.
- // Note that the name is all in Localized name.
- ACCORE_PORT HBITMAP acedGetBitmapForCommand (const TCHAR* cmdName,
- const COLORREF& backgroundColor);
- ACCORE_PORT HBITMAP acedGetCachedBitmapForCommand (const TCHAR* cmdName,
- const COLORREF& backgroundColor);
- ACCORE_PORT bool acedGetToolTipInfoForCommand( const ACHAR* cmdName
- , AcCommandToolTipInfo* pInfo );
- #pragma pack (pop)
- #endif // AD_CORE_RXMFCAPI_H
|