Beispiel #1
0
 private void SetFlag(ref Win32.GESTURECONFIG config, int flag, bool on)
 {
     if (on)
     {
         config.dwWant  |= flag;
         config.dwBlock &= ~flag;
     }
     else
     {
         config.dwWant  &= ~flag;
         config.dwBlock |= flag;
     }
 }
Beispiel #2
0
        private void ConfigureGesturesForSubmission()
        {
            // Here is where gesture support is configured.
            int count = 0;

            Win32.GESTURECONFIG[] configs;
            if (mAllGestures.dirty)
            {
                count      = 1;
                configs    = new Win32.GESTURECONFIG[count];
                configs[0] = mAllGestures.config;
            }
            else
            {
                // Go through the gesture configs and count up how many have changed
                if (mPan.dirty)
                {
                    count++;
                }
                if (mZoom.dirty)
                {
                    count++;
                }
                if (mRotate.dirty)
                {
                    count++;
                }
                if (mPressAndTap.dirty)
                {
                    count++;
                }
                if (mTwoFingerTap.dirty)
                {
                    count++;
                }

                // Allocate the array and go through the gesture configs again to assign them
                configs = new Win32.GESTURECONFIG[count];
                int i = 0;
                if (mPan.dirty)
                {
                    configs[i++] = mPan.config;
                }
                if (mZoom.dirty)
                {
                    configs[i++] = mZoom.config;
                }
                if (mRotate.dirty)
                {
                    configs[i++] = mRotate.config;
                }
                if (mPressAndTap.dirty)
                {
                    configs[i++] = mPressAndTap.config;
                }
                if (mTwoFingerTap.dirty)
                {
                    configs[i++] = mTwoFingerTap.config;
                }
            }

            // Set the gesture configs
            bool result = Win32.SetGestureConfig(this.hWnd, 0, count, ref configs, mdGestureConfigSize);

            if (!result)
            {
                throw new Exception("Error in execution of SetGestureConfig");
            }
        }
Beispiel #3
0
        private void ConfigureGesturesForSubmission()
        {
            Win32.GESTURECONFIG[] gestureconfigArray;
            int cIDs = 0;

            if (this.mAllGestures.dirty)
            {
                cIDs = 1;
                gestureconfigArray    = new Win32.GESTURECONFIG[cIDs];
                gestureconfigArray[0] = this.mAllGestures.config;
            }
            else
            {
                if (this.mPan.dirty)
                {
                    cIDs++;
                }
                if (this.mZoom.dirty)
                {
                    cIDs++;
                }
                if (this.mRotate.dirty)
                {
                    cIDs++;
                }
                if (this.mPressAndTap.dirty)
                {
                    cIDs++;
                }
                if (this.mTwoFingerTap.dirty)
                {
                    cIDs++;
                }
                gestureconfigArray = new Win32.GESTURECONFIG[cIDs];
                int num2 = 0;
                if (this.mPan.dirty)
                {
                    gestureconfigArray[num2++] = this.mPan.config;
                }
                if (this.mZoom.dirty)
                {
                    gestureconfigArray[num2++] = this.mZoom.config;
                }
                if (this.mRotate.dirty)
                {
                    gestureconfigArray[num2++] = this.mRotate.config;
                }
                if (this.mPressAndTap.dirty)
                {
                    gestureconfigArray[num2++] = this.mPressAndTap.config;
                }
                if (this.mTwoFingerTap.dirty)
                {
                    gestureconfigArray[num2++] = this.mTwoFingerTap.config;
                }
            }
            if (!Win32.SetGestureConfig(base.hWnd, 0, cIDs, ref gestureconfigArray, this.mdGestureConfigSize))
            {
                throw new Exception("Error in execution of SetGestureConfig");
            }
        }
 private void ConfigureGesturesForSubmission()
 {
     Win32.GESTURECONFIG[] gestureconfigArray;
     int cIDs = 0;
     if (this.mAllGestures.dirty)
     {
         cIDs = 1;
         gestureconfigArray = new Win32.GESTURECONFIG[cIDs];
         gestureconfigArray[0] = this.mAllGestures.config;
     }
     else
     {
         if (this.mPan.dirty)
         {
             cIDs++;
         }
         if (this.mZoom.dirty)
         {
             cIDs++;
         }
         if (this.mRotate.dirty)
         {
             cIDs++;
         }
         if (this.mPressAndTap.dirty)
         {
             cIDs++;
         }
         if (this.mTwoFingerTap.dirty)
         {
             cIDs++;
         }
         gestureconfigArray = new Win32.GESTURECONFIG[cIDs];
         int num2 = 0;
         if (this.mPan.dirty)
         {
             gestureconfigArray[num2++] = this.mPan.config;
         }
         if (this.mZoom.dirty)
         {
             gestureconfigArray[num2++] = this.mZoom.config;
         }
         if (this.mRotate.dirty)
         {
             gestureconfigArray[num2++] = this.mRotate.config;
         }
         if (this.mPressAndTap.dirty)
         {
             gestureconfigArray[num2++] = this.mPressAndTap.config;
         }
         if (this.mTwoFingerTap.dirty)
         {
             gestureconfigArray[num2++] = this.mTwoFingerTap.config;
         }
     }
     if (!Win32.SetGestureConfig(base.hWnd, 0, cIDs, ref gestureconfigArray, this.mdGestureConfigSize))
     {
         throw new Exception("Error in execution of SetGestureConfig");
     }
 }