Cutter: HexWidget refactoring

Created on 28 Apr 2019  ·  7Comments  ·  Source: rizinorg/cutter

Issue for tracking information about the hexWidget in hexedit/ karliss/hexedit branch.

Issues fixed by switching to the new hexWidget:

  • #1473 #1057 endian selection
  • #1472 #1064 word size and format
  • #1487 performance
  • #1060 currently implements the drawing logic, but doesn't read value from hex.pairs.
  • #1068 - copy address

Missing functionality compared to current hex widget:

  • [x] handleRaiseMemoryWidget
  • [x] bidirectional synchronization with other widgets
  • [x] sync/unsync option
  • [x] basic copy (preferably should respect cursor side)
  • [x] Ctrl-shift-c copy address
  • [x] right half of current hexdumpWidget
  • [x] range selection dialog
  • [x] font size refresh
  • [x] test in highDPI configuration

❌ zoom functionality - shouldn't be necessary if font size setting and highDPI scaling is respected

Other issues:

  • [x] Internal width doesn't get properly resized when changing size/format. Gets resized when dockWidget is resized.
  • [x] font update bug
  • [x] keyboard actions not working
  • [x] position sometimes gets set to end of address range

Non critical issues:

  • Gap between address and item columns seems to be bigger than item and ascii probably was caused by wrong font
  • Decide what to do with selection that doesn't match word size (leave as is, display in a special way, force word size alignment)
  • When resizing docks cursor sometimes stuck in horizontal arrow mode. Not sure if this is specific to the hexWidget .
Refactoring

Most helpful comment

Almost ready for review and PR.

  • Will create an updated test plan based on #1504
  • Need to check the formatting

All 7 comments

Hello @karliss ,

Make sure to avoid huge branches or huge Pull-requests. Those are hard to reviews, prone to problems and we have many examples in the past at least on radare2 side where people left in the middle of their huge development.

At this stage please aim at reproducing what's currently in master hexedit to get this new system in master quickly and then add new features or fix issues that are also in the other hexedit. 👍

Hope that make sense.

Review could be simplified by splitting current HexDumpWidget in to two parts so that parts which won't be replaced can be more easily reused.

Anything that can ease the review part and avoid huge PR is welcome!

Gap between address and item columns seems to be bigger than item and ascii

Some weird behaviour on Linux. On Windows it looks fine.

When resizing docks cursor sometimes stuck in horizontal arrow mode. Not sure if this is specific to the hexWidget .

I enabled mouseTracking to change cursor image in mouseMoveEvent(). Maybe not all cases are handled.

A little progress update, I am currently working on splitting existing HexDumpWidget in two parts. One of which will get later replaced by the new hexWidget. It builds and opens but I still need to connect the signals for it to work properly.

Tried rebasing this branch on top of #1504, seek synchronization worked, keyboard shortcuts weren't detected, font size update wasn't working correctly.

Almost ready for review and PR.

  • Will create an updated test plan based on #1504
  • Need to check the formatting
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Maijin picture Maijin  ·  5Comments

Maijin picture Maijin  ·  5Comments

karliss picture karliss  ·  3Comments

nauliajati picture nauliajati  ·  3Comments

ITAYC0HEN picture ITAYC0HEN  ·  4Comments