annotate libgui/graphics/Canvas.cc @ 24534:194eb4bd202b

maint: Update punctuation for GPL v3 license text. * COPYING, Makefile.am, README, bootstrap, bootstrap.conf, OctJavaQry.java, changelog.tmpl, check-subst-vars.in.sh, find-defun-files.sh, find-files-with-tests.sh, get-source-mtime.sh, mk-hg-id.sh, mk-octave-config-h.sh, mk-opts.pl, stl_algo.h-fixed, subst-config-vals.in.sh, subst-cross-config-vals.in.sh, subst-default-vals.in.sh, subst-script-vals.in.sh, configure.ac, Doxyfile.in, arith.txi, audio.txi, basics.txi, bugs.txi, config-images.sh, container.txi, cp-idx.txi, data.txi, debug.txi, diagperm.txi, diffeq.txi, add_to_aspell_dict, mk_undocumented_list, spellcheck, errors.txi, eval.txi, expr.txi, external.txi, fn-idx.txi, func.txi, genpropdoc.m, geometry.txi, geometryimages.m, grammar.txi, gui.txi, image.txi, images.awk, install.txi, interp.txi, interpimages.m, intro.txi, io.txi, linalg.txi, macros.texi, matrix.txi, mk-doc-cache.pl, mkcontrib.awk, mkoctfile.1, munge-texi.pl, nonlin.txi, numbers.txi, obsolete.txi, octave-cli.1, octave-config.1, octave.1, octave.css, octave.texi, oop.txi, op-idx.txi, optim.txi, package.txi, plot.txi, plotimages.m, poly.txi, preface.txi, quad.txi, set.txi, signal.txi, sparse.txi, sparseimages.m, splineimages.m, stats.txi, stmt.txi, strings.txi, system.txi, testfun.txi, var.txi, vectorize.txi, array.texi, bugs.texi, cp-idx.texi, dae.texi, diffeq.texi, error.texi, factor.texi, fn-idx.texi, gpl.texi, install.texi, intro.texi, liboctave.texi, matvec.texi, nleqn.texi, nlfunc.texi, ode.texi, optim.texi, preface.texi, quad.texi, range.texi, refcard-a4.tex, refcard-legal.tex, refcard-letter.tex, refcard.tex, HACKING.md, octave.appdata.xml.in, 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, liboctgui-build-info.h, liboctgui-build-info.in.cc, mk-default-qt-settings.in.sh, QTerminal.cc, QTerminal.h, BlockArray.cpp, BlockArray.h, Character.h, CharacterColor.h, Emulation.cpp, Emulation.h, Filter.cpp, Filter.h, History.cpp, History.h, KeyboardTranslator.cpp, KeyboardTranslator.h, QUnixTerminalImpl.cpp, QUnixTerminalImpl.h, Screen.cpp, Screen.h, ScreenWindow.cpp, ScreenWindow.h, SelfListener.cpp, SelfListener.h, TerminalCharacterDecoder.cpp, TerminalCharacterDecoder.h, TerminalModel.cpp, TerminalModel.h, TerminalView.cpp, TerminalView.h, Vt102Emulation.cpp, Vt102Emulation.h, kpty.cpp, kpty.h, kpty_p.h, QTerminalColors.cpp, QTerminalColors.h, QWinTerminalImpl.cpp, QWinTerminalImpl.h, main.cpp, color-picker.cc, color-picker.h, dialog.cc, dialog.h, documentation-dock-widget.cc, documentation-dock-widget.h, external-editor-interface.cc, external-editor-interface.h, files-dock-widget.cc, files-dock-widget.h, find-files-dialog.cc, find-files-dialog.h, find-files-model.cc, find-files-model.h, history-dock-widget.cc, history-dock-widget.h, 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-qt-link.cc, octave-qt-link.h, octave-settings.h, texinfo-parser.cc, texinfo-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.cc, terminal-dock-widget.h, thread-manager.cc, thread-manager.h, variable-editor-model.cc, variable-editor-model.h, variable-editor.cc, variable-editor.h, welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h, workspace-view.cc, workspace-view.h, build-env.h, build-env.in.cc, builtins.h, Cell.cc, Cell.h, __contourc__.cc, __dsearchn__.cc, __ichol__.cc, __ilu__.cc, __lin_interpn__.cc, __luinc__.cc, __magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, balance.cc, base-text-renderer.h, besselj.cc, betainc.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h, call-stack.cc, call-stack.h, cdisplay.c, cdisplay.h, cellfun.cc, coct-hdf5-types.c, colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, data.h, debug.cc, default-defs.in.h, defaults.cc, defaults.h, defun-dld.h, defun-int.h, defun.cc, defun.h, det.cc, dirfns.cc, dirfns.h, display.cc, display.h, dlmread.cc, dot.cc, dynamic-ld.cc, dynamic-ld.h, eig.cc, ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.cc, errwarn.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h, fft.cc, fft2.cc, fftn.cc, file-io.cc, file-io.h, filter.cc, find.cc, ft-text-renderer.cc, ft-text-renderer.h, gammainc.cc, gcd.cc, genprops.awk, getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, gl-render.cc, gl-render.h, gl2ps-print.cc, gl2ps-print.h, graphics-handle.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc, graphics.in.h, gripes.cc, gripes.h, gsvd.cc, gtk-manager.cc, gtk-manager.h, hash.cc, help.cc, help.h, hess.cc, hex2num.cc, hook-fcn.cc, hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h, inv.cc, kron.cc, load-path.cc, load-path.h, load-save.cc, load-save.h, lookup.cc, ls-ascii-helper.cc, ls-ascii-helper.h, ls-hdf5.cc, ls-hdf5.h, ls-mat-ascii.cc, ls-mat-ascii.h, ls-mat4.cc, ls-mat4.h, ls-mat5.cc, ls-mat5.h, ls-oct-binary.cc, ls-oct-binary.h, ls-oct-text.cc, ls-oct-text.h, ls-utils.cc, ls-utils.h, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex.cc, mex.h, mexproto.h, mgorth.cc, mk-errno-list.sh, mk-mxarray-h.in.sh, mxarray.in.h, nproc.cc, oct-errno.h, oct-errno.in.cc, oct-fstrm.cc, oct-fstrm.h, oct-handle.h, oct-hdf5-types.cc, oct-hdf5-types.h, oct-hdf5.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc, oct-iostrm.h, oct-map.cc, oct-map.h, oct-obj.h, oct-opengl.h, oct-prcstrm.cc, oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h, oct-tex-lexer.in.ll, oct-tex-parser.in.yy, oct.h, octave-default-image.h, octave-link.cc, octave-link.h, ordschur.cc, pager.cc, pager.h, pinv.cc, pr-output.cc, pr-output.h, procstream.cc, procstream.h, psi.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, sighandlers.cc, sighandlers.h, sparse-xdiv.cc, sparse-xdiv.h, sparse-xpow.cc, sparse-xpow.h, sparse.cc, spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc, symrec.cc, symrec.h, symscope.cc, symscope.h, symtab.cc, symtab.h, syscalls.cc, sysdep.cc, sysdep.h, text-renderer.cc, text-renderer.h, time.cc, toplev.cc, toplev.h, tril.cc, tsearch.cc, txt-eng.cc, txt-eng.h, typecast.cc, url-handle-manager.cc, url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc, variables.h, workspace-element.h, xdiv.cc, xdiv.h, xnorm.cc, xnorm.h, xpow.cc, xpow.h, zfstream.cc, zfstream.h, deprecated-config.h, __delaunayn__.cc, __eigs__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __init_gnuplot__.cc, __ode15__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc, audiodevinfo.cc, audioread.cc, ccolamd.cc, chol.cc, colamd.cc, config-module.awk, config-module.sh, convhulln.cc, dmperm.cc, fftw.cc, gzip.cc, oct-qhull.h, qr.cc, symbfact.cc, symrcm.cc, liboctinterp-build-info.h, liboctinterp-build-info.in.cc, mk-build-env-features.sh, mk-builtins.pl, mk-doc.pl, mk-pkg-add.sh, mk-version-h.in.sh, ov-base-diag.cc, ov-base-diag.h, ov-base-int.cc, ov-base-int.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc, ov-base-scalar.h, ov-base-sparse.cc, ov-base-sparse.h, ov-base.cc, ov-base.h, ov-bool-mat.cc, ov-bool-mat.h, ov-bool-sparse.cc, ov-bool-sparse.h, ov-bool.cc, ov-bool.h, ov-builtin.cc, ov-builtin.h, ov-cell.cc, ov-cell.h, ov-ch-mat.cc, ov-ch-mat.h, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h, ov-colon.cc, ov-colon.h, ov-complex.cc, ov-complex.h, ov-cs-list.cc, ov-cs-list.h, ov-cx-diag.cc, ov-cx-diag.h, ov-cx-mat.cc, ov-cx-mat.h, ov-cx-sparse.cc, ov-cx-sparse.h, ov-dld-fcn.cc, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn-inline.cc, ov-fcn-inline.h, ov-fcn.cc, ov-fcn.h, ov-float.cc, ov-float.h, ov-flt-complex.cc, ov-flt-complex.h, ov-flt-cx-diag.cc, ov-flt-cx-diag.h, ov-flt-cx-mat.cc, ov-flt-cx-mat.h, ov-flt-re-diag.cc, ov-flt-re-diag.h, ov-flt-re-mat.cc, ov-flt-re-mat.h, ov-int-traits.h, ov-int16.cc, ov-int16.h, ov-int32.cc, ov-int32.h, ov-int64.cc, ov-int64.h, ov-int8.cc, ov-int8.h, ov-intx.h, ov-java.cc, ov-java.h, ov-lazy-idx.cc, ov-lazy-idx.h, ov-mex-fcn.cc, ov-mex-fcn.h, ov-null-mat.cc, ov-null-mat.h, ov-oncleanup.cc, ov-oncleanup.h, ov-perm.cc, ov-perm.h, ov-range.cc, ov-range.h, ov-re-diag.cc, ov-re-diag.h, ov-re-mat.cc, ov-re-mat.h, ov-re-sparse.cc, ov-re-sparse.h, ov-scalar.cc, ov-scalar.h, ov-str-mat.cc, ov-str-mat.h, ov-struct.cc, ov-struct.h, ov-typeinfo.cc, ov-typeinfo.h, ov-uint16.cc, ov-uint16.h, ov-uint32.cc, ov-uint32.h, ov-uint64.cc, ov-uint64.h, ov-uint8.cc, ov-uint8.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, ovl.cc, ovl.h, octave.cc, octave.h, op-kw-docs, mk-ops.sh, op-b-b.cc, op-b-bm.cc, op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cdm-cm.cc, op-cdm-cs.cc, op-cdm-dm.cc, op-cdm-m.cc, op-cdm-s.cc, op-cell.cc, op-chm.cc, op-class.cc, op-cm-cdm.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-dm.cc, op-cm-m.cc, op-cm-pm.cc, op-cm-s.cc, op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc, op-cs-scm.cc, op-cs-sm.cc, op-dm-cdm.cc, op-dm-cm.cc, op-dm-cs.cc, op-dm-dm.cc, op-dm-m.cc, op-dm-s.cc, op-dm-scm.cc, op-dm-sm.cc, op-dm-template.cc, op-dms-template.cc, op-fcdm-fcdm.cc, op-fcdm-fcm.cc, op-fcdm-fcs.cc, op-fcdm-fdm.cc, op-fcdm-fm.cc, op-fcdm-fs.cc, op-fcm-fcdm.cc, op-fcm-fcm.cc, op-fcm-fcs.cc, op-fcm-fdm.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcm-pm.cc, op-fcn.cc, op-fcs-fcm.cc, op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fcdm.cc, op-fdm-fcm.cc, op-fdm-fcs.cc, op-fdm-fdm.cc, op-fdm-fm.cc, op-fdm-fs.cc, op-fm-fcdm.cc, op-fm-fcm.cc, op-fm-fcs.cc, op-fm-fdm.cc, op-fm-fm.cc, op-fm-fs.cc, op-fm-pm.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-int-concat.cc, op-int.h, op-m-cdm.cc, op-m-cm.cc, op-m-cs.cc, op-m-dm.cc, op-m-m.cc, op-m-pm.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc, op-pm-cm.cc, op-pm-fcm.cc, op-pm-fm.cc, op-pm-m.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc, op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc, op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, ops.h, options-usage.h, bp-table.cc, bp-table.h, comment-list.cc, comment-list.h, jit-ir.cc, jit-ir.h, jit-typeinfo.cc, jit-typeinfo.h, jit-util.cc, jit-util.h, lex.h, lex.ll, oct-lvalue.cc, oct-lvalue.h, oct-parse.in.yy, octave.gperf, parse.h, profiler.cc, profiler.h, pt-all.h, pt-arg-list.cc, pt-arg-list.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h, pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h, pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc, pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-funcall.cc, pt-funcall.h, pt-id.cc, pt-id.h, pt-idx.cc, pt-idx.h, pt-jit.cc, pt-jit.h, pt-jump.cc, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-walk.cc, pt-walk.h, pt.cc, pt.h, token.cc, token.h, Array-jit.cc, Array-tc.cc, version.cc, version.in.h, Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-f.cc, Array-fC.cc, Array-i.cc, Array-idx-vec.cc, Array-s.cc, Array-str.cc, Array-util.cc, Array-util.h, Array-voidp.cc, Array.cc, Array.h, CColVector.cc, CColVector.h, CDiagMatrix.cc, CDiagMatrix.h, CMatrix.cc, CMatrix.h, CNDArray.cc, CNDArray.h, CRowVector.cc, CRowVector.h, CSparse.cc, CSparse.h, DiagArray2.cc, DiagArray2.h, MArray-C.cc, MArray-d.cc, MArray-f.cc, MArray-fC.cc, MArray-i.cc, MArray-s.cc, MArray.cc, MArray.h, MDiagArray2.cc, MDiagArray2.h, MSparse-C.cc, MSparse-d.cc, MSparse.cc, MSparse.h, Matrix.h, MatrixType.cc, MatrixType.h, PermMatrix.cc, PermMatrix.h, Range.cc, Range.h, Sparse-C.cc, Sparse-b.cc, Sparse-d.cc, Sparse.cc, Sparse.h, boolMatrix.cc, boolMatrix.h, boolNDArray.cc, boolNDArray.h, boolSparse.cc, boolSparse.h, chMatrix.cc, chMatrix.h, chNDArray.cc, chNDArray.h, dColVector.cc, dColVector.h, dDiagMatrix.cc, dDiagMatrix.h, dMatrix.cc, dMatrix.h, dNDArray.cc, dNDArray.h, dRowVector.cc, dRowVector.h, dSparse.cc, dSparse.h, dim-vector.cc, dim-vector.h, fCColVector.cc, fCColVector.h, fCDiagMatrix.cc, fCDiagMatrix.h, fCMatrix.cc, fCMatrix.h, fCNDArray.cc, fCNDArray.h, fCRowVector.cc, fCRowVector.h, fColVector.cc, fColVector.h, fDiagMatrix.cc, fDiagMatrix.h, fMatrix.cc, fMatrix.h, fNDArray.cc, fNDArray.h, fRowVector.cc, fRowVector.h, idx-vector.cc, idx-vector.h, int16NDArray.cc, int16NDArray.h, int32NDArray.cc, int32NDArray.h, int64NDArray.cc, int64NDArray.h, int8NDArray.cc, int8NDArray.h, intNDArray.cc, intNDArray.h, uint16NDArray.cc, uint16NDArray.h, uint32NDArray.cc, uint32NDArray.h, uint64NDArray.cc, uint64NDArray.h, uint8NDArray.cc, uint8NDArray.h, cconv2.f, cdotc3.f, cmatm3.f, csconv2.f, dconv2.f, ddot3.f, dmatm3.f, sconv2.f, sdot3.f, smatm3.f, zconv2.f, zdconv2.f, zdotc3.f, zmatm3.f, crsf2csf.f, zrsf2csf.f, mk-f77-def.in.sh, liboctave-build-info.h, liboctave-build-info.in.cc, CollocWt.cc, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h, DAERTFunc.h, DASPK-opts.in, DASPK.cc, DASPK.h, DASRT-opts.in, DASRT.cc, DASRT.h, DASSL-opts.in, DASSL.cc, DASSL.h, DET.h, EIG.cc, EIG.h, LSODE-opts.in, LSODE.cc, LSODE.h, ODE.h, ODEFunc.h, ODES.cc, ODES.h, ODESFunc.h, Quad-opts.in, Quad.cc, Quad.h, aepbalance.cc, aepbalance.h, base-dae.h, base-de.h, base-min.h, bsxfun-decl.h, bsxfun-defs.cc, bsxfun.h, chol.cc, chol.h, eigs-base.cc, eigs-base.h, fEIG.cc, fEIG.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h, lo-amos-proto.h, lo-arpack-proto.h, lo-blas-proto.h, lo-fftpack-proto.h, lo-lapack-proto.h, lo-mappers.cc, lo-mappers.h, lo-qrupdate-proto.h, lo-ranlib-proto.h, lo-slatec-proto.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h, oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc, randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-dmsolve.cc, sparse-dmsolve.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, Sparse-diag-op-defs.h, Sparse-op-decls.h, Sparse-op-defs.h, Sparse-perm-op-defs.h, config-ops.sh, mk-ops.awk, mx-base.h, mx-defs.h, mx-ext.h, mx-inlines.cc, mx-op-decl.h, mx-op-defs.h, mx-ops, smx-ops, vx-ops, child-list.cc, child-list.h, cmach-info.c, cmach-info.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h, oct-passwd.cc, oct-passwd.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h, action-container.h, base-list.h, blaswrap.c, byte-swap.h, caseless-str.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, cquit.c, data-conv.cc, data-conv.h, f2c-main.c, f77-fcn.c, f77-fcn.h, file-info.cc, file-info.h, functor.h, glob-match.cc, glob-match.h, kpse.cc, kpse.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-array-gripes.cc, lo-array-gripes.h, lo-cutils.c, lo-cutils.h, lo-error.c, lo-error.h, lo-hash.cc, lo-hash.h, lo-ieee.cc, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-traits.h, lo-utils.cc, lo-utils.h, oct-base64.cc, oct-base64.h, oct-binmap.h, oct-cmplx.h, oct-glob.cc, oct-glob.h, oct-inttypes-fwd.h, oct-inttypes.cc, oct-inttypes.h, oct-locbuf.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-rl-edit.c, oct-rl-edit.h, oct-rl-hist.c, oct-rl-hist.h, oct-shlib.cc, oct-shlib.h, oct-sort.cc, oct-sort.h, oct-sparse.cc, oct-sparse.h, oct-string.cc, oct-string.h, octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc, quit.h, singleton-cleanup.cc, singleton-cleanup.h, sparse-sort.cc, sparse-sort.h, sparse-util.cc, sparse-util.h, str-vec.cc, str-vec.h, sun-utils.h, unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h, areadlink-wrapper.c, areadlink-wrapper.h, async-system-wrapper.c, async-system-wrapper.h, base64-wrappers.c, base64-wrappers.h, canonicalize-file-name-wrapper.c, canonicalize-file-name-wrapper.h, dirent-wrappers.c, dirent-wrappers.h, fcntl-wrappers.c, fcntl-wrappers.h, filepos-wrappers.c, filepos-wrappers.h, fpucw-wrappers.c, fpucw-wrappers.h, gen-tempname-wrapper.c, gen-tempname-wrapper.h, getopt-wrapper.c, getopt-wrapper.h, glob-wrappers.c, glob-wrappers.h, hash-wrappers.c, hash-wrappers.h, localcharset-wrapper.c, localcharset-wrapper.h, math-wrappers.c, math-wrappers.h, mkostemp-wrapper.c, mkostemp-wrapper.h, nanosleep-wrapper.c, nanosleep-wrapper.h, nproc-wrapper.c, nproc-wrapper.h, octave-popen2.c, octave-popen2.h, putenv-wrapper.c, putenv-wrapper.h, set-program-name-wrapper.c, set-program-name-wrapper.h, signal-wrappers.c, signal-wrappers.h, stat-wrappers.c, stat-wrappers.h, strdup-wrapper.c, strdup-wrapper.h, strftime-wrapper.c, strftime-wrapper.h, strmode-wrapper.c, strmode-wrapper.h, strptime-wrapper.c, strptime-wrapper.h, time-wrappers.c, time-wrappers.h, tmpfile-wrapper.c, tmpfile-wrapper.h, uname-wrapper.c, uname-wrapper.h, uniconv-wrappers.c, uniconv-wrappers.h, unistd-wrappers.c, unistd-wrappers.h, unsetenv-wrapper.c, unsetenv-wrapper.h, vasprintf-wrapper.c, vasprintf-wrapper.h, wait-for-input.c, wait-for-input.h, wait-wrappers.c, wait-wrappers.h, acinclude.m4, ax_blas.m4, ax_lapack.m4, ax_openmp.m4, ax_pthread.m4, octave_blas_f77_func.m4, pkg.m4, oct-conf-post.in.h, run-octave.in, Map.m, ascii.m, binary.m, cd.m, close.m, delete.m, dir.m, disp.m, ftp.m, loadobj.m, mget.m, mkdir.m, mput.m, rename.m, rmdir.m, saveobj.m, __get_properties__.m, audioplayer.m, disp.m, get.m, isplaying.m, pause.m, play.m, playblocking.m, resume.m, set.m, stop.m, subsasgn.m, subsref.m, __get_properties__.m, audiorecorder.m, disp.m, get.m, getaudiodata.m, getplayer.m, isrecording.m, pause.m, play.m, record.m, recordblocking.m, resume.m, set.m, stop.m, subsasgn.m, subsref.m, lin2mu.m, mu2lin.m, record.m, sound.m, soundsc.m, bitmax.m, chop.m, comma.m, isstr.m, mahalanobis.m, md5sum.m, octave_config_info.m, onenormest.m, paren.m, semicolon.m, sleep.m, usleep.m, wavread.m, wavwrite.m, acosd.m, acot.m, acotd.m, acoth.m, acsc.m, acscd.m, acsch.m, asec.m, asecd.m, asech.m, asind.m, atan2d.m, atand.m, cosd.m, cot.m, cotd.m, coth.m, csc.m, cscd.m, csch.m, sec.m, secd.m, sech.m, sind.m, tand.m, accumarray.m, accumdim.m, bincoeff.m, bitcmp.m, bitget.m, bitset.m, blkdiag.m, cart2pol.m, cart2sph.m, cell2mat.m, celldisp.m, circshift.m, common_size.m, cplxpair.m, cumtrapz.m, curl.m, dblquad.m, deal.m, deg2rad.m, del2.m, divergence.m, flip.m, flipdim.m, fliplr.m, flipud.m, gradient.m, idivide.m, int2str.m, integral.m, integral2.m, integral3.m, interp1.m, interp2.m, interp3.m, interpft.m, interpn.m, isequal.m, isequaln.m, logspace.m, nextpow2.m, num2str.m, pol2cart.m, polyarea.m, postpad.m, prepad.m, __splinen__.m, quad2d.m, quadgk.m, quadl.m, quadv.m, rad2deg.m, randi.m, rat.m, repelem.m, repmat.m, rot90.m, rotdim.m, shift.m, shiftdim.m, sortrows.m, sph2cart.m, structfun.m, subsindex.m, trapz.m, triplequad.m, xor.m, convhull.m, delaunay.m, delaunayn.m, dsearch.m, dsearchn.m, griddata.m, griddata3.m, griddatan.m, inpolygon.m, rectint.m, tsearchn.m, voronoi.m, voronoin.m, dialog.m, errordlg.m, getappdata.m, guidata.m, guihandles.m, helpdlg.m, inputdlg.m, isappdata.m, listdlg.m, msgbox.m, __file_filter__.m, __fltk_file_filter__.m, __get_funcname__.m, __is_function__.m, __uigetdir_fltk__.m, __uigetfile_fltk__.m, __uiobject_split_args__.m, __uiputfile_fltk__.m, questdlg.m, rmappdata.m, setappdata.m, uibuttongroup.m, uicontextmenu.m, uicontrol.m, uigetdir.m, uigetfile.m, uimenu.m, uipanel.m, uipushtool.m, uiputfile.m, uiresume.m, uitoggletool.m, uitoolbar.m, uiwait.m, waitbar.m, waitforbuttonpress.m, warndlg.m, __gripe_missing_component__.m, __makeinfo__.m, __unimplemented__.m, ans.m, debug.m, doc.m, doc_cache_create.m, error_ids.m, get_first_help_sentence.m, help.m, lookfor.m, print_usage.m, __additional_help_message__.m, __strip_html_tags__.m, slash.m, type.m, warning_ids.m, which.m, autumn.m, bone.m, brighten.m, cmpermute.m, cmunique.m, colorcube.m, colormap.m, contrast.m, cool.m, copper.m, cubehelix.m, flag.m, frame2im.m, getframe.m, gray.m, gray2ind.m, hot.m, hsv.m, hsv2rgb.m, im2double.m, im2frame.m, image.m, imagesc.m, imfinfo.m, imformats.m, imread.m, imshow.m, imwrite.m, ind2gray.m, ind2rgb.m, iscolormap.m, jet.m, lines.m, ntsc2rgb.m, ocean.m, pink.m, prism.m, __imfinfo__.m, __imread__.m, __imwrite__.m, colorspace_conversion_input_check.m, colorspace_conversion_revert.m, imageIO.m, imwrite_filename.m, ind2x.m, rainbow.m, rgb2hsv.m, rgb2ind.m, rgb2ntsc.m, rgbplot.m, spinmap.m, spring.m, summer.m, viridis.m, white.m, winter.m, beep.m, csvread.m, csvwrite.m, dlmwrite.m, fileread.m, importdata.m, is_valid_file_id.m, strread.m, textread.m, javaArray.m, java_get.m, java_set.m, javaaddpath.m, javachk.m, javaclasspath.m, javamem.m, javarmpath.m, ClassHelper.java, Matrix.java, OctClassLoader.java, Octave.java, OctaveReference.java, usejava.m, bandwidth.m, commutation_matrix.m, cond.m, condeig.m, condest.m, cross.m, duplication_matrix.m, expm.m, gls.m, housh.m, isbanded.m, isdefinite.m, isdiag.m, ishermitian.m, issymmetric.m, istril.m, istriu.m, krylov.m, linsolve.m, logm.m, lscov.m, normest.m, normest1.m, null.m, ols.m, orth.m, planerot.m, qzhess.m, rank.m, rref.m, subspace.m, trace.m, vech.m, vecnorm.m, bug_report.m, bunzip2.m, cast.m, citation.m, compare_versions.m, computer.m, copyfile.m, delete.m, desktop.m, dir.m, dos.m, edit.m, fact.m, fieldnames.m, fileattrib.m, fileparts.m, fullfile.m, genvarname.m, getfield.m, grabcode.m, gunzip.m, info.m, inputParser.m, inputname.m, isdeployed.m, isdir.m, ismac.m, ispc.m, isunix.m, license.m, list_primes.m, loadobj.m, ls.m, ls_command.m, menu.m, methods.m, mex.m, mexext.m, mkdir.m, mkoctfile.m, movefile.m, namelengthmax.m, nargchk.m, narginchk.m, nargoutchk.m, news.m, nthargout.m, open.m, orderfields.m, pack.m, parseparams.m, perl.m, __publish_html_output__.m, __publish_latex_output__.m, __w2mpth__.m, display_info_file.m, publish.m, python.m, recycle.m, run.m, saveobj.m, setfield.m, substruct.m, swapbytes.m, symvar.m, tar.m, tempdir.m, tmpnam.m, unix.m, unpack.m, untar.m, unzip.m, validateattributes.m, ver.m, version.m, what.m, zip.m, mk-doc.pl, mk-pkg-add.sh, decic.m, ode15i.m, ode15s.m, ode23.m, ode45.m, odeget.m, odeplot.m, odeset.m, AbsRel_norm.m, check_default_input.m, integrate_adaptive.m, kahan.m, ode_event_handler.m, odedefaults.m, odemergeopts.m, runge_kutta_23.m, runge_kutta_45_dorpri.m, runge_kutta_interpolate.m, starting_stepsize.m, __all_opts__.m, fminbnd.m, fminsearch.m, fminunc.m, fsolve.m, fzero.m, glpk.m, humps.m, lsqnonneg.m, optimget.m, optimset.m, pqpnonneg.m, __fdjac__.m, qp.m, sqp.m, import.m, matlabroot.m, pathdef.m, getsavepath.m, savepath.m, pkg.m, build.m, configure_make.m, default_prefix.m, describe.m, dirempty.m, get_description.m, get_forge_download.m, get_forge_pkg.m, get_unsatisfied_deps.m, getarch.m, getarchdir.m, install.m, installed_packages.m, list_forge_packages.m, load_packages.m, load_packages_and_dependencies.m, rebuild.m, save_order.m, uninstall.m, unload_packages.m, __clabel__.m, __getlegenddata__.m, __rotate_around_axis__.m, annotation.m, axis.m, box.m, camlookat.m, camorbit.m, campos.m, camroll.m, camtarget.m, camup.m, camva.m, camzoom.m, caxis.m, clabel.m, daspect.m, datetick.m, diffuse.m, grid.m, gtext.m, hidden.m, legend.m, lighting.m, material.m, orient.m, pbaspect.m, __axis_label__.m, __axis_limits__.m, rticks.m, shading.m, specular.m, text.m, thetaticks.m, title.m, view.m, whitebg.m, xlabel.m, xlim.m, xticklabels.m, xticks.m, ylabel.m, ylim.m, yticklabels.m, yticks.m, zlabel.m, zlim.m, zticklabels.m, zticks.m, area.m, bar.m, barh.m, camlight.m, colorbar.m, comet.m, comet3.m, compass.m, contour.m, contour3.m, contourc.m, contourf.m, cylinder.m, ellipsoid.m, errorbar.m, ezcontour.m, ezcontourf.m, ezmesh.m, ezmeshc.m, ezplot.m, ezplot3.m, ezpolar.m, ezsurf.m, ezsurfc.m, feather.m, fill.m, fplot.m, hist.m, isocaps.m, isocolors.m, isonormals.m, isosurface.m, light.m, line.m, loglog.m, loglogerr.m, mesh.m, meshc.m, meshz.m, pareto.m, patch.m, pcolor.m, peaks.m, pie.m, pie3.m, plot.m, plot3.m, plotmatrix.m, plotyy.m, polar.m, __add_datasource__.m, __bar__.m, __calc_isovalue_from_data__.m, __contour__.m, __errplot__.m, __ezplot__.m, __interp_cube__.m, __line__.m, __marching_cube__.m, __patch__.m, __pie__.m, __plt__.m, __quiver__.m, __scatter__.m, __stem__.m, __unite_shared_vertices__.m, quiver.m, quiver3.m, rectangle.m, reducepatch.m, reducevolume.m, ribbon.m, rose.m, scatter.m, scatter3.m, semilogx.m, semilogxerr.m, semilogy.m, semilogyerr.m, shrinkfaces.m, slice.m, smooth3.m, sombrero.m, sphere.m, stairs.m, stem.m, stem3.m, stemleaf.m, surf.m, surface.m, surfc.m, surfl.m, surfnorm.m, tetramesh.m, trimesh.m, triplot.m, trisurf.m, waterfall.m, __actual_axis_position__.m, __default_plot_options__.m, __gnuplot_drawnow__.m, __next_line_color__.m, __next_line_style__.m, __opengl_info__.m, __plt_get_axis_arg__.m, __pltopt__.m, allchild.m, ancestor.m, axes.m, cla.m, clf.m, close.m, closereq.m, colstyle.m, copyobj.m, figure.m, findall.m, findfigs.m, findobj.m, gca.m, gcbf.m, gcbo.m, gcf.m, gco.m, ginput.m, gnuplot_binary.in.m, graphics_toolkit.m, groot.m, hdl2struct.m, hggroup.m, hgload.m, hgsave.m, hgtransform.m, hold.m, isaxes.m, isfigure.m, isgraphics.m, ishandle.m, ishold.m, isprop.m, linkaxes.m, linkprop.m, meshgrid.m, ndgrid.m, newplot.m, pan.m, print.m, printd.m, __add_default_menu__.m, __ghostscript__.m, __gnuplot_draw_axes__.m, __gnuplot_draw_figure__.m, __gnuplot_get_var__.m, __gnuplot_ginput__.m, __gnuplot_has_feature__.m, __gnuplot_has_terminal__.m, __gnuplot_open_stream__.m, __gnuplot_print__.m, __gnuplot_version__.m, __opengl_print__.m, __print_parse_opts__.m, __set_default_mouse_modes__.m, refresh.m, refreshdata.m, rotate.m, rotate3d.m, saveas.m, shg.m, struct2hdl.m, subplot.m, zoom.m, compan.m, conv.m, deconv.m, mkpp.m, mpoles.m, padecoef.m, pchip.m, poly.m, polyaffine.m, polyder.m, polyeig.m, polyfit.m, polygcd.m, polyint.m, polyout.m, polyreduce.m, polyval.m, polyvalm.m, ppder.m, ppint.m, ppjumps.m, ppval.m, residue.m, roots.m, spline.m, splinefit.m, unmkpp.m, addpref.m, getpref.m, ispref.m, prefdir.m, preferences.m, loadprefs.m, prefsfile.m, saveprefs.m, rmpref.m, setpref.m, style.css, profexplore.m, profexport.m, profile.m, profshow.m, intersect.m, ismember.m, powerset.m, validsetargs.m, setdiff.m, setxor.m, union.m, unique.m, arch_fit.m, arch_rnd.m, arch_test.m, arma_rnd.m, autoreg_matrix.m, bartlett.m, blackman.m, detrend.m, diffpara.m, durbinlevinson.m, fftconv.m, fftfilt.m, fftshift.m, filter2.m, fractdiff.m, freqz.m, freqz_plot.m, hamming.m, hanning.m, hurst.m, ifftshift.m, periodogram.m, rectangle_lw.m, rectangle_sw.m, triangle_lw.m, triangle_sw.m, sinc.m, sinetone.m, sinewave.m, spectral_adf.m, spectral_xdf.m, spencer.m, stft.m, synthesis.m, unwrap.m, yulewalker.m, bicg.m, bicgstab.m, cgs.m, colperm.m, eigs.m, etreeplot.m, gmres.m, gplot.m, ichol.m, ilu.m, nonzeros.m, pcg.m, pcr.m, __sprand__.m, qmr.m, spaugment.m, spconvert.m, spdiags.m, speye.m, spfun.m, spones.m, sprand.m, sprandn.m, sprandsym.m, spstats.m, spy.m, svds.m, treelayout.m, treeplot.m, bessel.m, beta.m, betaln.m, ellipke.m, expint.m, factor.m, factorial.m, isprime.m, lcm.m, legendre.m, nchoosek.m, nthroot.m, perms.m, pow2.m, primes.m, reallog.m, realpow.m, realsqrt.m, gallery.m, hadamard.m, hankel.m, hilb.m, invhilb.m, magic.m, pascal.m, rosser.m, toeplitz.m, vander.m, wilkinson.m, __finish__.m, center.m, cloglog.m, corr.m, corrcoef.m, cov.m, crosstab.m, histc.m, iqr.m, kendall.m, kurtosis.m, logit.m, mean.m, meansq.m, median.m, mode.m, moment.m, ppplot.m, prctile.m, probit.m, qqplot.m, quantile.m, range.m, ranks.m, run_count.m, runlength.m, skewness.m, spearman.m, statistics.m, std.m, var.m, zscore.m, betacdf.m, betainv.m, betapdf.m, betarnd.m, binocdf.m, binoinv.m, binopdf.m, binornd.m, cauchy_cdf.m, cauchy_inv.m, cauchy_pdf.m, cauchy_rnd.m, chi2cdf.m, chi2inv.m, chi2pdf.m, chi2rnd.m, discrete_cdf.m, discrete_inv.m, discrete_pdf.m, discrete_rnd.m, empirical_cdf.m, empirical_inv.m, empirical_pdf.m, empirical_rnd.m, expcdf.m, expinv.m, exppdf.m, exprnd.m, fcdf.m, finv.m, fpdf.m, frnd.m, gamcdf.m, gaminv.m, gampdf.m, gamrnd.m, geocdf.m, geoinv.m, geopdf.m, geornd.m, hygecdf.m, hygeinv.m, hygepdf.m, hygernd.m, kolmogorov_smirnov_cdf.m, laplace_cdf.m, laplace_inv.m, laplace_pdf.m, laplace_rnd.m, logistic_cdf.m, logistic_inv.m, logistic_pdf.m, logistic_rnd.m, logncdf.m, logninv.m, lognpdf.m, lognrnd.m, nbincdf.m, nbininv.m, nbinpdf.m, nbinrnd.m, normcdf.m, norminv.m, normpdf.m, normrnd.m, poisscdf.m, poissinv.m, poisspdf.m, poissrnd.m, stdnormal_cdf.m, stdnormal_inv.m, stdnormal_pdf.m, stdnormal_rnd.m, tcdf.m, tinv.m, tpdf.m, trnd.m, unidcdf.m, unidinv.m, unidpdf.m, unidrnd.m, unifcdf.m, unifinv.m, unifpdf.m, unifrnd.m, wblcdf.m, wblinv.m, wblpdf.m, wblrnd.m, wienrnd.m, logistic_regression.m, logistic_regression_derivatives.m, logistic_regression_likelihood.m, anova.m, bartlett_test.m, chisquare_test_homogeneity.m, chisquare_test_independence.m, cor_test.m, f_test_regression.m, hotelling_test.m, hotelling_test_2.m, kolmogorov_smirnov_test.m, kolmogorov_smirnov_test_2.m, kruskal_wallis_test.m, manova.m, mcnemar_test.m, prop_test_2.m, run_test.m, sign_test.m, t_test.m, t_test_2.m, t_test_regression.m, u_test.m, var_test.m, welch_test.m, wilcoxon_test.m, z_test.m, z_test_2.m, base2dec.m, bin2dec.m, blanks.m, cstrcat.m, deblank.m, dec2base.m, dec2bin.m, dec2hex.m, erase.m, findstr.m, hex2dec.m, index.m, isletter.m, isstring.m, isstrprop.m, mat2str.m, native2unicode.m, ostrsplit.m, regexptranslate.m, rindex.m, str2num.m, strcat.m, strchr.m, strjoin.m, strjust.m, strmatch.m, strsplit.m, strtok.m, strtrim.m, strtrunc.m, substr.m, unicode2native.m, untabify.m, validatestring.m, __have_feature__.m, __printf_assert__.m, __prog_output_assert__.m, __run_test_suite__.m, assert.m, demo.m, example.m, fail.m, compare_plot_demos.m, dump_demos.m, html_compare_plot_demos.m, rundemos.m, runtests.m, speed.m, test.m, addtodate.m, asctime.m, calendar.m, clock.m, ctime.m, date.m, datenum.m, datestr.m, datevec.m, eomday.m, etime.m, is_leap_year.m, now.m, weekday.m, display-available.c, display-available.h, main-cli.cc, main-gui.cc, main.in.cc, mkoctfile.in.cc, octave-build-info.h, octave-build-info.in.cc, octave-config.in.cc, shared-fcns.h, args.tst, bug-31371.tst, bug-35448.tst, bug-35881.tst, bug-36025.tst, bug-38236.tst, bug-38565.tst, bug-38576.tst, bug-38691.tst, bug-41723.tst, bug-44940.tst, bug-46330.tst, bug-46660.tst, bug-50014.tst, bug-50035.tst, bug-50716.tst, bug-51192.tst, bug-51532.tst, bug-51534.tst, bug-51599.tst, bug-52075.tst, class-concat.tst, classdef-multiple-inheritance.tst, classdef.tst, classes.tst, colormaps.tst, command.tst, complex.tst, ctor-vs-method.tst, deprecate-props.tst, diag-perm.tst, error.tst, eval-catch.tst, fcn-handle-derived-resolution.tst, fntests.m, for.tst, func.tst, global.tst, if.tst, index.tst, io.tst, jit.tst, leftdiv.tst, line-continue.tst, logical-index.tst, mk-bc-overloads-tst.sh, mk-conv-tst.sh, mk-sparse-tst.sh, nest.tst, null-assign.tst, parser.tst, prefer.tst, publish.tst, range.tst, recursion.tst, return.tst, show-failures.awk, single-index.tst, slice.tst, struct.tst, switch.tst, system.tst, transpose.tst, try.tst, unwind.tst, while.tst: Changed punctuation of GPL license text to match that suggested by FSF.
author Rik <rik@octave.org>
date Sat, 06 Jan 2018 07:57:19 -0800
parents 501986e12b8b
children ab2321d4ba03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 /*
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23185
diff changeset
3 Copyright (C) 2011-2017 Michael Goffioul
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4
18500
49877d3be064 update copyright notices for new QtHandles code
John W. Eaton <jwe@octave.org>
parents: 18498
diff changeset
5 This file is part of Octave.
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24523
diff changeset
7 Octave is free software: you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22413
diff changeset
8 under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24523
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22413
diff changeset
10 (at your option) any later version.
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22413
diff changeset
12 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22413
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22413
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22413
diff changeset
15 GNU General Public License for more details.
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
18500
49877d3be064 update copyright notices for new QtHandles code
John W. Eaton <jwe@octave.org>
parents: 18498
diff changeset
18 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24523
diff changeset
19 <https://www.gnu.org/licenses/>.
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 */
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21723
diff changeset
23 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21203
diff changeset
24 # include "config.h"
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 #endif
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #include <QApplication>
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
28 #include <QBitmap>
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
29 #include <QCursor>
20080
908b68a98ba6 initial implementation of text annotations with Qt plotting
John W. Eaton <jwe@octave.org>
parents: 20040
diff changeset
30 #include <QInputDialog>
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #include <QList>
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 #include <QMouseEvent>
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
33 #include <QWheelEvent>
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 #include <QRectF>
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #include "Backend.h"
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 #include "Canvas.h"
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 #include "ContextMenu.h"
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 #include "GLCanvas.h"
18505
fb96b7f55242 rename file to avoid clash on case-insenstive filesystems (bug #41658)
John W. Eaton <jwe@octave.org>
parents: 18501
diff changeset
40 #include "QtHandlesUtils.h"
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41
20095
c164cfc24bdd QtHandles: add annotations dialog
John Donoghue <john.donoghue@ieee.org>
parents: 20090
diff changeset
42 #include "annotation-dialog.h"
c164cfc24bdd QtHandles: add annotations dialog
John Donoghue <john.donoghue@ieee.org>
parents: 20090
diff changeset
43
21199
dd6605e1eaea make gl2ps_renderer implementation private
John W. Eaton <jwe@octave.org>
parents: 21196
diff changeset
44 #include "gl2ps-print.h"
21196
bd96c2efd4fe move include statements for OpenGL headers to a single file
John W. Eaton <jwe@octave.org>
parents: 20596
diff changeset
45 #include "oct-opengl.h"
20080
908b68a98ba6 initial implementation of text annotations with Qt plotting
John W. Eaton <jwe@octave.org>
parents: 20040
diff changeset
46 #include "octave-qt-link.h"
908b68a98ba6 initial implementation of text annotations with Qt plotting
John W. Eaton <jwe@octave.org>
parents: 20040
diff changeset
47
908b68a98ba6 initial implementation of text annotations with Qt plotting
John W. Eaton <jwe@octave.org>
parents: 20040
diff changeset
48 #include "builtin-defun-decls.h"
19681
35bca657d74d printing for Qt plot widget (bug #42537)
John W. Eaton <jwe@octave.org>
parents: 19663
diff changeset
49
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 namespace QtHandles
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 {
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
53 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
54 Canvas::redraw (bool sync)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
55 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
56 QWidget *w = qWidget ();
19953
ed51e17f6ccf avoid possibly dereferencing invalid pointer
John W. Eaton <jwe@octave.org>
parents: 19896
diff changeset
57
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
58 if (w)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
59 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
60 if (sync)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
61 w->repaint ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
62 else
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
63 w->update ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
64 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
65 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
66
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
67 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
68 Canvas::blockRedraw (bool block)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
69 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
70 m_redrawBlocked = block;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
71 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
72
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
73 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
74 Canvas::setCursor (MouseMode mode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
75 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
76 QWidget *w = qWidget ();
19959
210b301a3e39 different cursors for zoom in/out on qthandles canvas
Johannes Leuschner <jhnnslschnr@gmail.com>
parents: 19954
diff changeset
77
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
78 if (w)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
79 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
80 static QCursor origCursor = w->cursor ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
81
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
82 switch (mode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
83 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
84 case PanMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
85 case RotateMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
86 w->setCursor (Qt::OpenHandCursor);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
87 break;
19681
35bca657d74d printing for Qt plot widget (bug #42537)
John W. Eaton <jwe@octave.org>
parents: 19663
diff changeset
88
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
89 case ZoomInMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
90 w->setCursor (QPixmap (":/images/zoom-in.png"));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
91 break;
19681
35bca657d74d printing for Qt plot widget (bug #42537)
John W. Eaton <jwe@octave.org>
parents: 19663
diff changeset
92
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
93 case ZoomOutMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
94 w->setCursor (QPixmap (":/images/zoom-out.png"));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
95 break;
19954
b6061813a693 always obtain gh_manager lock before accessing graphics objects
John W. Eaton <jwe@octave.org>
parents: 19953
diff changeset
96
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
97 default:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
98 w->setCursor (origCursor);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
99 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
100 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
101 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
102 }
18612
9597e00ed2dd Add support for "windowbuttonmotionfcn" and "currentpoint"
Michael Goffioul <michael.goffioul@gmail.com>
parents: 18505
diff changeset
103
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
104 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
105 Canvas::print (const QString& file_cmd, const QString& term)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
106 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
107 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
108 graphics_object obj = gh_manager::get_object (m_handle);
18612
9597e00ed2dd Add support for "windowbuttonmotionfcn" and "currentpoint"
Michael Goffioul <michael.goffioul@gmail.com>
parents: 18505
diff changeset
109
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
110 if (obj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
111 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
112 graphics_object figObj (obj.get_ancestor ("figure"));
18612
9597e00ed2dd Add support for "windowbuttonmotionfcn" and "currentpoint"
Michael Goffioul <michael.goffioul@gmail.com>
parents: 18505
diff changeset
113
23695
47c39af89401 tag deprecated gl2ps_print wrapper function with OCTAVE_DEPRECATED attribute
John W. Eaton <jwe@octave.org>
parents: 23577
diff changeset
114 octave::gl2ps_print (figObj, file_cmd.toStdString (), term.toStdString ());
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
115 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
116 }
18612
9597e00ed2dd Add support for "windowbuttonmotionfcn" and "currentpoint"
Michael Goffioul <michael.goffioul@gmail.com>
parents: 18505
diff changeset
117
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
118 /*
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
119 Two updateCurrentPoint() routines are required:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
120 1) Used for QMouseEvents where cursor position data is in callback from Qt.
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
121 2) Used for QKeyEvents where cursor position must be determined.
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
122 */
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
123 void
23070
bef714f45999 maint: Use space after function name/before parenthesis in libgui.
Rik <rik@octave.org>
parents: 22755
diff changeset
124 Canvas::updateCurrentPoint (const graphics_object& fig,
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
125 const graphics_object& obj, QMouseEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
126 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
127 gh_manager::auto_lock lock;
20110
248f2f2e7d48 Return correct x,y coordinates for keystroke with ginput in Qt (bug #44834).
Rik <rik@octave.org>
parents: 20107
diff changeset
128
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
129 gh_manager::post_set (fig.get_handle (), "currentpoint",
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
130 Utils::figureCurrentPoint (fig, event), false);
20110
248f2f2e7d48 Return correct x,y coordinates for keystroke with ginput in Qt (bug #44834).
Rik <rik@octave.org>
parents: 20107
diff changeset
131
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
132 Matrix children = obj.get_properties ().get_children ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
133 octave_idx_type num_children = children.numel ();
20110
248f2f2e7d48 Return correct x,y coordinates for keystroke with ginput in Qt (bug #44834).
Rik <rik@octave.org>
parents: 20107
diff changeset
134
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
135 for (int i = 0; i < num_children; i++)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
136 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
137 graphics_object childObj (gh_manager::get_object (children(i)));
20110
248f2f2e7d48 Return correct x,y coordinates for keystroke with ginput in Qt (bug #44834).
Rik <rik@octave.org>
parents: 20107
diff changeset
138
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
139 if (childObj.isa ("axes"))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
140 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
141 axes::properties& ap = Utils::properties<axes> (childObj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
142 Matrix x_zlim = ap.get_transform_zlim ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
143 graphics_xform x_form = ap.get_transform ();
20080
908b68a98ba6 initial implementation of text annotations with Qt plotting
John W. Eaton <jwe@octave.org>
parents: 20040
diff changeset
144
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
145 ColumnVector p1 = x_form.untransform (event->x (), event->y (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
146 x_zlim(0));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
147 ColumnVector p2 = x_form.untransform (event->x (), event->y (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
148 x_zlim(1));
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20110
diff changeset
149
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
150 Matrix cp (2, 3, 0.0);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
151
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
152 cp(0,0) = p1(0); cp(0,1) = p1(1); cp(0,2) = p1(2);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
153 cp(1,0) = p2(0); cp(1,1) = p2(1); cp(1,2) = p2(2);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
154
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
155 gh_manager::post_set (childObj.get_handle (), "currentpoint", cp,
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
156 false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
157 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
158 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
159 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
160
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
161 void
23070
bef714f45999 maint: Use space after function name/before parenthesis in libgui.
Rik <rik@octave.org>
parents: 22755
diff changeset
162 Canvas::updateCurrentPoint (const graphics_object& fig,
bef714f45999 maint: Use space after function name/before parenthesis in libgui.
Rik <rik@octave.org>
parents: 22755
diff changeset
163 const graphics_object& obj)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
164 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
165 gh_manager::auto_lock lock;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
166
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
167 gh_manager::post_set (fig.get_handle (), "currentpoint",
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
168 Utils::figureCurrentPoint (fig), false);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
169
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
170 Matrix children = obj.get_properties ().get_children ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
171 octave_idx_type num_children = children.numel ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
172
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
173 for (int i = 0; i < num_children; i++)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
174 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
175 graphics_object childObj (gh_manager::get_object (children(i)));
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
176
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
177 if (childObj.isa ("axes"))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
178 {
23070
bef714f45999 maint: Use space after function name/before parenthesis in libgui.
Rik <rik@octave.org>
parents: 22755
diff changeset
179 // FIXME: QCursor::pos() may give inaccurate results with
bef714f45999 maint: Use space after function name/before parenthesis in libgui.
Rik <rik@octave.org>
parents: 22755
diff changeset
180 // asynchronous window systems like X11 over ssh.
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
181 QWidget *w = qWidget ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
182 QPoint p = w->mapFromGlobal (QCursor::pos ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
183 axes::properties& ap = Utils::properties<axes> (childObj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
184 Matrix x_zlim = ap.get_transform_zlim ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
185 graphics_xform x_form = ap.get_transform ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
186
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
187 ColumnVector p1 = x_form.untransform (p.x (), p.y (), x_zlim(0));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
188 ColumnVector p2 = x_form.untransform (p.x (), p.y (), x_zlim(1));
19870
815db217f6f4 provide autoscale option for Qt plotting (bug #44307)
John W. Eaton <jwe@octave.org>
parents: 19867
diff changeset
189
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
190 Matrix cp (2, 3, 0.0);
19870
815db217f6f4 provide autoscale option for Qt plotting (bug #44307)
John W. Eaton <jwe@octave.org>
parents: 19867
diff changeset
191
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
192 cp(0,0) = p1(0); cp(0,1) = p1(1); cp(0,2) = p1(2);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
193 cp(1,0) = p2(0); cp(1,1) = p2(1); cp(1,2) = p2(2);
19870
815db217f6f4 provide autoscale option for Qt plotting (bug #44307)
John W. Eaton <jwe@octave.org>
parents: 19867
diff changeset
194
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
195 gh_manager::post_set (childObj.get_handle (), "currentpoint", cp,
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
196 false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
197 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
198 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
199 }
19870
815db217f6f4 provide autoscale option for Qt plotting (bug #44307)
John W. Eaton <jwe@octave.org>
parents: 19867
diff changeset
200
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
201 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
202 Canvas::annotation_callback (const octave_value_list& args)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
203 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
204 Ffeval (ovl ("annotation").append (args));
19870
815db217f6f4 provide autoscale option for Qt plotting (bug #44307)
John W. Eaton <jwe@octave.org>
parents: 19867
diff changeset
205
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
206 redraw ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
207 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
208
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
209 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
210 Canvas::canvasToggleAxes (const graphics_handle& handle)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
211 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
212 gh_manager::auto_lock lock;
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
213
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
214 graphics_object go = gh_manager::get_object (handle);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
215
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
216 if (go.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
217 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
218 figure::properties& fp = Utils::properties<figure> (go);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
219
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
220 graphics_handle ah = fp.get_currentaxes ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
221
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
222 graphics_object ax = gh_manager::get_object (ah);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
223
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
224 if (ax.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
225 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
226 axes::properties& ap = Utils::properties<axes> (ax);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
227
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
228 if (ap.handlevisibility_is ("on"))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
229 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
230 ap.set_visible (! ap.is_visible ());
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
231
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
232 redraw (true);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
233 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
234 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
235 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
236 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
237
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
238 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
239 Canvas::canvasToggleGrid (const graphics_handle& handle)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
240 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
241 gh_manager::auto_lock lock;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
242
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
243 graphics_object go = gh_manager::get_object (handle);
20270
062422f2e399 Show axes coordinates in Qt figures (bug #44959)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20245
diff changeset
244
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
245 if (go.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
246 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
247 figure::properties& fp = Utils::properties<figure> (go);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
248
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
249 graphics_handle ah = fp.get_currentaxes ();
20270
062422f2e399 Show axes coordinates in Qt figures (bug #44959)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20245
diff changeset
250
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
251 graphics_object ax = gh_manager::get_object (ah);
20270
062422f2e399 Show axes coordinates in Qt figures (bug #44959)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20245
diff changeset
252
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
253 if (ax.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
254 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
255 axes::properties& ap = Utils::properties<axes> (ax);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
256
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
257 std::string tmp;
22250
2fd4f1a3f4a8 allow building with Qt5 (bug #40252)
John W. Eaton <jwe@octave.org>
parents: 21824
diff changeset
258
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
259 // If any grid is off, then turn them all on. If they are all
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
260 // on, then turn them off.
20270
062422f2e399 Show axes coordinates in Qt figures (bug #44959)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20245
diff changeset
261
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
262 std::string state = ((ap.get_xgrid () == "off"
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
263 || ap.get_ygrid () == "off"
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
264 || ap.get_zgrid () == "off")
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
265 ? "on" : "off");
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
266
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
267 ap.set_xgrid (state);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
268 ap.set_ygrid (state);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
269 ap.set_zgrid (state);
20472
2d415c68213f Don't use GL_SELECT to find axes objects in Qt figures (bug #45540)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20292
diff changeset
270
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
271 redraw (true);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
272 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
273 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
274 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
275
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
276 static void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
277 autoscale_axes (axes::properties& ap)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
278 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
279 ap.clear_zoom_stack ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
280
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
281 ap.set_xlimmode ("auto");
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
282 ap.set_ylimmode ("auto");
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
283 ap.set_zlimmode ("auto");
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
284 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
285
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
286 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
287 Canvas::canvasAutoAxes (const graphics_handle& handle)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
288 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
289 gh_manager::auto_lock lock;
20270
062422f2e399 Show axes coordinates in Qt figures (bug #44959)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20245
diff changeset
290
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
291 graphics_object go = gh_manager::get_object (handle);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
292
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
293 if (go.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
294 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
295 figure::properties& fp = Utils::properties<figure> (go);
20270
062422f2e399 Show axes coordinates in Qt figures (bug #44959)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20245
diff changeset
296
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
297 graphics_handle ah = fp.get_currentaxes ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
298
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
299 graphics_object ax = gh_manager::get_object (ah);
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
300
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
301 if (ax.valid_object ())
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
302 {
20245
a5f9bf4df254 Avoid crash when trying to annotate an empty figure (bug #45241)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20244
diff changeset
303 axes::properties& ap = Utils::properties<axes> (ax);
a5f9bf4df254 Avoid crash when trying to annotate an empty figure (bug #45241)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20244
diff changeset
304
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
305 autoscale_axes (ap);
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
306
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
307 redraw (true);
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
308 }
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
309 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
310 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
311
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
312 void
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
313 Canvas::canvasPaintEvent (void)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
314 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
315 if (! m_redrawBlocked)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
316 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
317 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
318
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
319 draw (m_handle);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
320
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
321 if ((m_mouseMode == ZoomInMode && m_mouseAxes.ok ()) || m_rectMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
322 drawZoomBox (m_mouseAnchor, m_mouseCurrent);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
323 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
324 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
325
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
326 static bool
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
327 pan_enabled (const graphics_object figObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
328 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
329 // Getting pan mode property:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
330 octave_value ov_pm
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
331 = Utils::properties<figure> (figObj).get___pan_mode__ ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
332
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
333 octave_scalar_map pm = ov_pm.scalar_map_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
334
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
335 return pm.contents ("Enable").string_value () == "on";
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
336 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
337
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
338 static std::string
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
339 pan_mode (const graphics_object figObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
340 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
341 // Getting pan mode property:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
342 octave_value ov_pm
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
343 = Utils::properties<figure> (figObj).get___pan_mode__ ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
344
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
345 octave_scalar_map pm = ov_pm.scalar_map_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
346
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
347 return pm.contents ("Motion").string_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
348 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
349
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
350 static bool
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
351 zoom_enabled (const graphics_object figObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
352 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
353 // Getting zoom mode property:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
354 octave_value ov_zm
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
355 = Utils::properties<figure> (figObj).get___zoom_mode__ ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
356
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
357 octave_scalar_map zm = ov_zm.scalar_map_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
358
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
359 return zm.contents ("Enable").string_value () == "on";
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
360 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
361
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
362 static std::string
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
363 zoom_mode (const graphics_object figObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
364 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
365 // Getting zoom mode property:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
366 octave_value ov_zm
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
367 = Utils::properties<figure> (figObj).get___zoom_mode__ ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
368
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
369 octave_scalar_map zm = ov_zm.scalar_map_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
370
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
371 return zm.contents ("Motion").string_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
372 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
373
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
374 void
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
375 Canvas::select_object (graphics_object obj, QMouseEvent *event,
23433
c9fab0bc983e maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents: 23364
diff changeset
376 graphics_object& currentObj, graphics_object& axesObj,
23185
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
377 bool axes_only, std::vector<std::string> omit)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
378 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
379 QList<graphics_object> axesList;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
380 Matrix children = obj.get_properties ().get_all_children ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
381 octave_idx_type num_children = children.numel ();
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
382
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
383 for (int i = 0; i < num_children; i++)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
384 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
385 graphics_object childObj (gh_manager::get_object (children(i)));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
386
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
387 if (childObj.isa ("axes"))
23185
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
388 {
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
389 auto p = omit.begin ();
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
390 bool omitfound = false;
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
391 while (p != omit.end () && ! omitfound)
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
392 {
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
393 omitfound = (childObj.get ("tag").string_value () == *p);
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
394 p++;
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
395 }
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
396 if (! omitfound)
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
397 axesList.append (childObj);
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
398 }
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
399 else if (childObj.isa ("uicontrol") || childObj.isa ("uipanel")
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
400 || childObj.isa ("uibuttongroup"))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
401 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
402 Matrix bb = childObj.get_properties ().get_boundingbox (false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
403 QRectF r (bb(0), bb(1), bb(2), bb(3));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
404
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
405 r.adjust (-5, -5, 5, 5);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
406
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
407 #if (HAVE_QT4)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
408 bool rect_contains_pos = r.contains (event->posF ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
409 #else
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
410 bool rect_contains_pos = r.contains (event->localPos ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
411 #endif
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
412 if (rect_contains_pos)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
413 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
414 currentObj = childObj;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
415 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
416 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
417 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
418 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
419
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
420 if (axes_only)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
421 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
422 QPoint pt = event->pos ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
423
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
424 for (QList<graphics_object>::ConstIterator it = axesList.begin ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
425 it != axesList.end (); ++it)
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
426 {
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
427 const axes::properties& ap =
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
428 dynamic_cast<const axes::properties&> ((*it).get_properties ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
429
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
430 ColumnVector p0 = ap.pixel2coord (pt.x (), pt.y ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
431 Matrix xlim = ap.get_xlim ().matrix_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
432 Matrix ylim = ap.get_ylim ().matrix_value ();
20245
a5f9bf4df254 Avoid crash when trying to annotate an empty figure (bug #45241)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20244
diff changeset
433
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
434 if (xlim(0) < p0(0) && xlim(1) > p0(0)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
435 && ylim(0) < p0(1) && ylim(1) > p0(1))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
436 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
437 axesObj = *it;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
438 return;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
439 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
440 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
441 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
442 else if (! currentObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
443 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
444 for (QList<graphics_object>::ConstIterator it = axesList.begin ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
445 it != axesList.end (); ++it)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
446 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
447 graphics_object go = selectFromAxes (*it, event->pos ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
448
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
449 if (go)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
450 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
451 currentObj = go;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
452 axesObj = *it;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
453 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
454 // FIXME: is this really necessary? the axes object should
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
455 // have been selected through selectFromAxes anyway
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
456 else if (it->get_properties ().is_hittest ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
457 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
458 Matrix bb = it->get_properties ().get_boundingbox (true);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
459 QRectF r (bb(0), bb(1), bb(2), bb(3));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
460
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
461 #if defined (HAVE_QT4)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
462 bool rect_contains_pos = r.contains (event->posF ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
463 #else
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
464 bool rect_contains_pos = r.contains (event->localPos ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
465 #endif
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
466 if (rect_contains_pos)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
467 axesObj = *it;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
468 }
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
469
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
470 if (axesObj && currentObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
471 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
472 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
473 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
474 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
475
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
476 void
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
477 Canvas::canvasMouseMoveEvent (QMouseEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
478 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
479 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
480 graphics_object ax = gh_manager::get_object (m_mouseAxes);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
481
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
482 if (m_mouseMode != NoMode && (ax.valid_object () || m_mouseMode == TextMode))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
483 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
484 switch (m_mouseMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
485 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
486 case RotateMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
487 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
488 axes::properties& ap = Utils::properties<axes> (ax);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
489
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
490 ap.rotate3d (m_mouseCurrent.x (), event->x (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
491 m_mouseCurrent.y (), event->y ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
492
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
493 // Update current mouse position
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
494 m_mouseCurrent = event->pos ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
495
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
496 // Force immediate redraw
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
497 redraw (true);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
498 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
499 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
500 case TextMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
501 case ZoomInMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
502 case ZoomOutMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
503 m_mouseCurrent = event->pos ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
504 redraw (true);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
505 break;
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
506
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
507 case PanMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
508 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
509 axes::properties& ap = Utils::properties<axes> (ax);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
510
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
511 graphics_object figObj (ax.get_ancestor ("figure"));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
512
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
513 std::string mode = pan_mode (figObj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
514
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
515 ColumnVector p0 = ap.pixel2coord (m_mouseCurrent.x (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
516 m_mouseCurrent.y ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
517 ColumnVector p1 = ap.pixel2coord (event->x (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
518 event->y ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
519
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
520 ap.translate_view (mode, p0(0), p1(0), p0(1), p1(1));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
521
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
522 // Update current mouse position
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
523 m_mouseCurrent = event->pos ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
524
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
525 // Force immediate redraw
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
526 redraw (true);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
527 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
528
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
529 default:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
530 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
531 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
532 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
533 else if (m_mouseMode == NoMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
534 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
535 graphics_object obj = gh_manager::get_object (m_handle);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
536
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
537 if (obj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
538 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
539 graphics_object figObj (obj.get_ancestor ("figure"));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
540
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
541 if (figObj.valid_object () &&
23577
80c42f4cca13 maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents: 23450
diff changeset
542 ! figObj.get ("windowbuttonmotionfcn").isempty ())
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
543 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
544 updateCurrentPoint (figObj, obj, event);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
545 gh_manager::post_callback (figObj.get_handle (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
546 "windowbuttonmotionfcn");
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
547 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
548 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
549 }
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
550
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
551 // Update mouse coordinates in the figure window status bar
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
552 graphics_object obj = gh_manager::get_object (m_handle);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
553 graphics_object figObj = obj.get_ancestor ("figure");
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
554
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
555 if (figObj.valid_object () && obj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
556 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
557 graphics_object currentObj, axesObj;
23185
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
558 std::vector<std::string> omit = {"legend", "colorbar", "scribeoverlay"};
0032c2f7ee4e Don't display legend, colorbar, and annotation axes coordinates (bug #50272).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23083
diff changeset
559 select_object (obj, event, currentObj, axesObj, true, omit);
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
560
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
561 if (axesObj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
562 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
563 // FIXME: should we use signal/slot mechanism instead of
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
564 // directly calling parent fig methods
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
565 Figure *fig =
23447
db1fdf4384dd maint: Use convention "static_cast<void *>" for casting of pointers.
Rik <rik@octave.org>
parents: 23433
diff changeset
566 dynamic_cast<Figure *> (Backend::toolkitObject (figObj));
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
567 axes::properties& ap = Utils::properties<axes> (axesObj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
568
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
569 if (fig)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
570 fig->updateStatusBar (ap.pixel2coord (event->x (), event->y ()));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
571 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
572 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
573 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
574
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
575 void
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
576 Canvas::canvasMouseDoubleClickEvent (QMouseEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
577 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
578 // same processing as normal click, but event type is MouseButtonDblClick
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
579 canvasMousePressEvent (event);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
580 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
581
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
582 static double
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
583 button_number (QMouseEvent *event)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
584 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
585 double retval = 0;
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
586
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
587 switch (event->button ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
588 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
589 case Qt::LeftButton:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
590 retval = 1;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
591 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
592
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
593 case Qt::MidButton:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
594 retval = 2;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
595 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
596
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
597 case Qt::RightButton:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
598 retval = 3;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
599 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
600
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
601 default:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
602 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
603 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
604
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
605 return retval;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
606 }
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
607
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
608 void
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
609 Canvas::canvasMousePressEvent (QMouseEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
610 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
611 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
612 graphics_object obj = gh_manager::get_object (m_handle);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
613
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
614 bool isdblclick = (event->type () == QEvent::MouseButtonDblClick);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
615
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
616 if (obj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
617 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
618 graphics_object figObj (obj.get_ancestor ("figure"));
23360
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
619
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
620 // Any click in a figure canvas makes it current
23360
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
621 if (figObj)
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
622 {
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
623 graphics_object root = gh_manager::get_object (0);
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
624 Utils::properties<root_figure> (root)
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
625 .set_currentfigure (figObj.get_handle ().as_octave_value ());
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
626 }
43f549ac6dac Let mouse selection of Qt figures update "currentfigure" (bug #50666)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23219
diff changeset
627
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
628 graphics_object currentObj, axesObj;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
629
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
630 // Retrieve selected object.
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
631 select_object (obj, event, currentObj, axesObj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
632
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
633 // currentObj may be invalid if, e.g., all objects under the mouse
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
634 // click had "hittest" -> "off" or "pickableparts" -> "none". In that
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
635 // case, replace with underlying figObj which always accepts mouse
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
636 // clicks.
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
637 if (! currentObj.valid_object ())
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
638 currentObj = figObj;
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
639
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
640 if (axesObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
641 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
642 if (axesObj.get_properties ().handlevisibility_is ("on")
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
643 && axesObj.get_properties ().get_tag () != "legend"
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
644 && axesObj.get_properties ().get_tag () != "colorbar")
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
645 Utils::properties<figure> (figObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
646 .set_currentaxes (axesObj.get_handle ().as_octave_value ());
19887
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
647 }
966a1933f3fa respect x- or y-only pan mode when clicking and dragging (bug #44408)
John W. Eaton <jwe@octave.org>
parents: 19870
diff changeset
648
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
649 Figure *fig = dynamic_cast<Figure *> (Backend::toolkitObject (figObj));
19765
134e5bfff5c5 * Canvas.cc (button_number): New static function.
John W. Eaton <jwe@octave.org>
parents: 19762
diff changeset
650
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
651 MouseMode newMouseMode = NoMode;
19782
98cc7c741c5a avoid GCC warning about enumeration values not handled in switch statement
John W. Eaton <jwe@octave.org>
parents: 19765
diff changeset
652
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
653 if (fig)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
654 newMouseMode = fig->mouseMode ();
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
655
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
656 switch (newMouseMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
657 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
658 case NoMode:
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
659 {
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
660 // Update the figure "currentobject"
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
661 auto& fprop = Utils::properties<figure> (figObj);
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
662
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
663 if (currentObj.get_properties ().handlevisibility_is ("on"))
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
664 fprop.set_currentobject (currentObj.get_handle ()
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
665 .as_octave_value ());
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
666 else
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
667 fprop.set_currentobject (Matrix ());
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
668
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
669 // Update figure "selectiontype" and "currentpoint"
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
670 gh_manager::post_set (
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
671 figObj.get_handle (), "selectiontype",
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
672 Utils::figureSelectionType (event, isdblclick), false);
19765
134e5bfff5c5 * Canvas.cc (button_number): New static function.
John W. Eaton <jwe@octave.org>
parents: 19762
diff changeset
673
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
674 updateCurrentPoint (figObj, obj, event);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
675
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
676 gh_manager::post_callback (figObj.get_handle (),
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
677 "windowbuttondownfcn",
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
678 button_number (event));
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
679
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
680 // Execute the "buttondownfcn" of the selected object
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
681 if (! currentObj.get ("buttondownfcn").isempty ())
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
682 gh_manager::post_callback (currentObj.get_handle (),
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
683 "buttondownfcn",
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
684 button_number (event));
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
685
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
686 // Show context menu of the selected object
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
687 if (event->button () == Qt::RightButton)
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
688 ContextMenu::executeAt (currentObj.get_properties (),
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
689 event->globalPos ());
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24373
diff changeset
690 }
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
691 break;
20009
f2dea119369e Qt Canvas: set selection type to 'open' on double click (Bug #44669)
John Donoghue
parents: 20006
diff changeset
692
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
693 case TextMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
694 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
695 if (event->modifiers () == Qt::NoModifier)
18692
fe0e34be5576 maint: untabify recently added code files.
Rik <rik@octave.org>
parents: 18612
diff changeset
696 {
fe0e34be5576 maint: untabify recently added code files.
Rik <rik@octave.org>
parents: 18612
diff changeset
697 switch (event->buttons ())
fe0e34be5576 maint: untabify recently added code files.
Rik <rik@octave.org>
parents: 18612
diff changeset
698 {
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
699 case Qt::LeftButton:
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
700 m_mouseAnchor = m_mouseCurrent = event->pos ();
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
701 m_mouseMode = newMouseMode;
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
702 m_rectMode = true;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
703 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
704 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
705 redraw (false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
706 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
707 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
708
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
709 case PanMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
710 case RotateMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
711 case ZoomInMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
712 case ZoomOutMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
713 if (axesObj && axesObj.get_properties ().handlevisibility_is ("on"))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
714 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
715 bool redraw_figure = true;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
716
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
717 if (isdblclick)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
718 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
719 if (event->button () == Qt::LeftButton)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
720 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
721 axes::properties& ap = Utils::properties<axes> (axesObj);
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
722
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
723 autoscale_axes (ap);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
724 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
725 else
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
726 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
727 redraw_figure = false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
728 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
729 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
730 else if (event->modifiers () == Qt::NoModifier)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
731 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
732 switch (event->buttons ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
733 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
734 case Qt::LeftButton:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
735 m_mouseAnchor = m_mouseCurrent = event->pos ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
736 m_mouseAxes = axesObj.get_handle ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
737 m_mouseMode = newMouseMode;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
738 m_clickMode = newMouseMode == ZoomInMode;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
739 break;
20090
c6c5cb9c4743 Right-click should zoom out by 2 for Qt toolkit (bug #44304).
Rik <rik@octave.org>
parents: 20080
diff changeset
740
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
741 case Qt::RightButton:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
742 if (newMouseMode == ZoomInMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
743 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
744 m_mouseAnchor = m_mouseCurrent = event->pos ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
745 m_mouseAxes = axesObj.get_handle ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
746 m_mouseMode = newMouseMode;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
747 m_clickMode = false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
748 }
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
749
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
750 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
751
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
752 case Qt::MidButton:
18692
fe0e34be5576 maint: untabify recently added code files.
Rik <rik@octave.org>
parents: 18612
diff changeset
753 {
fe0e34be5576 maint: untabify recently added code files.
Rik <rik@octave.org>
parents: 18612
diff changeset
754 axes::properties& ap =
fe0e34be5576 maint: untabify recently added code files.
Rik <rik@octave.org>
parents: 18612
diff changeset
755 Utils::properties<axes> (axesObj);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
756
19870
815db217f6f4 provide autoscale option for Qt plotting (bug #44307)
John W. Eaton <jwe@octave.org>
parents: 19867
diff changeset
757 autoscale_axes (ap);
18692
fe0e34be5576 maint: untabify recently added code files.
Rik <rik@octave.org>
parents: 18612
diff changeset
758 }
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
759 break;
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
760
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
761 default:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
762 redraw_figure = false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
763 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
764 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
765 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
766 else if (event->modifiers () == Qt::ShiftModifier)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
767 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
768 switch (event->buttons ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
769 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
770 case Qt::LeftButton:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
771 if (newMouseMode == ZoomInMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
772 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
773 m_mouseAnchor = m_mouseCurrent = event->pos ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
774 m_mouseAxes = axesObj.get_handle ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
775 m_mouseMode = newMouseMode;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
776 m_clickMode = false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
777 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
778 break;
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
779
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
780 default:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
781 redraw_figure = false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
782 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
783 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
784 }
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
785
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
786 if (redraw_figure)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
787 redraw (false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
788 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
789 break;
19762
eebe8da58f8d allow shift + left button to zoom out (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19759
diff changeset
790
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
791 default:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
792 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
793 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
794 }
20009
f2dea119369e Qt Canvas: set selection type to 'open' on double click (Bug #44669)
John Donoghue
parents: 20006
diff changeset
795
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
796 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
797
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
798 void
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
799 Canvas::canvasMouseReleaseEvent (QMouseEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
800 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
801 if ((m_mouseMode == ZoomInMode || m_mouseMode == ZoomOutMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
802 && m_mouseAxes.ok ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
803 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
804 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
805 graphics_object ax = gh_manager::get_object (m_mouseAxes);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
806
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
807 if (ax.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
808 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
809 axes::properties& ap = Utils::properties<axes> (ax);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
810
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
811 graphics_object obj = gh_manager::get_object (m_handle);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
812
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
813 graphics_object figObj (obj.get_ancestor ("figure"));
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
814
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
815 std::string zm = zoom_mode (figObj);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
816
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
817 if (m_mouseAnchor == event->pos ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
818 {
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23449
diff changeset
819 double factor = (m_clickMode ? 2.0 : 0.5);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
820
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
821 ColumnVector p1 = ap.pixel2coord (event->x (), event->y ());
19894
ac18e88ea1bf zoom about point for single clicks
John W. Eaton <jwe@octave.org>
parents: 19887
diff changeset
822
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
823 ap.zoom_about_point (zm, p1(0), p1(1), factor);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
824 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
825 else if (m_mouseMode == ZoomInMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
826 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
827 ColumnVector p0 = ap.pixel2coord (m_mouseAnchor.x (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
828 m_mouseAnchor.y ());
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
829 ColumnVector p1 = ap.pixel2coord (event->x (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
830 event->y ());
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
831
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
832 Matrix xl (1, 2, 0.0);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
833 Matrix yl (1, 2, 0.0);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
834
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
835 xl(0) = std::min (p0(0), p1(0));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
836 xl(1) = std::max (p0(0), p1(0));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
837 yl(0) = std::min (p0(1), p1(1));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
838 yl(1) = std::max (p0(1), p1(1));
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
839
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
840 ap.zoom (zm, xl, yl);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
841 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
842
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
843 redraw (false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
844 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
845 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
846 else if (m_mouseMode == NoMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
847 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
848 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
849 graphics_object obj = gh_manager::get_object (m_handle);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
850
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
851 if (obj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
852 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
853 graphics_object figObj (obj.get_ancestor ("figure"));
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
854
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
855 updateCurrentPoint (figObj, obj, event);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
856 gh_manager::post_callback (figObj.get_handle (),
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
857 "windowbuttonupfcn");
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
858 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
859 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
860 else if (m_mouseMode == TextMode)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
861 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
862 gh_manager::auto_lock lock;
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20110
diff changeset
863
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
864 graphics_object figObj =
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
865 gh_manager::get_object (m_handle).get_ancestor ("figure");
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
866 if (figObj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
867 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
868 QWidget *w = qWidget ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
869 if (w)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
870 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
871 Matrix bb = figObj.get ("position").matrix_value ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
872 bb(0) = m_mouseAnchor.x () / bb(2);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
873 bb(1) = 1.0 - (m_mouseAnchor.y () / bb(3));
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
874 bb(2) = (event->x () - m_mouseAnchor.x ()) / bb(2);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
875 bb(3) = (m_mouseAnchor.y () - event->y ()) / bb(3);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
876
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
877 octave_value_list props = ovl ("textbox", bb);
20107
f1f6d5eab46f Draw a zoom-like box when creating an annotation interactively
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20106
diff changeset
878
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
879 annotation_dialog anno_dlg (w, props);
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20110
diff changeset
880
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
881 if (anno_dlg.exec () == QDialog::Accepted)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
882 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
883 props = anno_dlg.get_properties ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
884 props.prepend (figObj.get_handle ().as_octave_value ());
20107
f1f6d5eab46f Draw a zoom-like box when creating an annotation interactively
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20106
diff changeset
885
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
886 octave_link::post_event (this, &Canvas::annotation_callback,
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
887 props);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
888 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
889 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
890 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
891 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
892 m_rectMode = false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
893 m_mouseAxes = graphics_handle ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
894 m_mouseMode = NoMode;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
895 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
896
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
897 void
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
898 Canvas::canvasWheelEvent (QWheelEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
899 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
900 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
901 graphics_object obj = gh_manager::get_object (m_handle);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
902
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
903 if (obj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
904 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
905 std::string mode;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
906
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
907 graphics_object axesObj;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
908
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
909 Matrix children = obj.get_properties ().get_children ();
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
910 octave_idx_type num_children = children.numel ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
911
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
912 for (int i = 0; i < num_children; i++)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
913 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
914 graphics_object childObj (gh_manager::get_object (children(i)));
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
915
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
916 if (childObj.isa ("axes"))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
917 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
918 graphics_object go = selectFromAxes (childObj, event->pos ());
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
919
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
920 if (go)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
921 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
922 axesObj = childObj;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
923 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
924 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
925 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
926 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
927
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
928 if (axesObj)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
929 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
930 MouseMode newMouseMode = NoMode;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
931
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
932 graphics_object figObj (obj.get_ancestor ("figure"));
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
933
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
934 Figure *fig = dynamic_cast<Figure *> (Backend::toolkitObject (figObj));
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
935
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
936 if (fig)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
937 newMouseMode = fig->mouseMode ();
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
938
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
939 if (axesObj.get_properties ().handlevisibility_is ("on"))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
940 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
941 Utils::properties<figure> (figObj)
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
942 .set_currentaxes (axesObj.get_handle ().as_octave_value ());
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
943
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
944 if (zoom_enabled (figObj))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
945 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
946 if (event->delta () > 0)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
947 newMouseMode = ZoomInMode;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
948 else
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
949 newMouseMode = ZoomOutMode;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
950
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
951 mode = zoom_mode (figObj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
952 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
953 else if (pan_enabled (figObj))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
954 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
955 newMouseMode = PanMode;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
956
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
957 mode = pan_mode (figObj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
958 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
959 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
960
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
961 bool redrawFigure = true;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
962
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
963 switch (newMouseMode)
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
964 {
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
965 case ZoomInMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
966 case ZoomOutMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
967 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
968 axes::properties& ap = Utils::properties<axes> (axesObj);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
969
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
970 // Control how fast to zoom when using scroll wheel.
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
971 double wheel_zoom_speed = ap.get_mousewheelzoom ();
19759
ed1bafbb87ee allow mouse wheel zoom amount to be configurable for qt graphics (bug #44304)
John W. Eaton <jwe@octave.org>
parents: 19681
diff changeset
972
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
973 // Determine if we're zooming in or out.
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
974 double factor = (newMouseMode == ZoomInMode
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
975 ? 1 / (1.0 - wheel_zoom_speed)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
976 : 1.0 - wheel_zoom_speed);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
977
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
978 // FIXME: should we zoom about point for 2D plots?
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
979
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
980 ap.zoom (mode, factor);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
981 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
982 break;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
983
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
984 case PanMode:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
985 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
986 axes::properties& ap = Utils::properties<axes> (axesObj);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
987
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23449
diff changeset
988 double factor = (event->delta () > 0 ? 0.1 : -0.1);
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
989
24372
708b98b4cdd1 Make wheel scroll behave more consistently in pan mode (bug #52588).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23360
diff changeset
990 if (event->modifiers () == Qt::NoModifier
708b98b4cdd1 Make wheel scroll behave more consistently in pan mode (bug #52588).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23360
diff changeset
991 && mode != "horizontal")
708b98b4cdd1 Make wheel scroll behave more consistently in pan mode (bug #52588).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23360
diff changeset
992 ap.pan ("vertical", factor);
708b98b4cdd1 Make wheel scroll behave more consistently in pan mode (bug #52588).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23360
diff changeset
993 else if (event->modifiers () == Qt::ShiftModifier
708b98b4cdd1 Make wheel scroll behave more consistently in pan mode (bug #52588).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23360
diff changeset
994 && mode != "vertical")
708b98b4cdd1 Make wheel scroll behave more consistently in pan mode (bug #52588).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23360
diff changeset
995 ap.pan ("horizontal", factor);
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
996 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
997 break;
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
998
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
999 default:
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1000 redrawFigure = false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1001 break;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1002 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
1003
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1004 if (redrawFigure)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1005 redraw (false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1006 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1007 }
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1008 }
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 18692
diff changeset
1009
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1010 bool
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
1011 Canvas::canvasKeyPressEvent (QKeyEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1012 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1013 if (m_eventMask & KeyPress)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1014 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1015 gh_manager::auto_lock lock;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1016 graphics_object obj = gh_manager::get_object (m_handle);
20110
248f2f2e7d48 Return correct x,y coordinates for keystroke with ginput in Qt (bug #44834).
Rik <rik@octave.org>
parents: 20107
diff changeset
1017
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1018 if (obj.valid_object ())
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1019 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1020 graphics_object figObj (obj.get_ancestor ("figure"));
20110
248f2f2e7d48 Return correct x,y coordinates for keystroke with ginput in Qt (bug #44834).
Rik <rik@octave.org>
parents: 20107
diff changeset
1021
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1022 updateCurrentPoint (figObj, obj);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1023 }
20110
248f2f2e7d48 Return correct x,y coordinates for keystroke with ginput in Qt (bug #44834).
Rik <rik@octave.org>
parents: 20107
diff changeset
1024
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1025 octave_scalar_map eventData = Utils::makeKeyEventStruct (event);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1026
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1027 gh_manager::post_set (m_handle, "currentcharacter",
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1028 eventData.getfield ("Character"), false);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1029 gh_manager::post_callback (m_handle, "keypressfcn", eventData);
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1030
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1031 return true;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1032 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1033
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1034 return false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1035 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1036
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1037 bool
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
1038 Canvas::canvasKeyReleaseEvent (QKeyEvent *event)
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1039 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1040 if (! event->isAutoRepeat () && (m_eventMask & KeyRelease))
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1041 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1042 gh_manager::post_callback (m_handle, "keyreleasefcn",
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1043 Utils::makeKeyEventStruct (event));
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1044
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1045 return true;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1046 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1047
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1048 return false;
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1049 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1050
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1051 Canvas*
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
1052 Canvas::create (const std::string& /* name */, QWidget *parent,
22411
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1053 const graphics_handle& handle)
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1054 {
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1055 // Only OpenGL
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1056 return new GLCanvas (parent, handle);
c69805d1fa64 maint: Style check C++ code in libgui/
Rik <rik@octave.org>
parents: 22323
diff changeset
1057 }
18498
2e7cad6f180c Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1058
22413
8758addcf265 maint: Remove ';' at end of namespace declaration.
Rik <rik@octave.org>
parents: 22411
diff changeset
1059 }