#include <map_widget.h>
Inheritance diagram for MapWidget::

Public Slots | |
| void | setKeeperDirection (AtomicMove::AtomicMoveType direction) | 
| void | setArrows (std::vector< Move > const &arrows) | 
| void | updateDisplay () | 
| void | setVirtualKeeper (const QPoint &position) | 
| void | configChanged () | 
| void | switchToBetterScaling () | 
| void | mouseRepeat () | 
| void | cursorVisible (bool stop_autohide) | 
| void | cursorHidden () | 
Signals | |
| void | fieldClicked (QPoint point) | 
| void | gemMoved (QPoint from, QPoint to) | 
| void | keeperMoved (QPoint from, QPoint to) | 
| void | undo () | 
| void | redo () | 
Public Methods | |
| MapWidget (Map const *map, PixmapProvider *pixmap_provider, Theme const *theme, bool disable_auto_hide, QWidget *parent=0, char const *name=0) | |
| virtual | ~MapWidget () | 
| void | setMap (Map const *map) | 
| void | setPixmapProvider (PixmapProvider *pixmap_provider, Theme const *theme) | 
| AtomicMove::AtomicMoveType | keeperDirection () | 
| QPoint const & | virtualKeeper () const | 
Protected Methods | |
| virtual void | resizeEvent (QResizeEvent *event) | 
| virtual void | contentsMousePressEvent (QMouseEvent *event) | 
| virtual void | contentsMouseMoveEvent (QMouseEvent *event) | 
| virtual void | contentsMouseReleaseEvent (QMouseEvent *event) | 
Private Methods | |
| void | deleteItems (std::vector< QCanvasSprite *> &items) const | 
| void | createItems (std::vector< QCanvasSprite *> &items, int type, QPoint const &position, int x, int y, int z) const | 
| void | createItems (std::vector< QCanvasSprite *> &items, QPoint const &position, int x, int y, int z) const | 
| void | createItems (std::vector< QCanvasSprite *> &items, std::vector< int > image_indices, int x, int y, int z) const | 
| void | placeItems (std::vector< QCanvasSprite *> &items, int x, int y, int z) | 
| void | updateGeometry () | 
| void | deletePixmaps () | 
| void | deleteArrows () | 
| void | addArrow (QPoint from, QPoint to) | 
| void | deleteItems () | 
| void | newItems () | 
| bool | isValidPosition (QPoint position) const | 
| QPoint | getFieldFromPosition (QPoint position) const | 
| void | moveMovingItemPosition (QPoint const &offset) | 
| QCanvasPixmapArray * | createPixmapArray (QPixmap const &pixmap) const | 
Private Attributes | |
| QCanvas | m_canvas | 
| PixmapProvider * | m_pixmap_provider | 
| Theme const * | m_theme | 
| Map const * | m_map | 
| std::vector< int > | m_pieces | 
| int | m_x_offset | 
| int | m_y_offset | 
| int | m_square_size | 
| int | m_map_width | 
| int | m_map_height | 
| int | m_size | 
| bool | m_force_update | 
| bool | m_valid_click | 
| bool | m_in_drag | 
| bool | m_is_keeper_drag | 
| AtomicMove::AtomicMoveType | m_keeper_direction | 
| QPoint | m_click_position | 
| QPoint | m_click_field | 
| QPoint | m_click_offset | 
| QPoint | m_last_mouse_position | 
| QPoint | m_virtual_keeper_pos | 
| std::vector< QCanvasSprite *> | m_virtual_keeper_item | 
| std::vector< QCanvasSprite *> | m_moving_item | 
| std::vector< std::vector< QCanvasSprite *> >  | m_arrow_items | 
| std::vector< std::vector< QCanvasSprite *> >  | m_items | 
| std::vector< QCanvasPixmapArray *> | m_pixmaps | 
| std::vector< Move > | m_arrows | 
| QTimer * | m_timer | 
| QTimer * | m_repeat_timer | 
| int | m_mouse_repeat_state | 
| int | m_mouse_repeat_delay | 
| int | m_mouse_repeat_rate | 
| int | m_scaling_mode | 
| int | m_switch_time | 
| int | m_min_square_size | 
| bool | m_has_scrollbars | 
| bool | m_cursor_hidden | 
| bool | m_auto_hide_cursor | 
| bool | m_disable_auto_hide | 
| int | m_cursor_hide_delay | 
| QTimer * | m_cursor_timer | 
| int | m_virtual_keeper_direction | 
      
  | 
  |||||||||||||||||||||||||||||||||||||||||||
| 
 Creates the widget with the given map. The widget does not takes ownership of the map or the pixmap provider. 
  | 
  
      
  | 
  
| 
 Releasy all resources. 
  | 
  
      
  | 
  |||||||||||||||
| 
 Adds a new arrow. 
 
  | 
  
      
  | 
  
| 
 Call this, when the configuration file was changed. 
  | 
  
      
  | 
  
| 
 Used to let the used move keeper and gems with the mouse. 
  | 
  
      
  | 
  
| 
 Used to let the used move keeper and gems with the mouse. 
  | 
  
      
  | 
  
| 
 Used to let the used move keeper and gems with the mouse. 
  | 
  
      
  | 
  ||||||||||||||||||||||||||||||||||||
| 
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  | 
  
      
  | 
  ||||||||||||||||||||||||||||||||||||
| 
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  | 
  
      
  | 
  |||||||||||||||||||||||||||||||||||||||||||
| 
 Fills the given vector of items. If the vector is not empty, it will be cleared before. 
  | 
  
      
  | 
  
| 
 Creates a QCanvasPixmapArray from a QPixmap. 
 
  | 
  
      
  | 
  
| 
 This is called, if the mouse cursor hide delay expired. 
  | 
  
      
  | 
  
| 
 This is called, if the mouse cursor should be displayed. 
 
  | 
  
      
  | 
  
| 
 Deletes the currently used arrows. 
  | 
  
      
  | 
  
| 
 Deletes the items. 
  | 
  
      
  | 
  
| 
 Deletes the given vector of items. 
 
  | 
  
      
  | 
  
| 
 Deletes the currently used pixmaps. 
  | 
  
      
  | 
  
| 
 This is emitted, whener the user clicks on an field in the map. 
 
  | 
  
      
  | 
  |||||||||||||||
| 
 This is emitted if a gem was dragged. 
 
  | 
  
      
  | 
  
| 
 Converts mouse coordinates to field coordinates. 
 
  | 
  
      
  | 
  
| 
 Returns true, if the given mouse position is valid. 
 
  | 
  
      
  | 
  
| 
 Returns the current direction of the keeper. 
  | 
  
      
  | 
  |||||||||||||||
| 
 This is emitted if a keeper was dragged. 
 
  | 
  
      
  | 
  
| 
 This is called for mouse repeat. 
  | 
  
      
  | 
  
| 
 Moves the moving item. 
 
  | 
  
      
  | 
  
| 
 Make new items. 
  | 
  
      
  | 
  |||||||||||||||||||||||||||||
| 
 Places the items at the given position taking the offset into account and making them visible. 
 
  | 
  
      
  | 
  
| 
 This is emitted when redo was requested. 
  | 
  
      
  | 
  
| 
 Adjustes the size of the pixmaps. 
  | 
  
      
  | 
  
| 
 Sets a vector with arrows for atomic moves. Call updateDisplay() afterwards. 
  | 
  
      
  | 
  
| 
 Sets the direction of the keeper. 
 
  | 
  
      
  | 
  
| 
 Sets a map to display. Note that you have to call updateDisplay() to update the display. All arrows and the virtual keeper will be hidden. 
  | 
  
      
  | 
  |||||||||||||||
| 
 Sets the pixmap provider to use. The old pixmap provider will be deleted! 
  | 
  
      
  | 
  
| 
 Sets the virtual keeper. QPoint(-1,-1) means to hide the virtual keeper. 
  | 
  
      
  | 
  
| 
 This is called, when we should switch to better scaling. 
  | 
  
      
  | 
  
| 
 This is emitted when undo was requested. 
  | 
  
      
  | 
  
| 
 Call to update the display. 
  | 
  
      
  | 
  
| 
 Updates the square size, offsets and so on. 
  | 
  
      
  | 
  
| 
 Returns the position of the virtual keeper (QPoint(-1, -1) means hidden). 
  | 
  
      
  | 
  
| 
 Here we store the arrow items. 
  | 
  
      
  | 
  
| 
 The arrows. 
  | 
  
      
  | 
  
| 
 If true, we automartically hide the cursor. 
  | 
  
      
  | 
  
| 
 The current canvas. 
  | 
  
      
  | 
  
| 
 The field, where the mouse was clicked. 
  | 
  
      
  | 
  
| 
 The offset between the click point and the position of the clicked item. 
  | 
  
      
  | 
  
| 
 The mouse position when we clicked. 
  | 
  
      
  | 
  
| 
 If true, we hide the mouse cursor. 
  | 
  
      
  | 
  
| 
 The cursor hide delay. 
  | 
  
      
  | 
  
| 
 The timer used for mouse cursor hiding. 
  | 
  
      
  | 
  
| 
 If true, we disable auto hide forever. 
  | 
  
      
  | 
  
| 
 This is true, if we force an update. 
  | 
  
      
  | 
  
| 
 If true, we have scrollbars. 
  | 
  
      
  | 
  
| 
 If true, we are in a drag operation. 
  | 
  
      
  | 
  
| 
 If true, we are in a keeper drag operation and else in a gem drag operation. 
  | 
  
      
  | 
  
| 
 The currently used canvas items. 
  | 
  
      
  | 
  
| 
 Here we store the keeper direction. 
  | 
  
      
  | 
  
| 
 The last mouse position. 
  | 
  
      
  | 
  
| 
 The current map. 
  | 
  
      
  | 
  
| 
 The height of the map. 
  | 
  
      
  | 
  
| 
 The width of the map. 
  | 
  
      
  | 
  
| 
 The minimum size of a field. 
  | 
  
      
  | 
  
| 
 The mouse repeat delay in ms. 
  | 
  
      
  | 
  
| 
 The mouse repeat rate. 
  | 
  
      
  | 
  
| 
 The button state for the mouse repeat. 
  | 
  
      
  | 
  
| 
 The item for the moving keeper or gem. 
  | 
  
      
  | 
  
| 
 The currently used piece type. 
  | 
  
      
  | 
  
| 
 The current pixmap provider. 
  | 
  
      
  | 
  
| 
 The pixmaps. 
  | 
  
      
  | 
  
| 
 The timer used for mouse repeat. 
  | 
  
      
  | 
  
| 
 The scaling mode (0 = fast, 1 = good, 2 = timed good). 
  | 
  
      
  | 
  
| 
 m_map_height * m_map_width. 
  | 
  
      
  | 
  
| 
 The size of the squares. 
  | 
  
      
  | 
  
| 
 The time to switch between fast and good scaling. 
  | 
  
      
  | 
  
| 
 The current theme. 
  | 
  
      
  | 
  
| 
 The timer used. 
  | 
  
      
  | 
  
| 
 If true, the click position was valid. 
  | 
  
      
  | 
  
| 
 The current direction of the virtual keeper. 
  | 
  
      
  | 
  
| 
 The item for the virtual keeper. 
  | 
  
      
  | 
  
| 
 The position of the virtual keeper. 
  | 
  
      
  | 
  
| 
 The x-offset. 
  | 
  
      
  | 
  
| 
 The y-offset. 
  | 
  
1.2.9.1 written by Dimitri van Heesch,
 © 1997-2001