~tatokis/unity/gcc-72-errors

« back to all changes in this revision

Viewing changes to unity-shared/PlacesOverlayVScrollBar.h

  • Committer: handsome_feng
  • Date: 2016-01-15 01:41:04 UTC
  • mfrom: (4067 unity)
  • mto: This revision was merged to the branch mainline in revision 4073.
  • Revision ID: 445865575@qq.com-20160115014104-i62hh5373ut0knfu
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2
2
/*
3
 
 * Copyright (C) 2012 Canonical Ltd
 
3
 * Copyright (C) 2012-2015 Canonical Ltd
4
4
 *
5
5
 * This program is free software: you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License version 3 as
15
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
16
 *
17
17
 * Authored by: Brandon Schaefer <brandon.schaefer@canonical.com>
 
18
 *              Marco Trevisan <marco.trevisan@canonical.com>
18
19
 */
19
20
 
20
21
#ifndef PLACES_OVERLAY_VSCROLLBAR_H
27
28
#include <memory>
28
29
 
29
30
#include "unity-shared/PlacesVScrollBar.h"
30
 
#include "unity-shared/VScrollBarOverlayWindow.h"
31
31
 
32
32
namespace unity
33
33
{
46
46
  PlacesOverlayVScrollBar(NUX_FILE_LINE_PROTO);
47
47
  virtual ~PlacesOverlayVScrollBar() {}
48
48
 
49
 
  void PerformPageNavigation(ScrollDir dir);
50
 
 
51
 
protected:
52
 
  void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw);
 
49
  void PerformPageNavigation(ScrollDir);
53
50
 
54
51
private:
55
 
  void OnTrackGeometryChanged(nux::Area* area, nux::Geometry& geo);
56
 
  void OnVisibilityChanged(nux::Area* area, bool visible);
57
 
  void OnSensitivityChanged(nux::Area* area, bool sensitive);
58
 
 
59
 
  void OnMouseEnter(int x, int y, unsigned int button_flags, unsigned int key_flags);
60
 
  void OnMouseLeave(int x, int y, unsigned int button_flags, unsigned int key_flags);
61
 
 
62
 
  void OnMouseNear(nux::Point const& mouse_pos);
63
 
  void OnMouseBeyond(nux::Point const& mouse_pos);
64
 
  void AdjustThumbOffsetFromMouse();
65
 
 
66
 
  void OnMouseClick(int x, int y, unsigned int button_flags, unsigned int key_flags);
67
 
  void LeftMouseClick(int y);
68
 
  void MiddleMouseClick(int y);
69
 
 
70
 
  void OnMouseDown(int x, int y, unsigned int button_flags, unsigned int key_flags);
71
 
  void OnMouseUp(int x, int y, unsigned int button_flags, unsigned int key_flags);
72
 
  void OnMouseMove(int x, int y, int dx, int dy, unsigned int button_flags, unsigned int key_flags);
73
 
  void OnMouseDrag(int x, int y, int dx, int dy, unsigned int button_flags, unsigned int key_flags);
74
 
  void OnMouseWheel(int x, int y, int delta, unsigned long mouse_state, unsigned long key_state);
75
 
 
76
 
  void MouseDraggingOverlay(int y, int dy);
77
 
 
78
 
  bool IsMouseInTopHalfOfThumb(int y);
79
 
  void CheckIfThumbIsInsideSlider();
80
 
 
81
 
  bool IsScrollBarVisible() const;
82
 
 
83
 
  void UpdateConnectorPosition();
84
 
  void ResetConnector();
85
 
 
86
 
  void UpdateStepY();
87
 
 
88
 
  void SetupAnimation(int start, int stop, int milliseconds);
89
 
 
90
 
  void StartScrollAnimation(ScrollDir dir, int stop);
91
 
  void OnScroll(ScrollDir dir, int mouse_dy);
92
 
 
93
 
  void StartConnectorAnimation();
94
 
 
95
 
  void UpdateConnectorTexture();
96
 
 
97
 
  nux::ObjectPtr<VScrollBarOverlayWindow> overlay_window_;
 
52
  void UpdateScrollbarSize();
 
53
  void StartScrollAnimation(ScrollDir, int stop, unsigned duration);
98
54
 
99
55
  class ProximityArea;
100
56
  std::shared_ptr<ProximityArea> area_prox_;
101
57
 
102
58
  nux::animation::AnimateValue<int> animation_;
103
59
  connection::Wrapper tweening_connection_;
104
 
 
105
 
  nux::ObjectPtr<nux::BaseTexture> connector_texture_;
106
 
  
107
 
  bool thumb_above_slider_;
108
 
  int connector_height_;
109
 
  int mouse_down_offset_;
110
60
  int delta_update_;
111
61
 
112
62
  friend class MockScrollBar;