kig
#include <kig_view.h>

Public Member Functions | |
KigWidget (KigPart *doc, KigView *view, QWidget *parent=0, bool fullscreen=false) | |
~KigWidget () | |
void | clearStillPix () |
const KigDocument & | document () const |
Rect | entireDocumentRect () const |
const Coordinate | fromScreen (const QPoint &p) |
const Rect | fromScreen (const QRect &r) |
bool | isFullScreen () const |
double | pixelWidth () const |
void | recenterScreen () |
void | redrawScreen (const std::vector< ObjectHolder * > &selection, bool paintOnWidget=true) |
const ScreenInfo & | screenInfo () const |
void | scrollSetBottom (double rhs) |
void | scrollSetLeft (double rhs) |
void | setFullScreen (bool f) |
void | setShowingRect (const Rect &r) |
const Rect | showingRect () const |
void | slotRecenterScreen () |
void | slotZoomIn () |
void | slotZoomOut () |
void | updateCurPix (const std::vector< QRect > &=std::vector< QRect >()) |
void | updateEntireWidget () |
void | updateScrollBars () |
void | updateWidget (const std::vector< QRect > &=std::vector< QRect >()) |
const KigView * | view () const |
KigView * | view () |
void | zoomArea () |
void | zoomRect () |
Public Attributes | |
QPixmap | curPix |
QPixmap | stillPix |
Protected Attributes | |
bool | malreadyresized |
bool | misfullscreen |
bool | mispainting |
ScreenInfo | msi |
std::vector< QRect > | oldOverlay |
Detailed Description
This class is the real widget showing the document.
The other is a wrapper, that has the scrollbars... I'm not using QScrollView cause i've been having problems with that, and it's easier to do the work myself... Internally, this is basically a dumb class, which is manipulated by KigMode's. All events are forwarded to them.
Definition at line 50 of file kig_view.h.
Constructor & Destructor Documentation
KigWidget::KigWidget | ( | KigPart * | part, |
KigView * | view, | ||
QWidget * | parent = 0 , |
||
bool | fullscreen = false |
||
) |
standard qwidget constructor.
This file is part of Kig, a KDE program for Interactive Geometry...
if fullscreen is true, we're a fullscreen widget.
Copyright (C) 2002 Dominique Devriese devri ese@ kde.o rg
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Definition at line 45 of file kig_view.cpp.
KigWidget::~KigWidget | ( | ) |
Definition at line 71 of file kig_view.cpp.
Member Function Documentation
void KigWidget::clearStillPix | ( | ) |
The following are functions used by KigMode's to tell us to draw stuff...
i tried to optimise the drawing as much as possible, using much ideas from kgeo DOUBLE BUFFERING: we don't draw on the widget directly, we draw on a QPixmap ( curPix ), and bitBlt that onto the widget to avoid flickering. TRIPLE BUFFERING: we also currently keep an extra pixmap of what the widget looks like without objects that are moving... I'm currently wondering whether this isn't a performance loss rather than a gain, but well, i haven't done any measurements (yet ?), so for now it stays in... OVERLAYS Another thing: it turns out that working on the pixmaps isn't that slow, but working on the widget is. So we try to reduce the amount of work we spend on the widget. (i got this idea from kgeo, all credits for this go to marc.) on drawing, bart sch@w eb.d eKigPainter tells us (appendOverlay) for everything it draws what rects it draws in, so we know on updating the widget ( updateWidget() that the rest is still ok and doesn't need to be bitBlt'd again on the widget... clear stillPix...
Definition at line 245 of file kig_view.cpp.
const KigDocument & KigWidget::document | ( | ) | const |
Definition at line 460 of file kig_view.cpp.
Rect KigWidget::entireDocumentRect | ( | ) | const |
Definition at line 398 of file kig_view.cpp.
const Coordinate KigWidget::fromScreen | ( | const QPoint & | p | ) |
Definition at line 282 of file kig_view.cpp.
const Rect KigWidget::fromScreen | ( | const QRect & | r | ) |
Definition at line 292 of file kig_view.cpp.
bool KigWidget::isFullScreen | ( | ) | const |
Definition at line 500 of file kig_view.cpp.
double KigWidget::pixelWidth | ( | ) | const |
Definition at line 287 of file kig_view.cpp.
void KigWidget::recenterScreen | ( | ) |
this recenters the screen, that is, resets the shown rect to mpart->document().suggestedRect().
Definition at line 202 of file kig_view.cpp.
void KigWidget::redrawScreen | ( | const std::vector< ObjectHolder * > & | selection, |
bool | paintOnWidget = true |
||
) |
Definition at line 252 of file kig_view.cpp.
const ScreenInfo & KigWidget::screenInfo | ( | ) | const |
the part of the document we're currently showing i.e.
a rectangle of the document (which has its own coordinate system) which is mapped onto the widget.
Definition at line 272 of file kig_view.cpp.
void KigWidget::scrollSetBottom | ( | double | rhs | ) |
Definition at line 426 of file kig_view.cpp.
void KigWidget::scrollSetLeft | ( | double | rhs | ) |
Definition at line 436 of file kig_view.cpp.
void KigWidget::setFullScreen | ( | bool | f | ) |
Definition at line 535 of file kig_view.cpp.
void KigWidget::setShowingRect | ( | const Rect & | r | ) |
Definition at line 565 of file kig_view.cpp.
const Rect KigWidget::showingRect | ( | ) | const |
Mapping between Internal Coordinate Systems there are two coordinate systems: 1 the widget's coordinates: these are simple int's from (0,0) in the topleft of the widget to size() in the bottomRight...
2 the document's coordinates: these are the coordinates used by the KigDocument. Objects only know of their coordinates as related to this system. These are mapped by the KigView using the ScreenInfo class.
Definition at line 277 of file kig_view.cpp.
void KigWidget::slotRecenterScreen | ( | ) |
this gets called if the user clicks the recenter screen button.
It adds a KigCommand to the CommandHistory that recenters the screen..
Definition at line 515 of file kig_view.cpp.
void KigWidget::slotZoomIn | ( | ) |
Definition at line 212 of file kig_view.cpp.
void KigWidget::slotZoomOut | ( | ) |
Definition at line 225 of file kig_view.cpp.
void KigWidget::updateCurPix | ( | const std::vector< QRect > & | ol = std::vector<QRect>() | ) |
update curPix (bitBlt stillPix onto curPix..)
Definition at line 187 of file kig_view.cpp.
void KigWidget::updateEntireWidget | ( | ) |
Definition at line 149 of file kig_view.cpp.
void KigWidget::updateScrollBars | ( | ) |
Definition at line 298 of file kig_view.cpp.
void KigWidget::updateWidget | ( | const std::vector< QRect > & | overlay = std::vector<QRect>() | ) |
this means bitBlting curPix on the actual widget...
Definition at line 115 of file kig_view.cpp.
|
inline |
Definition at line 119 of file kig_view.h.
|
inline |
Definition at line 123 of file kig_view.h.
void KigWidget::zoomArea | ( | ) |
Definition at line 580 of file kig_view.cpp.
void KigWidget::zoomRect | ( | ) |
Definition at line 540 of file kig_view.cpp.
Member Data Documentation
QPixmap KigWidget::curPix |
temporary, gets bitBlt'd (copied) onto the widget (to avoid flickering)
Definition at line 84 of file kig_view.h.
|
protected |
Definition at line 102 of file kig_view.h.
|
protected |
is this a full-screen widget ?
Definition at line 98 of file kig_view.h.
|
protected |
Definition at line 100 of file kig_view.h.
|
protected |
this is a class that maps from our widget coordinates to the document's coordinates ( and back ).
Definition at line 93 of file kig_view.h.
|
protected |
Definition at line 87 of file kig_view.h.
QPixmap KigWidget::stillPix |
what do the still objects look like wondering if this is appropriate, maybe it should be part of MovingMode ?
Definition at line 79 of file kig_view.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.