--- /dev/null
+[Desktop Entry]
+Name=mDictionary Widget
+Type=qt
+X-Path=/usr/lib/hildon-desktop/mdictionarywidget
+X-Multiple-Instances=false
+X-home-applet-minwidth=100
+X-home-applet-minheight=72
--- /dev/null
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary 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 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary 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 mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#include "MainWidget.h"
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <QtGui/QX11Info>
+
+MainWidget::MainWidget(QWidget *parent) :
+ QWidget(parent)
+{
+ QCoreApplication::instance()->setApplicationName(
+ "mDictionary desktop widget");
+
+ // Get required atoms
+ Atom winTypeAtom = XInternAtom(
+ QX11Info::display(), "_NET_WM_WINDOW_TYPE", false);
+
+ Atom homeAppletAto = XInternAtom(
+ QX11Info::display(), "_HILDON_WM_WINDOW_TYPE_HOME_APPLET", false);
+
+ Atom appletIDAtom = XInternAtom(
+ QX11Info::display(), "_HILDON_APPLET_ID", false);
+
+ Atom utf8Atom = XInternAtom(
+ QX11Info::display(), "UTF8_STRING", false);
+
+ Atom appletSettingAtom = XInternAtom(
+ QX11Info::display(), "_HILDON_APPLET_SETTINGS", false);
+
+
+ // Set correct window type
+ XChangeProperty(QX11Info::display(), winId(), winTypeAtom, XA_ATOM, 32,
+ PropModeReplace, (unsigned char *) &homeAppletAto, 1);
+
+
+
+ // Use application name to fill AppletID
+ QByteArray id (QCoreApplication::instance()->applicationName().remove(' ').toUtf8());
+
+ XChangeProperty(QX11Info::display(), winId(), appletIDAtom, utf8Atom, 8,
+ PropModeReplace, (unsigned char *)id.constData(),
+ id.length());
+
+
+ layout = new QVBoxLayout;
+ setLayout(layout);
+
+ searchStringLineEdit = new QLineEdit;
+ searchButton = new QPushButton(tr("Search"));
+
+ layout->addWidget(searchStringLineEdit);
+ layout->addWidget(searchButton);
+}
--- /dev/null
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary 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 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary 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 mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#ifndef MAINWIDGET_H
+#define MAINWIDGET_H
+
+#include <QWidget>
+#include <QtGui>
+
+class MainWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit MainWidget(QWidget *parent = 0);
+
+private:
+ QLineEdit* searchStringLineEdit;
+ QPushButton* searchButton;
+ QVBoxLayout* layout;
+};
+
+#endif // MAINWIDGET_H
--- /dev/null
+# -------------------------------------------------
+# Project created by QtCreator 2010-08-03T08:54:27
+# -------------------------------------------------
+QT += core \
+ gui \
+
+TARGET = mdictionarywidget
+
+TEMPLATE = app
+
+MDICT_BINDIR = $$[MDICT_BINDIR]
+
+isEmpty(MDICT_BINDIR):MDICT_BINDIR = .
+
+DESTDIR = $${MDICT_BINDIR}
+
+
+unix {
+ # VARIABLES
+ isEmpty(PREFIX):PREFIX = /usr
+ BINDIR = $$PREFIX/bin
+ DATADIR = $$PREFIX/share
+ DEFINES += DATADIR=\\\"$$DATADIR\\\" \
+ PKGDATADIR=\\\"$$PKGDATADIR\\\"
+
+ # MAKE INSTALL
+ INSTALLS += target \
+ desktop
+
+ target.path = /usr/lib/hildon-desktop
+
+ desktop.path = $$DATADIR/applications/hildon-home
+ desktop.files += ../../../data/other/$${TARGET}.desktop
+}
+
+SOURCES += \
+ main.cpp \
+ MainWidget.cpp
+
+HEADERS += \
+ MainWidget.h
--- /dev/null
+/*******************************************************************************
+
+ This file is part of mDictionary.
+
+ mDictionary 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 3 of the License, or
+ (at your option) any later version.
+
+ mDictionary 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 mDictionary. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#include <QtGui/QApplication>
+#include "MainWidget.h"
+#include <X11/extensions/Xrender.h>
+
+int main(int argc, char *argv[]) {
+
+ Display *dpy = XOpenDisplay(0); // open default display
+ if (!dpy) {
+ qWarning("Cannot connect to the X server");
+ exit(1);
+ }
+
+
+ QApplication a(dpy, argc, argv);
+ QApplication::setOrganizationName("Comarch S.A.");
+ QApplication::setOrganizationDomain("comarch.com");
+ QApplication::setApplicationName("mDictionaryWidget");
+
+ MainWidget w;
+
+ w.show();
+
+ return a.exec();
+}
TEMPLATE=subdirs
-SUBDIRS = plugins base
+SUBDIRS = plugins base desktopWidget
check.target = check
check.CONFIG = recursive