History log of /haiku/src/apps/diskprobe/DataEditor.cpp
Revision Date Author Comments
# 425ac1b6 20-Jun-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

refactor: Swap %Ld for %lld in all format usages

* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# acdd772d 25-Apr-2022 Augustin Cavalier <waddlesplash@gmail.com>

DiskProbe: Check we actually have a buffer before computing the offset.

Fixes #17709.


# 9d06690e 11-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

userland: Pass more sizes with ioctls where we can.

No "functional" change intended.


# 1e4a6aa2 20-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

DiskProbe: style fixes...


# 23b89f01 20-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

DiskProbe: fix crash when trying to edit a package directory

/system and /home/config would crash diskprobe because DataEditor would
be left in an incompletely initialized state.

Also fix a memory leak: fAttribute was never freed, but is allocated with
strdup.

Fixes #10428.


# f756b25e 04-May-2013 Jerome Duval <jerome.duval@gmail.com>

DiskProbe: remove superfluous parentheses introduced in a31ac99


# a31ac990 04-May-2013 Jérôme Duval <jerome.duval@gmail.com>

Diskprobe: some 64 bit fixes

* also warnings about comparisons between signed and non signed.


# 6c85c7ee 14-Aug-2009 Philippe Saint-Pierre <stpere@gmail.com>

Revert r32402. Some problems are occuring in the attribute editor and I want to make sure they aren't caused by my patch before committing for good.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 498c03bd 14-Aug-2009 Philippe Saint-Pierre <stpere@gmail.com>

StringEditor : The TextView wasn't sending messages saying its content was modified by the user.
Symptoms :
* The Save menu item wasn't enabled
* the undo/redo menu item weren't neither

The fix I made was to commit the changes made by the user to the editor instance, by augmenting the InsertText and DeleteText from the TextView.
This fixes ticket #3507.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32402 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4fba3522 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed src/kits/tracker/OpenHashTable.h. The shared version in
headers/private/shared is newer, though with small interface changes.
* Removed the unnecessary Debug.h include in
headers/private/shared/ObjectList.h.
* Adjusted sources using these headers, mostly by adding missing includes.
* Lots of automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30123 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e551be6e 19-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

If a device returns an invalid size, we shouldn't crash.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22956 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a9dfa85e 24-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

* DataEditor::SetTo() now checks if the reported block size is zero and then sets
it to the 512 byte default - this fixes bug #960.
* IconView::UpdateIcon() now uses 8-bit icon for get_device_icon(), as B_RGB32 cannot
work in this case.
* Also, in case it couldn't get an icon, it now tries to show the generic icon instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19940 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a93fb72b 28-May-2006 Axel Dörfler <axeld@pinc-software.de>

* If only a part of the data could be read, the part that couldn't been read
is now cleared - this changes the behaviour of bug #603, but doesn't fix
it (as this is no DiskProbe bug).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17621 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08f833c0 22-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed two bugs:
- when undoing the first change, any later change would make that first change reappear
- in hex mode editing, changes were not merged because they changed the same byte
Updated version info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13801 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e98ea36 17-Dec-2004 Axel Dörfler <axeld@pinc-software.de>

The DataEditor now has a separate entry_ref for attributes - that's used
to have access to the attributes of a root directory. Internally, only
this ref is used when accessing attribute data.
Also fixed an initialization bug in case the stream couldn't be properly
opened; some values were just set too late (could lead to strange things
as well as a crash).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10481 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 61784ba6 15-Dec-2004 Axel Dörfler <axeld@pinc-software.de>

The DataEditor class now only redirects root directories to volumes; it
can now also open directories and symlinks, in which case nothing can be
done (but theoretically, the attributes could be changed).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10472 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fdaf57f5 20-May-2004 Axel Dörfler <axeld@pinc-software.de>

Always wrote fRealViewSize blocks; didn't use the correct calculated size...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7624 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0143eff3 22-Mar-2004 Axel Dörfler <axeld@pinc-software.de>

Read-only state was not properly initialized.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7055 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ef37dbe 29-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now listens to file/attribute changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6825 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0283ecc0 29-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented case insensitive search. It's now available in hex mode as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6822 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8db24919 27-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented find functionality. The find panel is still missing though, it
just searches for "test".
The find itself is implemented in DataEditor::Find() which sets the editor
in read-only mode and searches for the specified data. It will update a
progress monitor, it will find data no matter if it's on a view size break,
and it is interruptible at any time.
The DataEditor change methods now respect the read-only mode, and return
B_NOT_ALLOWED in this case.
Renamed the UpdateLooper class to EditorLooper class, since it now also
runs the find action.
The ProbeView class now maintains the "Find Again" menu item; it's target
message always contains the item that last searched for.
The HeaderView will now show a "Stop" button while the search operation
is in progress; it also acts as the Find() progress monitor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6789 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f4247749 27-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now accepts directories, but redirects them to their volume instead; also
adopts the block size from the file system in that case.
Fixed the broken check for a device (would also succeed for other types,
stat.st_mode types cannot just be or'd).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6783 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 85140487 27-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added the ability to merge changes. That means undo/redo now have a
handier granularity.
ReplaceChange will now try to merge with the next ReplaceChange if they
are adjacent.
Fixed compilation with tracing enabled.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a7511f36 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented changing the block size - that caused several changes to
DataEditor::SetViewSize()/SetViewOffset() because they did not correctly
update some values under certain circumstances.
There is now a kMsgDataEditorParameterChange instead of just ...OffsetChange;
the message will contain information about what has changed exactly.
Added a new kDataViewPreferredSize notifier that indicates a change of
the preferred size of the DataView. The ProbeView now listens to that
instead of knowing when to update the window limits.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6772 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 79681755 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

StateWatcher now only sends the update message if some state actually has changed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6766 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2aa20155 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

ApplyChanges() didn't always work correctly. Save() could crash with a
wrong index to the fChanges list.
Added the compile time possibility to trace the data editor changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6765 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4ce63bf 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented Save() functionality. ApplyChanges() can now create the editor
version of the file from any state.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c65f61d4 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added a StateWatcher class that will automatically send notices for
all changed states during the lifetime of the object upon destruction.
Added some comments.
Uncommented the IsModified() method (does not yet work correctly, though).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6760 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 707aa753 25-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Removed DataEditor::SetToAttribute() method.
DataEditor::InitCheck() is now properly working for all types.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6747 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ee24db11 25-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added some argument bound checks in Replace() and SetViewOffset().
Replace(), Insert(), and Remove() now locks the editor themselves.
ReplaceChange::Normalize() corrected the size for the right reason in a wrong way.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6741 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4897914e 25-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Accidently added only an int32 for the size, not an int64.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6738 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 66fcb84e 24-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now maintains the undo/redo state watcher, and also the data update
containing the range of affected bytes.
Added missing initialization of fLastChange and fFirstChange.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6733 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84a09d60 23-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

No longer takes an attribute for a file, or a device for an attribute.
Implemented attribute support.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6709 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 053bb738 23-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added a UpdateIfNeeded() method that you can call when you are not
interested in the data at all.
No longer imitates the BHandler observer model, but directly send
its update messages to the observers.
Now also stores the entry_ref of the file/device in the editor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6704 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15fef5f7 17-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Too bad the DataEditor did not report the correct size for devices... :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6624 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7efc8f4 17-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

The DataEditor class is now subclasses from BLocker instead of aggregating
it. This way, it can directly be used in the BAutolock class, and also provides
some more sophisticated locking functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6621 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04d3a3de 17-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now can also retrieve the size of a disk device.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6619 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f748e2d4 11-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Extended watching mechanism (it now works more like the BHandler watching
mechanism) - it's not really used yet, though.
Fixed some variable initialization bugs and missing return values.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6566 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92ad5151 09-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented the document handling foundation for DiskProbe.
Does not yet maintain the window position on disk (nor any other settings).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6549 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 732e8d7a 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Removed now unused arguments from the ReplaceChange constructor.
The last change also makes sure that changes can be applied at any time,
no matter if the block is currently loaded or not.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6104 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 73c630c9 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

The DataChange constructor must no longer make any changes to the buffer.
DataChange::Apply() will now remember the string instead, so that undo/redo
will work correctly even if the underlying data has changed in the mean time.
DataEditor::AddChange() will now apply the change as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5af91ef5 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented DataEditor::Redo(), and RemoveRedos(); the latter will now be
called by AddChange().
Fixed ApplyChanges() to only apply changes up to (and incl.) the last change;
it won't apply all changes anymore.
DataEditor::Undo() and Redo() now lock themselves.
Added some more simple tests to DiskProbe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6102 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1df68d1d 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Started to work on a DiskProbe replacement as a side project.
Implemented the basic editor engine that has features like undo/redo
and everything else DiskProbe could possibly need - not complete yet,
though it already has everything that would be needed for a 1:1 DiskProbe
duplicate.
The DiskProbe app is currently just a small text based test for that engine.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6096 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1e4a6aa2e53f86f4c177034089e8a406ec8039bc 20-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

DiskProbe: style fixes...


# 23b89f011f1399beec949c55f49183a81170c526 20-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

DiskProbe: fix crash when trying to edit a package directory

/system and /home/config would crash diskprobe because DataEditor would
be left in an incompletely initialized state.

Also fix a memory leak: fAttribute was never freed, but is allocated with
strdup.

Fixes #10428.


# f756b25e8a83e5485162a48ebef70f226baa376d 04-May-2013 Jerome Duval <jerome.duval@gmail.com>

DiskProbe: remove superfluous parentheses introduced in a31ac99


# a31ac990cc82daeccd7c8deb39e0c634643418fc 04-May-2013 Jérôme Duval <jerome.duval@gmail.com>

Diskprobe: some 64 bit fixes

* also warnings about comparisons between signed and non signed.


# 6c85c7eec82f314274e41ca842f7c9dc8f35d3c3 14-Aug-2009 Philippe Saint-Pierre <stpere@gmail.com>

Revert r32402. Some problems are occuring in the attribute editor and I want to make sure they aren't caused by my patch before committing for good.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 498c03bdd66b5e3252023b6d94a251160ec61120 14-Aug-2009 Philippe Saint-Pierre <stpere@gmail.com>

StringEditor : The TextView wasn't sending messages saying its content was modified by the user.
Symptoms :
* The Save menu item wasn't enabled
* the undo/redo menu item weren't neither

The fix I made was to commit the changes made by the user to the editor instance, by augmenting the InsertText and DeleteText from the TextView.
This fixes ticket #3507.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32402 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4fba3522e02906506b6c713ef5b57d72e9458fef 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed src/kits/tracker/OpenHashTable.h. The shared version in
headers/private/shared is newer, though with small interface changes.
* Removed the unnecessary Debug.h include in
headers/private/shared/ObjectList.h.
* Adjusted sources using these headers, mostly by adding missing includes.
* Lots of automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30123 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e551be6e701fb93b5a22d633d82eac09b3199139 19-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

If a device returns an invalid size, we shouldn't crash.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22956 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a9dfa85e4e1d06fa4f19cdeb99f147f490c4ab79 24-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

* DataEditor::SetTo() now checks if the reported block size is zero and then sets
it to the 512 byte default - this fixes bug #960.
* IconView::UpdateIcon() now uses 8-bit icon for get_device_icon(), as B_RGB32 cannot
work in this case.
* Also, in case it couldn't get an icon, it now tries to show the generic icon instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19940 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a93fb72be9510667dacf7c433859d246edacda55 28-May-2006 Axel Dörfler <axeld@pinc-software.de>

* If only a part of the data could be read, the part that couldn't been read
is now cleared - this changes the behaviour of bug #603, but doesn't fix
it (as this is no DiskProbe bug).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17621 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08f833c027a63e717a76c73958ceff41344ca500 22-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed two bugs:
- when undoing the first change, any later change would make that first change reappear
- in hex mode editing, changes were not merged because they changed the same byte
Updated version info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13801 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e98ea36fd14c9c0e072eedb30280a653304933d 17-Dec-2004 Axel Dörfler <axeld@pinc-software.de>

The DataEditor now has a separate entry_ref for attributes - that's used
to have access to the attributes of a root directory. Internally, only
this ref is used when accessing attribute data.
Also fixed an initialization bug in case the stream couldn't be properly
opened; some values were just set too late (could lead to strange things
as well as a crash).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10481 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 61784ba644ae4798e454564a98ac847e69da13ff 15-Dec-2004 Axel Dörfler <axeld@pinc-software.de>

The DataEditor class now only redirects root directories to volumes; it
can now also open directories and symlinks, in which case nothing can be
done (but theoretically, the attributes could be changed).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10472 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fdaf57f5a53ab95b7778bc9df9238edebd8199f0 20-May-2004 Axel Dörfler <axeld@pinc-software.de>

Always wrote fRealViewSize blocks; didn't use the correct calculated size...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7624 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0143eff357547b9b5494c6f3245d270019ec4cf4 22-Mar-2004 Axel Dörfler <axeld@pinc-software.de>

Read-only state was not properly initialized.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7055 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ef37dbe5172825d8143c51aba5eb6311ab462c8 29-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now listens to file/attribute changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6825 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0283ecc0cd8bcfc350216b80c1d87a7096c44015 29-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented case insensitive search. It's now available in hex mode as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6822 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8db249194cd850b2122f3d76f101cbcc26fd28ac 27-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented find functionality. The find panel is still missing though, it
just searches for "test".
The find itself is implemented in DataEditor::Find() which sets the editor
in read-only mode and searches for the specified data. It will update a
progress monitor, it will find data no matter if it's on a view size break,
and it is interruptible at any time.
The DataEditor change methods now respect the read-only mode, and return
B_NOT_ALLOWED in this case.
Renamed the UpdateLooper class to EditorLooper class, since it now also
runs the find action.
The ProbeView class now maintains the "Find Again" menu item; it's target
message always contains the item that last searched for.
The HeaderView will now show a "Stop" button while the search operation
is in progress; it also acts as the Find() progress monitor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6789 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f42477499052532cc512b43c9078caa54e8c425c 27-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now accepts directories, but redirects them to their volume instead; also
adopts the block size from the file system in that case.
Fixed the broken check for a device (would also succeed for other types,
stat.st_mode types cannot just be or'd).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6783 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 85140487900dfdea0098c11959b06d78870d2e72 27-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added the ability to merge changes. That means undo/redo now have a
handier granularity.
ReplaceChange will now try to merge with the next ReplaceChange if they
are adjacent.
Fixed compilation with tracing enabled.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a7511f36548f2c94f7889f809e274753e4ef09c2 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented changing the block size - that caused several changes to
DataEditor::SetViewSize()/SetViewOffset() because they did not correctly
update some values under certain circumstances.
There is now a kMsgDataEditorParameterChange instead of just ...OffsetChange;
the message will contain information about what has changed exactly.
Added a new kDataViewPreferredSize notifier that indicates a change of
the preferred size of the DataView. The ProbeView now listens to that
instead of knowing when to update the window limits.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6772 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 79681755a6d79760691660789e507fc26950a9b9 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

StateWatcher now only sends the update message if some state actually has changed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6766 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2aa201551abbf46be42f226fe4fb77bd7d2707d4 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

ApplyChanges() didn't always work correctly. Save() could crash with a
wrong index to the fChanges list.
Added the compile time possibility to trace the data editor changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6765 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4ce63bfc4ca46d872d218c2da53cb53da219704 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented Save() functionality. ApplyChanges() can now create the editor
version of the file from any state.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c65f61d4ad188611beaa221851599820bbdc71e9 26-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added a StateWatcher class that will automatically send notices for
all changed states during the lifetime of the object upon destruction.
Added some comments.
Uncommented the IsModified() method (does not yet work correctly, though).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6760 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 707aa753f3e2e387b69ea3d01fba63013236e015 25-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Removed DataEditor::SetToAttribute() method.
DataEditor::InitCheck() is now properly working for all types.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6747 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ee24db11e157ba87fe3a8cb127202c89e54d6c51 25-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added some argument bound checks in Replace() and SetViewOffset().
Replace(), Insert(), and Remove() now locks the editor themselves.
ReplaceChange::Normalize() corrected the size for the right reason in a wrong way.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6741 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4897914ecac7328e6aa725c5d27a45aae211c074 25-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Accidently added only an int32 for the size, not an int64.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6738 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 66fcb84e31c9c6f645bafa46ac145fa95f44612a 24-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now maintains the undo/redo state watcher, and also the data update
containing the range of affected bytes.
Added missing initialization of fLastChange and fFirstChange.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6733 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84a09d60e166b9a62412e4672e6645ec04beb49f 23-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

No longer takes an attribute for a file, or a device for an attribute.
Implemented attribute support.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6709 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 053bb7380a14cb55cd8dfcdf6d5ec753b0355f1e 23-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Added a UpdateIfNeeded() method that you can call when you are not
interested in the data at all.
No longer imitates the BHandler observer model, but directly send
its update messages to the observers.
Now also stores the entry_ref of the file/device in the editor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6704 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15fef5f790befa24856aae567426f25f3a0fde61 17-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Too bad the DataEditor did not report the correct size for devices... :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6624 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7efc8f44741886f45983bfc95d629e78f27b4bb 17-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

The DataEditor class is now subclasses from BLocker instead of aggregating
it. This way, it can directly be used in the BAutolock class, and also provides
some more sophisticated locking functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6621 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04d3a3dedfb89d1b8f04a428a82cab0a2ca0621c 17-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now can also retrieve the size of a disk device.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6619 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f748e2d460fd3b179aecd7092fb46ec5daf450f6 11-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Extended watching mechanism (it now works more like the BHandler watching
mechanism) - it's not really used yet, though.
Fixed some variable initialization bugs and missing return values.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6566 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92ad5151839383c0324ae46bf7538f22772307eb 09-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented the document handling foundation for DiskProbe.
Does not yet maintain the window position on disk (nor any other settings).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6549 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 732e8d7a7dcc25f0ec5e288e785912b782657275 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Removed now unused arguments from the ReplaceChange constructor.
The last change also makes sure that changes can be applied at any time,
no matter if the block is currently loaded or not.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6104 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 73c630c94846ea0738cf3e37eee2c25c89b73045 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

The DataChange constructor must no longer make any changes to the buffer.
DataChange::Apply() will now remember the string instead, so that undo/redo
will work correctly even if the underlying data has changed in the mean time.
DataEditor::AddChange() will now apply the change as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5af91ef5cb7c468bc0670caec533cfc8eef7e77f 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented DataEditor::Redo(), and RemoveRedos(); the latter will now be
called by AddChange().
Fixed ApplyChanges() to only apply changes up to (and incl.) the last change;
it won't apply all changes anymore.
DataEditor::Undo() and Redo() now lock themselves.
Added some more simple tests to DiskProbe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6102 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1df68d1dee54532fb02515cff83c9d8392adacd0 15-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Started to work on a DiskProbe replacement as a side project.
Implemented the basic editor engine that has features like undo/redo
and everything else DiskProbe could possibly need - not complete yet,
though it already has everything that would be needed for a 1:1 DiskProbe
duplicate.
The DiskProbe app is currently just a small text based test for that engine.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6096 a95241bf-73f2-0310-859d-f6bbb57e9c96