krita
kis_paint_device_iface.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <kapplication.h>
00021
00022 #include <dcopclient.h>
00023
00024 #include "kis_paint_device_iface.h"
00025 #include "kis_colorspace_iface.h"
00026 #include "kis_colorspace.h"
00027
00028 #include "kis_paint_device.h"
00029
00030 KisPaintDeviceIface::KisPaintDeviceIface( KisPaintDevice * parent )
00031 : DCOPObject("paintdevice")
00032 {
00033 m_parent = parent;
00034 }
00035
00036 Q_INT32 KisPaintDeviceIface::pixelSize() const
00037 {
00038 return m_parent->pixelSize();
00039 }
00040
00041 Q_INT32 KisPaintDeviceIface::nChannels() const
00042 {
00043 return m_parent->nChannels();
00044 }
00045
00046 QByteArray KisPaintDeviceIface::readBytes(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h)
00047 {
00048 QByteArray b (w * h * m_parent->pixelSize());
00049
00050 m_parent->readBytes((Q_UINT8*)b.data(), x, y, w, h);
00051 return b;
00052 }
00053
00054 void KisPaintDeviceIface::writeBytes(QByteArray bytes, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h)
00055 {
00056 m_parent->writeBytes((Q_UINT8*)bytes.data(), x, y, w, h);
00057 }
00058
00059 DCOPRef KisPaintDeviceIface::colorSpace() const
00060 {
00061 KisColorSpace * cs = m_parent->colorSpace();
00062 if ( !cs )
00063 return DCOPRef();
00064 else
00065 return DCOPRef( kapp->dcopClient()->appId(),
00066 cs->dcopObject()->objId(),
00067 "KisColorSpaceIface" );
00068 }
00069
00070 void KisPaintDeviceIface::setColorSpace(DCOPRef)
00071 {
00072
00073
00074 }
|