/// <summary>
        /// Initializes a new instance of the <see cref="PICAColorSpaceSuite"/> class.
        /// </summary>
        /// <param name="zstringSuite">The ASZString suite.</param>
        /// <param name="colorPicker">The color picker.</param>
        /// <exception cref="ArgumentNullException"><paramref name="zstringSuite"/> is null.</exception>
        public PICAColorSpaceSuite(IASZStringSuite zstringSuite, IColorPicker colorPicker)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }
            if (colorPicker == null)
            {
                throw new ArgumentNullException(nameof(colorPicker));
            }

            csMake                = new CSMake(Make);
            csDelete              = new CSDelete(Delete);
            csStuffComponent      = new CSStuffComponents(StuffComponents);
            csExtractComponent    = new CSExtractComponents(ExtractComponents);
            csStuffXYZ            = new CSStuffXYZ(StuffXYZ);
            csExtractXYZ          = new CSExtractXYZ(ExtractXYZ);
            csConvert8            = new CSConvert8(Convert8);
            csConvert16           = new CSConvert16(Convert16);
            csGetNativeSpace      = new CSGetNativeSpace(GetNativeSpace);
            csIsBookColor         = new CSIsBookColor(IsBookColor);
            csExtractColorName    = new CSExtractColorName(ExtractColorName);
            csPickColor           = new CSPickColor(PickColor);
            csConvert8to16        = new CSConvert(Convert8to16);
            csConvert16to8        = new CSConvert(Convert16to8);
            csConvertToMonitorRGB = new CSConvertToMonitorRGB(ConvertToMonitorRGB);

            colors            = new Dictionary <IntPtr, Color>(IntPtrEqualityComparer.Instance);
            colorsIndex       = 0;
            lookup16To8       = null;
            lookup8To16       = null;
            this.zstringSuite = zstringSuite;
            this.colorPicker  = colorPicker;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PICAColorSpaceSuite"/> class.
        /// </summary>
        /// <param name="zstringSuite">The ASZString suite.</param>
        public unsafe PICAColorSpaceSuite(IASZStringSuite zstringSuite)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }

            csMake                = new CSMake(Make);
            csDelete              = new CSDelete(Delete);
            csStuffComponent      = new CSStuffComponents(StuffComponents);
            csExtractComponent    = new CSExtractComponents(ExtractComponents);
            csStuffXYZ            = new CSStuffXYZ(StuffXYZ);
            csExtractXYZ          = new CSExtractXYZ(ExtractXYZ);
            csConvert8            = new CSConvert8(Convert8);
            csConvert16           = new CSConvert16(Convert16);
            csGetNativeSpace      = new CSGetNativeSpace(GetNativeSpace);
            csIsBookColor         = new CSIsBookColor(IsBookColor);
            csExtractColorName    = new CSExtractColorName(ExtractColorName);
            csPickColor           = new CSPickColor(PickColor);
            csConvert8to16        = new CSConvert(Convert8to16);
            csConvert16to8        = new CSConvert(Convert16to8);
            csConvertToMonitorRGB = new CSConvertToMonitorRGB(ConvertToMonitorRGB);
            this.zstringSuite     = zstringSuite;
            colors                = new Dictionary <ColorID, Color>();
            colorsIndex           = 0;
            lookup16To8           = null;
            lookup8To16           = null;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ActionListSuite"/> class.
        /// </summary>
        /// <param name="actionReferenceSuite">The action reference suite instance.</param>
        /// <param name="zstringSuite">The ASZString suite instance.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="actionReferenceSuite"/> is null.
        /// or
        /// <paramref name="zstringSuite"/> is null.
        /// </exception>
        public ActionListSuite(IActionReferenceSuite actionReferenceSuite, IASZStringSuite zstringSuite)
        {
            if (actionReferenceSuite == null)
            {
                throw new ArgumentNullException(nameof(actionReferenceSuite));
            }
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }

            make            = new ActionListMake(Make);
            free            = new ActionListFree(Free);
            getType         = new ActionListGetType(GetType);
            getCount        = new ActionListGetCount(GetCount);
            putInteger      = new ActionListPutInteger(PutInteger);
            putFloat        = new ActionListPutFloat(PutFloat);
            putUnitFloat    = new ActionListPutUnitFloat(PutUnitFloat);
            putString       = new ActionListPutString(PutString);
            putBoolean      = new ActionListPutBoolean(PutBoolean);
            putList         = new ActionListPutList(PutList);
            putObject       = new ActionListPutObject(PutObject);
            putGlobalObject = new ActionListPutGlobalObject(PutGlobalObject);
            putEnumerated   = new ActionListPutEnumerated(PutEnumerated);
            putReference    = new ActionListPutReference(PutReference);
            putClass        = new ActionListPutClass(PutClass);
            putGlobalClass  = new ActionListPutGlobalClass(PutGlobalClass);
            putAlias        = new ActionListPutAlias(PutAlias);
            putIntegers     = new ActionListPutIntegers(PutIntegers);
            putData         = new ActionListPutData(PutData);
            putZString      = new ActionListPutZString(PutZString);
            getInteger      = new ActionListGetInteger(GetInteger);
            getFloat        = new ActionListGetFloat(GetFloat);
            getUnitFloat    = new ActionListGetUnitFloat(GetUnitFloat);
            getStringLength = new ActionListGetStringLength(GetStringLength);
            getString       = new ActionListGetString(GetString);
            getBoolean      = new ActionListGetBoolean(GetBoolean);
            getList         = new ActionListGetList(GetList);
            getObject       = new ActionListGetObject(GetObject);
            getGlobalObject = new ActionListGetGlobalObject(GetGlobalObject);
            getEnumerated   = new ActionListGetEnumerated(GetEnumerated);
            getReference    = new ActionListGetReference(GetReference);
            getClass        = new ActionListGetClass(GetClass);
            getGlobalClass  = new ActionListGetGlobalClass(GetGlobalClass);
            getAlias        = new ActionListGetAlias(GetAlias);
            getIntegers     = new ActionListGetIntegers(GetIntegers);
            getDataLength   = new ActionListGetDataLength(GetDataLength);
            getData         = new ActionListGetData(GetData);
            getZString      = new ActionListGetZString(GetZString);

            actionDescriptorSuite     = null;
            this.actionReferenceSuite = actionReferenceSuite;
            this.zstringSuite         = zstringSuite;

            actionLists      = new Dictionary <IntPtr, ActionListItemCollection>(IntPtrEqualityComparer.Instance);
            actionListsIndex = 0;
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ErrorSuite"/> class.
        /// </summary>
        /// <param name="zstringSuite">The ASZString suite instance.</param>
        /// <exception cref="ArgumentNullException"><paramref name="zstringSuite"/> is null.</exception>
        public ErrorSuite(IASZStringSuite zstringSuite)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }

            setErrorFromPString = new ErrorSuiteSetErrorFromPString(SetErrorFromPString);
            setErrorFromCString = new ErrorSuiteSetErrorFromCString(SetErrorFromCString);
            setErrorFromZString = new ErrorSuiteSetErrorFromZString(SetErrorFromZString);
            this.zstringSuite   = zstringSuite;
            errorMessage        = null;
        }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PICAUIHooksSuite"/> class.
        /// </summary>
        /// <param name="parentWindowHandle">The parent window handle.</param>
        /// <param name="name">The plug-in name.</param>
        /// <param name="zstringSuite">The ASZString suite.</param>
        /// <exception cref="ArgumentNullException"><paramref name="zstringSuite"/> is null.</exception>
        public PICAUIHooksSuite(IntPtr parentWindowHandle, string name, IASZStringSuite zstringSuite)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }

            hwnd              = parentWindowHandle;
            pluginName        = name ?? string.Empty;
            uiWindowHandle    = new UISuiteMainWindowHandle(MainWindowHandle);
            uiSetCursor       = new UISuiteHostSetCursor(HostSetCursor);
            uiTickCount       = new UISuiteHostTickCount(HostTickCount);
            uiPluginName      = new UISuiteGetPluginName(GetPluginName);
            this.zstringSuite = zstringSuite;
        }
Beispiel #6
0
        /// <summary>
        /// Creates the action list suite.
        /// </summary>
        /// <param name="zstringSuite">The ASZString suite instance.</param>
        /// <exception cref="ArgumentNullException"><paramref name="zstringSuite"/> is null.</exception>
        /// <exception cref="ObjectDisposedException">The class has been disposed.</exception>
        public void CreateListSuite(IASZStringSuite zstringSuite)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }
            if (disposed)
            {
                throw new ObjectDisposedException(nameof(ActionSuiteProvider));
            }

            if (!ListSuiteCreated)
            {
                if (!ReferenceSuiteCreated)
                {
                    CreateReferenceSuite();
                }

                actionListSuite = new ActionListSuite(actionReferenceSuite, zstringSuite);
            }
        }
Beispiel #7
0
        /// <summary>
        /// Creates the action descriptor suite.
        /// </summary>
        /// <param name="aete">The AETE scripting information.</param>
        /// <param name="descriptorHandle">The descriptor handle.</param>
        /// <param name="scriptingData">The scripting data.</param>
        /// <param name="zstringSuite">The ASZString suite instance.</param>
        /// <exception cref="ArgumentNullException"><paramref name="zstringSuite"/> is null.</exception>
        /// <exception cref="ObjectDisposedException">The class has been disposed.</exception>
        public void CreateDescriptorSuite(PluginAETE aete, IntPtr descriptorHandle, Dictionary <uint, AETEValue> scriptingData, IASZStringSuite zstringSuite)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }
            if (disposed)
            {
                throw new ObjectDisposedException(nameof(ActionSuiteProvider));
            }

            if (!DescriptorSuiteCreated)
            {
                if (!ReferenceSuiteCreated)
                {
                    CreateReferenceSuite();
                }
                if (!ListSuiteCreated)
                {
                    CreateListSuite(zstringSuite);
                }
                actionDescriptorSuite = new ActionDescriptorSuite(aete, actionListSuite, actionReferenceSuite, zstringSuite);
                actionListSuite.ActionDescriptorSuite = actionDescriptorSuite;
                if (scriptingData != null)
                {
                    actionDescriptorSuite.SetScriptingData(descriptorHandle, scriptingData);
                }
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ActionDescriptorSuite"/> class.
        /// </summary>
        /// <param name="aete">The AETE scripting information.</param>
        /// <param name="actionListSuite">The action list suite instance.</param>
        /// <param name="actionReferenceSuite">The action reference suite instance.</param>
        /// <param name="zstringSuite">The ASZString suite instance.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="actionListSuite"/> is null.
        /// or
        /// <paramref name="actionReferenceSuite"/> is null.
        /// or
        /// <paramref name="zstringSuite"/> is null.
        /// </exception>
        public ActionDescriptorSuite(PluginAETE aete, IActionListSuite actionListSuite, IActionReferenceSuite actionReferenceSuite,
                                     IASZStringSuite zstringSuite)
        {
            if (actionListSuite == null)
            {
                throw new ArgumentNullException(nameof(actionListSuite));
            }
            if (actionReferenceSuite == null)
            {
                throw new ArgumentNullException(nameof(actionReferenceSuite));
            }
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }

            make = new ActionDescriptorMake(Make);
            free = new ActionDescriptorFree(Free);
            handleToDescriptor = new ActionDescriptorHandleToDescriptor(HandleToDescriptor);
            asHandle           = new ActionDescriptorAsHandle(AsHandle);
            getType            = new ActionDescriptorGetType(GetType);
            getKey             = new ActionDescriptorGetKey(GetKey);
            hasKey             = new ActionDescriptorHasKey(HasKey);
            getCount           = new ActionDescriptorGetCount(GetCount);
            isEqual            = new ActionDescriptorIsEqual(IsEqual);
            erase           = new ActionDescriptorErase(Erase);
            clear           = new ActionDescriptorClear(Clear);
            hasKeys         = new ActionDescriptorHasKeys(HasKeys);
            putInteger      = new ActionDescriptorPutInteger(PutInteger);
            putFloat        = new ActionDescriptorPutFloat(PutFloat);
            putUnitFloat    = new ActionDescriptorPutUnitFloat(PutUnitFloat);
            putString       = new ActionDescriptorPutString(PutString);
            putBoolean      = new ActionDescriptorPutBoolean(PutBoolean);
            putList         = new ActionDescriptorPutList(PutList);
            putObject       = new ActionDescriptorPutObject(PutObject);
            putGlobalObject = new ActionDescriptorPutGlobalObject(PutGlobalObject);
            putEnumerated   = new ActionDescriptorPutEnumerated(PutEnumerated);
            putReference    = new ActionDescriptorPutReference(PutReference);
            putClass        = new ActionDescriptorPutClass(PutClass);
            putGlobalClass  = new ActionDescriptorPutGlobalClass(PutGlobalClass);
            putAlias        = new ActionDescriptorPutAlias(PutAlias);
            putIntegers     = new ActionDescriptorPutIntegers(PutIntegers);
            putZString      = new ActionDescriptorPutZString(PutZString);
            putData         = new ActionDescriptorPutData(PutData);
            getInteger      = new ActionDescriptorGetInteger(GetInteger);
            getFloat        = new ActionDescriptorGetFloat(GetFloat);
            getUnitFloat    = new ActionDescriptorGetUnitFloat(GetUnitFloat);
            getStringLength = new ActionDescriptorGetStringLength(GetStringLength);
            getString       = new ActionDescriptorGetString(GetString);
            getBoolean      = new ActionDescriptorGetBoolean(GetBoolean);
            getList         = new ActionDescriptorGetList(GetList);
            getObject       = new ActionDescriptorGetObject(GetObject);
            getGlobalObject = new ActionDescriptorGetGlobalObject(GetGlobalObject);
            getEnumerated   = new ActionDescriptorGetEnumerated(GetEnumerated);
            getReference    = new ActionDescriptorGetReference(GetReference);
            getClass        = new ActionDescriptorGetClass(GetClass);
            getGlobalClass  = new ActionDescriptorGetGlobalClass(GetGlobalClass);
            getAlias        = new ActionDescriptorGetAlias(GetAlias);
            getIntegers     = new ActionDescriptorGetIntegers(GetIntegers);
            getZString      = new ActionDescriptorGetZString(GetZString);
            getDataLength   = new ActionDescriptorGetDataLength(GetDataLength);
            getData         = new ActionDescriptorGetData(GetData);

            this.aete                 = aete;
            this.actionListSuite      = actionListSuite;
            this.actionReferenceSuite = actionReferenceSuite;
            this.zstringSuite         = zstringSuite;
            actionDescriptors         = new Dictionary <IntPtr, ScriptingParameters>(IntPtrEqualityComparer.Instance);
            descriptorHandles         = new Dictionary <IntPtr, ScriptingParameters>(IntPtrEqualityComparer.Instance);
            actionDescriptorsIndex    = 0;
            HandleSuite.Instance.SuiteHandleDisposed += SuiteHandleDisposed;
            disposed = false;
        }