Mercurial > octave
comparison libgui/graphics/Canvas.h @ 22411:c69805d1fa64
maint: Style check C++ code in libgui/
* Backend.cc, Backend.h, BaseControl.cc, BaseControl.h, ButtonControl.cc,
ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h,
CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h,
ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc,
Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h,
GenericEventNotify.h, KeyMap.cc, KeyMap.h, ListBoxControl.cc, ListBoxControl.h,
Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, MouseModeActionGroup.cc,
MouseModeActionGroup.h, Object.cc, Object.h, ObjectFactory.cc, ObjectFactory.h,
ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc,
PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc,
PushTool.h, QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc,
RadioButtonControl.h, SliderControl.cc, SliderControl.h, TextControl.cc,
TextControl.h, TextEdit.cc, TextEdit.h, ToggleButtonControl.cc,
ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc, ToolBar.h,
ToolBarButton.cc, ToolBarButton.h, __init_qt__.cc, __init_qt__.h,
annotation-dialog.cc, annotation-dialog.h, gl-select.cc, gl-select.h,
color-picker.cc, color-picker.h, dialog.h, documentation-dock-widget.cc,
documentation-dock-widget.h, files-dock-widget.cc, files-dock-widget.h,
find-files-dialog.h, find-files-model.cc, find-files-model.h,
history-dock-widget.cc, history-dock-widget.h, liboctgui-build-info.h,
liboctgui-build-info.in.cc, file-editor-interface.h, file-editor-tab.cc,
file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc,
find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h,
octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h,
octave-cmd.cc, octave-cmd.h, octave-dock-widget.cc, octave-dock-widget.h,
octave-gui.cc, octave-gui.h, octave-interpreter.cc, octave-interpreter.h,
octave-qt-link.cc, octave-qt-link.h, parser.cc, parser.h, webinfo.cc,
webinfo.h, resource-manager.cc, resource-manager.h, settings-dialog.cc,
settings-dialog.h, shortcut-manager.cc, shortcut-manager.h,
terminal-dock-widget.h, thread-manager.cc, thread-manager.h, welcome-wizard.cc,
welcome-wizard.h, workspace-model.cc, workspace-model.h, workspace-view.cc,
workspace-view.h:
Style check C++ code in libgui/
author | Rik <rik@octave.org> |
---|---|
date | Wed, 31 Aug 2016 12:20:46 -0700 |
parents | bac0d6f07a3e |
children | 8758addcf265 |
comparison
equal
deleted
inserted
replaced
22410:bc38c1ff6698 | 22411:c69805d1fa64 |
---|---|
37 class octave_value_list; | 37 class octave_value_list; |
38 | 38 |
39 namespace QtHandles | 39 namespace QtHandles |
40 { | 40 { |
41 | 41 |
42 class Canvas | 42 class Canvas |
43 { | 43 { |
44 public: | 44 public: |
45 enum EventMask | 45 enum EventMask |
46 { | 46 { |
47 KeyPress = 0x01, | 47 KeyPress = 0x01, |
48 KeyRelease = 0x02 | 48 KeyRelease = 0x02 |
49 }; | 49 }; |
50 | 50 |
51 public: | 51 public: |
52 virtual ~Canvas (void) { } | 52 virtual ~Canvas (void) { } |
53 | 53 |
54 void redraw (bool sync = false); | 54 void redraw (bool sync = false); |
55 void blockRedraw (bool block = true); | 55 void blockRedraw (bool block = true); |
56 | 56 |
57 void print (const QString& file_cmd, const QString& term); | 57 void print (const QString& file_cmd, const QString& term); |
58 | 58 |
59 void addEventMask (int m) { m_eventMask |= m; } | 59 void addEventMask (int m) { m_eventMask |= m; } |
60 void clearEventMask (int m) { m_eventMask &= (~m); } | 60 void clearEventMask (int m) { m_eventMask &= (~m); } |
61 void setEventMask (int m) { m_eventMask = m; } | 61 void setEventMask (int m) { m_eventMask = m; } |
62 | 62 |
63 void setCursor (MouseMode mode); | 63 void setCursor (MouseMode mode); |
64 | 64 |
65 virtual QWidget* qWidget (void) = 0; | 65 virtual QWidget* qWidget (void) = 0; |
66 | 66 |
67 static Canvas* create (const std::string& name, QWidget* parent, | 67 static Canvas* create (const std::string& name, QWidget* parent, |
68 const graphics_handle& handle); | 68 const graphics_handle& handle); |
69 | 69 |
70 virtual void toggleAxes (const graphics_handle& handle) = 0; | 70 virtual void toggleAxes (const graphics_handle& handle) = 0; |
71 virtual void toggleGrid (const graphics_handle& handle) = 0; | 71 virtual void toggleGrid (const graphics_handle& handle) = 0; |
72 virtual void autoAxes (const graphics_handle& handle) = 0; | 72 virtual void autoAxes (const graphics_handle& handle) = 0; |
73 | 73 |
74 protected: | 74 protected: |
75 virtual void draw (const graphics_handle& handle) = 0; | 75 virtual void draw (const graphics_handle& handle) = 0; |
76 virtual void drawZoomBox (const QPoint& p1, const QPoint& p2) = 0; | 76 virtual void drawZoomBox (const QPoint& p1, const QPoint& p2) = 0; |
77 virtual void resize (int x, int y, int width, int height) = 0; | 77 virtual void resize (int x, int y, int width, int height) = 0; |
78 virtual graphics_object selectFromAxes (const graphics_object& ax, | 78 virtual graphics_object selectFromAxes (const graphics_object& ax, |
79 const QPoint& pt) = 0; | 79 const QPoint& pt) = 0; |
80 | 80 |
81 protected: | 81 protected: |
82 Canvas (const graphics_handle& handle) | 82 Canvas (const graphics_handle& handle) |
83 : m_handle (handle), | 83 : m_handle (handle), |
84 m_redrawBlocked (false), | 84 m_redrawBlocked (false), |
85 m_mouseMode (NoMode), | 85 m_mouseMode (NoMode), |
86 m_clickMode (false), | 86 m_clickMode (false), |
87 m_eventMask (0), | 87 m_eventMask (0), |
88 m_rectMode (false) | 88 m_rectMode (false) |
89 { } | 89 { } |
90 | 90 |
91 void canvasToggleAxes (const graphics_handle& handle); | 91 void canvasToggleAxes (const graphics_handle& handle); |
92 void canvasToggleGrid (const graphics_handle& handle); | 92 void canvasToggleGrid (const graphics_handle& handle); |
93 void canvasAutoAxes (const graphics_handle& handle); | 93 void canvasAutoAxes (const graphics_handle& handle); |
94 void canvasPaintEvent (void); | 94 void canvasPaintEvent (void); |
95 void canvasMouseDoubleClickEvent (QMouseEvent* event); | 95 void canvasMouseDoubleClickEvent (QMouseEvent* event); |
96 void canvasMouseMoveEvent (QMouseEvent* event); | 96 void canvasMouseMoveEvent (QMouseEvent* event); |
97 void canvasMousePressEvent (QMouseEvent* event); | 97 void canvasMousePressEvent (QMouseEvent* event); |
98 void canvasMouseReleaseEvent (QMouseEvent* event); | 98 void canvasMouseReleaseEvent (QMouseEvent* event); |
99 void canvasWheelEvent (QWheelEvent* event); | 99 void canvasWheelEvent (QWheelEvent* event); |
100 bool canvasKeyPressEvent (QKeyEvent* event); | 100 bool canvasKeyPressEvent (QKeyEvent* event); |
101 bool canvasKeyReleaseEvent (QKeyEvent* event); | 101 bool canvasKeyReleaseEvent (QKeyEvent* event); |
102 | 102 |
103 void updateCurrentPoint (const graphics_object& fig, | 103 void updateCurrentPoint (const graphics_object& fig, |
104 const graphics_object& obj, QMouseEvent *event); | 104 const graphics_object& obj, QMouseEvent *event); |
105 void updateCurrentPoint (const graphics_object& fig, | 105 void updateCurrentPoint (const graphics_object& fig, |
106 const graphics_object& obj); | 106 const graphics_object& obj); |
107 | 107 |
108 void annotation_callback (const octave_value_list& args); | 108 void annotation_callback (const octave_value_list& args); |
109 void select_object (graphics_object obj, QMouseEvent* event, | 109 void select_object (graphics_object obj, QMouseEvent* event, |
110 graphics_object ¤tObj, graphics_object &axesObj, | 110 graphics_object ¤tObj, graphics_object &axesObj, |
111 bool axes_only = false); | 111 bool axes_only = false); |
112 | 112 |
113 private: | 113 private: |
114 graphics_handle m_handle; | 114 graphics_handle m_handle; |
115 bool m_redrawBlocked; | 115 bool m_redrawBlocked; |
116 MouseMode m_mouseMode; | 116 MouseMode m_mouseMode; |
117 bool m_clickMode; // True: ZoomIn, False: ZoomOut | 117 bool m_clickMode; // True: ZoomIn, False: ZoomOut |
118 QPoint m_mouseAnchor; | 118 QPoint m_mouseAnchor; |
119 QPoint m_mouseCurrent; | 119 QPoint m_mouseCurrent; |
120 graphics_handle m_mouseAxes; | 120 graphics_handle m_mouseAxes; |
121 int m_eventMask; | 121 int m_eventMask; |
122 bool m_rectMode; | 122 bool m_rectMode; |
123 }; | 123 }; |
124 | 124 |
125 }; // namespace QtHandles | 125 }; // namespace QtHandles |
126 | 126 |
127 #endif | 127 #endif |
128 |