/****************************************************************************
** $Id: qt/src/iconview/qiconview.cpp 2.3.10 edited 2005-01-24 $
**
** Implementation of QIconView widget class
**
** Created : 990707
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the iconview module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "qiconview.h"
#ifndef QT_NO_ICONVIEW
#include "qpixmap.h"
#include "qfontmetrics.h"
#include "qpainter.h"
#include "qevent.h"
#include "qpalette.h"
#include "qmime.h"
#include "qimage.h"
#include "qpen.h"
#include "qbrush.h"
#include "qtimer.h"
#include "qcursor.h"
#include "qkeycode.h"
#include "qapplication.h"
#include "qmultilineedit.h"
#include "qmap.h"
#include "qarray.h"
#include "qlist.h"
#include "qvbox.h"
#include "qtooltip.h"
#include "qbitmap.h"
#include "qpixmapcache.h"
#include "qptrdict.h"
#include "qstringlist.h"
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#define RECT_EXTENSION 300
#ifdef QT_KEYPAD_MODE
extern bool qt_singleFocusWidget(const QWidget *in);
extern bool qt_modalEditingEnabled;
#endif
static const char * const unknown_xpm[] = {
"32 32 11 1",
"c c #ffffff",
"g c #c0c0c0",
"a c #c0ffc0",
"h c #a0a0a4",
"d c #585858",
"f c #303030",
"i c #400000",
"b c #00c000",
"e c #000000",
"# c #000000",
". c None",
"...###..........................",
"...#aa##........................",
".###baaa##......................",
".#cde#baaa##....................",
".#cccdeebaaa##..##f.............",
".#cccccdeebaaa##aaa##...........",
".#cccccccdeebaaaaaaaa##.........",
".#cccccccccdeebaaaaaaa#.........",
".#cccccgcgghhebbbbaaaaa#........",
".#ccccccgcgggdebbbbbbaa#........",
".#cccgcgcgcgghdeebiebbba#.......",
".#ccccgcggggggghdeddeeba#.......",
".#cgcgcgcggggggggghghdebb#......",
".#ccgcggggggggghghghghd#b#......",
".#cgcgcggggggggghghghhd#b#......",
".#gcggggggggghghghhhhhd#b#......",
".#cgcggggggggghghghhhhd#b#......",
".#ggggggggghghghhhhhhhdib#......",
".#gggggggggghghghhhhhhd#b#......",
".#hhggggghghghhhhhhhhhd#b#......",
".#ddhhgggghghghhhhhhhhd#b#......",
"..##ddhhghghhhhhhhhhhhdeb#......",
"....##ddhhhghhhhhhhhhhd#b#......",
"......##ddhhhhhhhhhhhhd#b#......",
"........##ddhhhhhhhhhhd#b#......",
"..........##ddhhhhhhhhd#b#......",
"............##ddhhhhhhd#b###....",
"..............##ddhhhhd#b#####..",
"................##ddhhd#b######.",
"..................##dddeb#####..",
"....................##d#b###....",
"......................####......"};
static QPixmap *unknown_icon = 0;
static QPixmap *qiv_buffer_pixmap = 0;
static QPixmap *qiv_selection = 0;
static void qt_cleanup_qiv1()
{
delete unknown_icon;
unknown_icon = 0;
delete qiv_selection;
qiv_selection = 0;
}
static void qt_cleanup_qiv2()
{
delete qiv_buffer_pixmap;
qiv_buffer_pixmap = 0;
delete qiv_selection;
qiv_selection = 0;
}
#if !defined(_WS_X11_)
static void createSelectionPixmap( const QColorGroup &cg )
{
qiv_selection = new QPixmap( 2, 2 );
qiv_selection->fill( Qt::color0 );
QBitmap m( 2, 2 );
m.fill( Qt::color1 );
QPainter p( &m );
p.setPen( Qt::color0 );
for ( int j = 0; j < 2; ++j ) {
p.drawPoint( j % 2, j );
}
p.end();
qiv_selection->setMask( m );
qiv_selection->fill( cg.highlight() );
}
#endif
static QPixmap *get_qiv_buffer_pixmap( const QSize &s )
{
if ( !qiv_buffer_pixmap ) {
qiv_buffer_pixmap = new QPixmap( s );
qAddPostRoutine( qt_cleanup_qiv2 );
return qiv_buffer_pixmap;
}
qiv_buffer_pixmap->resize( s );
return qiv_buffer_pixmap;
}
/*****************************************************************************
*
* Struct QIconViewPrivate
*
*****************************************************************************/
#ifndef QT_NO_DRAGANDDROP
class QIconDragData
{
public:
QIconDragData();
QIconDragData( const QRect &ir, const QRect &tr );
QRect pixmapRect() const;
QRect textRect() const;
void setPixmapRect( const QRect &r );
void setTextRect( const QRect &r );
QRect iconRect_, textRect_;
QString key_;
bool operator==( const QIconDragData &i ) const;
};
class QIconDragDataItem
{
public:
QIconDragDataItem() {}
QIconDragDataItem( const QIconDragItem &i1, const QIconDragData &i2 ) : data( i1 ), item( i2 ) {}
QIconDragItem data;
QIconDragData item;
bool operator== ( const QIconDragDataItem& ) const;
};
struct QIconDragPrivate
{
QValueList<QIconDragDataItem> items;
static bool decode( QMimeSource* e, QValueList<QIconDragDataItem> &lst );
};
#endif
class QIconViewToolTip;
class QIconViewPrivate
{
public:
QIconViewItem *firstItem, *lastItem;
uint count;
bool mousePressed;
QIconView::SelectionMode selectionMode;
QIconViewItem *currentItem, *tmpCurrentItem, *highlightedItem, *startDragItem, *pressedItem, *selectAnchor;
QRect *rubber;
QTimer *scrollTimer, *adjustTimer, *updateTimer, *inputTimer,
*fullRedrawTimer;
int rastX, rastY, spacing;
bool cleared, dropped, clearing;
int dragItems;
QPoint oldDragPos;
bool oldDragAcceptAction;
QIconView::Arrangement arrangement;
QIconView::ResizeMode resizeMode;
QSize oldSize;
#ifndef QT_NO_DRAGANDDROP
QValueList<QIconDragDataItem> iconDragData;
#endif
bool isIconDrag;
int numDragItems, cachedW, cachedH;
int maxItemWidth, maxItemTextLength;
QPoint dragStart;
bool drawDragShapes;
QString currInputString;
bool dirty, rearrangeEnabled;
QIconView::ItemTextPos itemTextPos;
bool reorderItemsWhenInsert;
#ifndef QT_NO_CURSOR
QCursor oldCursor;
#endif
bool resortItemsWhenInsert, sortDirection;
bool wordWrapIconText;
int cachedContentsX, cachedContentsY;
QBrush itemTextBrush;
bool drawAllBack;
QRegion clipRegion;
QPoint dragStartPos;
QFontMetrics *fm;
int minLeftBearing, minRightBearing;
bool containerUpdateLocked;
bool firstSizeHint;
#ifndef QT_NO_TOOLTIP
QIconViewToolTip *toolTip;
bool showTips;
#endif
QPixmapCache maskCache;
bool pressedSelected;
bool dragging;
QPtrDict<QIconViewItem> selectedItems;
struct ItemContainer {
ItemContainer( ItemContainer *pr, ItemContainer *nx, const QRect &r )
: p( pr ), n( nx ), rect( r ) {
items.setAutoDelete( FALSE );
if ( p )
p->n = this;
if ( n )
n->p = this;
}
ItemContainer *p, *n;
QRect rect;
QList<QIconViewItem> items;
} *firstContainer, *lastContainer;
struct SortableItem {
QIconViewItem *item;
};
};
#ifndef QT_NO_TOOLTIP
/*******************************
没有合适的资源?快使用搜索试试~ 我知道了~
cygwin-motorola-e6-开发环境精简版.rar
共2000个文件
h:3763个
so:356个
0:236个
需积分: 5 0 下载量 3 浏览量
2021-11-02
21:36:27
上传
评论
收藏 47.51MB RAR 举报
温馨提示
cygwin-motorola-e6-开发环境精简版
资源推荐
资源详情
资源评论
收起资源包目录
cygwin-motorola-e6-开发环境精简版.rar (2000个子文件)
parse.c 9KB
elfhex.c 3KB
headfile.c 3KB
findbyte.c 1KB
qiconview.cpp 139KB
Konsole.cpp 46KB
TEmuVt102.cpp 43KB
TEWidget.cpp 43KB
FileManage.cpp 30KB
TEScreen.cpp 26KB
qtabbar.cpp 24KB
qtabwidget.cpp 19KB
keytrans.cpp 19KB
Editor.cpp 19KB
StartMenu.cpp 14KB
storage.cpp 13KB
PicViewer.cpp 10KB
FolderDialog.cpp 10KB
FileBrowser.cpp 8KB
cpuinfo.cpp 8KB
commandeditdialog.cpp 7KB
TEmulation.cpp 7KB
ScrollTime.cpp 7KB
SelectAppDialog.cpp 7KB
processinfo.cpp 7KB
memory.cpp 7KB
TEHistory.cpp 6KB
storageinfo.cpp 6KB
lcdinfo.cpp 6KB
commandeditdialogbase.cpp 6KB
modulesinfo.cpp 5KB
SetupCmdDialog.cpp 5KB
graph.cpp 5KB
MyPty.cpp 4KB
playlistselection.cpp 4KB
ProgramDialog.cpp 4KB
NewFileDlg.cpp 3KB
sysloginfo.cpp 3KB
NetTime.cpp 3KB
smallcommandeditdialogbase.cpp 3KB
CmdDialog.cpp 3KB
session.cpp 3KB
JumpDlg.cpp 3KB
SecureityDialog.cpp 3KB
FileInfo.cpp 2KB
SelectAppDialog.cpp 2KB
OffPhone.cpp 2KB
NewDialog.cpp 2KB
FileCheckBox.cpp 2KB
moc_Test.cpp 2KB
moc_TestIDE.cpp 2KB
ReNameDialog.cpp 1KB
Main.cpp 1KB
ProcessDialog.cpp 1KB
TestIDE.cpp 1KB
FileDialog.cpp 1KB
TETabWidget.cpp 1KB
Main.cpp 863B
resfilereader.cpp 664B
FileCodec.cpp 324B
Test.cpp 54B
stl_algo.h 143KB
SA-1100.h 111KB
SA-1100.h 111KB
elf.h 98KB
elf.h 98KB
reiserfs_fs.h 90KB
reiserfs_fs.h 90KB
stl_rope.h 89KB
pci_ids.h 73KB
pci_ids.h 73KB
linux_logo.h 71KB
linux_logo.h 71KB
tls.h 68KB
tlspshar.h 61KB
locale_facets.h 57KB
fs.h 57KB
fs.h 57KB
ide.h 54KB
ide.h 54KB
stl_deque.h 54KB
soundcard.h 47KB
soundcard.h 47KB
ropeimpl.h 45KB
AT91RM9200_SYS.h 45KB
AT91RM9200_SYS.h 45KB
stl_tree.h 43KB
string2.h 43KB
string2.h 43KB
usb.h 39KB
usb.h 39KB
sdla_chdlc.h 38KB
sdla_chdlc.h 38KB
valarray_meta.h 38KB
stl_list.h 37KB
intermezzo_fs.h 36KB
intermezzo_fs.h 36KB
unistd.h 36KB
unistd.h 36KB
c++config.h 35KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
剑舞梦
- 粉丝: 165
- 资源: 47
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功