summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-25 22:03:41 (UTC)
committer harlekin <harlekin>2003-03-25 22:03:41 (UTC)
commitc03e0f1199be7b2be111059b57f9e8ce965f5828 (patch) (side-by-side diff)
tree85d30d63f4823def6bc405c55e52133661c7640b
parent8e685661d962c10c13efd3c442742c1afe1afd1b (diff)
downloadopie-c03e0f1199be7b2be111059b57f9e8ce965f5828.zip
opie-c03e0f1199be7b2be111059b57f9e8ce965f5828.tar.gz
opie-c03e0f1199be7b2be111059b57f9e8ce965f5828.tar.bz2
here comes the rotate startmenu applet .-)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/rotateapplet/config.in4
-rw-r--r--core/applets/rotateapplet/rotate.cpp127
-rw-r--r--core/applets/rotateapplet/rotate.h62
-rw-r--r--core/applets/rotateapplet/rotateapplet.pro12
-rw-r--r--core/launcher/opie-taskbar.control2
-rw-r--r--packages1
6 files changed, 207 insertions, 1 deletions
diff --git a/core/applets/rotateapplet/config.in b/core/applets/rotateapplet/config.in
new file mode 100644
index 0000000..1a0d923
--- a/dev/null
+++ b/core/applets/rotateapplet/config.in
@@ -0,0 +1,4 @@
+ config ROTATEAPPLET
+ boolean "Rotate"
+ default "y"
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
new file mode 100644
index 0000000..8f323d6
--- a/dev/null
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -0,0 +1,127 @@
+/*
+               =. This file is part of the OPIE Project
+             .=l. Copyright (c) 2003 Maximilian Reiss <harlekin@handhelds.org>
+           .>+-=
+ _;:,     .>    :=|. This library is free software; you can
+.> <,   >  .   <= redistribute it and/or modify it under
+:=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%+i>       _;_.
+    .i_,=:_.      -<s. This library 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
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-= this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+
+#include <qpe/resource.h>
+#include <qpe/qcopenvelope_qws.h>
+
+#include <qpe/qpeapplication.h>
+#include <qiconset.h>
+#include <qpopupmenu.h>
+
+#include "rotate.h"
+
+
+RotateApplet::RotateApplet ( )
+ : QObject ( 0, "RotateApplet" ), ref ( 0 )
+{
+ m_native = true;
+ m_startupRot = QPEApplication::defaultRotation();
+}
+
+RotateApplet::~RotateApplet ( )
+{
+}
+
+int RotateApplet::position ( ) const
+{
+ return 2;
+}
+
+QString RotateApplet::name ( ) const
+{
+ return tr( "Rotate shortcut" );
+}
+
+QString RotateApplet::text ( ) const
+{
+ return tr( "Rotate" );
+}
+
+QString RotateApplet::tr( const char* s ) const
+{
+ return qApp->translate( "RotateApplet", s, 0 );
+}
+
+QString RotateApplet::tr( const char* s, const char* p ) const
+{
+ return qApp->translate( "RotateApplet", s, p );
+}
+
+QIconSet RotateApplet::icon ( ) const
+{
+ QPixmap pix;
+ QImage img = Resource::loadImage ( "Rotation" );
+
+ if ( !img. isNull ( ))
+ pix. convertFromImage ( img. smoothScale ( 14, 14 ));
+ return pix;
+}
+
+QPopupMenu *RotateApplet::popup ( QWidget * ) const
+{
+ return 0;
+}
+
+void RotateApplet::activated ( )
+{
+ int newRotation;
+ if ( m_native == true ) {
+ newRotation = m_startupRot + 90;
+ } else {
+ newRotation = m_startupRot;
+ }
+ QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" );
+ env << newRotation;
+ QCopEnvelope env2( "QPE/System", "setDefaultRotation(int)" );
+ env2 << newRotation;
+
+ m_native = !m_native;
+
+}
+
+
+QRESULT RotateApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_QUnknown )
+ *iface = this;
+ else if ( uuid == IID_MenuApplet )
+ *iface = this;
+
+ if ( *iface )
+ (*iface)-> addRef ( );
+ return QS_OK;
+}
+
+Q_EXPORT_INTERFACE( )
+{
+ Q_CREATE_INSTANCE( RotateApplet )
+}
+
+
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h
new file mode 100644
index 0000000..11e2ec9
--- a/dev/null
+++ b/core/applets/rotateapplet/rotate.h
@@ -0,0 +1,62 @@
+/*
+               =. This file is part of the OPIE Project
+             .=l. Copyright (c) 2003 Maximilian Reiss <harlekin@handhelds.org>
+           .>+-=
+ _;:,     .>    :=|. This library is free software; you can
+.> <_,   >  .   <= redistribute it and/or modify it under
+:=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%+i>       _;_.
+    .i_,=:_.      -<s. This library 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
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-= this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+
+
+#ifndef __OPIE_ROTATE_APPLET_H__
+#define __OPIE_ROTATE_APPLET_H__
+
+#include <qpe/menuappletinterface.h>
+
+class RotateApplet : public QObject, public MenuAppletInterface
+{
+public:
+ RotateApplet ( );
+ virtual ~RotateApplet ( );
+
+ QRESULT queryInterface( const QUuid&, QUnknownInterface** );
+ Q_REFCOUNT
+
+ virtual int position() const;
+
+ virtual QString name ( ) const;
+ virtual QIconSet icon ( ) const;
+ virtual QString text ( ) const;
+ virtual QString tr( const char* ) const;
+ virtual QString tr( const char*, const char* ) const;
+ virtual QPopupMenu *popup ( QWidget *parent ) const;
+
+ virtual void activated ( );
+
+private:
+ bool m_native;
+ int m_startupRot;
+ ulong ref;
+};
+
+#endif
diff --git a/core/applets/rotateapplet/rotateapplet.pro b/core/applets/rotateapplet/rotateapplet.pro
new file mode 100644
index 0000000..abcca47
--- a/dev/null
+++ b/core/applets/rotateapplet/rotateapplet.pro
@@ -0,0 +1,12 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+HEADERS = rotate.h
+SOURCES = rotate.cpp
+TARGET = rotateapplet
+DESTDIR = $(OPIEDIR)/plugins/applets
+INCLUDEPATH += $(OPIEDIR)/include
+DEPENDPATH += $(OPIEDIR)/include
+LIBS += -lqpe
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/core/launcher/opie-taskbar.control b/core/launcher/opie-taskbar.control
index abe5fb8..411e511 100644
--- a/core/launcher/opie-taskbar.control
+++ b/core/launcher/opie-taskbar.control
@@ -1,8 +1,8 @@
-Files: bin/qpe apps/Settings/Calibrate.desktop pics/launcher pics/devicebuttons/*.png plugins/applets/libsuspendapplet.so* plugins/applets/libhomeapplet.so* plugins/applets/liblogoutapplet.so* root/etc/init.d/opie
+Files: bin/qpe apps/Settings/Calibrate.desktop pics/launcher pics/devicebuttons/*.png plugins/applets/libsuspendapplet.so* plugins/applets/libhomeapplet.so* plugins/applets/liblogoutapplet.so* plugins/applets/librotateapplet.so* root/etc/init.d/opie
Priority: required
Section: opie/system
Maintainer: Project Opie <opie@handhelds.org>
Architecture: arm
Version: $QPE_VERSION-$SUB_VERSION.3
Depends: opie-base
Description: Launcher for Opie
diff --git a/packages b/packages
index c004b1a..a35b267 100644
--- a/packages
+++ b/packages
@@ -1,169 +1,170 @@
CONFIG_APPSKEY noncore/settings/appskey appskey.pro
CONFIG_BINARY noncore/tools/calc2/binary binary.pro
CONFIG_CALC2 noncore/tools/calc2 calc2.pro
CONFIG_CALIBRATE core/apps/calibrate calibrate.pro
CONFIG_CHESS noncore/unsupported/chess chess.pro
CONFIG_CONVERTER noncore/unsupported/opiemail/converter converter.pro
CONFIG_DIALUP noncore/unsupported/netsetup/dialup dialup.pro
CONFIG_DICTIONARY noncore/apps/dictionary dictionary.pro
CONFIG_EUROCONV noncore/tools/euroconv/ euroconv.pro
CONFIG_GSMTOOL noncore/comm/gsmtool gsmtool.pro
CONFIG_KEYVIEW development/keyview keyview.pro
CONFIG_LAN noncore/unsupported/netsetup/lan lan.pro
CONFIG_LIB noncore/unsupported/opiemail/lib lib.pro
CONFIG_LIBFFMPEG core/multimedia/opieplayer/libffmpeg libffmpeg.pro
CONFIG_LIBFLASH core/multimedia/opieplayer/libflash libflash.pro
CONFIG_LIBOPIE_PIM libopie/pim pim.pro
CONFIG_LIBSQL libsql libsql.pro
CONFIG_MOBILEMSG noncore/comm/mobilemsg mobilemsg.pro
CONFIG_NETMONAPPLET noncore/unsupported/netmonapplet netmonapplet.pro
CONFIG_NETSETUP noncore/unsupported/netsetup netsetup.pro
CONFIG_OFILESELECTOR libopie/ofileselector ofileselector.pro
CONFIG_OPIE-WRITE noncore/apps/opie-write opie-write.pro
CONFIG_OPIEMAIL noncore/unsupported/opiemail opiemail.pro
CONFIG_POP3 noncore/unsupported/opiemail/ifaces/pop3 pop3.pro
CONFIG_QUICKEXEC quickexec quickexec.pro
CONFIG_RESTARTAPPLET core/applets/restartapplet restartapplet.pro
CONFIG_RESTARTAPPLET2 core/applets/restartapplet2 restartapplet2.pro
CONFIG_SDMON noncore/unsupported/sdmon sdmon.pro
CONFIG_SIMPLE noncore/tools/calc2/simple simple.pro
CONFIG_SMTP noncore/unsupported/opiemail/ifaces/smtp smtp.pro
CONFIG_SPREADSHEET noncore/unsupported/spreadsheet spreadsheet.pro
CONFIG_SYSTEMTIME noncore/unsupported/systemtime systemtime.pro
CONFIG_TEST libsql/test test.pro
CONFIG_TEST noncore/apps/opie-console/test test.pro
CONFIG_UBROWSER noncore/net/ubrowser ubrowser.pro
CONFIG_WELLENREITER noncore/net/wellenreiter wellenreiter.pro
CONFIG_WLANSETUP noncore/unsupported/wlansetup wlansetup.pro
CONFIG_ADDRESSBOOK core/pim/addressbook addressbook.pro
CONFIG_ADVANCEDFM noncore/apps/advancedfm advancedfm.pro
CONFIG_APPEARANCE2 noncore/settings/appearance2 appearance2.pro
CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/applet applet.pro
CONFIG_AQPKG noncore/apps/aqpkg aqpkg.pro
CONFIG_BACKUP noncore/settings/backup backup.pro
CONFIG_BATTERYAPPLET core/applets/batteryapplet batteryapplet.pro
CONFIG_BEND noncore/mail/bend bend.pro
CONFIG_BLUE-PIN noncore/net/opietooth/blue-pin blue-pin.pro
CONFIG_BOUNCE noncore/games/bounce bounce.pro
CONFIG_BUTTON-SETTINGS core/settings/button button.pro
CONFIG_BUZZWORD noncore/games/buzzword buzzword.pro
CONFIG_CALCULATOR noncore/tools/calculator calculator.pro
CONFIG_CARDMON core/applets/cardmon cardmon.pro
CONFIG_CHECKBOOK noncore/apps/checkbook checkbook.pro
CONFIG_CITYTIME core/settings/citytime citytime.pro
CONFIG_CLIPBOARDAPPLET core/applets/clipboardapplet clipboardapplet.pro
CONFIG_CLOCK noncore/tools/clock clock.pro
CONFIG_CLOCKAPPLET core/applets/clockapplet clockapplet.pro
CONFIG_CONFEDIT noncore/apps/confedit confedit.pro
CONFIG_DATEBOOK core/pim/datebook datebook.pro
CONFIG_DECO_FLAT noncore/decorations/flat flat.pro
CONFIG_DECO_LIQUID noncore/decorations/liquid liquid.pro
CONFIG_DECO_POLISHED noncore/decorations/polished polished.pro
CONFIG_DRAWPAD noncore/graphics/drawpad drawpad.pro
CONFIG_DVORAK inputmethods/dvorak dvorak.pro
CONFIG_EMBEDDEDKONSOLE core/apps/embeddedkonsole embeddedkonsole.pro
CONFIG_FIFTEEN noncore/games/fifteen fifteen.pro
CONFIG_FILEBROWSER core/apps/filebrowser filebrowser.pro
CONFIG_FLAT noncore/styles/flat flat.pro
CONFIG_FORMATTER noncore/tools/formatter formatter.pro
CONFIG_FREETYPE freetype freetype.pro
CONFIG_FRESH noncore/styles/fresh fresh.pro
CONFIG_FTPLIB noncore/net/ftplib ftplib.pro
CONFIG_GO noncore/games/go go.pro
CONFIG_HANDWRITING inputmethods/handwriting handwriting.pro
CONFIG_HELPBROWSER core/apps/helpbrowser helpbrowser.pro
CONFIG_HOMEAPPLET core/applets/homeapplet homeapplet.pro
CONFIG_INTERFACES noncore/net/networksettings/interfaces interfaces.pro
CONFIG_IRDAAPPLET core/applets/irdaapplet irdaapplet.pro
CONFIG_JUMPX inputmethods/jumpx jumpx.pro
CONFIG_KBILL noncore/games/kbill kbill.pro
CONFIG_KCHECKERS noncore/games/kcheckers kcheckers.pro
CONFIG_KEYBOARD inputmethods/keyboard keyboard.pro
CONFIG_KEYPEBBLE noncore/comm/keypebble keypebble.pro
CONFIG_KJUMPX inputmethods/kjumpx kjumpx.pro
CONFIG_KPACMAN noncore/games/kpacman kpacman.pro
CONFIG_LANGUAGE noncore/settings/language language.pro
CONFIG_LAUNCHER-SETTINGS core/settings/launcher launcher.pro
CONFIG_LAUNCHER_CORE core/launcher launcher.pro
CONFIG_LIBOPIETOOTH noncore/net/opietooth/lib lib.pro
CONFIG_LIBKATE noncore/apps/tinykate/libkate libkate.pro
CONFIG_LIBMAD core/multimedia/opieplayer/libmad libmad.pro
CONFIG_LIBMAIL noncore/mail/libmail libmail.pro
CONFIG_LIBMPEG3 core/multimedia/opieplayer/libmpeg3 libmpeg3.pro
CONFIG_LIBOPIE libopie libopie.pro
CONFIG_LIBQPE library library.pro
CONFIG_LIBQPE-X11 x11/libqpe-x11 libqpe-x11.pro
CONFIG_LIGHT-AND-POWER core/settings/light-and-power light-and-power.pro
CONFIG_LIQUID noncore/styles/liquid liquid.pro
CONFIG_LOGOUTAPPLET core/applets/logoutapplet logoutapplet.pro
CONFIG_OPIETOOTH-MANAGER noncore/net/opietooth/manager manager.pro
CONFIG_MEDIUMMOUNT noncore/settings/mediummount mediummount.pro
CONFIG_METAL noncore/styles/metal metal.pro
CONFIG_MINDBREAKER noncore/games/mindbreaker mindbreaker.pro
CONFIG_MINESWEEP noncore/games/minesweep minesweep.pro
CONFIG_MODPLUG core/multimedia/opieplayer/modplug modplug.pro
CONFIG_MULTIKEY inputmethods/multikey multikey.pro
CONFIG_NETSYSTEMTIME noncore/settings/netsystemtime netsystemtime.pro
CONFIG_NETWORKSETUP noncore/net/networksettings networksettings.pro
CONFIG_NOTESAPPLET noncore/applets/notesapplet notesapplet.pro
CONFIG_OBEX core/applets/obex2 obex.pro
CONFIG_OCOPSERVER x11/ipc/server ocopserver.pro
CONFIG_OIPKG core/apps/oipkg oipkg.pro
CONFIG_OPIE-CONSOLE noncore/apps/opie-console opie-console.pro
CONFIG_OPIE-LOGIN core/opie-login opie-login.pro
CONFIG_OPIEMAIL2 noncore/mail mail.pro
CONFIG_OPIE-READER noncore/apps/opie-reader opie-reader.pro
CONFIG_OPIE-SH noncore/tools/opie-sh opie-sh.pro
CONFIG_OPIE-SHEET noncore/apps/opie-sheet opie-sheet.pro
CONFIG_OPIEALARM core/opiealarm
CONFIG_OPIEFTP noncore/net/opieftp opieftp.pro
CONFIG_OPIEIRC noncore/net/opieirc opieirc.pro
CONFIG_OPIEPLAYER core/multimedia/opieplayer opieplayer.pro
CONFIG_OPIEPLAYER2 noncore/multimedia/opieplayer2 opieplayer2.pro
CONFIG_OXYGEN noncore/apps/oxygen oxygen.pro
CONFIG_PARASHOOT noncore/games/parashoot parashoot.pro
CONFIG_PICKBOARD inputmethods/pickboard pickboard.pro
CONFIG_QASTEROIDS noncore/games/qasteroids qasteroids.pro
CONFIG_QCOP core/apps/qcop qcop.pro
CONFIG_ODICT noncore/apps/odict odict.pro
CONFIG_QPDF noncore/graphics/qpdf qpdf.pro
CONFIG_REMOTE noncore/tools/remote remote.pro
CONFIG_ROTATION noncore/settings/rotation rotation.pro
CONFIG_RUNAPPLET core/applets/runapplet runapplet.pro
CONFIG_SCREENSHOTAPPLET core/applets/screenshotapplet screenshotapplet.pro
CONFIG_SECURITY core/settings/security security.pro
CONFIG_SFCAVE noncore/games/sfcave sfcave.pro
CONFIG_SFCAVE-SDL noncore/games/sfcave-sdl sfcave-sdl.pro
CONFIG_SHOWIMG noncore/multimedia/showimg showimg.pro
CONFIG_SINGLE single single.pro
CONFIG_SNAKE noncore/games/snake snake.pro
CONFIG_SOLITAIRE noncore/games/solitaire solitaire.pro
CONFIG_SOUND noncore/settings/sound sound.pro
CONFIG_SSHKEYS noncore/settings/sshkeys sshkeys.pro
CONFIG_SUSPENDAPPLET core/applets/suspendapplet suspendapplet.pro
+CONFIG_ROTATEAPPLET core/applets/rotateapplet rotateapplet.pro
CONFIG_SYSINFO noncore/apps/sysinfo sysinfo.pro
CONFIG_TABLEVIEWER noncore/apps/tableviewer tableviewer.pro
CONFIG_TABMANAGER noncore/settings/tabmanager tabmanager.pro
CONFIG_TETRIX noncore/games/tetrix tetrix.pro
CONFIG_TEXTEDIT core/apps/textedit textedit.pro
CONFIG_THEME noncore/styles/theme theme.pro
CONFIG_TICTAC noncore/games/tictac tictac.pro
CONFIG_TINYKATE noncore/apps/tinykate tinykate.pro
CONFIG_TODAY core/pim/today today.pro
CONFIG_TODAY_ADDRESSBOOK core/pim/today/plugins/addressbook addressbook.pro
CONFIG_TODAY_DATEBOOK core/pim/today/plugins/datebook datebook.pro
CONFIG_TODAY_FORTUNE noncore/todayplugins/fortune fortune.pro
CONFIG_TODAY_MAIL core/pim/today/plugins/mail mail.pro
CONFIG_TODAY_STOCKTICKER noncore/todayplugins/stockticker/stockticker stockticker.pro
CONFIG_TODAY_STOCKTICKERLIB noncore/todayplugins/stockticker/stocktickerlib stocktickerlib.pro
CONFIG_TODAY_WEATHER noncore/todayplugins/weather weather.pro
CONFIG_TODAY_TODOLIST core/pim/today/plugins/todolist todolist.pro
CONFIG_TODO core/pim/todo todo.pro
CONFIG_UNIKEYBOARD inputmethods/unikeyboard unikeyboard.pro
CONFIG_USERMANAGER noncore/settings/usermanager usermanager.pro
CONFIG_VMEMO core/applets/vmemo vmemo.pro
CONFIG_VOLUMEAPPLET core/applets/volumeapplet volumeapplet.pro
CONFIG_WAVPLUGIN core/multimedia/opieplayer/wavplugin wavplugin.pro
CONFIG_WIRELESSAPPLET noncore/applets/wirelessapplet wirelessapplet.pro
CONFIG_WLAN noncore/net/networksettings/wlan wlan.pro
CONFIG_WORDGAME noncore/games/wordgame wordgame.pro