summaryrefslogtreecommitdiff
authorzecke <zecke>2005-04-16 22:00:51 (UTC)
committer zecke <zecke>2005-04-16 22:00:51 (UTC)
commit632d3e87a7e2cf6efecb676987d622e937ecafb8 (patch) (side-by-side diff)
tree6689c8549e494841108217daa21913ec27565720
parent790b371e6c7ed9da76eafb8a5b2e5d5458b320d8 (diff)
downloadopie-632d3e87a7e2cf6efecb676987d622e937ecafb8.zip
opie-632d3e87a7e2cf6efecb676987d622e937ecafb8.tar.gz
opie-632d3e87a7e2cf6efecb676987d622e937ecafb8.tar.bz2
Opie/X11:
Minor updates to build a recent Opie version for usage with the X Window System
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--x11/libqpe-x11/qpe/qpeapplication.cpp26
-rw-r--r--x11/libqpe-x11/qpe/qpeapplication.h8
-rw-r--r--x11/libqpe-x11/qt/qwindowsystem_qws.h3
3 files changed, 26 insertions, 11 deletions
diff --git a/x11/libqpe-x11/qpe/qpeapplication.cpp b/x11/libqpe-x11/qpe/qpeapplication.cpp
index 73e7ce4..c49f3ad 100644
--- a/x11/libqpe-x11/qpe/qpeapplication.cpp
+++ b/x11/libqpe-x11/qpe/qpeapplication.cpp
@@ -406,25 +406,25 @@ void QPEApplication::applyStyle() {
setPalette( pal, TRUE );
// Font
QString ff = config.readEntry( "FontFamily", font().family() );
int fs = config.readNumEntry( "FontSize", font().pointSize() );
setFont( QFont(ff, fs) );
}
int QPEApplication::defaultRotation() {
return 0;
}
-void QPEApplication::setDefaultRotation(int r ) {
+void QPEApplication::setDefaultRotation(int) {
}
void QPEApplication::grabKeyboard() {
QPEApplication::Private * d = ( ( QPEApplication* ) qApp ) ->d;
if ( qApp->type() == QApplication::GuiServer )
d->kbgrabber = 0;
else {
QCopEnvelope e( "QPE/System", "grabKeyboard(QString)" );
e << d->appName;
d->kbgrabber = 2; // me
}
@@ -440,41 +440,46 @@ void QPEApplication::ungrabKeyboard() {
}
}
void QPEApplication::showMainWidget( QWidget* wid, bool b) {
d->show(wid, b );
}
void QPEApplication::showMainDocumentWidget( QWidget* mw, bool m) {
if ( mw && argc() == 2 )
Global::setDocument( mw, QString::fromUtf8(argv()[1] ) );
d->show(mw, m );
}
void QPEApplication::showDialog( QDialog* d, bool nomax ) {
+ showWidget( d, nomax );
+}
+int QPEApplication::execDialog( QDialog* d, bool nomax) {
+ showDialog(d,nomax);
+ return d->exec();
+}
+
+void QPEApplication::showWidget( QWidget* d, bool nomax ) {
QSize sh = d->sizeHint();
int w = QMAX(sh.width(),d->width());
int h = QMAX(sh.height(),d->height());
if ( !nomax
&& ( w > qApp->desktop()->width()*3/4
|| h > qApp->desktop()->height()*3/4 ) )
{
- d->showMaximized();
+ d->showMaximized();
} else {
- d->resize(w,h);
- d->show();
+ d->resize(w,h);
+ d->show();
}
}
-int QPEApplication::execDialog( QDialog* d, bool nomax) {
- showDialog(d,nomax);
- return d->exec();
-}
+
void QPEApplication::setKeepRunning() {
if ( qApp && qApp->inherits( "QPEApplication" ) ) {
QPEApplication * qpeApp = ( QPEApplication* ) qApp;
qpeApp->d->keep_running = TRUE;
}
}
bool QPEApplication::keepRunning()const {
return d->keep_running;
}
bool QPEApplication::keyboardGrabbed()const {
return d->kbgrabber;
}
@@ -748,49 +753,54 @@ int QPEApplication::x11ClientMessage(QWidget* w, XEvent* event, bool b ) {
return 0;
}
}
}
return QApplication::x11ClientMessage(w, event, b );
}
#define KeyPress XKeyPress
#define KeyRelease XKeyRelease
#if defined(OPIE_NEW_MALLOC)
+#define likely(x) x
// The libraries with the skiff package (and possibly others) have
// completely useless implementations of builtin new and delete that
// use about 50% of your CPU. Here we revert to the simple libc
// functions.
void* operator new[]( size_t size )
{
return malloc( size );
}
void* operator new( size_t size )
{
return malloc( size );
}
void operator delete[]( void* p )
{
+ if ( likely(p) )
free( p );
}
void operator delete[]( void* p, size_t /*size*/ )
{
+ if ( likely(p) )
free( p );
}
void operator delete( void* p )
{
+ if ( likely(p) )
free( p );
}
void operator delete( void* p, size_t /*size*/ )
{
+ if ( likely(p) )
free( p );
}
#endif
diff --git a/x11/libqpe-x11/qpe/qpeapplication.h b/x11/libqpe-x11/qpe/qpeapplication.h
index b1fc074..5521998 100644
--- a/x11/libqpe-x11/qpe/qpeapplication.h
+++ b/x11/libqpe-x11/qpe/qpeapplication.h
@@ -1,23 +1,24 @@
#ifndef OPIE_QPE_APPLICATION_H
#define OPIE_QPE_APPLICATION_H
/**
* LGPLed
*/
#include <qapplication.h>
#include <qevent.h>
-
-#include <qpe/timestring.h>
+#include <qtopia/timestring.h>
+#include <unistd.h>
+#include <stdlib.h>
class QCopChannel;
class QPEApplication : public QApplication {
Q_OBJECT
public:
QPEApplication(int& argc, char** argv, Type=GuiClient );
~QPEApplication();
static QString qpeDir();
static QString documentDir();
void applyStyle();
@@ -37,25 +38,26 @@ public:
enum InputMethodHint {
Normal,
AlwaysOff,
AlwaysOn
};
static void setInputMethodHint( QWidget*, InputMethodHint );
static InputMethodHint inputMethodHint( QWidget* );
void showMainWidget( QWidget*, bool nomax = FALSE );
void showMainDocumentWidget( QWidget*, bool nomax = FALSE );
static void showDialog( QDialog*, bool nomax = FALSE );
- static int execDialog( QDialog*, bool nomax = FALSE );
+ static int execDialog ( QDialog*, bool nomax = FALSE );
+ static void showWidget( QWidget*, bool nomax = FALSE );
static void setKeepRunning();
bool keepRunning()const;
bool keyboardGrabbed()const;
int exec();
// QWS bits
enum screenSaverHint {
Disable = 0,
DisableLightOff = 1,
DisableSuspend = 2,
diff --git a/x11/libqpe-x11/qt/qwindowsystem_qws.h b/x11/libqpe-x11/qt/qwindowsystem_qws.h
index 88902c8..42470cd 100644
--- a/x11/libqpe-x11/qt/qwindowsystem_qws.h
+++ b/x11/libqpe-x11/qt/qwindowsystem_qws.h
@@ -1,24 +1,27 @@
#ifndef OPIE_QWINDOWSYSTEM_H
#define OPIE_QWINDOWSYSTEM_H
#include <qimage.h>
class QWSScreenSaver;
class QWSServer {
public:
QWSServer(){}
~QWSServer(){}
static void sendKeyEvent(int, int, int, bool, bool ) { }
struct KeyboardFilter {
+ bool filter(int,int,int,bool,bool) {
+ return false;
+ }
};
static void setKeyboardFilter( KeyboardFilter* ) {
}
static void setScreenSaver( QWSScreenSaver* ) {
}
static void setScreenSaverInterval( int ) {
}
static void setScreenSaverIntervals( int[] ) {