コード例 #1
0
ファイル: Cursor.cs プロジェクト: plunch/sdlsharp
        public Cursor(SystemCursor id) : this()
        {
            var cursor = ErrorIfInvalid(SDL_CreateSystemCursor(id));

            SetHandle(cursor.handle);
            cursor.SetHandle(IntPtr.Zero);
        }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: tony-jang/NextCapture
        private void OSXCapture_CaptureModeChanged(object sender, CaptureModeChangedEventArgs e)
        {
            switch (e.NewValue)
            {
            case Core.CaptureMode.Unknown:
                if (e.OldValue == Core.CaptureMode.Window)
                {
                    var mw = new MessageWindow(Config.AppName, "Comming soon!");

                    mw.Show();
                    mw.Activate();
                }

                SystemCursor.Show();
                HideDragLayer();
                ClearLayer();
                break;

            case Core.CaptureMode.Drag:
            case Core.CaptureMode.Window:
                SystemCursor.Hide();
                UpdateLayout(MousePosition, MousePosition);
                break;

            case Core.CaptureMode.FullScreen:
                break;
            }
        }
コード例 #3
0
 /// <summary>
 /// Replaces the specified system cursor with the given cursor. The cursor will
 /// be destroyed and as such must not be loaded from a resource. Use CopyCursor
 /// on cursors loaded from resources before calling this method.
 /// </summary>
 public static void SetSystemCursor(CursorHandle cursor, SystemCursor id)
 {
     if (!Imports.SetSystemCursor(cursor, id))
     {
         throw Error.GetExceptionForLastError();
     }
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: tony-jang/NextCapture
        private static void ForceClose()
        {
            MouseHook.UnHook();
            Keyboard.Hook.UnHook();
            SystemCursor.Show();

            Application.ExitThread();
        }
コード例 #5
0
        /// <summary>
        /// Replaces the specified system cursor with the given cursor. The cursor will
        /// be destroyed and as such must not be loaded from a resource. Use CopyCursor
        /// on cursors loaded from resources before calling this method.
        /// </summary>
        public static void SetSystemCursor(CursorHandle cursor, SystemCursor id)
        {
            if (!Imports.SetSystemCursor(cursor, id))
            {
                throw Errors.GetIoExceptionForLastError();
            }

            // SetSystemCursor destroys passed in cursors
            cursor.SetHandleAsInvalid();
        }
コード例 #6
0
ファイル: WindowsCursor.cs プロジェクト: nozgames/noz-windows
        public WindowsCursor(SystemCursor systemCursor)
        {
            switch (systemCursor)
            {
            default:
            case SystemCursor.Arrow:
                Handle = IntPtr.Zero;
                break;

            case SystemCursor.IBeam:
                Handle = Win32.LoadCursor(IntPtr.Zero, (int)Win32.CursorName.IBeam);
                break;
            }
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: tony-jang/NextCapture
        public static void Close()
        {
            if (MouseHook != null)
            {
                MouseHook.UnHook();
                Notify.Visible = false;

                SystemCursor.Show();

                MouseHook = null;
                Notify    = null;
            }

            Application.Exit();
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: tony-jang/NextCapture
        private static void Initialize()
        {
            AppDomain.CurrentDomain.AssemblyResolve    += CurrentDomain_AssemblyResolve;
            AppDomain.CurrentDomain.ProcessExit        += CurrentDomain_ProcessExit;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            Application.ThreadException += Application_ThreadException;
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Dispatcher.Init();
            HotkeyManager.Init();
            SystemCursor.Show();

            LoadAssembly("SharpDX.dll");
            LoadAssembly("SharpDX.Direct3D11.dll");
            LoadAssembly("SharpDX.DXGI.dll");

            ShutterPlayer = new SoundPlayer(Properties.Resources.shutter);

            OSXCapture = new OSXCapture();

            foreach (var engine in OSXCapture.CaptureEngines)
            {
                engine.BeginCapture += ScreenCapture_BeginCapture;
            }

            MouseHook = new MouseHook();
            MouseHook.Hook();

            MouseHook.Filters.Add(OSXCapture);

#if DEBUG
            HotkeyManager.Register("Force_Close", new Hotkey()
            {
                ModifierKey = VKeys.Alt,
                SubKeys     = new[] { VKeys.Escape },
                Action      = new HotKeyEvent((s, e) =>
                {
                    Program.Close();
                    (e as HotkeyEventArgs).Handled = true;
                })
            });
#endif
        }
コード例 #9
0
        public DesktopWindow(string title, uint width, uint height)
        {
            const int centered = Sdl2Native.SDL_WINDOWPOS_CENTERED;

            Sdl2Native.SDL_Init(SDLInitFlags.Video | SDLInitFlags.GameController);
            _window = new Sdl2Window(title,
                                     centered, centered,
                                     (int)width, (int)height,
                                     SDL_WindowFlags.OpenGL,
                                     threadedProcessing: false
                                     );
            SwapchainSource = VeldridStartup.GetSwapchainSource(_window);

            _arrow  = Sdl2Native.SDL_CreateSystemCursor(SDL_SystemCursor.Arrow);
            _hand   = Sdl2Native.SDL_CreateSystemCursor(SDL_SystemCursor.Hand);
            _wait   = Sdl2Native.SDL_CreateSystemCursor(SDL_SystemCursor.Wait);
            _cursor = SystemCursor.Arrow;
        }
コード例 #10
0
 public SystemCursorMode(SystemCursor cursor)
 {
     _cursor = cursor;
 }
コード例 #11
0
ファイル: Cursor.cs プロジェクト: slagusev/HatlessEngine
 /// <summary>
 /// Creates a system cursor.
 /// </summary>
 public Cursor(string id, SystemCursor cursor)
     : this(id)
 {
     IsSystemCursor = true;
     SystemCursor   = cursor;
 }
コード例 #12
0
 public static extern Cursor SDL_CreateSystemCursor(SystemCursor id);
コード例 #13
0
 /// <summary>
 /// Replaces the specified system cursor with the given cursor. The cursor will
 /// be destroyed and as such must not be loaded from a resource. Use CopyCursor
 /// on cursors loaded from resources before calling this method.
 /// </summary>
 public static void SetSystemCursor(CursorHandle cursor, SystemCursor id)
 => Error.ThrowLastErrorIfFalse(Imports.SetSystemCursor(cursor, id));
コード例 #14
0
	public static extern IntPtr LoadCursor(IntPtr hInstcance, SystemCursor hcur);
コード例 #15
0
 public SystemCursorMode(SystemCursor cursor)
 {
     _cursor = cursor;
 }
コード例 #16
0
 public static extern IntPtr LoadCursor(IntPtr hInstcance, SystemCursor hcur);
コード例 #17
0
 void SetCursor(CustomCursor[] customs, SystemCursor system)
 {
     _customs = customs;
     _system  = system;
 }
コード例 #18
0
ファイル: SDLCursor.cs プロジェクト: dthusian/SDLCore
 /// <summary>
 /// Constructs a cursor from a system-defined icon.
 /// </summary>
 /// <param name="cursor">
 /// The cursor to construct
 /// </param>
 public SDLCursor(SystemCursor cursor)
 {
     sdlCursorPtr = SDL.SDL_CreateSystemCursor((SDL.SDL_SystemCursor)cursor);
 }
コード例 #19
0
ファイル: Methods.cs プロジェクト: ehailey1/treehopper-sdk
 public static extern bool SetSystemCursor(IntPtr cursor, SystemCursor id);
コード例 #20
0
 public static IntPtr LoadCursor(IntPtr hInstcance, SystemCursor hcur)
 {
     NotImplemented(MethodBase.GetCurrentMethod());
     return(IntPtr.Zero);
 }
コード例 #21
0
 private static extern IntPtr SDL_CreateSystemCursor(SystemCursor id);
コード例 #22
0
ファイル: API.cs プロジェクト: sulix/opentk-sdl2
		extern public static IntPtr CreateSystemCursor(SystemCursor id);
コード例 #23
0
 internal override void Reset()
 {
     _customs = new CustomCursor[0];
     _system  = Default;
 }
コード例 #24
0
ファイル: SDL2.cs プロジェクト: Drink-WaHaHa/MonoGame-cloned-
 public static IntPtr CreateSystemCursor(SystemCursor id)
 {
     return(GetError(SDL_CreateSystemCursor(id)));
 }
コード例 #25
0
ファイル: mouse.cs プロジェクト: GeorchW/SharpSDL2
 public static extern IntPtr CreateSystemCursor(SystemCursor id);
コード例 #26
0
ファイル: Cursor.cs プロジェクト: villermen/hatless-engine
 /// <summary>
 /// Creates a system cursor.
 /// </summary>
 public Cursor(string id, SystemCursor cursor)
     : this(id, "")
 {
     _isSystemCursor = true;
     _systemCursor = cursor;
 }
コード例 #27
0
 public override Cursor CreateCursor(SystemCursor systemCursor)
 {
     return(_fakeCursor);
 }
コード例 #28
0
 public static IntPtr LoadCursor(IntPtr hInstance, SystemCursor cursor)
 {
     return(LoadCursor(hInstance, new IntPtr((int)cursor)));
 }
コード例 #29
0
 public static extern bool SetSystemCursor(
     CursorHandle hcur,
     SystemCursor id);