|
|
@ -577,7 +577,7 @@ KDE_NO_EXPORT void View::playingStop () {
|
|
|
|
m_playing = false;
|
|
|
|
m_playing = false;
|
|
|
|
WId w = m_viewer->embeddedWinId ();
|
|
|
|
WId w = m_viewer->embeddedWinId ();
|
|
|
|
if (w)
|
|
|
|
if (w)
|
|
|
|
XClearWindow (qt_xdisplay(), w);
|
|
|
|
XClearWindow (tqt_xdisplay(), w);
|
|
|
|
m_view_area->resizeEvent (0L);
|
|
|
|
m_view_area->resizeEvent (0L);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -689,12 +689,12 @@ KDE_NO_CDTOR_EXPORT Viewer::Viewer (TQWidget *parent, View * view)
|
|
|
|
: QXEmbed (parent), m_plain_window (0), m_bgcolor (0), m_aspect (0.0),
|
|
|
|
: QXEmbed (parent), m_plain_window (0), m_bgcolor (0), m_aspect (0.0),
|
|
|
|
m_view (view) {
|
|
|
|
m_view (view) {
|
|
|
|
/*XWindowAttributes xwa;
|
|
|
|
/*XWindowAttributes xwa;
|
|
|
|
XGetWindowAttributes (qt_xdisplay(), winId (), &xwa);
|
|
|
|
XGetWindowAttributes (tqt_xdisplay(), winId (), &xwa);
|
|
|
|
XSetWindowAttributes xswa;
|
|
|
|
XSetWindowAttributes xswa;
|
|
|
|
xswa.background_pixel = 0;
|
|
|
|
xswa.background_pixel = 0;
|
|
|
|
xswa.border_pixel = 0;
|
|
|
|
xswa.border_pixel = 0;
|
|
|
|
xswa.colormap = xwa.colormap;
|
|
|
|
xswa.colormap = xwa.colormap;
|
|
|
|
create (XCreateWindow (qt_xdisplay (), parent->winId (), 0, 0, 10, 10, 0,
|
|
|
|
create (XCreateWindow (tqt_xdisplay (), parent->winId (), 0, 0, 10, 10, 0,
|
|
|
|
x11Depth (), InputOutput, (Visual*)x11Visual (),
|
|
|
|
x11Depth (), InputOutput, (Visual*)x11Visual (),
|
|
|
|
CWBackPixel | CWBorderPixel | CWColormap, &xswa));*/
|
|
|
|
CWBackPixel | CWBorderPixel | CWColormap, &xswa));*/
|
|
|
|
setAcceptDrops (true);
|
|
|
|
setAcceptDrops (true);
|
|
|
@ -711,22 +711,22 @@ KDE_NO_EXPORT void Viewer::changeProtocol (QXEmbed::Protocol p) {
|
|
|
|
if (p == QXEmbed::XPLAIN) {
|
|
|
|
if (p == QXEmbed::XPLAIN) {
|
|
|
|
setProtocol (p);
|
|
|
|
setProtocol (p);
|
|
|
|
if (!m_plain_window) {
|
|
|
|
if (!m_plain_window) {
|
|
|
|
int scr = DefaultScreen (qt_xdisplay ());
|
|
|
|
int scr = DefaultScreen (tqt_xdisplay ());
|
|
|
|
m_plain_window = XCreateSimpleWindow (
|
|
|
|
m_plain_window = XCreateSimpleWindow (
|
|
|
|
qt_xdisplay(),
|
|
|
|
tqt_xdisplay(),
|
|
|
|
m_view->winId (),
|
|
|
|
m_view->winId (),
|
|
|
|
0, 0, width(), height(),
|
|
|
|
0, 0, width(), height(),
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
BlackPixel (qt_xdisplay(), scr),
|
|
|
|
BlackPixel (tqt_xdisplay(), scr),
|
|
|
|
BlackPixel (qt_xdisplay(), scr));
|
|
|
|
BlackPixel (tqt_xdisplay(), scr));
|
|
|
|
embed (m_plain_window);
|
|
|
|
embed (m_plain_window);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
XClearWindow (qt_xdisplay(), m_plain_window);
|
|
|
|
XClearWindow (tqt_xdisplay(), m_plain_window);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (m_plain_window) {
|
|
|
|
if (m_plain_window) {
|
|
|
|
XDestroyWindow (qt_xdisplay(), m_plain_window);
|
|
|
|
XDestroyWindow (tqt_xdisplay(), m_plain_window);
|
|
|
|
m_plain_window = 0;
|
|
|
|
m_plain_window = 0;
|
|
|
|
XSync (qt_xdisplay (), false);
|
|
|
|
XSync (tqt_xdisplay (), false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//setProtocol (p);
|
|
|
|
//setProtocol (p);
|
|
|
|
setProtocol (QXEmbed::XPLAIN);
|
|
|
|
setProtocol (QXEmbed::XPLAIN);
|
|
|
@ -737,7 +737,7 @@ KDE_NO_EXPORT void Viewer::changeProtocol (QXEmbed::Protocol p) {
|
|
|
|
KDE_NO_EXPORT void Viewer::windowChanged (WId w) {
|
|
|
|
KDE_NO_EXPORT void Viewer::windowChanged (WId w) {
|
|
|
|
kdDebug () << "windowChanged " << (int)w << endl;
|
|
|
|
kdDebug () << "windowChanged " << (int)w << endl;
|
|
|
|
if (w /*&& m_plain_window*/)
|
|
|
|
if (w /*&& m_plain_window*/)
|
|
|
|
XSelectInput (qt_xdisplay (), w,
|
|
|
|
XSelectInput (tqt_xdisplay (), w,
|
|
|
|
//KeyPressMask | KeyReleaseMask |
|
|
|
|
//KeyPressMask | KeyReleaseMask |
|
|
|
|
KeyPressMask |
|
|
|
|
KeyPressMask |
|
|
|
|
//EnterWindowMask | LeaveWindowMask |
|
|
|
|
//EnterWindowMask | LeaveWindowMask |
|
|
|
@ -781,12 +781,12 @@ void Viewer::sendKeyEvent (int key) {
|
|
|
|
KeySym keysym = XStringToKeysym (buf);
|
|
|
|
KeySym keysym = XStringToKeysym (buf);
|
|
|
|
XKeyEvent event = {
|
|
|
|
XKeyEvent event = {
|
|
|
|
XKeyPress, 0, true,
|
|
|
|
XKeyPress, 0, true,
|
|
|
|
qt_xdisplay (), w, qt_xrootwin(), w,
|
|
|
|
tqt_xdisplay (), w, tqt_xrootwin(), w,
|
|
|
|
/*time*/ 0, 0, 0, 0, 0,
|
|
|
|
/*time*/ 0, 0, 0, 0, 0,
|
|
|
|
0, XKeysymToKeycode (qt_xdisplay (), keysym), true
|
|
|
|
0, XKeysymToKeycode (tqt_xdisplay (), keysym), true
|
|
|
|
};
|
|
|
|
};
|
|
|
|
XSendEvent (qt_xdisplay(), w, false, KeyPressMask, (XEvent *) &event);
|
|
|
|
XSendEvent (tqt_xdisplay(), w, false, KeyPressMask, (XEvent *) &event);
|
|
|
|
XFlush (qt_xdisplay ());
|
|
|
|
XFlush (tqt_xdisplay ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -795,12 +795,12 @@ KDE_NO_EXPORT void Viewer::sendConfigureEvent () {
|
|
|
|
if (w) {
|
|
|
|
if (w) {
|
|
|
|
XConfigureEvent c = {
|
|
|
|
XConfigureEvent c = {
|
|
|
|
ConfigureNotify, 0UL, True,
|
|
|
|
ConfigureNotify, 0UL, True,
|
|
|
|
qt_xdisplay (), w, winId (),
|
|
|
|
tqt_xdisplay (), w, winId (),
|
|
|
|
x (), y (), width (), height (),
|
|
|
|
x (), y (), width (), height (),
|
|
|
|
0, None, False
|
|
|
|
0, None, False
|
|
|
|
};
|
|
|
|
};
|
|
|
|
XSendEvent(qt_xdisplay(),c.event,true,StructureNotifyMask,(XEvent*)&c);
|
|
|
|
XSendEvent(tqt_xdisplay(),c.event,true,StructureNotifyMask,(XEvent*)&c);
|
|
|
|
XFlush (qt_xdisplay ());
|
|
|
|
XFlush (tqt_xdisplay ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -823,8 +823,8 @@ KDE_NO_EXPORT void Viewer::setCurrentBackgroundColor (const TQColor & c) {
|
|
|
|
setPaletteBackgroundColor (c);
|
|
|
|
setPaletteBackgroundColor (c);
|
|
|
|
WId w = embeddedWinId ();
|
|
|
|
WId w = embeddedWinId ();
|
|
|
|
if (w) {
|
|
|
|
if (w) {
|
|
|
|
XSetWindowBackground (qt_xdisplay (), w, c.rgb ());
|
|
|
|
XSetWindowBackground (tqt_xdisplay (), w, c.rgb ());
|
|
|
|
XFlush (qt_xdisplay ());
|
|
|
|
XFlush (tqt_xdisplay ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|