OSDN Git Service

designing draw and adding hilight class
authorsuma <devnull@localhost>
Thu, 4 Dec 2008 06:28:48 +0000 (15:28 +0900)
committersuma <devnull@localhost>
Thu, 4 Dec 2008 06:28:48 +0000 (15:28 +0900)
src/control/hilight.cpp [new file with mode: 0644]
src/control/hilight.h [new file with mode: 0644]
src/control/standard/hexview.cpp
src/control/standard/hexview.h

diff --git a/src/control/hilight.cpp b/src/control/hilight.cpp
new file mode 100644 (file)
index 0000000..2dd86db
--- /dev/null
@@ -0,0 +1,15 @@
+
+#include "hilight.h"
+#include "document.h"
+
+
+Hilight::Hilight(Document *doc)
+       : doc_(doc)
+{
+}
+
+Hilight::~Hilight()
+{
+}
+
+
diff --git a/src/control/hilight.h b/src/control/hilight.h
new file mode 100644 (file)
index 0000000..65e3043
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef HILIGHT_H_INC
+#define HILIGHT_H_INC
+
+class Document;
+
+class Hilight
+{
+protected:
+       Document *doc_;
+
+public:
+       Hilight(Document *doc);
+       ~Hilight();
+
+};
+
+
+
+#endif
index e621bad..b7563c6 100644 (file)
@@ -14,7 +14,7 @@ namespace Standard {
 // Config
 HexConfig::HexConfig()
        : Margin(10, 10, 10, 10)
-       , ByteMargin(0, 0, 5, 5)
+       , ByteMargin(0, 4, 5, 1)
        , Font("times", 24)
        , FontMetrics(Font)
 {
@@ -270,15 +270,29 @@ struct DrawHilightInfo {
                }
        }
 
-       //std::vector<ColorInfo> colors_;
-       GetPosColor(pos, len, colors_);
        if (!selected) {
                // non selected
-               DrawHilightInfo hi(ALL, y, lines, width_count);
                DrawInfo di(ALL, y, lines, width_count);
                return;
        } else {
-               //selected
+               // selected
+               //std::vector<ColorInfo> colors_;
+               //GetPosColor(top, len, colors_);
+               quint64 index = top;
+               for (int i = 0, j = 0; i < lines; i++, j = (j+1) & 0xF, index++) {
+                       // x range: 0 - 15
+                       qint64 dif = sb - index;
+                       qint64 left = se - index;
+                       if (sb <= index && index <= se) {
+                               // in range
+                       } else if (0 <= dif && dif < 16) {
+                               // begin
+                       } else if (0 <= left && left < 16) {
+                               // end
+                       } else {
+                               // normal
+                       }
+               }
        }
 }
 #endif
index ee75f1d..108156f 100644 (file)
@@ -28,7 +28,7 @@ namespace Standard {
                QRect Margin;
                QRect ByteMargin;
                QFont Font;
-               QColor Colors[ColorCount];
+               QColor Colors[Color::ColorCount];
                int Spaces[Num+1]; // last is yoyuu
 
        private:
@@ -94,7 +94,6 @@ namespace Standard {
                        quint64 sb;
                        quint64 se;
                        DrawInfo(int Y, quint64 Top, int Count, int Xb, int Xe, quint64 Sb, quint64 Se, uint Size)
-                               : buff(size)
                        {
                                y = Y;
                                count = Count;