1 /* 2 * Copyright 2006-2009, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _CURSOR_H 6 #define _CURSOR_H 7 8 9 #include <Archivable.h> 10 #include <InterfaceDefs.h> 11 12 13 enum BCursorID { 14 B_CURSOR_ID_SYSTEM_DEFAULT = 1, 15 16 B_CURSOR_ID_CONTEXT_MENU = 3, 17 B_CURSOR_ID_COPY = 4, 18 B_CURSOR_ID_CREATE_LINK = 29, 19 B_CURSOR_ID_CROSS_HAIR = 5, 20 B_CURSOR_ID_FOLLOW_LINK = 6, 21 B_CURSOR_ID_GRAB = 7, 22 B_CURSOR_ID_GRABBING = 8, 23 B_CURSOR_ID_HELP = 9, 24 B_CURSOR_ID_I_BEAM = 2, 25 B_CURSOR_ID_I_BEAM_HORIZONTAL = 10, 26 B_CURSOR_ID_MOVE = 11, 27 B_CURSOR_ID_NO_CURSOR = 12, 28 B_CURSOR_ID_NOT_ALLOWED = 13, 29 B_CURSOR_ID_PROGRESS = 14, 30 B_CURSOR_ID_RESIZE_NORTH = 15, 31 B_CURSOR_ID_RESIZE_EAST = 16, 32 B_CURSOR_ID_RESIZE_SOUTH = 17, 33 B_CURSOR_ID_RESIZE_WEST = 18, 34 B_CURSOR_ID_RESIZE_NORTH_EAST = 19, 35 B_CURSOR_ID_RESIZE_NORTH_WEST = 20, 36 B_CURSOR_ID_RESIZE_SOUTH_EAST = 21, 37 B_CURSOR_ID_RESIZE_SOUTH_WEST = 22, 38 B_CURSOR_ID_RESIZE_NORTH_SOUTH = 23, 39 B_CURSOR_ID_RESIZE_EAST_WEST = 24, 40 B_CURSOR_ID_RESIZE_NORTH_EAST_SOUTH_WEST = 25, 41 B_CURSOR_ID_RESIZE_NORTH_WEST_SOUTH_EAST = 26, 42 B_CURSOR_ID_ZOOM_IN = 27, 43 B_CURSOR_ID_ZOOM_OUT = 28 44 }; 45 46 47 class BCursor : BArchivable { 48 public: 49 BCursor(const void* cursorData); 50 BCursor(const BCursor& other); 51 BCursor(BCursorID id); 52 BCursor(BMessage* data); 53 virtual ~BCursor(); 54 55 virtual status_t Archive(BMessage* archive, 56 bool deep = true) const; 57 static BArchivable* Instantiate(BMessage* archive); 58 59 BCursor& operator=(const BCursor& other); 60 bool operator==(const BCursor& other) const; 61 bool operator!=(const BCursor& other) const; 62 63 private: 64 virtual status_t Perform(perform_code d, void* arg); 65 66 virtual void _ReservedCursor1(); 67 virtual void _ReservedCursor2(); 68 virtual void _ReservedCursor3(); 69 virtual void _ReservedCursor4(); 70 71 void _FreeCursorData(); 72 73 private: 74 friend class BApplication; 75 friend class BView; 76 77 int32 fServerToken; 78 bool fNeedToFree; 79 80 bool _reservedWasPendingViewCursor; 81 // Probably bogus because of padding. 82 uint32 _reserved[6]; 83 }; 84 85 #endif // _CURSOR_H 86