Added .gitignore Added watch file Added lintian-overrides Added debug package Fixed copyrightubuntu/disco
parent
2b74a82f85
commit
40607fae55
@ -1,3 +0,0 @@
|
||||
build/
|
||||
*.qm
|
||||
*.kdev4
|
@ -0,0 +1,31 @@
|
||||
# - Try to find libX11-xcb
|
||||
# Once done this will define
|
||||
#
|
||||
# X11_XCB_FOUND - system has libX11-xcb
|
||||
# X11_XCB_LIBRARIES - Link these to use libX11-xcb
|
||||
# X11_XCB_INCLUDE_DIR - the libX11-xcb include dir
|
||||
# X11_XCB_DEFINITIONS - compiler switches required for using libX11-xcb
|
||||
|
||||
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org>
|
||||
# Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org>
|
||||
# Copyright (c) 2007 Matthias Kretz, <kretz@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
IF (NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
PKG_CHECK_MODULES(PKG_X11_XCB QUIET x11-xcb)
|
||||
|
||||
SET(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS})
|
||||
|
||||
FIND_PATH(X11_XCB_INCLUDE_DIR NAMES X11/Xlib-xcb.h HINTS ${PKG_X11_XCB_INCLUDE_DIRS})
|
||||
FIND_LIBRARY(X11_XCB_LIBRARIES NAMES X11-xcb HINTS ${PKG_X11_XCB_LIBRARY_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(X11_XCB DEFAULT_MSG X11_XCB_LIBRARIES X11_XCB_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARIES)
|
||||
ENDIF (NOT WIN32)
|
@ -0,0 +1,238 @@
|
||||
# Try to find XCB on a Unix system
|
||||
#
|
||||
# This will define:
|
||||
#
|
||||
# XCB_FOUND - True if xcb is available
|
||||
# XCB_LIBRARIES - Link these to use xcb
|
||||
# XCB_INCLUDE_DIRS - Include directory for xcb
|
||||
# XCB_DEFINITIONS - Compiler flags for using xcb
|
||||
#
|
||||
# In addition the following more fine grained variables will be defined:
|
||||
#
|
||||
# XCB_XCB_FOUND XCB_XCB_INCLUDE_DIR XCB_XCB_LIBRARY
|
||||
# XCB_UTIL_FOUND XCB_UTIL_INCLUDE_DIR XCB_UTIL_LIBRARY
|
||||
# XCB_COMPOSITE_FOUND XCB_COMPOSITE_INCLUDE_DIR XCB_COMPOSITE_LIBRARY
|
||||
# XCB_DAMAGE_FOUND XCB_DAMAGE_INCLUDE_DIR XCB_DAMAGE_LIBRARY
|
||||
# XCB_XFIXES_FOUND XCB_XFIXES_INCLUDE_DIR XCB_XFIXES_LIBRARY
|
||||
# XCB_RENDER_FOUND XCB_RENDER_INCLUDE_DIR XCB_RENDER_LIBRARY
|
||||
# XCB_RANDR_FOUND XCB_RANDR_INCLUDE_DIR XCB_RANDR_LIBRARY
|
||||
# XCB_SHAPE_FOUND XCB_SHAPE_INCLUDE_DIR XCB_SHAPE_LIBRARY
|
||||
# XCB_DRI2_FOUND XCB_DRI2_INCLUDE_DIR XCB_DRI2_LIBRARY
|
||||
# XCB_GLX_FOUND XCB_GLX_INCLUDE_DIR XCB_GLX_LIBRARY
|
||||
# XCB_SHM_FOUND XCB_SHM_INCLUDE_DIR XCB_SHM_LIBRARY
|
||||
# XCB_XV_FOUND XCB_XV_INCLUDE_DIR XCB_XV_LIBRARY
|
||||
# XCB_SYNC_FOUND XCB_SYNC_INCLUDE_DIR XCB_SYNC_LIBRARY
|
||||
# XCB_XTEST_FOUND XCB_XTEST_INCLUDE_DIR XCB_XTEST_LIBRARY
|
||||
# XCB_ICCCM_FOUND XCB_ICCCM_INCLUDE_DIR XCB_ICCCM_LIBRARY
|
||||
# XCB_EWMH_FOUND XCB_EWMH_INCLUDE_DIR XCB_EWMH_LIBRARY
|
||||
# XCB_IMAGE_FOUND XCB_IMAGE_INCLUDE_DIR XCB_IMAGE_LIBRARY
|
||||
# XCB_RENDERUTIL_FOUND XCB_RENDERUTIL_INCLUDE_DIR XCB_RENDERUTIL_LIBRARY
|
||||
# XCB_KEYSYMS_FOUND XCB_KEYSYMS_INCLUDE_DIR XCB_KEYSYMS_LIBRARY
|
||||
#
|
||||
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org>
|
||||
# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
set(knownComponents XCB
|
||||
COMPOSITE
|
||||
DAMAGE
|
||||
DRI2
|
||||
EWMH
|
||||
GLX
|
||||
ICCCM
|
||||
IMAGE
|
||||
KEYSYMS
|
||||
RANDR
|
||||
RENDER
|
||||
RENDERUTIL
|
||||
SHAPE
|
||||
SHM
|
||||
SYNC
|
||||
UTIL
|
||||
XFIXES
|
||||
XTEST
|
||||
XV)
|
||||
|
||||
unset(unknownComponents)
|
||||
|
||||
set(pkgConfigModules)
|
||||
set(requiredComponents)
|
||||
|
||||
if (XCB_FIND_COMPONENTS)
|
||||
set(comps ${XCB_FIND_COMPONENTS})
|
||||
else()
|
||||
set(comps ${knownComponents})
|
||||
endif()
|
||||
|
||||
# iterate through the list of requested components, and check that we know them all.
|
||||
# If not, fail.
|
||||
foreach(comp ${comps})
|
||||
list(FIND knownComponents ${comp} index )
|
||||
if("${index}" STREQUAL "-1")
|
||||
list(APPEND unknownComponents "${comp}")
|
||||
else()
|
||||
if("${comp}" STREQUAL "XCB")
|
||||
list(APPEND pkgConfigModules "xcb")
|
||||
elseif("${comp}" STREQUAL "COMPOSITE")
|
||||
list(APPEND pkgConfigModules "xcb-composite")
|
||||
elseif("${comp}" STREQUAL "DAMAGE")
|
||||
list(APPEND pkgConfigModules "xcb-damage")
|
||||
elseif("${comp}" STREQUAL "DRI2")
|
||||
list(APPEND pkgConfigModules "xcb-dri2")
|
||||
elseif("${comp}" STREQUAL "EWMH")
|
||||
list(APPEND pkgConfigModules "xcb-ewmh")
|
||||
elseif("${comp}" STREQUAL "GLX")
|
||||
list(APPEND pkgConfigModules "xcb-glx")
|
||||
elseif("${comp}" STREQUAL "ICCCM")
|
||||
list(APPEND pkgConfigModules "xcb-icccm")
|
||||
elseif("${comp}" STREQUAL "IMAGE")
|
||||
list(APPEND pkgConfigModules "xcb-image")
|
||||
elseif("${comp}" STREQUAL "KEYSYMS")
|
||||
list(APPEND pkgConfigModules "xcb-keysyms")
|
||||
elseif("${comp}" STREQUAL "RANDR")
|
||||
list(APPEND pkgConfigModules "xcb-randr")
|
||||
elseif("${comp}" STREQUAL "RENDER")
|
||||
list(APPEND pkgConfigModules "xcb-render")
|
||||
elseif("${comp}" STREQUAL "RENDERUTIL")
|
||||
list(APPEND pkgConfigModules "xcb-renderutil")
|
||||
elseif("${comp}" STREQUAL "SHAPE")
|
||||
list(APPEND pkgConfigModules "xcb-shape")
|
||||
elseif("${comp}" STREQUAL "SHM")
|
||||
list(APPEND pkgConfigModules "xcb-shm")
|
||||
elseif("${comp}" STREQUAL "SYNC")
|
||||
list(APPEND pkgConfigModules "xcb-sync")
|
||||
elseif("${comp}" STREQUAL "UTIL")
|
||||
list(APPEND pkgConfigModules "xcb-util")
|
||||
elseif("${comp}" STREQUAL "XFIXES")
|
||||
list(APPEND pkgConfigModules "xcb-xfixes")
|
||||
elseif("${comp}" STREQUAL "XTEST")
|
||||
list(APPEND pkgConfigModules "xcb-xtest")
|
||||
elseif("${comp}" STREQUAL "XV")
|
||||
list(APPEND pkgConfigModules "xcb-xv")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
if(DEFINED unknownComponents)
|
||||
set(msgType STATUS)
|
||||
if(XCB_FIND_REQUIRED)
|
||||
set(msgType FATAL_ERROR)
|
||||
endif()
|
||||
if(NOT XCB_FIND_QUIETLY)
|
||||
message(${msgType} "XCB: requested unknown components ${unknownComponents}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
macro(_XCB_HANDLE_COMPONENT _comp)
|
||||
set(_header )
|
||||
set(_lib )
|
||||
if("${_comp}" STREQUAL "XCB")
|
||||
set(_header "xcb/xcb.h")
|
||||
set(_lib "xcb")
|
||||
elseif("${_comp}" STREQUAL "COMPOSITE")
|
||||
set(_header "xcb/composite.h")
|
||||
set(_lib "xcb-composite")
|
||||
elseif("${_comp}" STREQUAL "DAMAGE")
|
||||
set(_header "xcb/damage.h")
|
||||
set(_lib "xcb-damage")
|
||||
elseif("${_comp}" STREQUAL "DRI2")
|
||||
set(_header "xcb/dri2.h")
|
||||
set(_lib "xcb-dri2")
|
||||
elseif("${_comp}" STREQUAL "EWMH")
|
||||
set(_header "xcb/xcb_ewmh.h")
|
||||
set(_lib "xcb-ewmh")
|
||||
elseif("${_comp}" STREQUAL "GLX")
|
||||
set(_header "xcb/glx.h")
|
||||
set(_lib "xcb-glx")
|
||||
elseif("${_comp}" STREQUAL "ICCCM")
|
||||
set(_header "xcb/xcb_icccm.h")
|
||||
set(_lib "xcb-icccm")
|
||||
elseif("${_comp}" STREQUAL "IMAGE")
|
||||
set(_header "xcb/xcb_image.h")
|
||||
set(_lib "xcb-image")
|
||||
elseif("${_comp}" STREQUAL "KEYSYMS")
|
||||
set(_header "xcb/xcb_keysyms.h")
|
||||
set(_lib "xcb-keysyms")
|
||||
elseif("${_comp}" STREQUAL "RANDR")
|
||||
set(_header "xcb/randr.h")
|
||||
set(_lib "xcb-randr")
|
||||
elseif("${_comp}" STREQUAL "RENDER")
|
||||
set(_header "xcb/render.h")
|
||||
set(_lib "xcb-render")
|
||||
elseif("${_comp}" STREQUAL "RENDERUTIL")
|
||||
set(_header "xcb/xcb_renderutil.h")
|
||||
set(_lib "xcb-render-util")
|
||||
elseif("${_comp}" STREQUAL "SHAPE")
|
||||
set(_header "xcb/shape.h")
|
||||
set(_lib "xcb-shape")
|
||||
elseif("${_comp}" STREQUAL "SHM")
|
||||
set(_header "xcb/shm.h")
|
||||
set(_lib "xcb-shm")
|
||||
elseif("${_comp}" STREQUAL "SYNC")
|
||||
set(_header "xcb/sync.h")
|
||||
set(_lib "xcb-sync")
|
||||
elseif("${_comp}" STREQUAL "UTIL")
|
||||
set(_header "xcb/xcb_util.h")
|
||||
set(_lib "xcb-util")
|
||||
elseif("${_comp}" STREQUAL "XFIXES")
|
||||
set(_header "xcb/xfixes.h")
|
||||
set(_lib "xcb-xfixes")
|
||||
elseif("${_comp}" STREQUAL "XTEST")
|
||||
set(_header "xcb/xtest.h")
|
||||
set(_lib "xcb-xtest")
|
||||
elseif("${_comp}" STREQUAL "XV")
|
||||
set(_header "xcb/xv.h")
|
||||
set(_lib "xcb-xv")
|
||||
endif()
|
||||
|
||||
find_path(XCB_${_comp}_INCLUDE_DIR NAMES ${_header} HINTS ${PKG_XCB_INCLUDE_DIRS})
|
||||
find_library(XCB_${_comp}_LIBRARY NAMES ${_lib} HINTS ${PKG_XCB_LIBRARY_DIRS})
|
||||
|
||||
if(XCB_${_comp}_INCLUDE_DIR AND XCB_${_comp}_LIBRARY)
|
||||
list(APPEND XCB_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
|
||||
list(APPEND XCB_LIBRARIES ${XCB_${_comp}_LIBRARY})
|
||||
if (NOT XCB_FIND_QUIETLY)
|
||||
message(STATUS "XCB[${_comp}]: Found component ${_comp}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(XCB_FIND_REQUIRED_${_comp})
|
||||
list(APPEND requiredComponents XCB_${_comp}_FOUND)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(XCB_${_comp} DEFAULT_MSG XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
|
||||
|
||||
# compatibility for old variable naming
|
||||
set(XCB_${_comp}_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
|
||||
set(XCB_${_comp}_LIBRARIES ${XCB_${_comp}_LIBRARY})
|
||||
endmacro()
|
||||
|
||||
IF (NOT WIN32)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_XCB QUIET ${pkgConfigModules})
|
||||
|
||||
set(XCB_DEFINITIONS ${PKG_XCB_CFLAGS})
|
||||
|
||||
foreach(comp ${comps})
|
||||
_xcb_handle_component(${comp})
|
||||
endforeach()
|
||||
|
||||
if(XCB_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS ${requiredComponents})
|
||||
|
||||
# compatibility for old variable naming
|
||||
set(XCB_INCLUDE_DIR ${XCB_INCLUDE_DIRS})
|
||||
|
||||
ENDIF (NOT WIN32)
|
@ -0,0 +1,6 @@
|
||||
/files
|
||||
/*.log
|
||||
/*.substvars
|
||||
|
||||
/screengrab-dbg/
|
||||
/screengrab/
|
@ -1,5 +1,5 @@
|
||||
screengrab (1.95pr1-1) unstable; urgency=low
|
||||
screengrab (1.95+20150907-1) unstable; urgency=medium
|
||||
|
||||
* Initial packaging
|
||||
* Initial packaging (Closes: #795791)
|
||||
|
||||
-- Alf Gaida <agaida@siduction.org> Fri, 21 Nov 2014 21:45:06 +0100
|
||||
-- Alf Gaida <agaida@siduction.org> Mon, 07 Sep 2015 23:00:38 +0200
|
||||
|
@ -0,0 +1,6 @@
|
||||
# there will be no manpage in a foreseeable future
|
||||
screengrab: binary-without-manpage usr/bin/screengrab
|
||||
|
||||
# the contained html documents are shown with the help button
|
||||
screengrab: possible-documentation-but-no-doc-base-registration
|
||||
|
@ -0,0 +1,2 @@
|
||||
version=3
|
||||
https://github.com/QtDesktop/screengrab/releases .*/(.*)\.tar\.gz
|
@ -0,0 +1,106 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
|
||||
* doomer3d@gmail.com *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusConnectionInterface>
|
||||
#include <QDBusInterface>
|
||||
#include <QDir>
|
||||
#include <QTimer>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "dbusnotifier.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define SERVICE_FREEDESKTOP "org.freedesktop.Notifications"
|
||||
#define PATH_FREEDESKTOP "/org/freedesktop/Notifications" ,"org.freedesktop.Notifications"
|
||||
|
||||
#define CACHE_DIR "notify-cache"
|
||||
#define CACHE_PREV "preview.jpg"
|
||||
|
||||
DBusNotifier::DBusNotifier(QObject *parent) : QObject(parent)
|
||||
{
|
||||
_notifier = new QDBusInterface(SERVICE_FREEDESKTOP, PATH_FREEDESKTOP,
|
||||
QDBusConnection::sessionBus(), this);
|
||||
if (_notifier->lastError().type() != QDBusError::NoError) {
|
||||
qWarning() << "Notify: Unable to create interface.";
|
||||
return;
|
||||
}
|
||||
|
||||
qWarning() << "Notify: DBus interfece created successfully.";
|
||||
|
||||
QDir dir(Config::getConfigDir());
|
||||
if (!dir.exists(CACHE_DIR))
|
||||
dir.mkdir(CACHE_DIR);
|
||||
|
||||
_previewPath = dir.absolutePath() + QDir::toNativeSeparators(QDir::separator()) + CACHE_PREV;
|
||||
_appIconPath = QString(SG_ICONPATH);
|
||||
|
||||
_notifyDuration = Config::instance()->getTimeTrayMess() * 1000;
|
||||
|
||||
}
|
||||
|
||||
DBusNotifier::~DBusNotifier()
|
||||
{
|
||||
if (!_previewPath.isEmpty()) {
|
||||
QDir dir(QDir::home());
|
||||
dir.remove(_previewPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DBusNotifier::displayNotify(const StateNotifyMessage &message)
|
||||
{
|
||||
QList<QVariant> n = prepareNotification(message);
|
||||
|
||||
if (!n.isEmpty()) {
|
||||
QDBusReply<uint> reply = _notifier->callWithArgumentList(QDBus::Block,"Notify",n);
|
||||
}
|
||||
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
QList<QVariant> DBusNotifier::prepareNotification(const StateNotifyMessage& message)
|
||||
{
|
||||
QList<QVariant> args;
|
||||
|
||||
args << "Screen Grab";
|
||||
args << QVariant(QVariant::UInt); // id
|
||||
|
||||
// app-icon(path to icon on disk)
|
||||
args << _appIconPath;
|
||||
|
||||
// summary (notification title)
|
||||
args << message.header;
|
||||
|
||||
// message text
|
||||
args << message.message;
|
||||
|
||||
// actions is none
|
||||
args << QStringList();
|
||||
|
||||
// hints
|
||||
args << QVariantMap();
|
||||
|
||||
// timeout
|
||||
args << _notifyDuration;
|
||||
|
||||
return args;
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
|
||||
* doomer3d@gmail.com *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef DBUSNOTIFIER_H
|
||||
#define DBUSNOTIFIER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "core.h"
|
||||
|
||||
class QDBusInterface;
|
||||
|
||||
class DBusNotifier : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DBusNotifier(QObject *parent = 0);
|
||||
~DBusNotifier();
|
||||
|
||||
void displayNotify(const StateNotifyMessage& message);
|
||||
|
||||
private:
|
||||
QList<QVariant> prepareNotification(const StateNotifyMessage& message);
|
||||
|
||||
QDBusInterface *_notifier;
|
||||
int _notifyDuration;
|
||||
QString _appIconPath;
|
||||
QString _previewPath;
|
||||
};
|
||||
|
||||
#endif // DBUSNOTIFIER_H
|
@ -0,0 +1,43 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
|
||||
* doomer3d@gmail.com *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "x11utils.h"
|
||||
|
||||
#include <xcb/xfixes.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
|
||||
void X11Utils::compositePointer(int offsetX, int offsetY, QPixmap *snapshot)
|
||||
{
|
||||
Xcb::ScopedCPointer<xcb_xfixes_get_cursor_image_reply_t> cursor(
|
||||
xcb_xfixes_get_cursor_image_reply(Xcb::connection(),
|
||||
xcb_xfixes_get_cursor_image_unchecked(Xcb::connection()),
|
||||
NULL));
|
||||
|
||||
if (cursor.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QImage qcursorimg((uchar *) xcb_xfixes_get_cursor_image_cursor_image(cursor.data()),
|
||||
cursor->width, cursor->height,
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
|
||||
QPainter painter(snapshot);
|
||||
painter.drawImage(QPointF(cursor->x - cursor->xhot - offsetX, cursor->y - cursor ->yhot - offsetY), qcursorimg);
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
|
||||
* doomer3d@gmail.com *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef X11UTILS_H
|
||||
#define X11UTILS_H
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QScopedPointer>
|
||||
#include <QX11Info>
|
||||
|
||||
#include <X11/Xlib-xcb.h>
|
||||
#include <fixx11h.h>
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
namespace X11Utils {
|
||||
void compositePointer(int offsetX, int offsetY, QPixmap *snapshot);
|
||||
}
|
||||
|
||||
|
||||
namespace Xcb {
|
||||
template <typename T>
|
||||
class ScopedCPointer : public QScopedPointer<T, QScopedPointerPodDeleter>
|
||||
{
|
||||
public:
|
||||
ScopedCPointer(T *p = 0) : QScopedPointer<T, QScopedPointerPodDeleter>(p) {}
|
||||
};
|
||||
|
||||
inline xcb_connection_t *connection()
|
||||
{
|
||||
return XGetXCBConnection(QX11Info::display());
|
||||
}
|
||||
} // namespace Xcb
|
||||
|
||||
#endif // X11UTILS_H
|
||||
|
@ -1,14 +1,56 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
|
||||
* doomer3d@gmail.com *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "uploaderconfigwidget_mediacrush.h"
|
||||
#include "ui_uploaderconfigwidget_mediacrush.h"
|
||||
|
||||
#include "uploaderconfig.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
UploaderConfigWidget_MediaCrush::UploaderConfigWidget_MediaCrush(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::UploaderConfigWidget_MediaCrush)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// load settings
|
||||
UploaderConfig config;
|
||||
|
||||
QVariantMap loadedValues;
|
||||
loadedValues.insert(KEY_MCSH_URL, "");
|
||||
|
||||
loadedValues = config.loadSettings("mediacru.sh", loadedValues);
|
||||
ui->editUrl->setText(loadedValues[KEY_MCSH_URL].toString());
|
||||
|
||||
}
|
||||
|
||||
UploaderConfigWidget_MediaCrush::~UploaderConfigWidget_MediaCrush()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void UploaderConfigWidget_MediaCrush::saveSettings()
|
||||
{
|
||||
UploaderConfig config;
|
||||
|
||||
QVariantMap savingValues;
|
||||
savingValues.insert(KEY_MCSH_URL, ui->editUrl->text());
|
||||
|
||||
config.saveSettings("mediacru.sh", savingValues);
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
# Translations
|
||||
Comment[it]=Catturare schermate e condividerle in rete
|
||||
GenericName[it]=Cattura schermata
|
Loading…
Reference in new issue