summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show 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,4 +1,4 @@
-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>
diff --git a/packages b/packages
index c004b1a..a35b267 100644
--- a/packages
+++ b/packages
@@ -141,6 +141,7 @@ 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