/****************************************************************************
**
** Qt/Embedded virtual framebuffer
**
** Created : 20000605
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the Qt GUI Toolkit.
**
** Licensees holding valid Qt Professional Edition licenses may use this
** file in accordance with the Qt Professional Edition License Agreement
** provided with the Qt Professional Edition.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about the Professional Edition licensing.
**
*****************************************************************************/
#include <qmenubar.h>
#include <qpopupmenu.h>
#include <qapplication.h>
#include <qmessagebox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qfiledialog.h>
#include <qslider.h>
#include <qspinbox.h>
#include <qradiobutton.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qcursor.h>
#include "qvfb.h"
#include "qvfbview.h"
#include "qvfbratedlg.h"
#include "config.h"
#include "skin.h"
static const char * logo[] = {
/* width height ncolors chars_per_pixel */
"50 50 17 1",
/* colors */
" c #000000",
". c #495808",
"X c #2A3304",
"o c #242B04",
"O c #030401",
"+ c #9EC011",
"@ c #93B310",
"# c #748E0C",
"$ c #A2C511",
"% c #8BA90E",
"& c #99BA10",
"* c #060701",
"= c #181D02",
"- c #212804",
"; c #61770A",
": c #0B0D01",
"/ c None",
/* pixels */
"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$@;.o=::=o.;@$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$+#X* **X#+$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$#oO* O **o#+$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$&.* OO O*.&$$$$$$$$$$$$$",
"$$$$$$$$$$$$@XOO * OO X&$$$$$$$$$$$$",
"$$$$$$$$$$$@XO OO O **:::OOO OOO X@$$$$$$$$$$$",
"$$$$$$$$$$&XO O-;#@++@%.oOO X&$$$$$$$$$$",
"$$$$$$$$$$.O : *-#+$$$$$$$$+#- : O O*.$$$$$$$$$$",
"$$$$$$$$$#*OO O*.&$$$$$$$$$$$$+.OOOO **#$$$$$$$$$",
"$$$$$$$$+-OO O *;$$$$$$$$$$$&$$$$;* o+$$$$$$$$",
"$$$$$$$$#O* O .+$$$$$$$$$$@X;$$$+.O *#$$$$$$$$",
"$$$$$$$$X* -&$$$$$$$$$$@- :;$$$&- OX$$$$$$$$",
"$$$$$$$@*O *O#$$$$$$$$$$@oOO**;$$$# O*%$$$$$$$",
"$$$$$$$; -+$$$$$$$$$@o O OO ;+$$-O *;$$$$$$$",
"$$$$$$$. ;$$$$$$$$$@-OO OO X&$$;O .$$$$$$$",
"$$$$$$$o *#$$$$$$$$@o O O O-@$$$#O *o$$$$$$$",
"$$$$$$+= *@$$$$$$$@o* OO -@$$$$&: =$$$$$$$",
"$$$$$$+: :+$$$$$$@- *-@$$$$$$: :+$$$$$$",
"$$$$$$+: :+$$$$$@o* O *-@$$$$$$: :+$$$$$$",
"$$$$$$$= :@$$$$@o*OOO -@$$$$@: =+$$$$$$",
"$$$$$$$- O%$$$@o* O O O O-@$$$#* OX$$$$$$$",
"$$$$$$$. O *O;$$&o O*O* *O -@$$; O.$$$$$$$",
"$$$$$$$;* Oo+$$;O*O:OO-- Oo@+= *;$$$$$$$",
"$$$$$$$@* O O#$$$;*OOOo@@-O Oo;O* **@$$$$$$$",
"$$$$$$$$X* OOO-+$$$;O o@$$@- O O OX$$$$$$$$",
"$$$$$$$$#* * O.$$$$;X@$$$$@-O O O#$$$$$$$$",
"$$$$$$$$+oO O OO.+$$+&$$$$$$@-O o+$$$$$$$$",
"$$$$$$$$$#* **.&$$$$$$$$$$@o OO:#$$$$$$$$$",
"$$$$$$$$$+. O* O-#+$$$$$$$$+;O OOO:@$$$$$$$$$",
"$$$$$$$$$$&X *O -;#@++@#;=O O -@$$$$$$$$",
"$$$$$$$$$$$&X O O*O::::O OO Oo@$$$$$$$",
"$$$$$$$$$$$$@XOO OO O*X+$$$$$$",
"$$$$$$$$$$$$$&.* ** O :: *:#$$$$$$$",
"$$$$$$$$$$$$$$$#o*OO O Oo#@-OOO=#$$$$$$$$",
"$$$$$$$$$$$$$$$$+#X:* * O**X#+$$@-*:#$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$%;.o=::=o.#@$$$$$$@X#$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$+$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/",
};
QVFb::QVFb( int display_id, int w, int h, int d, const QString &skin, QWidget *parent,
const char *name, uint flags )
: QMainWindow( parent, name, flags )
{
imagesave = new QFileDialog(".", "*.png", this, 0, TRUE);
imagesave->setSelection("snapshot.png");
setIcon(QPixmap(logo));
rateDlg = 0;
view = 0;
init( display_id, w, h, d, skin );
createMenu( menuBar() );
}
QVFb::~QVFb()
{
}
void QVFb::popupMenu()
{
QPopupMenu *pm = new QPopupMenu( this );
createMenu( pm );
pm->exec(QCursor::pos());
}
void QVFb::init( int display_id, int w, int h, int d, const QString &skin_name )
{
setCaption( QString("Virtual framebuffer %1x%2 %3bpp Display :%4")
.arg(w).arg(h).arg(d).arg(display_id) );
delete view;
if ( !skin_name.isEmpty() && QFile::exists(skin_name) ) {
bool vis = isVisible();
if ( vis ) hide();
menuBar()->hide();
Skin *skin = new Skin( this, skin_name, w, h );
view = new QVFbView( display_id, w, h, d, skin );
skin->setView( view );
view->setMargin( 0 );
view->setFrameStyle( QFrame::NoFrame );
view->setFixedSize( w, h );
setCentralWidget( skin );
adjustSize();
view->show();
if ( vis ) show();
} else {
if ( !currentSkin.isEmpty() ) {
clearMask();
reparent( 0, 0, pos(), TRUE );
}
menuBar()->show();
view = new QVFbView( display_id, w, h, d, this );
view->setMargin( 0 );
view->setFrameStyle( QFrame::NoFrame );
setCentralWidget( view );
resize(w,menuBar()->height()+h);
view->show();
}
currentSkin = skin_name;
}
void QVFb::enableCursor( bool e )
{
view->viewport()->setCursor( e ? ArrowCursor : BlankCursor );
viewMenu->setItemChecked( cursorId, e );
}
void QVFb::createMenu(QMenuData *menu)
{
QPopupMenu *file = new QPopupMenu( this );
file->insertItem( "&Configure...", this, SLOT(configure()), ALT+CTRL+Key_C );
file->insertSeparator();
file->insertItem( "&Save image...", this, SLOT(saveImage()), ALT+CTRL+Key_S );
file->insertItem( "&Animation...", this, SLOT(toggleAnimation()), ALT+CTRL+Key_A );
file->insertSeparator();
file->insertItem( "&Quit", qApp, SLOT(quit()) );
menu->insertItem( "&File", file );
viewMenu = new QPopupMenu( this );
viewMenu->setCheckable( true );
cursorId = viewMenu->insertItem( "Show &Cursor", this, SLOT(toggleCursor()) );
enableCursor(TRUE);
viewMenu->insertItem( "&Refresh Rate...", this, SLOT(changeRate()) );
viewMenu->insertSeparator();
viewMenu->insertItem( "Zoom scale &1", this, SLOT(setZoom1()) );
viewMenu->insertItem( "Zoom scale &2", this, SLOT(setZoom2()) );
viewMenu->insertItem( "Zoom scale &3", this, SLOT(setZoom3()) );
viewMenu->insertItem( "Zoom scale &4", this, SLOT(setZoom4()) );
viewMenu->insertItem( "Zoom scale &0.5", this, SLOT(setZoomHalf()) );
menu->insertItem( "&View", viewMenu );
QPopupMenu *help = new QPopupMenu( this );
help->insertItem("About...", this, SLOT(about()));
menu->insertSeparator();
menu->insertItem( "&Help", help );
}
void QVFb::setZoom(double z)
{
view->setZoom(z);
}
void QVFb::setZoomHalf()
{
setZoom(0.5);
}
void QVFb::setZoom1()
{
setZoom(1);
}
void QVFb::setZoom2()
{
setZoom(2);
}
void QVFb::setZoom3()
{
setZoom(3);
}
void QVFb::setZoom4()
{
setZoom(4);
}
void QVFb::saveImage()
{
QImage img = view->image();
if ( imagesave->exec() ) {
QString filename = imagesave->selectedFile();
if ( !!filename )
img.save(filename,"PNG");
}
}
void QVFb::toggleAnimation()
{
if ( view->animating() ) {
view->stopAnimation();
} else {
QString filename = imagesave->getSaveFileName("animation.mng", "*.mng", this, "", "Save animation...");
if ( !filename ) {
view->stopAnimation();
} else {
view->startAnimation(filename);
}
}
}
void QVFb::toggleCursor()
{
ena
没有合适的资源?快使用搜索试试~ 我知道了~
qvfb-1.1.tar
4星 · 超过85%的资源 需积分: 0 31 下载量 142 浏览量
2009-01-14
15:25:46
上传
评论 2
收藏 778KB GZ 举报
温馨提示
共59个文件
in:7个
cpp:6个
h:6个
一个可以模拟minigui图形显示的软件
资源详情
资源评论
资源推荐
收起资源包目录
qvfb-1.1.tar.gz (59个子文件)
qvfb-1.1
acinclude.m4 312KB
admin
cvs.sh 14KB
libtool.m4.in 184KB
acinclude.m4.in 128KB
cvs-clean.pl 2KB
mkinstalldirs 725B
am_edit 67KB
depcomp 12KB
Doxyfile.global 37KB
config.guess 38KB
config.sub 28KB
detect-autoconf.sh 2KB
conf.change.pl 5KB
Makefile.common 1KB
configure.in.min 2KB
missing 9KB
ylwrap 4KB
install-sh 5KB
ltmain.sh 155KB
ChangeLog 22KB
config.pl 7KB
debianrules 5KB
Doxyfile.am 7KB
subdirs 31B
config.h.in 3KB
Makefile.dist 450B
aclocal.m4 328KB
TODO 1B
Makefile.am 1KB
qvfb.kdevses 230B
configure.in 1KB
README 52B
qvfb
qvfb.h 2KB
skin.h 871B
pda_up.png 133KB
qanimationwriter.h 1KB
qanimationwriter.cpp 9KB
qvfbview.h 3KB
qvfbratedlg.h 1KB
skin.cpp 3KB
qvfbratedlg.cpp 2KB
Makefile.am 955B
qvfb.cpp 13KB
README 3KB
qvfbview.cpp 12KB
Makefile.in 19KB
pda_down.png 134KB
main.cpp 2KB
gammaview.h 908B
config.ui 71KB
pda.skin 371B
Makefile.in 18KB
INSTALL 7KB
AUTHORS 4B
configure 680KB
stamp-h.in 10B
ChangeLog 0B
COPYING 18KB
qvfb.kdevprj 3KB
共 59 条
- 1
wolfrz
- 粉丝: 5
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用 C 语言实现的计算非负整数的阶乘
- 2011-2021最新版本北京大学数字普惠金融指数(PKU-DFIIC).xlsx
- 县域数字乡村指数2018-2020(1).xlsx
- Docker容器配置进阶
- tensorflow-gpu-2.7.4-cp37-cp37m-manylinux2010-x86-64.whl
- 多段线、 圆、弧转多段线(仅我可见)
- tensorflow-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- 李慧琴C语言基础部分.zip
- yeyue-p8Yi4-ve4a83792.apk
- tensorflow-gpu-2.7.3-cp38-cp38-manylinux2010-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1