[kaffe] CVS kaffe (jserv): Better debugging information for Qt AWT backend.
Kaffe CVS
cvs-commits at kaffe.org
Mon Jul 12 03:25:02 PDT 2004
PatchSet 4954
Date: 2004/07/12 10:20:53
Author: jserv
Branch: HEAD
Tag: (none)
Log:
Better debugging information for Qt AWT backend.
* libraries/clib/awt/qt/cbd.cc,
libraries/clib/awt/qt/clr.cc,
libraries/clib/awt/qt/evt.cc,
libraries/clib/awt/qt/fnt.cc,
libraries/clib/awt/qt/gra.cc,
libraries/clib/awt/qt/img.cc,
libraries/clib/awt/qt/tlk.cc,
libraries/clib/awt/qt/toolkit.h,
libraries/clib/awt/qt/wnd.cc:
Introduces qqDebug() macro to wrap qDebug for better debugging
information, so that we can catch specific details via message
handler.
Members:
ChangeLog:1.2518->1.2519
libraries/clib/awt/qt/cbd.cc:1.3->1.4
libraries/clib/awt/qt/clr.cc:1.4->1.5
libraries/clib/awt/qt/evt.cc:1.7->1.8
libraries/clib/awt/qt/fnt.cc:1.4->1.5
libraries/clib/awt/qt/gra.cc:1.3->1.4
libraries/clib/awt/qt/img.cc:1.6->1.7
libraries/clib/awt/qt/tlk.cc:1.5->1.6
libraries/clib/awt/qt/toolkit.h:1.4->1.5
libraries/clib/awt/qt/wnd.cc:1.4->1.5
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2518 kaffe/ChangeLog:1.2519
--- kaffe/ChangeLog:1.2518 Mon Jul 12 06:39:49 2004
+++ kaffe/ChangeLog Mon Jul 12 10:20:53 2004
@@ -1,5 +1,20 @@
2004-07-12 Jim Huang <jserv at kaffe.org>
+ * libraries/clib/awt/qt/cbd.cc,
+ libraries/clib/awt/qt/clr.cc,
+ libraries/clib/awt/qt/evt.cc,
+ libraries/clib/awt/qt/fnt.cc,
+ libraries/clib/awt/qt/gra.cc,
+ libraries/clib/awt/qt/img.cc,
+ libraries/clib/awt/qt/tlk.cc,
+ libraries/clib/awt/qt/toolkit.h,
+ libraries/clib/awt/qt/wnd.cc:
+ Introduces qqDebug() macro to wrap qDebug for better debugging
+ information, so that we can catch specific details via message
+ handler.
+
+2004-07-12 Jim Huang <jserv at kaffe.org>
+
* libraries/clib/awt/qt/evt.cc:
Safer way to handler processEvent.
Index: kaffe/libraries/clib/awt/qt/cbd.cc
diff -u kaffe/libraries/clib/awt/qt/cbd.cc:1.3 kaffe/libraries/clib/awt/qt/cbd.cc:1.4
--- kaffe/libraries/clib/awt/qt/cbd.cc:1.3 Sat Jul 10 01:58:25 2004
+++ kaffe/libraries/clib/awt/qt/cbd.cc Mon Jul 12 10:20:53 2004
@@ -95,7 +95,7 @@
}
else {
mime = "application/x-java-serialized-object";
- AWT_DBG(printf("Only text copy and paste is supported...\n"));
+ AWT_DBG(qqDebug("Only text copy and paste is supported...\n"));
//KEN : FIXIT
//Do we need this?
}
@@ -133,9 +133,9 @@
len = env->GetArrayLength( jData);
cbdText = QString((char *)data);
//QApplication::clipboard()->setData(new QTextDrag( cbdText));
- fprintf(stderr,"!!!Posting to Clipboard %s\n",data);
+ qFatal("!!!Posting to Clipboard %s\n",data);
} else {
- fprintf(stderr,"!!!Clipboard EMPTY!!!!\n");
+ qFatal("!!!Clipboard EMPTY!!!!\n");
}
cbdDirty = 0;
}
@@ -151,7 +151,7 @@
if(QTextDrag::decode(QApplication::clipboard()->data(), text)) {
//Poll native clipboard for new data
if(text.compare(cbdText) != 0) {
- fprintf(stderr,"!!!lostOwnership!!!!\n");
+ qFatal("!!!lostOwnership!!!!\n");
cbdText = text;
return env->CallStaticVoidMethod( NativeClipboard, lostOwnership);
}
Index: kaffe/libraries/clib/awt/qt/clr.cc
diff -u kaffe/libraries/clib/awt/qt/clr.cc:1.4 kaffe/libraries/clib/awt/qt/clr.cc:1.5
--- kaffe/libraries/clib/awt/qt/clr.cc:1.4 Sat Jul 10 01:58:25 2004
+++ kaffe/libraries/clib/awt/qt/clr.cc Mon Jul 12 10:20:53 2004
@@ -55,7 +55,7 @@
initColorMapping( env, clazz, X);
// uint pixel = QColor(JRED(rgb), JGREEN(rgb), JBLUE(rgb)).pixel();
- // AWT_DBG(qDebug("clrGetPixelValue: %8x -> %x (%d)\n", rgb, pixel, pixel));
+ // AWT_DBG(qqDebug("clrGetPixelValue: %8x -> %x (%d)\n", rgb, pixel, pixel));
return rgb;
}
Index: kaffe/libraries/clib/awt/qt/evt.cc
diff -u kaffe/libraries/clib/awt/qt/evt.cc:1.7 kaffe/libraries/clib/awt/qt/evt.cc:1.8
--- kaffe/libraries/clib/awt/qt/evt.cc:1.7 Mon Jul 12 06:39:48 2004
+++ kaffe/libraries/clib/awt/qt/evt.cc Mon Jul 12 10:20:53 2004
@@ -93,7 +93,7 @@
}
bool EventDispatcher::eventFilter(QObject* o, QEvent* e) {
- DBG(AWT, qDebug("event type=%d widget=%p\n", e->type(), o));
+ DBG(AWT, qqDebug("event type=%d widget=%p\n", e->type(), o));
QEvent* newEvent = NULL;
EventPacket* packet = NULL;
bool processed = false;
@@ -116,7 +116,7 @@
}
case QEvent::Show: {
- DBG(AWT, qDebug("Event Show: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event Show: srcIdx=%d\n", X->srcIdx));
#if (QT_VERSION < 300)
newEvent = (QEvent*) new QShowEvent(true);
@@ -130,7 +130,7 @@
}
case QEvent::Hide: {
- DBG(AWT, qDebug("Event Hid: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event Hid: srcIdx=%d\n", X->srcIdx));
#if (QT_VERSION < 300)
newEvent = (QEvent*) new QHideEvent(true);
@@ -145,7 +145,7 @@
case QEvent::FocusIn:
case QEvent::FocusOut: {
- DBG(AWT, qDebug("Event Focus: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event Focus: srcIdx=%d\n", X->srcIdx));
QFocusEvent* tmpFocusEvent = (QFocusEvent*)e;
newEvent = (QEvent*) new QFocusEvent(tmpFocusEvent->type());
((QFocusEvent*)newEvent)->setReason(tmpFocusEvent->reason());
@@ -155,7 +155,7 @@
case QEvent::KeyPress:
case QEvent::KeyRelease: {
- DBG(AWT, qDebug("Event Key: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event Key: srcIdx=%d\n", X->srcIdx));
QKeyEvent* tmpKeyEvent = (QKeyEvent*)e;
newEvent = (QEvent*) new QKeyEvent(tmpKeyEvent->type(),tmpKeyEvent->key(),
tmpKeyEvent->ascii(), tmpKeyEvent->state(), tmpKeyEvent->text(),
@@ -167,7 +167,7 @@
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseMove: {
- DBG(AWT, qDebug("Event MouseButton: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event MouseButton: srcIdx=%d\n", X->srcIdx));
QMouseEvent* tmpMouseEvent = (QMouseEvent*)e;
newEvent = (QEvent*) new QMouseEvent(tmpMouseEvent->type(),
tmpMouseEvent->pos(), tmpMouseEvent->button(),
@@ -176,7 +176,7 @@
break;
}
case QEvent::Paint: {
- DBG(AWT, qDebug("Event Paint: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event Paint: srcIdx=%d\n", X->srcIdx));
QPaintEvent* tmpPaintEvent = (QPaintEvent*)e;
newEvent = (QEvent*) new QPaintEvent(tmpPaintEvent->rect(),
tmpPaintEvent->erased());
@@ -184,7 +184,7 @@
break;
}
case QEvent::Move: {
- DBG(AWT, qDebug("Event Move: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event Move: srcIdx=%d\n", X->srcIdx));
QPoint data(((QWidget*)o)->width(), ((QWidget*)o)->height());
QMoveEvent* tmpMoveEvent = (QMoveEvent*)e;
// Hide width/height in oldPos of newEvent
@@ -194,7 +194,7 @@
break;
}
case QEvent::Resize: {
- DBG(AWT, qDebug("Event Resize: srcIdx=%d\n", X->srcIdx));
+ DBG(AWT, qqDebug("Event Resize: srcIdx=%d\n", X->srcIdx));
QSize data(((QWidget*)o)->x(), ((QWidget*)o)->y());
QResizeEvent* tmpResizeEvent = (QResizeEvent*)e;
// Hide x/y in oldSize of newEvent
@@ -283,15 +283,15 @@
{
jclass Component;
- DBG(AWT, qDebug("evtInit\n"));
+ DBG(AWT, qqDebug("evtInit\n"));
if ( ComponentEvent != NULL ){
- DBG(AWT, qDebug("evtInit called twice\n"));
+ DBG(AWT, qqDebug("evtInit called twice\n"));
return NULL;
}
if(qapp == NULL) {
- DBG(AWT, qDebug("evtInit: qapp not initialized!\n"));
+ DBG(AWT, qqDebug("evtInit: qapp not initialized!\n"));
}
eventDispatcher = new EventDispatcher();
@@ -362,7 +362,7 @@
case QEvent::Destroy: {
- DBG(AWT, qDebug("processing Destroy: SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing Destroy: SrcIdx=%d\n", index));
/*
* We should get this just for windows which have been destroyed from an
* external client, since removeNotify() calls evtUnregisterSource() (i.e.
@@ -376,13 +376,13 @@
}
case QEvent::Reparent: {
- DBG(AWT, qDebug("processing Reparent: SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing Reparent: SrcIdx=%d\n", index));
return NULL;
}
case QEvent::FocusIn:
case QEvent::FocusOut: {
- DBG(AWT, qDebug("processing %s: SrcIdx=%d\n",(event->type() == QEvent::FocusIn)?"FocusIn":"FocusOut",index));
+ DBG(AWT, qqDebug("processing %s: SrcIdx=%d\n",(event->type() == QEvent::FocusIn)?"FocusIn":"FocusOut",index));
int evtId;
int et = event->type();
if ( et == QEvent::FocusIn ) {
@@ -404,7 +404,7 @@
case QEvent::KeyPress:
case QEvent::KeyRelease: {
- DBG(AWT, qDebug("processing %s: SrcIdx=%d\n",(event->type() == QEvent::KeyPress)?"KeyPress":"KeyRelease",index));
+ DBG(AWT, qqDebug("processing %s: SrcIdx=%d\n",(event->type() == QEvent::KeyPress)?"KeyPress":"KeyRelease",index));
QKeyEvent *keyEvent = (QKeyEvent*)event;
int n, keyCode, keyChar, mod;
@@ -441,7 +441,7 @@
int evtId = (((QEvent*)keyEvent)->type() == QEvent::KeyPress)? KEY_PRESSED : KEY_RELEASED;
mod = keyMod(keyEvent->state());
- DBG(AWT, qDebug("KeyEvent: idx=%d keyCode=%d keyChar=%c mod=%d\n", index, keyCode,keyChar,mod));
+ DBG(AWT, qqDebug("KeyEvent: idx=%d keyCode=%d keyChar=%c mod=%d\n", index, keyCode,keyChar,mod));
return env->CallStaticObjectMethod( KeyEvent, getKeyEvent,
index, evtId, keyCode, keyChar, mod);
@@ -449,7 +449,7 @@
}
case QEvent::MouseButtonPress: {
- DBG(AWT, qDebug("processing MouseButtonPress Event SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing MouseButtonPress Event SrcIdx=%d\n", index));
QMouseEvent* mouseEvent = (QMouseEvent*)event;
// check the diff between event.xbutton.button and QMouseEvent::button()
if (checkSource( X, index) ){
@@ -464,7 +464,7 @@
mouseEvent->x(), mouseEvent->y());
}
case QEvent::MouseButtonRelease: {
- DBG(AWT, qDebug("processing MouseButtonRelease Event SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing MouseButtonRelease Event SrcIdx=%d\n", index));
QMouseEvent* mouseEvent = (QMouseEvent*)event;
// check the diff between event.xbutton.button and QMouseEvent::button()
return env->CallStaticObjectMethod(MouseEvent, getMouseEvent,
@@ -472,21 +472,21 @@
mouseEvent->x(), mouseEvent->y());
}
case QEvent::MouseMove: {
- DBG(AWT, qDebug("processing MouseMove Event SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing MouseMove Event SrcIdx=%d\n", index));
QMouseEvent* mouseEvent = (QMouseEvent*)event;
return env->CallStaticObjectMethod(MouseEvent, getMouseEvent,
index, MOUSE_MOVED, 0,
mouseEvent->x(), mouseEvent->y());
}
case QEvent::Paint: {
- DBG(AWT, qDebug("processing Paint Event SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing Paint Event SrcIdx=%d\n", index));
QPaintEvent* paintEvent = (QPaintEvent*)event;
QRect rect=paintEvent->rect();
return env->CallStaticObjectMethod(PaintEvent, getPaintEvent,
index, UPDATE, rect.x(), rect.y(), rect.width(), rect.height());
}
case QEvent::Move: {
- DBG(AWT, qDebug("processing Move Event SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing Move Event SrcIdx=%d\n", index));
QMoveEvent* moveEvent = (QMoveEvent*)event;
QPoint pos, data;
pos = moveEvent->pos();
@@ -495,7 +495,7 @@
index, COMPONENT_RESIZED, pos.x(), pos.y(), data.x(), data.y());
}
case QEvent::Resize: {
- DBG(AWT, qDebug("processing Resize Event SrcIdx=%d\n", index));
+ DBG(AWT, qqDebug("processing Resize Event SrcIdx=%d\n", index));
QResizeEvent* resizeEvent = (QResizeEvent*)event;
QSize size, data;
size = resizeEvent->size();
@@ -515,13 +515,13 @@
QEvent *event;
int index;
- DBG(AWT, qDebug("getNextEvent..\n"));
+ DBG(AWT, qqDebug("getNextEvent..\n"));
pollJavaClipboard(env);
if (g_event_queue.count()) {
- packet=g_event_queue.dequeue();
- event=packet->getEvent();
- index=packet->getIndex();
+ packet = g_event_queue.dequeue();
+ event = packet->getEvent();
+ index = packet->getIndex();
if (event) {
jEvt = processEvent(env, X, event, index);
delete event;
@@ -539,14 +539,14 @@
{
jobject jEvt = NULL;
- DBG(AWT, qDebug("peekEvent..\n"));
+ DBG(AWT, qqDebug("peekEvent..\n"));
#if 0
if ( nextEvent( env, clazz, X, False) && ((getSourceIdx( X, (void*)X->event.xany.window) >= 0)) ) {
if ( (jEvt = (processEvent[X->event.xany.type])( env, X)) )
X->preFetched = 1;
}
- DBG( AWT_EVT, printf("..peekEvent: %s %p, %lx\n", eventStr(X->evtId), jEvt, X->event.xany.window));
+ DBG( AWT_EVT, qFatal("..peekEvent: %s %p, %lx\n", eventStr(X->evtId), jEvt, X->event.xany.window));
#endif
return jEvt;
}
@@ -582,7 +582,7 @@
*/
void Java_java_awt_Toolkit_evtWakeup(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("evtWakeup\n"));
+ DBG(AWT, qqDebug("evtWakeup\n"));
}
/*
@@ -604,7 +604,7 @@
*/
int i = getSourceIdx( X, wnd);
- DBG(AWT, qDebug("registerSource( %p) -> %d\n", wnd, i));
+ DBG(AWT, qqDebug("registerSource( %p) -> %d\n", wnd, i));
return i;
}
@@ -624,7 +624,7 @@
if ( X->lastWindow == wnd )
X->lastWindow = 0;
- DBG(AWT, qDebug("unregisterSource( %p) -> %d\n", wnd, i));
+ DBG(AWT, qqDebug("unregisterSource( %p) -> %d\n", wnd, i));
return i;
}
Index: kaffe/libraries/clib/awt/qt/fnt.cc
diff -u kaffe/libraries/clib/awt/qt/fnt.cc:1.4 kaffe/libraries/clib/awt/qt/fnt.cc:1.5
--- kaffe/libraries/clib/awt/qt/fnt.cc:1.4 Sat Jul 10 01:58:25 2004
+++ kaffe/libraries/clib/awt/qt/fnt.cc Mon Jul 12 10:20:53 2004
@@ -77,7 +77,7 @@
int weight=QFont::Normal;
bool italic=FALSE;
- DBG(AWT, qDebug("fntInitFont...%s\n",spec));
+ DBG(AWT, qqDebug("fntInitFont...%s\n",spec));
if ( style & 0x1 ) { /* we have a Font.BOLD request */
//i0 = NWEIGHT - 1; i1 = -1; di = -1;
@@ -140,7 +140,7 @@
QFontMetrics fm((QFont)(*fs));
int w = ((fm.minRightBearing() - fm.minLeftBearing()) == fm.maxWidth()) ? fm.maxWidth() : 0;
- DBG(AWT, qDebug("fntGetFixedWidth %d\n",w));
+ DBG(AWT, qqDebug("fntGetFixedWidth %d\n",w));
return w;
}
@@ -182,7 +182,7 @@
jboolean
Java_java_awt_Toolkit_fntIsWideFont ( JNIEnv* env, jclass clazz, QFont* fs )
{
- DBG(AWT, qDebug("fntIsWideFont\n"));
+ DBG(AWT, qqDebug("fntIsWideFont\n"));
return 0;
// XXX: like: (fs->min_byte1 | fs->max_byte1);
}
@@ -205,7 +205,7 @@
for( i=0;i<n;i++)
jw[i] = fm.width(QChar((char)i));
env->ReleaseIntArrayElements( widths, jw, 0);
- DBG(AWT, qDebug("fntGetWidths %d\n",fm.maxWidth()));
+ DBG(AWT, qqDebug("fntGetWidths %d\n",fm.maxWidth()));
return widths;
}
@@ -224,7 +224,7 @@
a.setRawData(jb+off,len);
w = fm.width(QString(a),len);
env->ReleaseByteArrayElements( jBytes, jb, JNI_ABORT);
- DBG(AWT, qDebug("fntBytesWidth %s %d\n",jb+off, w));
+ DBG(AWT, qqDebug("fntBytesWidth %s %d\n",jb+off, w));
return w;
}
@@ -235,7 +235,7 @@
jChar = (jChar << 8) | (jChar >> 8);
#endif
QFontMetrics fm((QFont)(*fs));
- DBG(AWT, qDebug("fntCharWidth...\n"));
+ DBG(AWT, qqDebug("fntCharWidth...\n"));
return fm.width(QChar((ushort)jChar));
}
@@ -251,7 +251,7 @@
QChar *unicode;
int w;
QFontMetrics fm((QFont)(*fs));
- DBG(AWT, qDebug("fntCharsWidth...\n"));
+ DBG(AWT, qqDebug("fntCharsWidth...\n"));
if ( off+len > n ) len = n - off;
@@ -269,7 +269,7 @@
w = fm.width(QString(jchar2CString(X,jc+off,len)));
env->ReleaseCharArrayElements( jChars, jc, JNI_ABORT);
- DBG(AWT, qDebug("fntCharsWidth %s %d\n",jchar2CString(X,jc+off,len),w));
+ DBG(AWT, qqDebug("fntCharsWidth %s %d\n",jchar2CString(X,jc+off,len),w));
return w;
}
@@ -299,7 +299,7 @@
w = fm.width(QString(jchar2CString(X,jc,len)));
- DBG(AWT, qDebug("fntStringWidth %s %d\n",jchar2CString(X,jc,len),w));
+ DBG(AWT, qqDebug("fntStringWidth %s %d\n",jchar2CString(X,jc,len),w));
env->ReleaseStringChars( jStr, jc);
return w;
}
Index: kaffe/libraries/clib/awt/qt/gra.cc
diff -u kaffe/libraries/clib/awt/qt/gra.cc:1.3 kaffe/libraries/clib/awt/qt/gra.cc:1.4
--- kaffe/libraries/clib/awt/qt/gra.cc:1.3 Sat Jul 10 01:58:25 2004
+++ kaffe/libraries/clib/awt/qt/gra.cc Mon Jul 12 10:20:53 2004
@@ -33,7 +33,7 @@
{
QPaintDevice* drw;
- DBG(AWT, qDebug("initGraphics: gr %p (tgt %p, type=%d) xo %d,yo %d %d,%d - %d,%d %p %x %x\n",
+ DBG(AWT, qqDebug("initGraphics: gr %p (tgt %p, type=%d) xo %d,yo %d %d,%d - %d,%d %p %x %x\n",
gr, tgt,tgtType, xOff,yOff, xClip,yClip,wClip,hClip, fnt,fg,bg));
if ( tgt ) {
@@ -43,11 +43,11 @@
break; /* Window */
case 1:
drw = (QPixmap*)(((Image*)tgt)->qpm);
- DBG(AWT, qDebug("tgt = IMAGE drw=%p\n",drw));
+ DBG(AWT, qqDebug("tgt = IMAGE drw=%p\n",drw));
break; /* Image */
case 2:
drw = ((Graphics*)tgt)->drw;
- DBG(AWT, qDebug("tgt = GRAPHICS\n"));
+ DBG(AWT, qqDebug("tgt = GRAPHICS\n"));
break; /* Graphics */
default:
qFatal("illegal Graphics target: %d\n", tgtType);
@@ -69,7 +69,7 @@
}
gr->painter = new QPainter(drw);
- DBG(AWT, qDebug("painter=%x\n", gr->painter));
+ DBG(AWT, qqDebug("painter=%x\n", gr->painter));
gr->painter->setPen(QCOLOR(fg));
gr->painter->setBrush(QCOLOR(fg));
@@ -102,7 +102,7 @@
void Java_java_awt_Toolkit_graFreeGraphics(JNIEnv* env, jclass clazz,
Graphics* gr)
{
- DBG(AWT, qDebug("freeGraphics: %p\n", gr));
+ DBG(AWT, qqDebug("freeGraphics: %p\n", gr));
if(gr->painter)
delete gr->painter;
@@ -114,7 +114,7 @@
Graphics* gr, jint x, jint y, jint width, jint height,
jint xDelta, jint yDelta )
{
- DBG(AWT, qDebug("copyArea: %p, %d,%d-%d,%d %d,%d\n", gr, x,y,width,height, xDelta,yDelta));
+ DBG(AWT, qqDebug("copyArea: %p, %d,%d-%d,%d %d,%d\n", gr, x,y,width,height, xDelta,yDelta));
/* some X servers act alleric on that (careless bitblt, again) */
if ( (width < 0) || (height < 0) )
@@ -127,7 +127,7 @@
void Java_java_awt_Toolkit_graClearRect(JNIEnv* env, jclass clazz,
Graphics* gr, jint x, jint y, jint width, jint height)
{
- DBG(AWT, qDebug("clearRect: %p, %d,%d-%d,%d\n", gr, x,y,width,height));
+ DBG(AWT, qqDebug("clearRect: %p, %d,%d-%d,%d\n", gr, x,y,width,height));
QPainter *painter = (QPainter*)gr->painter;
painter->fillRect(x + gr->x0, y + gr->y0, width, height, QCOLOR(gr->bg));
@@ -149,7 +149,7 @@
jb = env->GetByteArrayElements( jBytes, &isCopy);
jbo = jb + offset;
- DBG(AWT, qDebug("drawBytes: %p, %p,%d,%d \"%s\" %d,%d\n", gr,
+ DBG(AWT, qqDebug("drawBytes: %p, %p,%d,%d \"%s\" %d,%d\n", gr,
jBytes,offset,len, jb, x,y));
if ( offset+len > n )
@@ -180,7 +180,7 @@
jc = env->GetCharArrayElements( jChars, &isCopy);
jco = jc + offset;
- DBG(AWT, qDebug("drawChars: %p, %p,%d,%d \"%s\" %d,%d\n", gr, jChars,offset,len,
+ DBG(AWT, qqDebug("drawChars: %p, %p,%d,%d \"%s\" %d,%d\n", gr, jChars,offset,len,
jchar2CString(X,jco,len), x,y));
if ( offset+len > n )
@@ -212,7 +212,7 @@
if ( !str ) return;
cstr = java2CString(env, X, str);
- DBG(AWT, qDebug("drawString: %p \"%s\" %d,%d\n", gr, cstr, x,y));
+ DBG(AWT, qqDebug("drawString: %p \"%s\" %d,%d\n", gr, cstr, x,y));
painter = (QPainter*)gr->painter;
QString qstr(cstr);
@@ -223,7 +223,7 @@
void Java_java_awt_Toolkit_graDrawLine(JNIEnv* env, jclass clazz,
Graphics* gr, jint x1, jint y1, jint x2, jint y2)
{
- DBG( AWT_GRA, qDebug("drawLine: %p, %d,%d - %d,%d\n", gr, x1,y1, x2,y2));
+ DBG( AWT_GRA, qqDebug("drawLine: %p, %d,%d - %d,%d\n", gr, x1,y1, x2,y2));
QPainter *painter = (QPainter*)gr->painter;
if( (x1==x2) && (y1==y2) ) { //swing gimmicks
@@ -239,7 +239,7 @@
Graphics* gr, jint x, jint y, jint width, jint height,
jint startAngle, jint arcAngle)
{
- DBG( AWT_GRA, qDebug("drawArc: %p, %d,%d-%d,%d %d,%d\n", gr,
+ DBG( AWT_GRA, qqDebug("drawArc: %p, %d,%d-%d,%d %d,%d\n", gr,
x,y,width,height, startAngle,arcAngle));
QPainter *painter = (QPainter*)gr->painter;
@@ -253,7 +253,7 @@
Graphics* gr, jint x, jint y, jint width, jint height,
jint startAngle, jint arcAngle)
{
- DBG( AWT_GRA, qDebug("fillArc: %p, %d,%d-%d,%d %d,%d\n", gr,
+ DBG( AWT_GRA, qqDebug("fillArc: %p, %d,%d-%d,%d %d,%d\n", gr,
x,y,width,height, startAngle, arcAngle));
QPainter *painter = (QPainter*)gr->painter;
@@ -266,7 +266,7 @@
void Java_java_awt_Toolkit_graDrawOval(JNIEnv* env, jclass clazz,
Graphics* gr, int x, jint y, jint width, jint height)
{
- DBG( AWT_GRA, qDebug("drawOval: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
+ DBG( AWT_GRA, qqDebug("drawOval: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
QPainter *painter = (QPainter*)gr->painter;
@@ -278,7 +278,7 @@
void Java_java_awt_Toolkit_graFillOval(JNIEnv* env, jclass clazz,
Graphics* gr, jint x, jint y, jint width, jint height)
{
- DBG( AWT_GRA, qDebug("fillOval: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
+ DBG( AWT_GRA, qqDebug("fillOval: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
QPainter *painter = (QPainter*)gr->painter;
@@ -317,7 +317,7 @@
{
int n;
- DBG( AWT_GRA, qDebug("drawPolygon: %p, %p,%p %d\n", gr, xPoints, yPoints, nPoints));
+ DBG( AWT_GRA, qqDebug("drawPolygon: %p, %p,%p %d\n", gr, xPoints, yPoints, nPoints));
if ( !xPoints || !yPoints ) return;
@@ -336,7 +336,7 @@
void Java_java_awt_Toolkit_graDrawPolyline(JNIEnv* env, jclass clazz,
Graphics* gr, jintArray xPoints, jintArray yPoints, jint nPoints)
{
- DBG( AWT_GRA, qDebug("drawPolyline: %p, %p,%p %d\n", gr, xPoints, yPoints, nPoints));
+ DBG( AWT_GRA, qqDebug("drawPolyline: %p, %p,%p %d\n", gr, xPoints, yPoints, nPoints));
if ( !xPoints || !yPoints ) return;
@@ -352,7 +352,7 @@
{
//XPoint *p;
- DBG( AWT_GRA, qDebug("fillPolygon: %p, %p,%p %d\n", gr, xPoints, yPoints, nPoints));
+ DBG( AWT_GRA, qqDebug("fillPolygon: %p, %p,%p %d\n", gr, xPoints, yPoints, nPoints));
if ( !xPoints || !yPoints ) return;
@@ -366,7 +366,7 @@
void Java_java_awt_Toolkit_graDrawRect(JNIEnv* env, jclass clazz,
Graphics* gr, jint x, jint y, jint width, jint height)
{
- DBG( AWT_GRA, qDebug("drawRect: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
+ DBG( AWT_GRA, qqDebug("drawRect: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
QPainter *painter = (QPainter*)gr->painter;
@@ -378,7 +378,7 @@
void Java_java_awt_Toolkit_graFillRect(JNIEnv* env, jclass clazz,
Graphics* gr, jint x, jint y, jint width, jint height)
{
- DBG( AWT_GRA, qDebug("fillRect: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
+ DBG( AWT_GRA, qqDebug("fillRect: %p, %d,%d - %d,%d\n", gr, x,y,width,height));
QPainter *painter = (QPainter*)gr->painter;
@@ -401,7 +401,7 @@
{
int x1, x2, y1, y2, a, b;
- DBG( AWT_GRA, qDebug("drawRoundRect: %p, %d,%d - %d,%d %d,%d\n", gr,
+ DBG( AWT_GRA, qqDebug("drawRoundRect: %p, %d,%d - %d,%d %d,%d\n", gr,
x,y,width,height, wArc, hArc));
QPainter *painter = (QPainter*)gr->painter;
@@ -415,7 +415,7 @@
{
int x1, x2, y1, y2, a, b;
- DBG( AWT_GRA, qDebug("fillRoundRect: %p, %d,%d - %d,%d %d,%d\n", gr,
+ DBG( AWT_GRA, qqDebug("fillRoundRect: %p, %d,%d - %d,%d %d,%d\n", gr,
x,y,width,height, wArc, hArc));
QPainter *painter = (QPainter*)gr->painter;
@@ -428,7 +428,7 @@
int bright, dark;
int xw, yh;
- DBG( AWT_GRA, qDebug("draw3DRect: %p, %d,%d - %d,%d %d %x\n", gr,
+ DBG( AWT_GRA, qqDebug("draw3DRect: %p, %d,%d - %d,%d %d %x\n", gr,
x,y,width,height, raised, rgb));
QPainter *painter = (QPainter*)gr->painter;
@@ -456,7 +456,7 @@
Graphics* gr, jint x, jint y, jint width, jint height,
jboolean raised, jint rgb)
{
- DBG( AWT_GRA, qDebug("fill3DRect: %p, %d,%d - %d,%d %d %x\n", gr,
+ DBG( AWT_GRA, qqDebug("fill3DRect: %p, %d,%d - %d,%d %d %x\n", gr,
x,y,width,height, raised, rgb));
QPainter *painter = (QPainter*)gr->painter;
@@ -479,7 +479,7 @@
void Java_java_awt_Toolkit_graSetClip(JNIEnv* env, jclass clazz,
Graphics* gr, jint xClip, jint yClip, jint wClip, jint hClip)
{
- DBG( AWT_GRA, qDebug("setClip: %p, %d,%d - %d,%d\n", gr, xClip, yClip, wClip, hClip));
+ DBG( AWT_GRA, qqDebug("setClip: %p, %d,%d - %d,%d\n", gr, xClip, yClip, wClip, hClip));
if(wClip <= 0)
wClip = 0;
@@ -495,7 +495,7 @@
void Java_java_awt_Toolkit_graSetColor(JNIEnv* env, jclass clazz,
Graphics* gr, jint clr)
{
- DBG(AWT, qDebug("setColor: gr=%p, clr=%x, painter=%x\n", gr, clr,
+ DBG(AWT, qqDebug("setColor: gr=%p, clr=%x, painter=%x\n", gr, clr,
gr->painter));
gr->fg = clr;
@@ -512,7 +512,7 @@
void Java_java_awt_Toolkit_graSetBackColor(JNIEnv* env, jclass clazz,
Graphics* gr, jint clr)
{
- DBG( AWT_GRA, qDebug("setBackColor: %p, %x\n", gr, clr));
+ DBG( AWT_GRA, qqDebug("setBackColor: %p, %x\n", gr, clr));
gr->bg = clr;
@@ -524,7 +524,7 @@
void Java_java_awt_Toolkit_graSetFont(JNIEnv* env, jclass clazz,
Graphics* gr, jobject fnt)
{
- DBG( AWT_GRA, qDebug("setFont: %p, %p\n", gr, fnt));
+ DBG( AWT_GRA, qqDebug("setFont: %p, %p\n", gr, fnt));
QPainter *painter = (QPainter*)gr->painter;
gr->painter->setFont(*((QFont*)fnt));
@@ -533,7 +533,7 @@
void Java_java_awt_Toolkit_graSetOffset(JNIEnv* env, jclass clazz,
Graphics* gr, jint xOff, jint yOff)
{
- DBG( AWT_GRA, qDebug("setOffset: %p, %d,%d\n", gr, xOff, yOff));
+ DBG( AWT_GRA, qqDebug("setOffset: %p, %d,%d\n", gr, xOff, yOff));
gr->x0 = xOff;
gr->y0 = yOff;
@@ -542,7 +542,7 @@
void Java_java_awt_Toolkit_graSetPaintMode(JNIEnv* env, jclass clazz,
Graphics* gr)
{
- DBG( AWT_GRA, qDebug("setPaintMode: %p\n", gr));
+ DBG( AWT_GRA, qqDebug("setPaintMode: %p\n", gr));
gr->xor_mode = 0;
@@ -556,7 +556,7 @@
void Java_java_awt_Toolkit_graSetXORMode(JNIEnv* env, jclass clazz,
Graphics* gr, jint xorClr)
{
- DBG( AWT_GRA, qDebug("setXORMode: %p, %x\n", gr, xorClr));
+ DBG( AWT_GRA, qqDebug("setXORMode: %p, %x\n", gr, xorClr));
gr->xor_mode = 1;
gr->xclr = xorClr;
@@ -571,7 +571,7 @@
void Java_java_awt_Toolkit_graSetVisible(JNIEnv* env, jclass clazz,
Graphics* gr, jint isVisible)
{
- DBG( AWT_GRA, qDebug("setVisble: %p %d\n", gr, isVisible));
+ DBG( AWT_GRA, qqDebug("setVisble: %p %d\n", gr, isVisible));
/*
* This is rather a hack to "defuse" a Graphics object, but we don't want to
@@ -603,7 +603,7 @@
unsigned long dpix, spix, bgpix = 0;
int sr, sg, sb, dr, dg, db;
- DBG( AWT_GRA, qDebug("drawAlphaImage: %p %p (%p, %p), %d,%d %d,%d %d,%d %x\n",
+ DBG( AWT_GRA, qqDebug("drawAlphaImage: %p %p (%p, %p), %d,%d %d,%d %d,%d %x\n",
gr, img, img->qImg, img->alpha, srcX, srcY, dstX, dstY, width, height, bgval));
if ( !img ) return;
@@ -682,7 +682,7 @@
jint dstX, jint dstY,
jint width, jint height, jint bgval )
{
- DBG( AWT_GRA, qDebug("drawImage: %p %p (%p,%p,%p %d,%d) %d,%d, %d,%d, %d,%d, %x\n",
+ DBG( AWT_GRA, qqDebug("drawImage: %p %p (%p,%p,%p %d,%d) %d,%d, %d,%d, %d,%d, %x\n",
gr, img, img->qImg,img->qImg_AlphaMask,img->alpha, img->width,img->height,
srcX,srcY, dstX,dstY, width,height, bgval));
@@ -717,7 +717,7 @@
Image *tgt;
int tmpXImg = (img->qImg == NULL);
- DBG( AWT_GRA, qDebug("drawImageScaled: %p %p (%p), %d,%d,%d,%d, %d,%d,%d,%d, %x\n",
+ DBG( AWT_GRA, qqDebug("drawImageScaled: %p %p (%p), %d,%d,%d,%d, %d,%d,%d,%d, %x\n",
gr, img, img->qImg, dx0, dy0, dx1, dy1, sx0, sy0, sx1, sy1, bgval));
if ( !img ) return;
Index: kaffe/libraries/clib/awt/qt/img.cc
diff -u kaffe/libraries/clib/awt/qt/img.cc:1.6 kaffe/libraries/clib/awt/qt/img.cc:1.7
--- kaffe/libraries/clib/awt/qt/img.cc:1.6 Mon Jul 12 06:39:48 2004
+++ kaffe/libraries/clib/awt/qt/img.cc Mon Jul 12 10:20:53 2004
@@ -44,7 +44,7 @@
unsigned int nPix;
char *data;
img->qImg = new QImage();
- DBG( AWT_IMG, qDebug("alloc: %p %p (%dx%d)\n", img, img->qImg, img->width, img->height));
+ DBG( AWT_IMG, qqDebug("alloc: %p %p (%dx%d)\n", img, img->qImg, img->width, img->height));
}
void
@@ -62,7 +62,7 @@
memset( data, 0xff, nBytes);
img->qImg_AlphaMask = new QImage();
- DBG( AWT_IMG, qDebug( "alloc mask: %p %p (%dx%d)\n", img, img->qImg_AlphaMask, img->width, img->height));
+ DBG( AWT_IMG, qqDebug( "alloc mask: %p %p (%dx%d)\n", img, img->qImg_AlphaMask, img->width, img->height));
}
@@ -126,7 +126,7 @@
for ( j=0; j<img->width; j++ ) {
a = GetAlpha( img->alpha, j, i);
if ( a < threshold ) {
- DBG( AWT_IMG, qDebug("reduce alpha! %d %d",img->qImg->width(),img->qImg->height()) );
+ DBG( AWT_IMG, qqDebug("reduce alpha! %d %d",img->qImg->width(),img->qImg->height()) );
img->qImg->setPixel(j,i,0);
}
}
@@ -145,7 +145,7 @@
void*
Java_java_awt_Toolkit_imgCreateImage ( JNIEnv* env, jclass clazz, jint width, jint height )
{
- DBG( AWT_IMG, qDebug("imgCreateImage w=%d h=%d\n",(int)width,(int)height));
+ DBG( AWT_IMG, qqDebug("imgCreateImage w=%d h=%d\n",(int)width,(int)height));
Image *img = createImage( width, height);
createXImage( X, img);
return img;
@@ -155,7 +155,7 @@
void*
Java_java_awt_Toolkit_imgCreateScreenImage ( JNIEnv* env, jclass clazz, jint width, jint height )
{
- DBG( AWT_IMG, qDebug("imgCreateScreenImage w=%d h=%d\n",(int)width,(int)height));
+ DBG( AWT_IMG, qqDebug("imgCreateScreenImage w=%d h=%d\n",(int)width,(int)height));
Image *img = createImage( width, height);
img->qpm = new QPixmap(width,height);
return img;
@@ -170,7 +170,7 @@
jintArray clrMap, jbyteArray idxPels, jint trans,
jint off, jint scan)
{
- DBG( AWT_IMG, qDebug("imgSetIdxPels\n"));
+ DBG( AWT_IMG, qqDebug("imgSetIdxPels\n"));
register int row, col;
unsigned long pix;
jint rgb;
@@ -209,7 +209,7 @@
jint x, jint y, jint w, jint h,
jintArray rgbPels, jint off, jint scan)
{
- DBG( AWT_IMG, qDebug("imgSetRGBPels\n"));
+ DBG( AWT_IMG, qqDebug("imgSetRGBPels\n"));
register int row, col;
unsigned long pix = 0;
jboolean isCopy;
@@ -256,7 +256,7 @@
* called for external (generic) production, since our own prod facilities usually
* know better if and how to do alpha support
*/
- DBG( AWT_IMG, qDebug("imgComplete\n"));
+ DBG( AWT_IMG, qqDebug("imgComplete\n"));
if ( img->alpha && !needsFullAlpha( X, img, 0.0) )
reduceAlpha( X, img, 128);
}
@@ -285,7 +285,7 @@
Java_java_awt_Toolkit_imgCreateScaledImage ( JNIEnv* env, jclass clazz,
Image* img, int width, int height )
{
- DBG( AWT_IMG, qDebug("imgCreateScaledImage img=%p w=%d h=%d\n",img, (int)width, (int)height));
+ DBG( AWT_IMG, qqDebug("imgCreateScaledImage img=%p w=%d h=%d\n",img, (int)width, (int)height));
Image *scaledImg = createImage( width, height);
*(scaledImg->qImg) = img->qImg->smoothScale(width,height);
@@ -298,7 +298,7 @@
void
Java_java_awt_Toolkit_imgProduceImage ( JNIEnv* env, jclass clazz, jobject producer, Image* img )
{
- DBG( AWT_IMG, qDebug("imgProduceImage\n"));
+ DBG( AWT_IMG, qqDebug("imgProduceImage\n"));
int i, j;
int r, g, b;
unsigned long pix;
@@ -427,27 +427,10 @@
char *fn = java2CString( env, X, fileName);
unsigned char sig[SIG_LENGTH];
- DBG( AWT_IMG, qDebug("imgCreateFromFile file=%s\n",fn));
+ DBG( AWT_IMG, qqDebug("imgCreateFromFile file=%s\n",fn));
QImage *image = new QImage();
bool ok = FALSE;
#if 0
- if ( (infile = AWT_OPEN( fn)) >= 0 ) {
- if ( AWT_READ( infile, sig, sizeof(sig)) == sizeof(sig) ) {
- AWT_REWIND( infile); /* some native converters can't skip the signature read */
-
- switch ( imageFormat( sig) ) {
- case SIG_GIF:
- //fprintf(stderr,"got gif!!!!\n");
- //img = readGifFile( infile,fn);
- //fprintf(stderr,"img=%p\n",img);
- //if(img->next) break;
- //AWT_FREE(img);
- case SIG_JPEG:
- //img = readJpegFile( infile);
- //break;
- case SIG_PNG:
- //img = readPngFile( infile);
- //break;
//QApplication::setOverrideCursor( waitCursor );
#endif
ok = image->load( fn);
@@ -475,7 +458,7 @@
Java_java_awt_Toolkit_imgCreateFromData ( JNIEnv* env, jclass clazz,
jbyteArray jbuffer, jint off, jint len )
{
- DBG( AWT_IMG, qDebug("imgCreateFromData\n"));
+ DBG( AWT_IMG, qqDebug("imgCreateFromData\n"));
Image *img = 0;
jboolean isCopy;
jint length = env->GetArrayLength( jbuffer);
@@ -523,7 +506,7 @@
void*
Java_java_awt_Toolkit_imgSetFrame ( JNIEnv* env, jclass clazz, Image* img, int frameNo )
{
- printf("imgSetFrame\n");
+ DBG(AWT_IMG, qqDebug("imgSetFrame\n"));
Image *imgCur = img;
if ( !img->next )
Index: kaffe/libraries/clib/awt/qt/tlk.cc
diff -u kaffe/libraries/clib/awt/qt/tlk.cc:1.5 kaffe/libraries/clib/awt/qt/tlk.cc:1.6
--- kaffe/libraries/clib/awt/qt/tlk.cc:1.5 Mon Jul 12 06:39:48 2004
+++ kaffe/libraries/clib/awt/qt/tlk.cc Mon Jul 12 10:20:53 2004
@@ -37,7 +37,7 @@
jint Java_java_awt_Toolkit_tlkProperties(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkProperties\n"));
+ DBG(AWT, qqDebug("tlkProperties\n"));
jint props = TLK_EXTERNAL_DECO;
// take out the flags TLK_IS_BLOCKING & TLK_NEEDS_FLUSH from props
@@ -75,7 +75,7 @@
#else
qapp = new QApplication(argc, argv, QApplication::GuiServer);
#endif
- DBG(AWT, qDebug("qapp initialization.\n"));
+ DBG(AWT, qqDebug("qapp initialization.\n"));
// allocate X->buf for string opeartion
getBuffer(X, 128);
@@ -86,7 +86,7 @@
X->windows = (WindowRec*) AWT_CALLOC( X->nWindows, sizeof(WindowRec));
X->fwdIdx = -1;
- DBG(AWT, qDebug("tlkInit Done.\n"));
+ DBG(AWT, qqDebug("tlkInit Done.\n"));
return JNI_TRUE;
}
@@ -102,13 +102,13 @@
jstring Java_java_awt_Toolkit_tlkVersion(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkVersion\n"));
+ DBG(AWT, qqDebug("tlkVersion\n"));
return env->NewStringUTF( "QtAWT-1.0");
}
jint Java_java_awt_Toolkit_tlkGetResolution(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkGetResolution\n"));
+ DBG(AWT, qqDebug("tlkGetResolution\n"));
/*
* DPI of screen. It seems that this information will not be used by Java.
*/
@@ -117,19 +117,19 @@
jint Java_java_awt_Toolkit_tlkGetScreenHeight(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkGetScreenHeight\n"));
+ DBG(AWT, qqDebug("tlkGetScreenHeight\n"));
return qapp->desktop()->height();
}
jint Java_java_awt_Toolkit_tlkGetScreenWidth(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkGetScreenWidth\n"));
+ DBG(AWT, qqDebug("tlkGetScreenWidth\n"));
return qapp->desktop()->width();
}
void Java_java_awt_Toolkit_tlkSync(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkSync\n"));
+ DBG(AWT, qqDebug("tlkSync\n"));
/*
* We simply let Qt handles synchronization,
*/
@@ -137,19 +137,19 @@
void Java_java_awt_Toolkit_tlkFlush(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkFlush\n"));
+ DBG(AWT, qqDebug("tlkFlush\n"));
}
void Java_java_awt_Toolkit_tlkBeep(JNIEnv* env, jclass clazz)
{
- DBG(AWT, qDebug("tlkBeep\n"));
+ DBG(AWT, qqDebug("tlkBeep\n"));
qapp->beep();
}
void Java_java_awt_Toolkit_tlkDisplayBanner(JNIEnv* env, jclass clazz,
jstring banner )
{
- DBG(AWT, qDebug("tlkDisplayBanner\n"));
+ DBG(AWT, qqDebug("tlkDisplayBanner\n"));
}
*** Patch too long, truncated ***
More information about the kaffe
mailing list