* Add union-like class PackageData which wraps the V1 and V2
BPackageData classes.
* GlobalFactory: Create a data reader depending on the data format
version.
* Package: Add a loader for V1 format and try that, if the other one
fails.
It is no longer public (or even private) API. BPackageDataReaderFactory
returns a BAbstractBufferedDataReader instead. The advantage is that
the latter doesn't have hpkg format specific dependencies.
It doesn't do much in terms of buffering, but defines an interface
buffered readers can implement, namely the additional
ReadDataToOutput() which currently BPackageDataReader specifies.
It uses sub-namespace BPackage::BHPKG::V1. Unlike the one for the
current format version, the V1 version of BPackageInfoContentHandler
lives in BHPKG(::V1) sub-namespace and is private.
* Use enums/constants/functions instead of preprocessor macros.
* Missing include in PackageInfoAttributeValue.h.
* PackageReaderImpl::Init(): Check version before header size and
return B_MISMATCHED_VALUES instead of B_BAD_DATA, if the version
doesn't match. This allows callers to determine the condition and
try a reader for a different version. A more flexible interface for
that case would be nice, but since we want to support the old package
version only temporarily, the current solution should be good enough.
Consider ':' a potential path delimiter and try all combinations of
chopped off prefixes and suffixes. This makes detection in the output
of a multi-file grep work even if the found line starts with a path
character or is a path. A path in the typical colon delimited search
paths (e.g. PATH) is detected as well.
* We were trying relative paths as is, which means checking them with
Terminal's current working directory. Now we use the CWD of the active
process.
* In case the path is relative, add a context menu item "Copy absolute
path".
A similar problem to that described in my previous commit afflicted the
step out case as well. We now store the current IP when issuing a step
out, and use that as the function address once execution returns.
When using step over to step out of a function, we need to use the
address range of the step statement to determine the function which
returned said value, not the current IP, as that has already exited the
function and will consequently be that of the caller, leading to such
returns being attributed to the wrong function, and consequently also
the wrong type.
Introduce a class String which refers to shared private data that is
registered in a global hash table (in class StringPool) and use the
class consequently. This eliminates duplicate allocations for the same
string and also speeds up tests for equality. There's quite a bit
overhead for the management structures (apparently even more than for
the string data itself), but due to almost all strings being used
multiple times this still almost halves the memory usage for string
data.
In some cases /bin/open puts some additional fields in the
B_REFS_RECEIVED message, but those were completely ignored. This makes
opening paths with appended line/column numbers actually work as
expected.
When holding down Command, text under the mouse is checked whether it
looks like a URL or a local path. If so, it is highlighted and can be
clicked, which will open the URL/file. Right-clicking opens a context
menu with items for opening the link/file or copying it to the
clipboard. When additionally holding down Shift, path prefixes up to
the component under the mouse will be considered (no effect for URLs).
Changes:
* Add HyperLink class. Encapsulates a type, the address, and an
optional base address. Features an Open() method to open the address.
* Move/add some string constants to TermConst.
* Move TermView::CharClassifier to top level and rename to
DefaultCharClassifier.
* Introduce TermViewHighlight and TermViewHighlighter. The former
refers to a range of text in a TermView's text buffer. It also
contains a pointer to a TermViewHighlighter object, which specifies
how the text range shall be rendered (colors and attributes).
* TermView:
- Add respective _{Add,Remove}Highlight() methods and adjust the code
to support highlights.
- Make the selection a TermViewHighlight. At least its visual aspect
is now handled like other highlights.
- Introduce an inner TextBufferSyncLocker. It is used instead of
BAutolock when locking the text buffer to synchronize the visual
buffer with it. After it unlocks it calls
_VisibleTextBufferChanged(), if the visual text buffer has changed,
which in turn calls a new callback on the active state.
- Add WindowActivated() and ModifiersChanged() callbacks to the state
interface.
- Add new states HyperLinkState and HyperLinkMenuState which
implement the new feature.
Fix modifier issues