summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/emulation_widget.cpp45
-rw-r--r--noncore/apps/opie-console/emulation_widget.h80
2 files changed, 125 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp
new file mode 100644
index 0000000..a45db8c
--- a/dev/null
+++ b/noncore/apps/opie-console/emulation_widget.cpp
@@ -0,0 +1,45 @@
+// opie-console includes
+#include "emulation_widget.h"
+#include "common.h"
+#include "widget_layer.h"
+#include "profile.h"
+
+// qt includes
+#include <qwidget.h>
+#include <qarray.h>
+#include <qstring.h>
+#include <qpainter.h>
+#include <qrect.h>
+
+
+EmulationWidget::EmulationWidget( const Profile& config, QWidget *parent, const char* name ) : WidgetLayer( config, parent, name )
+{
+
+}
+
+EmulationWidget::~EmulationWidget()
+{
+}
+
+
+void setImage( QArray<Character> const newimg, int lines, int columns )
+{
+}
+
+void drawAttrString( QString& string, QPainter &paint, QRect rect, Character attr, bool usePixmap, bool clear )
+{
+
+
+}
+
+///////////////////////
+// scrollbar
+// ////////////////////
+
+void EmulationWidget::scroll( int value )
+{
+}
+
+void EmulationWidget::setScroll( int cursor, int slines )
+{
+}
diff --git a/noncore/apps/opie-console/emulation_widget.h b/noncore/apps/opie-console/emulation_widget.h
new file mode 100644
index 0000000..9d0f63e
--- a/dev/null
+++ b/noncore/apps/opie-console/emulation_widget.h
@@ -0,0 +1,80 @@
+// opie console includes
+#include "widget_layer.h"
+#include "profile.h"
+#include "common.h"
+
+// qt includes
+#include <qwidget.h>
+#include <qpainter.h>
+#include <qstring.h>
+#include <qarray.h>
+#include <qrect.h>
+
+
+/**
+ * EmulationWidget
+ * simple implementation of EmulationLayer
+ * (doesn't support scrollbar, history, etc, yet)
+ */
+class EmulationWidget : public WidgetLayer
+{ Q_OBJECT
+
+public:
+
+ /**
+ * constructor
+ * @param const Profile& config, the configuration
+ * @param QWidget* parent, parent widget
+ * @param const char* name, the name of the widget
+ */
+ EmulationWidget( const Profile& config, QWidget *parent=0, const char *name =0 );
+
+ /**
+ * destructor
+ */
+ ~EmulationWidget();
+
+ /**
+ * sets the image
+ * @param QArray<Character> const newimg, the new image
+ * @param int lines, lines of the new image
+ * @param int columns, columns of the new image
+ */
+ virtual void setImage( QArray<Character> const newimg, int columns, int lines );
+
+ /**
+ * reloads configuration
+ * @param const Profile& config, configuration
+ */
+ virtual void reloadConfig( const Profile& config );
+
+ /**
+ * sets the scrollbar (not yet implemented)
+ */
+ virtual void setScroll( int cursor, int slines );
+
+ /**
+ * scrolls (not yet implemented)
+ * @param int value, scroll by this value
+ */
+ virtual void scroll( int value );
+
+protected:
+
+ /**
+ * calculates current image bounds
+ */
+ virtual void calcGeometry();
+
+ /**
+ * draws a String
+ * @param QString& string, string to be drawn
+ * @param QPainter& painter, painter, that should draw
+ * @param QRect rect, rect to be drawn into
+ * @param Character attr, attributes of Characters
+ * @param bool usePixmap, if to use the background pixmap (currently not supported)
+ * @param bool clear, if rect should be cleared
+ */
+ void drawAttrString( QString& string, QPainter& painter, QRect rect, Character attr, bool pm, bool clear );
+
+}