Main Page | Class List | File List | Class Members | File Members

ScreenShot Class Reference

#include <screenshot.h>

Collaboration diagram for ScreenShot:

Collaboration graph
[legend]
List of all members.

Public Slots

void shoot ()
void save ()
void target (int)
void delaychanged (int)
void fileSelect ()
void fileChanged ()
void timeout ()
void areaSelected (const QRect &)
void areaSelect ()

Public Member Functions

 ScreenShot (QWidget *parent=0, const char *name=0, WFlags fl=0)

Private Types

enum  Mode { screen, window, area }

Private Member Functions

void getWindow ()
void displayShot ()

Private Attributes

Mode mode
int delay
QTimer * timer
QPixmap shotPixmap
QImage shotImage
bool haveImage
QString workDir
QString fileName
QString baseName
int shotCount
QRect areaRect
AreaGrabselectArea

Detailed Description

This is the main class, derived from a class created with QTs designer. Subclassing in this way is my preferred method to work with GUIs, as this keeps the GUI stuff neatly separated from the stuff that does the actual work.


Member Enumeration Documentation

enum ScreenShot::Mode [private]
 

Enumeration values:
screen 
window 
area 


Constructor & Destructor Documentation

ScreenShot::ScreenShot QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

The c'tor hasn't got much to do except set up some class variables. All the layouting of widgets and the connection of signals and slots is already been done in ScreenShotUI.


Member Function Documentation

void ScreenShot::areaSelect  )  [slot]
 

A necessary slot to make shure this widget is hidden when area selection starts.

void ScreenShot::areaSelected const QRect &  r  )  [slot]
 

This slot is called when area selection is completed. The selectArea widget is deleted to clean up, it has already hidden itself at this point.

void ScreenShot::delaychanged int  n  )  [slot]
 

This slot is used whenever a different delay is selected.

void ScreenShot::displayShot  )  [private]
 

Like the name says, this is where the shot image is shown.

void ScreenShot::fileChanged  )  [slot]
 

This slot is called when the user bothers to change the filename by typing on the keyboard, which is signified by a return pressed signal.

void ScreenShot::fileSelect  )  [slot]
 

This slot receives the click on the fileToolButton. It is used to pop up a file dialog and let the user select a file ( and directory ) name. The default directory initially is the user's home directory, after this it will be the selected directory. The selected file name, if valid, will always be converted to have the extension ".png".

void ScreenShot::getWindow  )  [private]
 

getWindow() grabs the currently focussed window, if it is completely visible. If the window is partially obscured, a region the size of the window is grabbed anyway. I see this as a feature, so don't ask me to do anything about it.
This is the only place generic X11 functions are used.

void ScreenShot::save  )  [slot]
 

This slot is triggered by clicking the QPushButton labeled with the same name. It saves the generated image at the chosen location.

void ScreenShot::shoot  )  [slot]
 

This slot gets triggered by clicking the QPushButton labeled with the same name.

void ScreenShot::target int  n  )  [slot]
 

This slot gets called when selecting a different target in the radio button group box.

void ScreenShot::timeout  )  [slot]
 

This slot is used by the timer, when it timeouts. The timer is only used if mode == screen or mode == window.


Member Data Documentation

QRect ScreenShot::areaRect [private]
 

QString ScreenShot::baseName [private]
 

int ScreenShot::delay [private]
 

QString ScreenShot::fileName [private]
 

bool ScreenShot::haveImage [private]
 

Mode ScreenShot::mode [private]
 

AreaGrab* ScreenShot::selectArea [private]
 

int ScreenShot::shotCount [private]
 

QImage ScreenShot::shotImage [private]
 

QPixmap ScreenShot::shotPixmap [private]
 

QTimer* ScreenShot::timer [private]
 

QString ScreenShot::workDir [private]
 


The documentation for this class was generated from the following files:
Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for screenshot $Revision:1.1$ by Rolf C. Rönnau using doxygen 1.4.2