mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
.uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@2400 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f46f635930
commit
a8a2e0ac7e
13 changed files with 262 additions and 0 deletions
17
uppdev/Testcase/UppTestLib/UppTestLib.upp
Normal file
17
uppdev/Testcase/UppTestLib/UppTestLib.upp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
target
|
||||
libtest.so;
|
||||
|
||||
library
|
||||
"QtCore QtGui";
|
||||
|
||||
options
|
||||
"-DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -lQtGui -lQtCore";
|
||||
|
||||
options(GCC) -fPIC;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "DLL";
|
||||
|
||||
3
uppdev/Testcase/UppTestLib/init
Normal file
3
uppdev/Testcase/UppTestLib/init
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#ifndef _UppTestLib_icpp_init_stub
|
||||
#define _UppTestLib_icpp_init_stub
|
||||
#endif
|
||||
56
uppdev/Testcase/UppTestLib/main.cpp
Normal file
56
uppdev/Testcase/UppTestLib/main.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#include <QtGui/QtGui>
|
||||
#include <QtGui/QStyle>
|
||||
#include <X11/X.h>
|
||||
#include <iostream>
|
||||
|
||||
// #define LOG(str)
|
||||
#define LOG(str) std::clog << str << std::endl
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static bool initted = false;
|
||||
QApplication *app = 0;
|
||||
|
||||
int Init()
|
||||
{
|
||||
if (!initted) {
|
||||
int argc = 1;
|
||||
char *argv[] = {"qapp", NULL};
|
||||
if (!QApplication::instance()) {
|
||||
app = new QApplication(argc, argv);
|
||||
if (app) {
|
||||
initted = true;
|
||||
LOG("Init()");
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
initted = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int IsInitted()
|
||||
{
|
||||
LOG("IsInitted()");
|
||||
return initted;
|
||||
}
|
||||
|
||||
void UnInit()
|
||||
{
|
||||
if (initted) {
|
||||
if (app) {
|
||||
delete app;
|
||||
app = 0;
|
||||
}
|
||||
initted = false;
|
||||
}
|
||||
LOG("UnInit()");
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
Loading…
Reference in a new issue