⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qt-main.cpp

📁 open source bios with linux platform, very good and can be reused.
💻 CPP
字号:
/* tag: openbios qt user interface *  * Copyright (C) 2003-2004 Stefan Reinauer * * See the file "COPYING" for further information about * the copyright and warranty status of this work. */extern "C" {#include <pthread.h>#include <unistd.h>#include "unix/plugins.h"#include "unix/plugin_pci.h"}#include "gui-qt.h"#define DEBUGvolatile unsigned char * fb=0;volatile int gui_running=0;typedef struct {	int argc;	char **argv;} threaddata;void *gui_thread(void *ptr){	threaddata *td=(threaddata *)ptr;		QApplication a(td->argc, td->argv);	FrameBufferWidget w;	a.setMainWidget(&w);	w.show();		fb=w.getFrameBuffer();	gui_running=-1;	a.exec();	gui_running=0;		return 0;}extern "C" {extern int plugin_qt_init(void);int plugin_qt_init(void){	pthread_t mythread;	char *args[]={ "plugin_qt" };	threaddata mytd = { 1, args };#ifdef DEBUG	printf("Initializing \"framebuffer\" plugin...");#endif	pthread_create(&mythread, NULL, gui_thread, &mytd);	while (!fb) 		usleep(20);#if 0		/* now we have the framebuffer start address.	 * updating pci config space to reflect this	 */#if (BITS > 32)	*(u32 *)(pci_config_space+0x14)=(u32)((unsigned long)fb>>32);#else	*(u32 *)(pci_config_space+0x14)=0;#endif	*(u32 *)(pci_config_space+0x10)=(u32)((unsigned long)fb&0xffffffff);	/* next is to write the rom address. We write that at a random	 * address in pci config space for now.	 */#if (BITS > 32)	*(u32 *)(pci_config_space+0x34)=(u32)((unsigned long)qt_fcode>>32);#else	*(u32 *)(pci_config_space+0x34)=0;#endif	*(u32 *)(pci_config_space+0x30)=(u32)((unsigned long)qt_fcode&0xffffffff);		/* FIXME: we need to put the fcode image for this	 * device to the rom resource, once it exists	 */		/* register pci device to be available to beginagain */	pci_register_device(0, 2, 0, pci_config_space);#endif	#ifdef DEBUG	printf("done.\n");#endif	return 0;}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -