Changeset View
Changeset View
Standalone View
Standalone View
effects/zoom/zoom.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 45 | ZoomEffect::ZoomEffect() | |||
---|---|---|---|---|---|
56 | , imageWidth(0) | 56 | , imageWidth(0) | ||
57 | , imageHeight(0) | 57 | , imageHeight(0) | ||
58 | , isMouseHidden(false) | 58 | , isMouseHidden(false) | ||
59 | , xMove(0) | 59 | , xMove(0) | ||
60 | , yMove(0) | 60 | , yMove(0) | ||
61 | , moveFactor(20.0) | 61 | , moveFactor(20.0) | ||
62 | { | 62 | { | ||
63 | initConfig<ZoomConfig>(); | 63 | initConfig<ZoomConfig>(); | ||
64 | QAction* a = 0; | 64 | QAction* a = nullptr; | ||
65 | a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); | 65 | a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); | ||
66 | KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal); | 66 | KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal); | ||
67 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal); | 67 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal); | ||
68 | effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a); | 68 | effects->registerGlobalShortcut(Qt::META + Qt::Key_Equal, a); | ||
69 | effects->registerAxisShortcut(Qt::ControlModifier | Qt::MetaModifier, PointerAxisDown, a); | 69 | effects->registerAxisShortcut(Qt::ControlModifier | Qt::MetaModifier, PointerAxisDown, a); | ||
70 | 70 | | |||
71 | a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this); | 71 | a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this); | ||
72 | KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus); | 72 | KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus); | ||
▲ Show 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 363 | #ifdef KWIN_HAVE_XRENDER_COMPOSITING | |||
364 | if (xrenderPicture) { | 364 | if (xrenderPicture) { | ||
365 | #define DOUBLE_TO_FIXED(d) ((xcb_render_fixed_t) ((d) * 65536)) | 365 | #define DOUBLE_TO_FIXED(d) ((xcb_render_fixed_t) ((d) * 65536)) | ||
366 | static const xcb_render_transform_t xrenderIdentity = { | 366 | static const xcb_render_transform_t xrenderIdentity = { | ||
367 | DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), | 367 | DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), | ||
368 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), | 368 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1), DOUBLE_TO_FIXED(0), | ||
369 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1) | 369 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1) | ||
370 | }; | 370 | }; | ||
371 | if (mousePointer == MousePointerScale) { | 371 | if (mousePointer == MousePointerScale) { | ||
372 | xcb_render_set_picture_filter(xcbConnection(), *xrenderPicture, 4, const_cast<char*>("good"), 0, NULL); | 372 | xcb_render_set_picture_filter(xcbConnection(), *xrenderPicture, 4, const_cast<char*>("good"), 0, nullptr); | ||
373 | const xcb_render_transform_t xform = { | 373 | const xcb_render_transform_t xform = { | ||
374 | DOUBLE_TO_FIXED(1.0 / zoom), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), | 374 | DOUBLE_TO_FIXED(1.0 / zoom), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), | ||
375 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1.0 / zoom), DOUBLE_TO_FIXED(0), | 375 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1.0 / zoom), DOUBLE_TO_FIXED(0), | ||
376 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1) | 376 | DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(0), DOUBLE_TO_FIXED(1) | ||
377 | }; | 377 | }; | ||
378 | xcb_render_set_picture_transform(xcbConnection(), *xrenderPicture, xform); | 378 | xcb_render_set_picture_transform(xcbConnection(), *xrenderPicture, xform); | ||
379 | } | 379 | } | ||
380 | xcb_render_composite(xcbConnection(), XCB_RENDER_PICT_OP_OVER, *xrenderPicture, XCB_RENDER_PICTURE_NONE, | 380 | xcb_render_composite(xcbConnection(), XCB_RENDER_PICT_OP_OVER, *xrenderPicture, XCB_RENDER_PICTURE_NONE, | ||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |