BVB Source Codes

x64dbg Show QHexEditPrivate.h Source code

Return Download x64dbg: download QHexEditPrivate.h Source code - Download x64dbg Source code - Type:.h
  1. #ifndef QHEXEDITPRIVATE_H
  2. #define QHEXEDITPRIVATE_H
  3.  
  4. #include <QWidget>
  5. #include <QScrollArea>
  6. #include <QUndoStack>
  7. #include <QKeyEvent>
  8. #include <QTimer>
  9. #include "XByteArray.h"
  10.  
  11. class QHexEditPrivate : public QWidget
  12. {
  13.     Q_OBJECT
  14. public:
  15.     QHexEditPrivate(QScrollArea* parent);
  16.  
  17.     //properties
  18.     void setCursorPos(int position);
  19.     int cursorPos();
  20.     void setOverwriteMode(bool overwriteMode);
  21.     bool overwriteMode();
  22.     void setWildcardEnabled(bool enabled);
  23.     bool wildcardEnabled();
  24.     void setKeepSize(bool enabled);
  25.     bool keepSize();
  26.     void setHorizontalSpacing(int x);
  27.     int horizontalSpacing();
  28.     void setTextColor(QColor color);
  29.     QColor textColor();
  30.     void setWildcardColor(QColor color);
  31.     QColor wildcardColor();
  32.     void setBackgroundColor(QColor color);
  33.     QColor backgroundColor();
  34.     void setSelectionColor(QColor color);
  35.     QColor selectionColor();
  36.  
  37.     //data management
  38.     void setData(const QByteArray & data, const QByteArray & mask);
  39.     QByteArray data();
  40.     QByteArray mask();
  41.     void insert(int index, const QByteArray & ba, const QByteArray & mask);
  42.     void insert(int index, char ch, char mask);
  43.     void remove(int index, int len = 1);
  44.     void replace(int index, char ch, char mask);
  45.     void replace(int index, const QByteArray & ba, const QByteArray & mask);
  46.     void replace(int pos, int len, const QByteArray & after, const QByteArray & mask);
  47.     void fill(int index, const QByteArray & ba, const QByteArray & mask);
  48.     void undo();
  49.     void redo();
  50.  
  51. signals:
  52.     void currentAddressChanged(int address);
  53.     void currentSizeChanged(int size);
  54.     void dataChanged();
  55.     void dataEdited();
  56.     void overwriteModeChanged(bool state);
  57.  
  58. protected:
  59.     void focusInEvent(QFocusEvent* event);
  60.     void resizeEvent(QResizeEvent* event);
  61.     void keyPressEvent(QKeyEvent* event);
  62.     void mouseMoveEvent(QMouseEvent* event);
  63.     void mousePressEvent(QMouseEvent* event);
  64.  
  65.     void paintEvent(QPaintEvent* event);
  66.  
  67.     int cursorPos(QPoint pos);          // calc cursorpos from graphics position. DOES NOT STORE POSITION
  68.  
  69.     void resetSelection(int pos);       // set selectionStart && selectionEnd to pos
  70.     void resetSelection();              // set selectionEnd to selectionStart
  71.     void setSelection(int pos);         // set min (if below init) || max (if greater init)
  72.     int getSelectionBegin();
  73.     int getSelectionEnd();
  74.  
  75. private slots:
  76.     void updateCursor();
  77.  
  78. private:
  79.     void adjust();
  80.     void ensureVisible();
  81.  
  82.     QScrollArea* _scrollArea;
  83.     QTimer _cursorTimer;
  84.     QUndoStack* _undoDataStack;
  85.     QUndoStack* _undoMaskStack;
  86.  
  87.     XByteArray _xData;
  88.     XByteArray _xMask;
  89.  
  90.     QColor _textColor;
  91.     QColor _wildcardColor;
  92.     QColor _backgroundColor;
  93.     QColor _selectionColor;
  94.  
  95.     bool _blink;                            // true: then cursor blinks
  96.     bool _overwriteMode;
  97.     bool _wildcardEnabled;
  98.     bool _keepSize;
  99.  
  100.     int _charWidth, _charHeight;            // char dimensions (dpendend on font)
  101.     int _cursorX, _cursorY;                 // graphics position of the cursor
  102.     int _cursorPosition;                    // character positioin in stream (on byte ends in to steps)
  103.     int _xPosHex;                           // graphics x-position of the areas
  104.  
  105.     int _selectionBegin;                    // First selected char
  106.     int _selectionEnd;                      // Last selected char
  107.     int _selectionInit;                     // That's, where we pressed the mouse button
  108.  
  109.     int _size;
  110.     int _initSize;
  111.     int _horizonalSpacing;
  112. };
  113.  
  114. #endif //QHEXEDITPRIVATE_H
  115.  
  116.  
downloadQHexEditPrivate.h Source code - Download x64dbg Source code
Related Source Codes/Software:
pencil - Multiplatform GUI Prototyping/Wireframing 2017-04-16
rainloop-webmail - Simple, modern & fast web-based email client ... 2017-04-16
qt - Qt binding for Go (Golang) which supports Windows ... 2017-04-16
MLeaksFinder - Find memory leaks in your iOS app at develop time. 2017-04-16
jsfeat - JavaScript Computer Vision library. 2017-04-16
later - A javascript library for defining recurring schedu... 2017-04-16
Android-ItemTouchHelper-Demo - Basic example of using ItemTouchHelper to add drag... 2017-04-16
onionshare - Securely and anonymously share a file of any size ... 2017-04-16
android-viewflow - A horizontal view scroller library for Android 2017-04-16
css-in-js - React: CSS in JS techniques comparison. 2017-04-16
mama2 - Mother plan - all firewood high flame 2017-04-23
BlurEffectForAndroidDesign - Sample to show how to implement blur graphical tri... 2017-04-23
sphinx_rtd_theme - Sphinx theme for readthedocs.org 2017-04-23
rouge - A pure-ruby code highlighter that is compatible wi... 2017-04-23
spring-security-oauth - Support for adding OAuth1(a) and OAuth2 features (... 2017-04-23
Toucan - Fabulous Image Processing in Swift 2017-04-23
CoffeeScriptRedux - 2017-04-23
breakpoint - Really simple media queries in Sa 2017-04-23
libsvm - 2017-04-22
grr - GRR Rapid Response: remote live forensics for inci... 2017-04-22

 Back to top