Beispiel #1
0
        private WContext OpenSystemContext(bool ctrlSysCursor = true)
        {
            WContext context = WInfo.GetDefaultSystemContext();

            if (context == null)
            {
                return(null);
            }
            // Set system cursor if caller wants it.
            if (ctrlSysCursor)
            {
                context.Options |= (uint)ECTXOptionValues.CXO_SYSTEM;
            }
            else
            {
                context.Options &= ~(uint)ECTXOptionValues.CXO_SYSTEM;
            }
            context.Name = "BgoonLibrary Tablet Context";

            deviceID = WInfo.GetDefaultDeviceIndex();
            WintabAxis tabletX = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_X);
            WintabAxis tabletY = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_Y);

            NativeRect = new BRect(tabletX.axMin, tabletY.axMin, tabletX.axMax, tabletY.axMax);

            context.OutOrgX = context.OutOrgY = 0;
            context.OutExtX = (int)(context.OutExtX * OutputExtFactor);
            context.OutExtY = (int)(context.OutExtY * OutputExtFactor);
            //context.OutOrgX = context.OutOrgY = 0;
            //context.OutExtX = MaxPos.x;
            //context.OutExtY = MaxPos.y;

            //context.OutExtY *= -1;
            return(context.Open() ? context : null);
        }
Beispiel #2
0
        private WContext OpenDigitalContext(bool ctrlSysCursor = true)
        {
            WContext context = WInfo.GetDefaultDigitizingContext();

            if (context == null)
            {
                return(null);
            }

            context.Options |= (uint)ECTXOptionValues.CXO_MESSAGES;
            if (ctrlSysCursor)
            {
                context.Options |= (uint)ECTXOptionValues.CXO_SYSTEM;
            }
            context.Name = "BgoonLibrary Tablet Context";

            deviceID = WInfo.GetDefaultDeviceIndex();
            WintabAxis tabletX = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_X);
            WintabAxis tabletY = WInfo.GetDeviceAxis(deviceID, EAxisDimension.AXIS_Y);

            NativeRect = new BRect(tabletX.axMin, tabletX.axMax, tabletY.axMin, tabletY.axMax);

            context.OutOrgX = context.OutOrgY = 0;
            context.OutExtX = (int)(context.OutExtX * OutputExtFactor);
            context.OutExtY = (int)(context.OutExtY * OutputExtFactor);

            //context.OutExtY *= -1;

            return(context.Open() ? context : null);
        }
Beispiel #3
0
        private void UpdateSometime()
        {
            if (!IsRunning)
            {
                return;
            }

            maxNormalPressure  = WInfo.GetMaxPressure(true);
            maxTangentPressure = WInfo.GetMaxPressure(false);
            displaySize        = new Vector2(
                SystemInformation.VirtualScreen.Width,
                SystemInformation.VirtualScreen.Height);
            if (context != null)
            {
                inputRect  = new BRect(context.InOrgX, context.InOrgY, context.InExtX, context.InExtY);
                outputRect = new BRect(context.OutOrgX, context.OutOrgY, context.OutExtX, context.OutExtY);
                systemRect = new BRect(context.SysOrgX, context.SysOrgY, context.SysExtX, context.SysExtY);
            }
        }
Beispiel #4
0
 public void Reduce(BRect source)
 {
     if (xMin < source.xMin)
     {
         xMin = source.xMin;
     }
     if (xMax > source.xMax)
     {
         xMax = source.xMax;
     }
     if (yMax > source.yMax)
     {
         yMax = source.yMax;
     }
     if (yMin < source.yMin)
     {
         yMin = source.yMin;
     }
 }
Beispiel #5
0
 public void Extend(BRect source)
 {
     if (xMin > source.xMin)
     {
         xMin = source.xMin;
     }
     if (xMax < source.xMax)
     {
         xMax = source.xMax;
     }
     if (yMax < source.yMax)
     {
         yMax = source.yMax;
     }
     if (yMin > source.yMin)
     {
         yMin = source.yMin;
     }
 }