// ____ ______ __ // / __ \ / ____// / // / /_/ // / / / // / ____// /___ / /___ PixInsight Class Library // /_/ \____//_____/ PCL 2.4.23 // ---------------------------------------------------------------------------- // pcl/Cursor.h - Released 2022-03-12T18:59:29Z // ---------------------------------------------------------------------------- // This file is part of the PixInsight Class Library (PCL). // PCL is a multiplatform C++ framework for development of PixInsight modules. // // Copyright (c) 2003-2022 Pleiades Astrophoto S.L. All Rights Reserved. // // Redistribution and use in both source and binary forms, with or without // modification, is permitted provided that the following conditions are met: // // 1. All redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. All redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names // of their contributors, may be used to endorse or promote products derived // from this software without specific prior written permission. For written // permission, please contact info@pixinsight.com. // // 4. All products derived from this software, in any form whatsoever, must // reproduce the following acknowledgment in the end-user documentation // and/or other materials provided with the product: // // "This product is based on software from the PixInsight project, developed // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)." // // Alternatively, if that is where third-party acknowledgments normally // appear, this acknowledgment must be reproduced in the product itself. // // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE, // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // ---------------------------------------------------------------------------- #ifndef __PCL_Cursor_h #define __PCL_Cursor_h /// \file pcl/Cursor.h #include #include #include namespace pcl { // ---------------------------------------------------------------------------- /*! * \namespace pcl::StdCursor * \brief Standard cursor shapes available in the PixInsight core application * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StdCursor::NoCursor No cursor is shown
StdCursor::Arrow Standard arrow cursor (pointing left)
StdCursor::InvArrow Inverted arrow cursor (pointing right)
StdCursor::UpArrow Upwards arrow
StdCursor::DownArrow Downwards arrow
StdCursor::LeftArrow Leftwards arrow
StdCursor::RightArrow Rightwards arrow
StdCursor::Checkmark Checkmark (ok) cursor
StdCursor::Crossmark Crossmark (cancel) cursor
StdCursor::Accept Arrow + checkmark
StdCursor::Reject Arrow + crossmark
StdCursor::Add Arrow + plus sign
StdCursor::Copy Arrow + square
StdCursor::Cross Crosshair
StdCursor::Hourglass Hourglass (native Windows wait cursor)
StdCursor::Watch Watch (native Macintosh wait cursor)
StdCursor::Wait Default wait cursor (same as StdCursor::Watch)
StdCursor::ArrowWait Arrow + hourglass/watch
StdCursor::ArrowQuestion Arrow + question mark
StdCursor::IBeam I-beam cursor (text edition)
StdCursor::VerticalSize Vertical resize
StdCursor::HorizontalSize Horizontal resize
StdCursor::ForwardDiagonalSize Forward diagonal resize (/)
StdCursor::BackwardDiagonalSize Backward diagonal resize (\\)
StdCursor::SizeAll Resize in all directions
StdCursor::VerticalSplit Split vertical
StdCursor::HorizontalSplit Split horizontal
StdCursor::Hand Pointing hand cursor
StdCursor::PointingHand Pointing hand cursor (same as StdCursor::Hand)
StdCursor::OpenHand Open hand cursor (used to inform about dragging operations)
StdCursor::ClosedHand Closed hand cursor (used during active dragging operations)
StdCursor::SquarePlus Plus sign into a square (used for zooming in)
StdCursor::SquareMinus Minus sign into a square (used for zooming out)
StdCursor::CirclePlus Plus sign into a circle (used for zooming in)
StdCursor::CircleMinus Minus sign into a circle (used for zooming out)
StdCursor::Forbidden Stop cursor
*/ namespace StdCursor { enum value_type { NoCursor, // no cursor is shown Arrow, // standard arrow cursor (pointing left) InvArrow, // inverted arrow cursor (pointing right) UpArrow, // upwards arrow DownArrow, // downwards arrow LeftArrow, // leftwards arrow RightArrow, // rightwards arrow Checkmark, // checkmark (ok) cursor Crossmark, // crossmark (cancel) cursor Accept, // arrow + checkmark Reject, // arrow + crossmark Add, // arrow + plus sign Copy, // arrow + square Cross, // crosshair Hourglass, // hourglass (native Windows wait cursor) Watch, // watch (native Macintosh wait cursor) Wait = Watch, // wait cursor: we like the watch! :) ArrowWait, // arrow + hourglass/watch ArrowQuestion, // arrow + question mark IBeam, // I-beam cursor (text edition) VerticalSize, // vertical resize HorizontalSize, // horizontal resize ForwardDiagonalSize, // forward diagonal resize (/) BackwardDiagonalSize, // backward diagonal resize (\) SizeAll, // resize in all directions VerticalSplit, // split vertical HorizontalSplit, // split horizontal Hand, // pointing hand cursor PointingHand = Hand, // pointing hand cursor (same as Hand) OpenHand, // open hand cursor ClosedHand, // closed hand cursor SquarePlus, // plus sign into a square (used for zoom in) SquareMinus, // minus sign into a square (used for zoom out) CirclePlus, // plus sign into a circle (used for zoom in) CircleMinus, // minus sign into a circle (used for zoom out) Forbidden // stop cursor }; } // ---------------------------------------------------------------------------- #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION class Bitmap; // ---------------------------------------------------------------------------- /*! * \class Cursor * \brief Client-side interface to a PixInsight %Cursor object * * ### TODO: Write a detailed description for %Cursor. */ class PCL_CLASS Cursor : public UIObject { public: /*! * Represents a standard cursor shape. */ typedef StdCursor::value_type std_cursor; /*! * Constructs a %Cursor object with the specified standard cursor \a shape. */ Cursor( std_cursor shape = StdCursor::Arrow ); /*! * Constructs a %Cursor object with the specified \a bmp shape and * hot spot coordinates \a hotSpot. */ Cursor( const Bitmap& bmp, const pcl::Point& hotSpot ); /*! * Constructs a %Cursor object with the specified \a bmp shape and * hot spot coordinates \a hotSpotX and \a hotSpotY. */ Cursor( const Bitmap& bmp, int hotSpotX = 0, int hotSpotY = 0 ); /*! * Copy constructor. This object will reference the same server-side cursor * as the specified instance \a c. */ Cursor( const Cursor& c ) : UIObject( c ) { } /*! * Move constructor. */ Cursor( Cursor&& x ) : UIObject( std::move( x ) ) { } /*! * Destroys a %Cursor object. If this object references an existing cursor * in the PixInsight core application, its reference count is decremented. * If it becomes unreferenced, it will be garbage-collected. */ virtual ~Cursor() { } /*! * Copy assignment operator. Returns a reference to this object. * * Makes this object reference the same server-side cursor as the specified * instance \a c. If the previous cursor becomes unreferenced, it will be * garbage-collected by the PixInsight core application. */ Cursor& operator =( const Cursor& c ) { SetHandle( c.handle ); return *this; } /*! * Move assignment operator. Returns a reference to this object. */ Cursor& operator =( Cursor&& x ) { Transfer( x ); return *this; } /*! * Returns a reference to a null cursor. A null %Cursor object does * not correspond to an existing cursor object in the PixInsight core * application. */ static Cursor& Null(); /*! * Returns the hot spot coordinates of this %Cursor object. * * The hot spot is the active point of the cursor. It is used by * the operating system to calculate the current cursor position. Hot spot * coordinates are given relative to the upper left corner of the cursor's * shape bitmap. */ pcl::Point HotSpot() const; /*! * Returns the current cursor position in global coordinates. */ static pcl::Point Position(); /*! * Sets the current cursor position to the specified \a x and \a y global * coordinates. */ static void SetPosition( int x, int y ); /*! * Sets the current cursor position in global coordinates. * * This function is equivalent to SetPosition( pos.x, pos.y ). */ static void SetPosition( const pcl::Point& pos ) { SetPosition( pos.x, pos.y ); } private: Cursor( void* h ) : UIObject( h ) { } void* CloneHandle() const override; friend class Control; }; // ---------------------------------------------------------------------------- #endif // __PCL_BUILDING_PIXINSIGHT_APPLICATION } // pcl #endif // __PCL_Cursor_h // ---------------------------------------------------------------------------- // EOF pcl/Cursor.h - Released 2022-03-12T18:59:29Z