diff options
author | Michele Calgaro <[email protected]> | 2023-08-28 10:59:35 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-09-03 19:32:16 +0900 |
commit | 2505a01dd2ae2c9696210783d677d7d45caa665f (patch) | |
tree | 21cccb348d5a6062d9f612f1ec54cb5c59fb4d7f /qtinterface/interface_tqt3/tqpaintdevice.cpp | |
parent | 8745f781ced6d3f7dcb75daada02eafb2b583139 (diff) | |
download | tqtinterface-2505a01dd2ae2c9696210783d677d7d45caa665f.tar.gz tqtinterface-2505a01dd2ae2c9696210783d677d7d45caa665f.zip |
Drop USE_QT3/4 code
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit 701d92857caed18c0099b264c45a0b0edce782f2)
Diffstat (limited to 'qtinterface/interface_tqt3/tqpaintdevice.cpp')
-rw-r--r-- | qtinterface/interface_tqt3/tqpaintdevice.cpp | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/qtinterface/interface_tqt3/tqpaintdevice.cpp b/qtinterface/interface_tqt3/tqpaintdevice.cpp index 457d37d..eed94dd 100644 --- a/qtinterface/interface_tqt3/tqpaintdevice.cpp +++ b/qtinterface/interface_tqt3/tqpaintdevice.cpp @@ -21,103 +21,3 @@ Boston, MA 02110-1301, USA. #include <tqt.h> #include <ntqpaintdevice.h> - -#ifdef USE_QT4 - -// the following is necessary to work around breakage in many versions -// of XFree86's Xlib.h still in use -// ### which versions? -#if defined(_XLIB_H_) // crude hack, but... -#error "cannot include <X11/Xlib.h> before this file" -#endif -#define XRegisterIMInstantiateCallback qt_XRegisterIMInstantiateCallback -#define XUnregisterIMInstantiateCallback qt_XUnregisterIMInstantiateCallback -#define XSetIMValues qt_XSetIMValues -#include <X11/Xlib.h> -#undef XRegisterIMInstantiateCallback -#undef XUnregisterIMInstantiateCallback -#undef XSetIMValues - -#include <X11/Xutil.h> -#include <X11/Xos.h> -#include <X11/Xatom.h> - -#include <Qt/qcolormap.h> - -/*! - Returns the window system handle of the paint device for XRender - support. Use of this function is not portable. This function will - return 0 if XRender support is not compiled into Qt, if the - XRender extension is not supported on the X11 display, or if the - handle could not be created. -*/ -Qt::HANDLE QPaintDevice::x11RenderHandle() const -{ -// #ifndef TQT_NO_XFTFREETYPE -// return rendhd ? XftDrawPicture( (XftDraw *) rendhd ) : 0; -// #else - return 0; -// #endif // TQT_NO_XFTFREETYPE -} - -static GC* app_gc_tmp = 0; // temporary GC -static GC* app_gc_tmp_m = 0; // temporary GC (monochrome) - -static GC create_gc( int scrn, bool monochrome ) -{ - GC gc; - Display *appDpy = QX11Info::display(); - if ( monochrome ) { - Pixmap pm = XCreatePixmap( appDpy, RootWindow( appDpy, scrn ), 8, 8, 1 ); - gc = XCreateGC( appDpy, pm, 0, 0 ); - XFreePixmap( appDpy, pm ); - } else { - if ( QPaintDevice::x11AppDefaultVisual( scrn ) ) { - gc = XCreateGC( appDpy, RootWindow( appDpy, scrn ), 0, 0 ); - } else { - Window w; - XSetWindowAttributes a; - QColormap cmap_background = QColormap::instance( scrn ); - QColormap cmap_border = QColormap::instance( scrn ); - a.background_pixel = cmap_background.pixel( Qt::black ); - a.border_pixel = cmap_border.pixel( Qt::black ); - - a.colormap = QPaintDevice::x11AppColormap( scrn ); - w = XCreateWindow( appDpy, RootWindow( appDpy, scrn ), 0, 0, 100, 100, - 0, QPaintDevice::x11AppDepth( scrn ), InputOutput, - (Visual*)QPaintDevice::x11AppVisual( scrn ), - CWBackPixel|CWBorderPixel|CWColormap, &a ); - gc = XCreateGC( appDpy, w, 0, 0 ); - XDestroyWindow( appDpy, w ); - } - } - XSetGraphicsExposures( appDpy, gc, False ); - return gc; -} - -GC qt_xget_temp_gc( int scrn, bool monochrome ) // get temporary GC -{ - int appScreenCount = QApplication::desktop()->numScreens(); - if ( scrn < 0 || scrn >= appScreenCount ) { - qDebug("invalid screen (tmp) %d %d", scrn, appScreenCount ); - QWidget* bla = 0; - bla->setName("hello"); - } - GC gc; - if ( monochrome ) { - if ( !app_gc_tmp_m ) // create GC for bitmap - memset( (app_gc_tmp_m = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); - if ( !app_gc_tmp_m[scrn] ) - app_gc_tmp_m[scrn] = create_gc( scrn, TRUE ); - gc = app_gc_tmp_m[scrn]; - } else { // create standard GC - if ( !app_gc_tmp ) - memset( (app_gc_tmp = new GC[appScreenCount]), 0, appScreenCount * sizeof( GC ) ); - if ( !app_gc_tmp[scrn] ) - app_gc_tmp[scrn] = create_gc( scrn, FALSE ); - gc = app_gc_tmp[scrn]; - } - return gc; -} - -#endif // USE_QT4 |