Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

cursors.cpp

Go to the documentation of this file.
00001 //==============================================
00002 //  copyright            : (C) 2003-2005 by Will Stokes
00003 //==============================================
00004 //  This program is free software; you can redistribute it
00005 //  and/or modify it under the terms of the GNU General
00006 //  Public License as published by the Free Software
00007 //  Foundation; either version 2 of the License, or
00008 //  (at your option) any later version.
00009 //==============================================
00010 
00011 //Systemwide includes
00012 #include <qcursor.h>
00013 #include <qpixmap.h>
00014 
00015 //Projectwide includes
00016 #include "cursors.h"
00017 
00018 //Include cursor xpm's
00019 #include "../../resources/cursors/crossCursor.xpm"
00020 
00021 #include "../../resources/cursors/moveSelectionCursor.xpm"
00022 #include "../../resources/cursors/moveHorCursor.xpm"
00023 #include "../../resources/cursors/moveVertCursor.xpm"
00024 #include "../../resources/cursors/moveTLCursor.xpm"
00025 #include "../../resources/cursors/moveTRCursor.xpm"
00026 
00027 #include "../../resources/cursors/scaleSelectionCursor.xpm"
00028 #include "../../resources/cursors/rotateCursor.xpm"
00029 
00030 #include "../../resources/cursors/targetCursor.xpm"
00031 //==============================================
00032 QCursor** customCursors = new QCursor*[CUSTOM_CURSOR_COUNT];
00033 //==============================================
00034 void loadCursors()
00035 {
00036   customCursors[CROSS_CURSOR]           = new QCursor( QPixmap( (const char**)crossCursor_xpm));                              
00037 
00038   customCursors[MOVE_SELECTION_CURSOR]  = new QCursor( QPixmap( (const char**)moveSelectionCursor_xpm));                              
00039   customCursors[MOVE_HOR_CURSOR]        = new QCursor( QPixmap( (const char**)moveHorCursor_xpm));                              
00040   customCursors[MOVE_VERT_CURSOR]       = new QCursor( QPixmap( (const char**)moveVertCursor_xpm));                              
00041   customCursors[MOVE_TL_CURSOR]         = new QCursor( QPixmap( (const char**)moveTLCursor_xpm));                              
00042   customCursors[MOVE_TR_CURSOR]         = new QCursor( QPixmap( (const char**)moveTRCursor_xpm));                              
00043 
00044   customCursors[SCALE_SELECTION_CURSOR] = new QCursor( QPixmap( (const char**)scaleSelectionCursor_xpm));                              
00045   customCursors[ROTATE_CURSOR]          = new QCursor( QPixmap( (const char**)rotateCursor_xpm));                              
00046 
00047   customCursors[TARGET_CURSOR]          = new QCursor( QPixmap( (const char**)targetCursor_xpm));                              
00048 
00049   customCursors[DEFAULT_CURSOR]         = new QCursor( Qt::ArrowCursor );
00050 }
00051 //===========================================================
00052 const QCursor& getCursor( CUSTOM_CURSOR_TYPE type )
00053 {
00054   if( type < 0 || type >= CUSTOM_CURSOR_COUNT )
00055     return *customCursors[DEFAULT_CURSOR];
00056   else
00057     return *customCursors[type];
00058 }
00059 //===========================================================

Generated on Mon Apr 11 18:27:45 2005 for AlbumShaper by  doxygen 1.3.9.1