diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bcb704366cb5e333a626c18c308c7e0448a8e69f (patch) | |
tree | f0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /ksirc/puke/pframe.cpp | |
download | tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/puke/pframe.cpp')
-rw-r--r-- | ksirc/puke/pframe.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/ksirc/puke/pframe.cpp b/ksirc/puke/pframe.cpp new file mode 100644 index 00000000..fcff1d96 --- /dev/null +++ b/ksirc/puke/pframe.cpp @@ -0,0 +1,84 @@ +#include "pframe.h" + + +PObject * +PFrame::createWidget(CreateArgs &ca) +{ + PFrame *pw = new PFrame(ca.parent); + QFrame *tf; + if(ca.parent != 0 && + ca.parent->widget()->isWidgetType() == TRUE) + tf = new QFrame((QWidget *) ca.parent->widget()); + else + tf = new QFrame(); + pw->setWidget(tf); + pw->setWidgetId(ca.pwI); + pw->setPukeController(ca.pc); + return pw; +} + + +PFrame::PFrame( PObject *parent) + : PWidget(parent) +{ + // kdDebug(5008) << "PFrame PFrame called" << endl; + frame = 0; +} + +PFrame::~PFrame() +{ + // kdDebug(5008) << "PFrame: in destructor" << endl; + /* + delete frame; // Delete the frame + frame=0; // Set it to 0 + setWidget(frame); // Now set all widget() calls to 0. + */ +} + +void PFrame::messageHandler(int fd, PukeMessage *pm) +{ + // kdDebug(5008) << "PFrame handler called" << endl; + PukeMessage pmRet; + switch(pm->iCommand){ + case PUKE_QFRAME_SET_FRAME: + widget()->setFrameStyle(pm->iArg); + pmRet.iCommand = PUKE_QFRAME_SET_FRAME_ACK; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = widget()->frameStyle(); + pmRet.cArg = 0; + emit outputMessage(fd, &pmRet); + break; + case PUKE_QFRAME_SET_LINEWIDTH: + widget()->setLineWidth(pm->iArg); + pmRet.iCommand = PUKE_QFRAME_SET_LINEWIDTH_ACK; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = widget()->lineWidth(); + pmRet.cArg = 0; + emit outputMessage(fd, &pmRet); + break; + default: + PWidget::messageHandler(fd, pm); + } +} + +void PFrame::setWidget(QObject *w) +{ + if(w != 0 && w->inherits("QFrame") == FALSE) + { + errorInvalidSet(w); + return; + } + + frame = (QFrame *) w; + PWidget::setWidget((QWidget *) w); +} + + +QFrame *PFrame::widget() +{ + // kdDebug(5008) << "PFrame widget called" << endl; + return frame; +} + +#include "pframe.moc" + |