• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • kig
kig_view.cpp
Go to the documentation of this file.
1 
21 #include "kig_view.h"
22 #include "kig_view.moc"
23 
24 #include "kig_part.h"
25 #include "kig_document.h"
26 #include "kig_commands.h"
27 #include "../misc/coordinate_system.h"
28 #include "../misc/kiginputdialog.h"
29 #include "../misc/kigpainter.h"
30 #include "../modes/mode.h"
31 #include "../modes/dragrectmode.h"
32 
33 #include <qapplication.h>
34 #include <qevent.h>
35 #include <qlayout.h>
36 #include <qscrollbar.h>
37 
38 #include <kdebug.h>
39 #include <klocale.h>
40 
41 #include <cmath>
42 #include <algorithm>
43 #include <iterator>
44 
45 KigWidget::KigWidget( KigPart* part,
46  KigView* view,
47  QWidget* parent,
48  bool fullscreen )
49  : QWidget( parent,
50  fullscreen ? Qt::FramelessWindowHint : (Qt::WFlags)0 ),
51  mpart( part ),
52  mview( view ),
53  stillPix(size()),
54  curPix(size()),
55  msi( Rect(), rect() ),
56  misfullscreen( fullscreen ),
57  mispainting( false ),
58  malreadyresized( false )
59 {
60  setAttribute( Qt::WA_PaintOnScreen, true );
61  part->addWidget(this);
62 
63  setFocusPolicy(Qt::ClickFocus);
64  setAttribute( Qt::WA_NoBackground, true );
65  setMouseTracking(true);
66 
67  curPix = QPixmap( size() );
68  stillPix = QPixmap( size() );
69 }
70 
71 KigWidget::~KigWidget()
72 {
73  mpart->delWidget( this );
74 }
75 
76 void KigWidget::paintEvent(QPaintEvent* e)
77 {
78  mispainting = true;
79  std::vector<QRect> overlay;
80  overlay.push_back( e->rect() );
81  updateWidget( overlay );
82 }
83 
84 void KigWidget::mousePressEvent (QMouseEvent* e)
85 {
86  if( e->button() & Qt::LeftButton )
87  return mpart->mode()->leftClicked( e, this );
88  if ( e->button() & Qt::MidButton )
89  return mpart->mode()->midClicked( e, this );
90  if ( e->button() & Qt::RightButton )
91  return mpart->mode()->rightClicked( e, this );
92 }
93 
94 void KigWidget::mouseMoveEvent (QMouseEvent* e)
95 {
96  if( ( e->buttons() & Qt::LeftButton ) == Qt::LeftButton )
97  return mpart->mode()->leftMouseMoved( e, this );
98  if ( ( e->buttons() & Qt::MidButton ) == Qt::MidButton )
99  return mpart->mode()->midMouseMoved( e, this );
100  if ( ( e->buttons() & Qt::RightButton ) == Qt::RightButton )
101  return mpart->mode()->rightMouseMoved( e, this );
102  return mpart->mode()->mouseMoved( e, this );
103 }
104 
105 void KigWidget::mouseReleaseEvent (QMouseEvent* e)
106 {
107  if( e->button() & Qt::LeftButton )
108  return mpart->mode()->leftReleased( e, this );
109  if ( e->button() & Qt::MidButton )
110  return mpart->mode()->midReleased( e, this );
111  if ( e->button() & Qt::RightButton )
112  return mpart->mode()->rightReleased( e, this );
113 }
114 
115 void KigWidget::updateWidget( const std::vector<QRect>& overlay )
116 {
117  if ( !mispainting )
118  {
119  QRect r;
120  int rectinited = false;
121  for ( std::vector<QRect>::const_iterator i = oldOverlay.begin(); i != oldOverlay.end(); ++i )
122  if ( rectinited )
123  r |= *i;
124  else
125  {
126  r = *i;
127  rectinited = true;
128  }
129  for ( std::vector<QRect>::const_iterator i = overlay.begin(); i != overlay.end(); ++i )
130  if ( rectinited )
131  r |= *i;
132  else
133  {
134  r = *i;
135  rectinited = true;
136  }
137  repaint( r );
138  return;
139  }
140 
141  oldOverlay = overlay;
142 
143  QPainter p( this );
144  p.drawPixmap( overlay.front().topLeft(), curPix, overlay.front() );
145  p.end();
146  mispainting = false;
147 }
148 
149 void KigWidget::updateEntireWidget()
150 {
151  std::vector<QRect> overlay;
152  overlay.push_back( QRect( QPoint( 0, 0 ), size() ) );
153  updateWidget( overlay );
154 }
155 
156 void KigWidget::resizeEvent( QResizeEvent* e )
157 {
158  QSize osize = e->oldSize();
159  QSize nsize = e->size();
160  Rect orect = msi.shownRect();
161 
162  curPix = QPixmap( nsize );
163  stillPix = QPixmap( nsize );
164  msi.setViewRect( rect() );
165 
166  Rect nrect( 0., 0.,
167  orect.width() * nsize.width() / osize.width(),
168  orect.height() * nsize.height() / osize.height() );
169  nrect = matchScreenShape( nrect );
170  nrect.setCenter( orect.center() );
171  msi.setShownRect( nrect );
172 
173  // horrible hack... We need to somehow differentiate between the
174  // resizeEvents we get on startup, and the ones generated by the
175  // user. The first requires recentering the screen, the latter
176  // does not..
177  if ( !malreadyresized )
178  {
179  recenterScreen();
180  malreadyresized = true;
181  }
182 
183  mpart->redrawScreen( this );
184  updateScrollBars();
185 }
186 
187 void KigWidget::updateCurPix( const std::vector<QRect>& ol )
188 {
189  // we make curPix look like stillPix again...
190  QPainter p( &curPix );
191  for ( std::vector<QRect>::const_iterator i = oldOverlay.begin(); i != oldOverlay.end(); ++i )
192  p.drawPixmap( i->topLeft(), stillPix, *i );
193  for ( std::vector<QRect>::const_iterator i = ol.begin(); i != ol.end(); ++i )
194  p.drawPixmap( i->topLeft(), stillPix, *i );
195  p.end();
196 
197  // we add ol to oldOverlay, so that part of the widget will be
198  // updated too in updateWidget...
199  std::copy( ol.begin(), ol.end(), std::back_inserter( oldOverlay ) );
200 }
201 
202 void KigWidget::recenterScreen()
203 {
204  msi.setShownRect( matchScreenShape( mpart->document().suggestedRect() ) );
205 }
206 
207 Rect KigWidget::matchScreenShape( const Rect& r ) const
208 {
209  return r.matchShape( Rect::fromQRect( rect() ) );
210 }
211 
212 void KigWidget::slotZoomIn()
213 {
214  Rect nr = msi.shownRect();
215  Coordinate c = nr.center();
216  nr /= 2;
217  nr.setCenter( c );
218  KigCommand* cd =
219  new KigCommand( *mpart,
220  i18n( "Zoom In" ) );
221  cd->addTask( new KigViewShownRectChangeTask( *this, nr ) );
222  mpart->history()->push( cd );
223 }
224 
225 void KigWidget::slotZoomOut()
226 {
227  Rect nr = msi.shownRect();
228  Coordinate c = nr.center();
229  nr *= 2;
230  nr.setCenter( c );
231 
232  // zooming in is undoable.. I know this isn't really correct,
233  // because the current view doesn't really belong to the document (
234  // althought KGeo and KSeg both save them along, iirc ). However,
235  // undoing a zoom or another operation affecting the window seems a
236  // bit too useful to not be available. Please try to convince me if
237  // you feel otherwise ;-)
238  KigCommand* cd =
239  new KigCommand( *mpart,
240  i18n( "Zoom Out" ) );
241  cd->addTask( new KigViewShownRectChangeTask( *this, nr ) );
242  mpart->history()->push( cd );
243 }
244 
245 void KigWidget::clearStillPix()
246 {
247  stillPix.fill(Qt::white);
248  oldOverlay.clear();
249  oldOverlay.push_back ( QRect( QPoint(0,0), size() ) );
250 }
251 
252 void KigWidget::redrawScreen( const std::vector<ObjectHolder*>& _selection, bool dos )
253 {
254  std::vector<ObjectHolder*> nonselection;
255  std::vector<ObjectHolder*> selection = _selection;
256  std::set<ObjectHolder*> objs = mpart->document().objectsSet();
257  std::sort( selection.begin(), selection.end() );
258  std::set_difference( objs.begin(), objs.end(), selection.begin(), selection.end(),
259  std::back_inserter( nonselection ) );
260 
261  // update the screen...
262  clearStillPix();
263  KigPainter p( msi, &stillPix, mpart->document() );
264  p.drawGrid( mpart->document().coordinateSystem(), mpart->document().grid(),
265  mpart->document().axes() );
266  p.drawObjects( selection, true );
267  p.drawObjects( nonselection, false );
268  updateCurPix( p.overlay() );
269  if ( dos ) updateEntireWidget();
270 }
271 
272 const ScreenInfo& KigWidget::screenInfo() const
273 {
274  return msi;
275 }
276 
277 const Rect KigWidget::showingRect() const
278 {
279  return msi.shownRect();
280 }
281 
282 const Coordinate KigWidget::fromScreen( const QPoint& p )
283 {
284  return msi.fromScreen( p );
285 }
286 
287 double KigWidget::pixelWidth() const
288 {
289  return msi.pixelWidth();
290 }
291 
292 const Rect KigWidget::fromScreen( const QRect& r )
293 {
294  return msi.fromScreen( r );
295 }
296 
297 
298 void KigWidget::updateScrollBars()
299 {
300  mview->updateScrollBars();
301 }
302 
303 KigView::KigView( KigPart* part,
304  bool fullscreen,
305  QWidget* parent )
306  : QWidget( parent ),
307  mlayout( 0 ), mrightscroll( 0 ), mbottomscroll( 0 ),
308  mupdatingscrollbars( false ),
309  mrealwidget( 0 ), mpart( part )
310 {
311  connect( part, SIGNAL( recenterScreen() ), this, SLOT( slotInternalRecenterScreen() ) );
312 
313  mlayout = new QGridLayout( this );
314  mlayout->setMargin( 2 );
315  mlayout->setSpacing( 2 );
316  mrightscroll = new QScrollBar( Qt::Vertical, this );
317  mrightscroll->setObjectName( "Right Scrollbar" );
318  // TODO: make this configurable...
319  mrightscroll->setTracking( true );
320  connect( mrightscroll, SIGNAL( valueChanged( int ) ),
321  this, SLOT( slotRightScrollValueChanged( int ) ) );
322  connect( mrightscroll, SIGNAL( sliderReleased() ),
323  this, SLOT( updateScrollBars() ) );
324  mbottomscroll = new QScrollBar( Qt::Horizontal, this );
325  mbottomscroll->setObjectName( "Bottom Scrollbar" );
326  connect( mbottomscroll, SIGNAL( valueChanged( int ) ),
327  this, SLOT( slotBottomScrollValueChanged( int ) ) );
328  connect( mbottomscroll, SIGNAL( sliderReleased() ),
329  this, SLOT( updateScrollBars() ) );
330  mrealwidget = new KigWidget( part, this, this, fullscreen );
331  mrealwidget->setObjectName( "Kig Widget" );
332  mlayout->addWidget( mbottomscroll, 1, 0 );
333  mlayout->addWidget( mrealwidget, 0, 0 );
334  mlayout->addWidget( mrightscroll, 0, 1 );
335 
336  resize( sizeHint() );
337  mrealwidget->recenterScreen();
338  part->redrawScreen( mrealwidget );
339  updateScrollBars();
340 }
341 
342 void KigView::updateScrollBars()
343 {
344  // we update the scrollbars to reflect the new "total size" of the
345  // document... The total size is scaled in entireDocumentRect().
346  // ( it is scaled as a rect that contains all the points in the
347  // document, and then enlarged a bit, and scaled to match the screen
348  // width/height ratio...)
349  // What we do here is tell the scroll bars what they should show as
350  // their total size..
351 
352  // see the doc of this variable in the header for this...
353  mupdatingscrollbars = true;
354 
355  Rect er = mrealwidget->entireDocumentRect();
356  Rect sr = mrealwidget->screenInfo().shownRect();
357 
358  // we define the total rect to be the smallest rect that contains
359  // both er and sr...
360  er |= sr;
361 
362  // we need ints, not doubles, so since "pixelwidth == widgetcoord /
363  // internalcoord", we use "widgetcoord/pixelwidth", which would then
364  // equal "internalcoord", which has to be an int ( by definition.. )
365  // I know, I'm a freak to think about these sorts of things... ;)
366  double pw = mrealwidget->screenInfo().pixelWidth();
367 
368  // what the scrollbars reflect is the bottom resp. the left side of
369  // the shown rect. This is why the maximum value is not er.top()
370  // (which would be the maximum value of the top of the shownRect),
371  // but er.top() - sr.height(), which is the maximum value the bottom of
372  // the shownRect can reach...
373 
374  int rightmin = static_cast<int>( er.bottom() / pw );
375  int rightmax = static_cast<int>( ( er.top() - sr.height() ) / pw );
376 
377  mrightscroll->setMinimum( rightmin );
378  mrightscroll->setMaximum( rightmax );
379  mrightscroll->setSingleStep( (int)( sr.height() / pw / 10 ) );
380  mrightscroll->setPageStep( (int)( sr.height() / pw / 1.2 ) );
381 
382  // note that since Qt has a coordinate system with the lowest y
383  // values at the top, and we have it the other way around ( i know I
384  // shouldn't have done this.. :( ), we invert the value that the
385  // scrollbar shows. This is inverted again in
386  // slotRightScrollValueChanged()...
387  mrightscroll->setValue( (int) ( rightmin + ( rightmax - ( sr.bottom() / pw ) ) ) );
388 
389  mbottomscroll->setMinimum( (int)( er.left() / pw ) );
390  mbottomscroll->setMaximum( (int)( ( er.right() - sr.width() ) / pw ) );
391  mbottomscroll->setSingleStep( (int)( sr.width() / pw / 10 ) );
392  mbottomscroll->setPageStep( (int)( sr.width() / pw / 1.2 ) );
393  mbottomscroll->setValue( (int)( sr.left() / pw ) );
394 
395  mupdatingscrollbars = false;
396 }
397 
398 Rect KigWidget::entireDocumentRect() const
399 {
400  return matchScreenShape( mpart->document().suggestedRect() );
401 }
402 
403 void KigView::slotRightScrollValueChanged( int v )
404 {
405  if ( ! mupdatingscrollbars )
406  {
407  // we invert the inversion that was done in updateScrollBars() (
408  // check the documentation there..; )
409  v = mrightscroll->minimum() + ( mrightscroll->maximum() - v );
410  double pw = mrealwidget->screenInfo().pixelWidth();
411  double nb = double( v ) * pw;
412  mrealwidget->scrollSetBottom( nb );
413  };
414 }
415 
416 void KigView::slotBottomScrollValueChanged( int v )
417 {
418  if ( ! mupdatingscrollbars )
419  {
420  double pw = mrealwidget->screenInfo().pixelWidth();
421  double nl = double( v ) * pw;
422  mrealwidget->scrollSetLeft( nl );
423  };
424 }
425 
426 void KigWidget::scrollSetBottom( double rhs )
427 {
428  Rect sr = msi.shownRect();
429  Coordinate bl = sr.bottomLeft();
430  bl.y = rhs;
431  sr.setBottomLeft( bl );
432  msi.setShownRect( sr );
433  mpart->redrawScreen( this );
434 }
435 
436 void KigWidget::scrollSetLeft( double rhs )
437 {
438  Rect sr = msi.shownRect();
439  Coordinate bl = sr.bottomLeft();
440  bl.x = rhs;
441  sr.setBottomLeft( bl );
442  msi.setShownRect( sr );
443  mpart->redrawScreen( this );
444 }
445 
446 const ScreenInfo& KigView::screenInfo() const
447 {
448  return mrealwidget->screenInfo();
449 }
450 
451 KigView::~KigView()
452 {
453 }
454 
455 KigWidget* KigView::realWidget() const
456 {
457  return mrealwidget;
458 }
459 
460 const KigDocument& KigWidget::document() const
461 {
462  return mpart->document();
463 }
464 
465 QSize KigWidget::sizeHint() const
466 {
467  return QSize( 630, 450 );
468 }
469 
470 void KigWidget::wheelEvent( QWheelEvent* e )
471 {
472  int delta = e->delta();
473  Qt::Orientation orient = e->orientation();
474  if ( orient == Qt::Vertical )
475  mview->scrollVertical( delta );
476  else
477  mview->scrollHorizontal( delta );
478 }
479 
480 void KigView::scrollHorizontal( int delta )
481 {
482  if ( delta >= 0 )
483  for ( int i = 0; i < delta; i += 120 )
484  mbottomscroll->triggerAction( QScrollBar::SliderSingleStepSub );
485  else
486  for ( int i = 0; i >= delta; i -= 120 )
487  mbottomscroll->triggerAction( QScrollBar::SliderSingleStepAdd );
488 }
489 
490 void KigView::scrollVertical( int delta )
491 {
492  if ( delta >= 0 )
493  for ( int i = 0; i < delta; i += 120 )
494  mrightscroll->triggerAction( QScrollBar::SliderSingleStepSub );
495  else
496  for ( int i = 0; i >= delta; i -= 120 )
497  mrightscroll->triggerAction( QScrollBar::SliderSingleStepAdd );
498 }
499 
500 bool KigWidget::isFullScreen() const
501 {
502  return misfullscreen;
503 }
504 
505 void KigView::slotZoomIn()
506 {
507  mrealwidget->slotZoomIn();
508 }
509 
510 void KigView::slotZoomOut()
511 {
512  mrealwidget->slotZoomOut();
513 }
514 
515 void KigWidget::slotRecenterScreen()
516 {
517  Rect nr = mpart->document().suggestedRect();
518  KigCommand* cd =
519  new KigCommand( *mpart,
520  i18n( "Recenter View" ) );
521 
522  cd->addTask( new KigViewShownRectChangeTask( *this, nr ) );
523  mpart->history()->push( cd );
524 }
525 
526 void KigView::toggleFullScreen()
527 {
528  mrealwidget->setFullScreen( ! mrealwidget->isFullScreen() );
529  if ( mrealwidget->isFullScreen() )
530  topLevelWidget()->setWindowState( topLevelWidget()->windowState() | Qt::WindowFullScreen ); // set
531  else
532  topLevelWidget()->setWindowState( topLevelWidget()->windowState() & ~Qt::WindowFullScreen ); // reset
533 }
534 
535 void KigWidget::setFullScreen( bool f )
536 {
537  misfullscreen = f;
538 }
539 
540 void KigWidget::zoomRect()
541 {
542  mpart->emitStatusBarText( i18n( "Select the rectangle that should be shown." ) );
543  DragRectMode d( *mpart, *this );
544  mpart->runMode( &d );
545  if ( ! d.cancelled() )
546  {
547  Rect nr = d.rect();
548  KigCommand* cd =
549  new KigCommand( *mpart,
550  i18n( "Change Shown Part of Screen" ) );
551 
552  cd->addTask( new KigViewShownRectChangeTask( *this, nr ) );
553  mpart->history()->push( cd );
554  };
555 
556  mpart->redrawScreen( this );
557  updateScrollBars();
558 }
559 
560 void KigView::zoomRect()
561 {
562  mrealwidget->zoomRect();
563 }
564 
565 void KigWidget::setShowingRect( const Rect& r )
566 {
567  msi.setShownRect( r.matchShape( Rect::fromQRect( rect() ) ) );
568 }
569 
570 void KigView::slotRecenterScreen()
571 {
572  mrealwidget->slotRecenterScreen();
573 }
574 
575 void KigView::slotInternalRecenterScreen()
576 {
577  mrealwidget->recenterScreen();
578 }
579 
580 void KigWidget::zoomArea()
581 {
582 // mpart->emitStatusBarText( i18n( "Select the area that should be shown." ) );
583  Rect oldrect = showingRect();
584  Coordinate tl = oldrect.topLeft();
585  Coordinate br = oldrect.bottomRight();
586  bool ok = true;
587  KigInputDialog::getTwoCoordinates( i18n( "Select Zoom Area" ),
588  i18n( "Select the zoom area by entering the coordinates<br />"
589  "of the upper left corner and the lower right corner." ) +
590  QString::fromLatin1( "<br />" ) +
591  mpart->document().coordinateSystem().coordinateFormatNoticeMarkup(),
592  this, &ok, mpart->document(), &tl, &br );
593  if ( ok )
594  {
595  Coordinate nc1( tl.x, br.y );
596  Coordinate nc2( br.x, tl.y );
597  Rect nr( nc1, nc2 );
598  KigCommand* cd = new KigCommand( *mpart, i18n( "Change Shown Part of Screen" ) );
599 
600  cd->addTask( new KigViewShownRectChangeTask( *this, nr ) );
601  mpart->history()->push( cd );
602  }
603 
604  mpart->redrawScreen( this );
605  updateScrollBars();
606 }
607 
608 void KigView::zoomArea()
609 {
610  mrealwidget->zoomArea();
611 }
612 
KigWidget::misfullscreen
bool misfullscreen
is this a full-screen widget ?
Definition: kig_view.h:98
KigView::slotInternalRecenterScreen
void slotInternalRecenterScreen()
Definition: kig_view.cpp:575
KigMode::rightReleased
virtual void rightReleased(QMouseEvent *, KigWidget *)
Definition: mode.cc:87
KigView::realWidget
KigWidget * realWidget() const
Definition: kig_view.cpp:455
kig_view.h
KigPart::mode
KigMode * mode() const
Definition: kig_part.h:143
KigViewShownRectChangeTask
Definition: kig_commands.h:210
KigWidget::updateEntireWidget
void updateEntireWidget()
Definition: kig_view.cpp:149
KigPart::delWidget
void delWidget(KigWidget *)
Definition: kig_part.cpp:864
KigCommand
a KigCommand represents almost every action performed in Kig.
Definition: kig_commands.h:44
Rect::width
double width() const
Definition: rect.cc:204
KigWidget::zoomArea
void zoomArea()
Definition: kig_view.cpp:580
KigView::~KigView
~KigView()
Definition: kig_view.cpp:451
KigDocument::grid
bool grid() const
Definition: kig_document.cc:186
Rect::bottomLeft
Coordinate bottomLeft() const
Definition: rect.cc:161
KigDocument::objectsSet
const std::set< ObjectHolder * > & objectsSet() const
Definition: kig_document.cc:51
Rect::left
double left() const
Definition: rect.cc:186
KigCommand::addTask
void addTask(KigCommandTask *)
Definition: kig_commands.cpp:74
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
KigPart::document
const KigDocument & document() const
Definition: kig_part.cpp:989
DragRectMode::cancelled
bool cancelled() const
whether the user cancelled the rect mode.
Definition: dragrectmode.cc:170
QWidget
KigWidget::mispainting
bool mispainting
Definition: kig_view.h:100
KigPart::history
QUndoStack * history()
Definition: kig_part.cpp:633
KigPart::emitStatusBarText
void emitStatusBarText(const QString &text)
Definition: kig_part.cpp:695
KigWidget::malreadyresized
bool malreadyresized
Definition: kig_view.h:102
KigWidget::entireDocumentRect
Rect entireDocumentRect() const
Definition: kig_view.cpp:398
KigMode::rightClicked
virtual void rightClicked(QMouseEvent *, KigWidget *)
Definition: mode.cc:79
KigWidget::slotZoomIn
void slotZoomIn()
Definition: kig_view.cpp:212
kig_part.h
Rect::right
double right() const
Definition: rect.cc:190
KigWidget::~KigWidget
~KigWidget()
Definition: kig_view.cpp:71
KigWidget::recenterScreen
void recenterScreen()
this recenters the screen, that is, resets the shown rect to mpart->document().suggestedRect().
Definition: kig_view.cpp:202
KigView::scrollVertical
void scrollVertical(int delta)
Definition: kig_view.cpp:490
ScreenInfo
ScreenInfo is a simple utility class that maps a region of the document onto a region of the screen...
Definition: screeninfo.h:31
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
KigInputDialog::getTwoCoordinates
static void getTwoCoordinates(const QString &caption, const QString &label, QWidget *parent, bool *ok, const KigDocument &doc, Coordinate *cvalue, Coordinate *cvalue2)
Static convenience function to get two Coordinates at once from the user.
Definition: kiginputdialog.cc:265
KigMode::mouseMoved
virtual void mouseMoved(QMouseEvent *, KigWidget *)
mouse moved without any buttons down...
Definition: mode.cc:91
KigWidget::updateScrollBars
void updateScrollBars()
Definition: kig_view.cpp:298
DragRectMode::rect
Rect rect() const
this returns the selected rect.
Definition: dragrectmode.cc:136
KigWidget::screenInfo
const ScreenInfo & screenInfo() const
the part of the document we're currently showing i.e.
Definition: kig_view.cpp:272
Rect::fromQRect
static Rect fromQRect(const QRect &)
Definition: rect.cc:256
KigView
This class is a wrapper for KigWidget.
Definition: kig_view.h:229
KigView::zoomArea
void zoomArea()
Definition: kig_view.cpp:608
KigPart::redrawScreen
void redrawScreen()
Definition: kig_part.cpp:980
KigWidget::slotZoomOut
void slotZoomOut()
Definition: kig_view.cpp:225
KigPainter
KigPainter is an extended QPainter.
Definition: kigpainter.h:51
KigWidget::setShowingRect
void setShowingRect(const Rect &r)
Definition: kig_view.cpp:565
KigWidget::oldOverlay
std::vector< QRect > oldOverlay
Definition: kig_view.h:87
KigPart::addWidget
void addWidget(KigWidget *)
Definition: kig_part.cpp:859
KigWidget::fromScreen
const Coordinate fromScreen(const QPoint &p)
Definition: kig_view.cpp:282
Rect::topLeft
Coordinate topLeft() const
Definition: rect.cc:171
Rect::bottom
double bottom() const
Definition: rect.cc:194
Rect::setCenter
void setCenter(const Coordinate p)
Definition: rect.cc:91
KigWidget::slotRecenterScreen
void slotRecenterScreen()
this gets called if the user clicks the recenter screen button.
Definition: kig_view.cpp:515
KigPart::runMode
void runMode(KigMode *)
Definition: kig_part.cpp:735
Rect::center
Coordinate center() const
Definition: rect.cc:181
KigMode::midClicked
virtual void midClicked(QMouseEvent *, KigWidget *)
Definition: mode.cc:67
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
KigView::screenInfo
const ScreenInfo & screenInfo() const
Definition: kig_view.cpp:446
Rect::top
double top() const
Definition: rect.cc:199
KigWidget::document
const KigDocument & document() const
Definition: kig_view.cpp:460
KigWidget::scrollSetLeft
void scrollSetLeft(double rhs)
Definition: kig_view.cpp:436
ScreenInfo::setViewRect
void setViewRect(const QRect &r)
Definition: screeninfo.cc:83
Rect::matchShape
Rect matchShape(const Rect &rhs, bool shrink=false) const
return a rect which is a copy of this rect, but has an aspect ratio equal to rhs's one...
Definition: rect.cc:282
KigWidget::updateCurPix
void updateCurPix(const std::vector< QRect > &=std::vector< QRect >())
update curPix (bitBlt stillPix onto curPix..)
Definition: kig_view.cpp:187
KigPainter::drawGrid
void drawGrid(const CoordinateSystem &c, bool showGrid=true, bool showAxes=true)
Definition: kigpainter.cpp:507
kig_document.h
kig_commands.h
KigView::slotZoomIn
void slotZoomIn()
Definition: kig_view.cpp:505
KigMode::leftMouseMoved
virtual void leftMouseMoved(QMouseEvent *, KigWidget *)
this means: mouse moved with left mouse button down (in case that wasn't clear...) ...
Definition: mode.cc:56
CoordinateSystem::coordinateFormatNoticeMarkup
virtual QString coordinateFormatNoticeMarkup() const =0
Like coordinateFormatNotice(), but with HTML tags useful to have a rich text...
KigWidget::zoomRect
void zoomRect()
Definition: kig_view.cpp:540
ScreenInfo::setShownRect
void setShownRect(const Rect &r)
Definition: screeninfo.cc:73
KigWidget::KigWidget
KigWidget(KigPart *doc, KigView *view, QWidget *parent=0, bool fullscreen=false)
standard qwidget constructor.
Definition: kig_view.cpp:45
KigWidget::isFullScreen
bool isFullScreen() const
Definition: kig_view.cpp:500
KigView::zoomRect
void zoomRect()
Definition: kig_view.cpp:560
KigWidget::curPix
QPixmap curPix
temporary, gets bitBlt'd (copied) onto the widget (to avoid flickering)
Definition: kig_view.h:84
KigWidget::clearStillPix
void clearStillPix()
The following are functions used by KigMode's to tell us to draw stuff...
Definition: kig_view.cpp:245
Rect::height
double height() const
Definition: rect.cc:209
KigView::toggleFullScreen
void toggleFullScreen()
Definition: kig_view.cpp:526
KigView::KigView
KigView(KigPart *part, bool fullscreen=false, QWidget *parent=0)
Definition: kig_view.cpp:303
KigView::scrollHorizontal
void scrollHorizontal(int delta)
Definition: kig_view.cpp:480
KigWidget::updateWidget
void updateWidget(const std::vector< QRect > &=std::vector< QRect >())
this means bitBlting curPix on the actual widget...
Definition: kig_view.cpp:115
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
KigMode::leftClicked
virtual void leftClicked(QMouseEvent *, KigWidget *)
Definition: mode.cc:52
KigView::slotZoomOut
void slotZoomOut()
Definition: kig_view.cpp:510
KigMode::rightMouseMoved
virtual void rightMouseMoved(QMouseEvent *, KigWidget *)
Definition: mode.cc:83
Coordinate::x
double x
X Component.
Definition: coordinate.h:126
ScreenInfo::pixelWidth
double pixelWidth() const
Definition: screeninfo.cc:61
KigMode::leftReleased
virtual void leftReleased(QMouseEvent *, KigWidget *)
Definition: mode.cc:60
Coordinate::y
double y
Y Component.
Definition: coordinate.h:129
KigView::updateScrollBars
void updateScrollBars()
Definition: kig_view.cpp:342
KigPart
This is a "Part".
Definition: kig_part.h:68
ScreenInfo::shownRect
const Rect & shownRect() const
Definition: screeninfo.cc:68
KigMode::midMouseMoved
virtual void midMouseMoved(QMouseEvent *, KigWidget *)
Definition: mode.cc:71
Rect::bottomRight
Coordinate bottomRight() const
Definition: rect.cc:166
KigDocument::axes
bool axes() const
Definition: kig_document.cc:206
KigDocument::coordinateSystem
const CoordinateSystem & coordinateSystem() const
Definition: kig_document.cc:40
KigWidget::pixelWidth
double pixelWidth() const
Definition: kig_view.cpp:287
ScreenInfo::fromScreen
Coordinate fromScreen(const QPoint &p) const
Definition: screeninfo.cc:35
KigMode::midReleased
virtual void midReleased(QMouseEvent *, KigWidget *)
Definition: mode.cc:75
KigWidget::setFullScreen
void setFullScreen(bool f)
Definition: kig_view.cpp:535
KigWidget::redrawScreen
void redrawScreen(const std::vector< ObjectHolder * > &selection, bool paintOnWidget=true)
Definition: kig_view.cpp:252
KigView::slotRecenterScreen
void slotRecenterScreen()
Definition: kig_view.cpp:570
KigWidget::msi
ScreenInfo msi
this is a class that maps from our widget coordinates to the document's coordinates ( and back )...
Definition: kig_view.h:93
Rect::setBottomLeft
void setBottomLeft(const Coordinate p)
Definition: rect.cc:76
KigWidget::stillPix
QPixmap stillPix
what do the still objects look like wondering if this is appropriate, maybe it should be part of Movi...
Definition: kig_view.h:79
KigDocument::suggestedRect
Rect suggestedRect() const
Return a rect containing most of the objects, which would be a fine suggestion to map to the widget...
Definition: kig_document.cc:106
DragRectMode
DragRectMode is a mode that provides a rect for selecting the objects inside it.
Definition: dragrectmode.h:40
KigWidget::showingRect
const Rect showingRect() const
Mapping between Internal Coordinate Systems there are two coordinate systems: 1 the widget's coordina...
Definition: kig_view.cpp:277
KigWidget::scrollSetBottom
void scrollSetBottom(double rhs)
Definition: kig_view.cpp:426
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal