OSDN Git Service

initial
authorsuma <devnull@localhost>
Sun, 26 Oct 2008 16:15:23 +0000 (01:15 +0900)
committersuma <devnull@localhost>
Sun, 26 Oct 2008 16:15:23 +0000 (01:15 +0900)
doc/design.txt [new file with mode: 0644]
src/control/control.cpp [new file with mode: 0644]
src/control/control.h [new file with mode: 0644]
src/control/cursor.cpp [new file with mode: 0644]
src/control/cursor.h [new file with mode: 0644]
src/control/document.cpp [new file with mode: 0644]
src/control/document.h [new file with mode: 0644]
src/control/view.cpp [new file with mode: 0644]
src/control/view.h [new file with mode: 0644]
src/hex.pro [new file with mode: 0644]
src/main.cpp [new file with mode: 0644]

diff --git a/doc/design.txt b/doc/design.txt
new file mode 100644 (file)
index 0000000..d3d17a7
--- /dev/null
@@ -0,0 +1,21 @@
+
+View/Controller
+       View
+       Cursor
+               Position(inDocument)
+               VPosition(visible document position)
+               MouseInput
+               KeyInput
+       Scrollbar
+               Lensbar
+
+       ColorHilighting
+       OverlayView
+
+Document
+       +PieceTree
+       +
+       Event
+       BackupThread
+
+
diff --git a/src/control/control.cpp b/src/control/control.cpp
new file mode 100644 (file)
index 0000000..b356ff6
--- /dev/null
@@ -0,0 +1,32 @@
+
+#include "control.h"
+
+Control::Control(Document *doc)
+       : doc_(doc)
+{
+}
+
+Control::~Control()
+{
+}
+
+bool Control::AddCursor(int id, Cursor *cur)
+{
+       if (curs_.find(id) != curs_.constEnd()) {
+               return false;
+       }
+       curs_.insert(id, cur);
+       return true;
+}
+
+bool Control::AddView(int id, View *view)
+{
+       CursorMap::const_iterator i = curs_.find(id);
+       if (i == curs_.constEnd()) {
+               return false;
+       }
+       //(*id)->AddView(view);
+       return true;
+}
+
+
diff --git a/src/control/control.h b/src/control/control.h
new file mode 100644 (file)
index 0000000..6751970
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef CONTROL_H_INC
+#define CONTROL_H_INC
+
+#include <QVector>
+#include <QMap>
+
+class Document;
+class Cursor;
+class View;
+
+class Control
+{
+rotected:
+       Document *doc_;
+       typedef QMap<int, Cursor*> CursorMap;
+       CursorMap curs_;
+
+public:
+       Control(Document *doc);
+       ~Control();
+
+       bool AddCursor(int id, Cursor *cur);
+       bool AddView(int id, View *view);
+
+};
+
+
+#endif
diff --git a/src/control/cursor.cpp b/src/control/cursor.cpp
new file mode 100644 (file)
index 0000000..f89fbfd
--- /dev/null
@@ -0,0 +1,13 @@
+
+#include "cursor.h"
+#include "document.h"
+
+Cursor::Cursor(Document *doc)
+       : doc_(doc)
+{
+}
+
+Cursor::~Cursor()
+{
+}
+
diff --git a/src/control/cursor.h b/src/control/cursor.h
new file mode 100644 (file)
index 0000000..7993ded
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef CURSOR_H_INC
+#define CURSOR_H_INC
+
+class Document;
+
+class Cursor
+{
+protected:
+       Document *doc_;
+
+public:
+       Cursor(Document *doc);
+       virtual ~Cursor();
+
+};
+
+
+
+#endif
diff --git a/src/control/document.cpp b/src/control/document.cpp
new file mode 100644 (file)
index 0000000..ca7a180
--- /dev/null
@@ -0,0 +1,12 @@
+
+#include "document.h"
+
+Document::Document()
+{
+}
+
+Document::~Document()
+{
+}
+
+
diff --git a/src/control/document.h b/src/control/document.h
new file mode 100644 (file)
index 0000000..e7481aa
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef DOCUMENT_H_INC
+#define DOCUMENT_H_INC
+
+
+class Document
+{
+public;
+       Document();
+       virtual ~Document();
+
+};
+
+
+#endif
+
diff --git a/src/control/view.cpp b/src/control/view.cpp
new file mode 100644 (file)
index 0000000..4c65d73
--- /dev/null
@@ -0,0 +1,11 @@
+
+#include <QtGui>
+#include "view.h"
+#include "document.h"
+
+View::View(QWidget *parent, Document *doc)
+       : QWidget(parent)
+       , doc_(doc)
+{
+}
+
diff --git a/src/control/view.h b/src/control/view.h
new file mode 100644 (file)
index 0000000..1673c1a
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef VIEW_H_INC
+#define VIEW_H_INC
+
+#include <QWidget>
+
+class Document;
+
+class View : public QWidget
+{
+       Q_OBJECT
+
+protected:
+       Document *doc_;
+
+public:
+       View(QWidget *parent = 0, Document *doc);
+
+
+};
+
+
+#endif
diff --git a/src/hex.pro b/src/hex.pro
new file mode 100644 (file)
index 0000000..cce2f9f
--- /dev/null
@@ -0,0 +1,11 @@
+######################################################################
+# Automatically generated by qmake (2.01a) ? 9 ? 29 06:10:32 2008
+######################################################################
+
+TEMPLATE = app
+HEADERS = control/view.h
+SOURCES = control/control.cpp control/document.cpp control/cursor.cpp \
+       control/view.cpp \
+       main.cpp
+
+# Directories
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644 (file)
index 0000000..22276d6
--- /dev/null
@@ -0,0 +1,11 @@
+#include <QApplication>
+#include "mywidgets.h"
+
+int main(int argc, char *argv[])
+{
+       QApplication app(argc, argv);
+       Mywidgets wid;
+       wid.show();
+       return app.exec();
+}
+