Add inner class BWatchingInterface and method SetWatchingInterface().
This abstracts the calls to watch_node() and stop_watching(), thus
making it possible to use the path monitor in Tracker.
* The config space is larger than 255, we need to use an uint16 to access
offsets superior or equal to 256. The current API only proposes an uint8 for this.
This change switches the offset parameter to the uint16 type. Axel hinted that
the used values are the same with such a change (the doc says sign extended to 2 or
4 bytes).
I checked with GCC2 and it's indeed the case when inspecting the memory.
With GCC4, instructions are the same on function call.
* prints info about extended capabilities.
* struct pci_module_info and struct pci_device_module_info are extended with
pci_find_extended_capability().
* Also change kMinCellSize from a uint32 to a float so that it can be used
with std::min() and std::max() instead of min_c() and max_c().
* Set the text controls sizes and margins based on the font size. Also rework
_TextRectOffset() so that it will get the right spacing from by dividing the
palette frame by 3.
* Replace bare numbers and refactor with calculation or magic constant.
* Create a private method _TextRectOffset() which calculates and
returns the vertical text rect offset to use based on the font size.
* Replace 2.0 with new kBevelSpacing constant where appropriate.
* fPaletteFrame calculation in _LayoutView() was refactored but should
not have changed.
Fixes#9816
It is no longer necessary, or even desirable for us to set the max
content width of the menu bar of a BMenuField now that BMenuItem
truncation and BMenuField sizing are working.
The user may, however, wish to set the max content width of the menu
bar of a BMenuField themselves like so:
menuField->MenuBar()->SetMaxContentWidth(width);
and the Interface Kit will automatically deduct the left and right
margins from the width including the space used by the drop down arrow.
* For all identifiers: Rename global settings file to global writable
file. We want to use the respective attribute also for other writable
files, not only settings files.
* User settings file/global writable file info/attribute: Add
isDirectory property/child attribute. This allows declaring global/
user settings directories associated with the package.
... cancelling the normal item truncation behavior.
This funcationality comes from BeOS R5, we need to reproduce it for
backwards compat. KeymapSwitcher depends on it at least.
Minimum width is 20px, was set in last commit, comes from BeOS R5.
We use these constants in both MenuField.cpp and BMCPrivate.cpp
Incorporate kMarginWidth into kPopUpIndicatorWidth.
A small code simplication in FrameResized() along with replacing bare numbers
with magic constants.
* the Virtio PCI bus driver exposes a Virtio controller to the Virtio bus manager,
which in turn exposes a Virtio device consumed by Virtio drivers. Drivers follow the
new driver model.
* virtio_block handles Virtio block devices under disk/virtual/virtio_block/x/raw.
* Here is the Qemu command line option for Virtio disk devices:
-drive file=haiku.image,if=virtio
* the PCI bus driver currently supports only legacy interrupts (no MSI(-X) yet).
* There is room for improvements in the bus manager:
- it notifies the host for each queued request, which isn't optimal.
- transfer descriptors should probably be simply preallocated (they are nicely
leaked at the moment).
- indirect descriptors are not supported yet.
and in the block driver:
- get the id of the disk.
- implements flushing the cache.
- improves dma restrictions.
- do_io() should use a page for header descriptors instead of malloc(), which
could cross boundaries.
* The device manager tries to guess the driver based on the PCI device type, this
implies having to declare the "busses/virtio" path for each possible type
provided by Virtio. Thus future driver additions might require patching the device
manager.
* virtio.h is still private, the API is subject to changes.
* virtio_pci.h, virtio_blk.h, virtio_ring.h are copied unchanged from FreeBSD.
... the one expected for the respective attribute. Before it was
possible that e.g. a uint was read and then interpreted as a
const char*, if a string was expected for that attribute.
... <package/hpkg/PackageAttributes.h>, which also defines other
properties (name and type) for each attribute. It does so via a macro
that the caller can define to generate whatever code is desired.
Global and user settings files can be declared. For global ones an
update policy can be specified. If not specified, the settings file is
not included in the package, but created by the program (or user) later.
If an update type is specified, it defines what to do with the settings
file when updating the package to a newer version.
User settings files are never included in the package; they are always
created by the program or the user. If the package contains a template/
default settings file, it can be declared, but for informative purposes
only.
* Add minor_version to hpkg_header and hpkg_repo_header and make
heap_compression uint16.
* If the minor version of a package/repository file is greater than the
current one unknown attributes are ignored without error. This allows
introducing new harmless attributes without making the resulting files
unreadable for older package kit versions.
* ReaderImplBase:
- Add virtual CreateCachedHeapReader() which can create a cached
reader based on the given heap reader.
- Rename HeapReader() to RawHeapReader() and add HeapReader() for the
cached heap reader.
- Add DetachHeapReader() to allow a clients to remove the heap
reader(s) after deleting the ReaderImplBase object.
* packagefs:
- Add CachedDataReader class, which wraps a given
BAbstractBufferedDataReader and provides caching for it using a
VMCache. The implementation is based on the IOCache implementation.
- Use CachedDataReader to wrap the heap reader. For file data that
means they are cached twice -- in the heap reader cache and in the
file cache -- but due to the heap reader using a VMCache as well,
the pages will be recycled automatically anyway. For attribute data
the cache should be very helpful, since they weren't cached at all
before.
* Add flags parameter to Init() of BPackageReader and friends.
* Introduce flag B_HPKG_READER_DONT_PRINT_VERSION_MISMATCH_MESSAGE and
don't print a version mismatch error when given.
* package extract/list: Use the new flag.
* Pull _UnwriteLastPartialChunk() out of Reinit() for reuse.
* _UnwriteLastPartialChunk(): fPendingDataSize wasn't set.
* _PushChunks(): Some simplifications for clarity.
* ChunkBuffer/RemoveDataRanges(): Use data reading and decompression
methods provided by our base class instead of duplicating the
implementation.
* RemoveDataRanges():
- _FlushPendingData() before starting, so we don't ignore the pending
data and _UnwriteLastPartialChunk() when done, so a partial chunk
is read back into the pending data buffer.
- fUncompressedHeapSize wasn't reset before the main processing loop,
thus resulting in an erroneous size later on.
* Introduce BPackageWriterParameters which comprises all parameters
for package creation, currently flags and compression level. Such an
object can be passed to BPackageWriter::Init() and is passed on to
PackageWriterImpl and WriterImplBase.
* PackageFileHeapWriter: Add compressionLevel property and pass the
value on to ZlibCompressor.
* package add/create: Add options -0 ... -9 to specify the compression
level to be used.
Instead of handling compression for individual file/attribute data we
do now compress the whole heap where they are stored. This
significantly improves compression ratios. We still divide the
uncompressed data into 64 KiB chunks and use a chunk offset array for
the compressed chunks to allow for quick random access without too much
overhead. The tradeoff is a limited possible compression ratio -- i.e.
we won't be as good as tar.gz (though surprisingly with my test
archives we did better than zip).
The other package file sections (package attributes and TOC) are no
longer compressed individually. Their uncompressed data are simply
pushed onto the heap where the usual compression strategy applies. To
simplify things the repository format has been changed in the same
manner although it doesn't otherwise use the heap, since it only stores
meta data.
Due to the data compression having been exposed in public and private
API, this change touches a lot of package kit using code, including
packagefs and the boot loader packagefs support. The latter two haven't
been tested yet. Moreover packagefs needs a new kind of cache so we
avoid re-reading the same heap chunk for two different data items it
contains.
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.
* Switch bash, debugger, less, telnet[d] and top apps to use termcap
functionality provided by ncurses lib instead of GNU libtermcap.so;
* NetBSD version of tput utility replaced with ncurses' one. Fixes#9606;
* terminfo database is provided as mandatory package installed during
building target system;
* Remove libtermcap module. The termcap database source and
corresponding build rules are not removed to provide backward compatibility -
until all optional packages will be rebuild on upcoming system version
using terminfo. Note that gcc2 builds may require to provide termcap a bit
longer in the sake of binary compatibility with R5 era apps.
* If at least one image is either B_HAIKU_ABI_GCC_2_ANCIENT or
B_HAIKU_ABI_GCC_2_BEOS almost all areas are marked as executable.
* B_EXECUTE_AREA and B_STACK_AREA are made public. The former is enforced since
the introduction of DEP and apps need it to correctly set area protection.
The latter is currently needed only to recognize stack areas and fix their
protection in compatibility mode, but may also be useful if an app wants
to use sigaltstack from POSIX API.
* Factor out the code to add some data to the about window, with a header and a content under it
* Make this method public so it's possible to add custom entries in an about box
* If the method is called with only the header or only the content, the text is added non-bold and non-indented (like the description entry*).
* Make the header text bold. I'm not sure it looks that good, after all. Thoughts ?
This means the build tools will no longer be built against the host
platform's libbe, which avoids compatibility problems -- e.g. an
older Haiku host libbe may not have certain features the build tools
require -- and also makes the build behave more similiar on Haiku and
other platforms. The host libroot dependency still remains and is not
easy to get rid of.
Also remove some bits of BeOS/Dano/Zeta build support.
* Pull out base class MimeEntryProcessor out of AppMetaMimeCreator.
* Pull class MimeInfoUpdater out of UpdateMimeInfoThread and derive it
from MimeEntryProcessor.
* MimeInfoUpdater: Instead of BMimeType::GuessMimeType(), use
Database::GuessMimeType() directly.
* This pulls in some more stuff, like libicon and agg which are also
included in libbe_build, now.
* Update a few libbe_build classes and headers needed to get things
building.
* This likely breaks the <build>mimeset build on Haiku.
* Add class DatabaseLocation. It contains a list of the MIME DB
directory paths plus methods to access type files.
* Move all low-level MIME DB access functions from
database_{support,access} to DatabaseLocation. All code that formerly
used those now requires a DatabaseLocation object. In BMimeType and in
the registrar the default object is used, but the low-level classes
can now be reused with different locations.
* Move get_icon_data() from database_access to database_support and
delete the former, which is now empty.
* Together with database_{access,support}.cpp it is built into a static
library.
* Add new interfaces MimeSniffer and Database::NotificationListener for
plugging in registrar specific functionality (the sniffer add-on
support and the notification mechanism).
Each installation location (system, common, common/non-packaged,
~/config, ~/config/non-package) can now have a read-only data/mime_db
directory. ~/config/settings/beos_mime is now named mime_db as well. The
contents of all directories makes up the MIME DB. Entries in more
specific locations shadow entries in more general locations. Only the
directory in ~/config/settings is where the registrar writes changes to.
The new layout allows packages to contribute entries to the MIME DB by
simply providing the respective files in data/mime_db. Consequently the
user settings directory is supposed to contain only the things the user
has actually changed.
Seems to work fine as far as tested. A few issues, though:
* The registrar doesn't monitor the directories yet, so it doesn't
notice entry changes due to package de-/activation.
* ATM it is not possible to remove a MIME type that is not in the user
settings directory, although the FileTypes GUI suggests that it is.
We'd have to work with white-outs, since we cannot remove the files in
the data/mime_db directories. Or, alternatively, the API has to be
extended and the FileTypes GUI adjusted to disable the "Remove" button
in such a case.
An arbitrary number of directories can be added, which the implemented
BEntryList interface presents as a single merged entry list. Three
different merge policies are supported which define how entries that
appear in more than one directory are treated.
Remove no longer needed header includes, most that I recently added
a few that were already there but just aren't needed anymore. Don't
use BPrivate::MenuPrivate namespace.
Just a few commits ago I moved the label truncation code out of
BMenuItem and into BMCMenuBar because the truncation had to happen
outside of BMenuItem. Turns out, that wasn't true so I'm moving the
label truncation back into BMenuItem and removing the _DrawItems()
method from BMCMenuBar.
Note that the code is not a copy of what was there before, but, the
updated version I created for BMCMenuBar. The main difference is that
I use menuPrivate.Padding() instead of GetItemMargins() and I always
use the width of the parent menu frame instead of using fBounds even
if the state is not MENU_STATE_CLOSED. These are changes needed for
BMCMenuBar but should work just as well for a regular BMenu.
...instead of in BMenuItem and remove the truncation code from BMenuItem.
The label truncation code cannot work in BMenuItem because the super
menu helpfully resizes itself to fit the menu item. So, instead we do the label
truncation in BMCPrivate making sure that BMenuItem there can't expand the
BMCMenuBar because we set the width to fMenuField->_MenuBarWidth()
explicity.
Note that this only truncates the label in BMCMenuField, i.e. the label inside
the menufield, it does nothing to the labels of the menu items in the attached
BMenu or BPopUpMenu which is exactly what we want.
Was passing !fixedSize into the view flags of BMenuBar, which made no sense.
Stop doing that, set fixedSize to true instead.
Remove the fixedSize parameter from this contructor, it's too late for that.
* Add optional packages Zlib and Zlib-devel.
* Simplify the build feature section for zlib and also extract the
source package.
* Replace all remaining references to the zlib instance in the tree and
remove it.
In some cases, BStringColumn wouldn't properly detect that an update was
needed, and would consequently fail to truncate a string as needed with
a column resize.
* Set its type to B_MODAL_WINDO, and also set B_NOT_MOVABLE
* Since this removes the window tab, add an "Ok" button to close the window
* Remove the GetWindow mess and just use it as any regular window
* Adjust all callers again
The AlertPosition method doesn't seem to work right, the window pops up
offset to the right. I also noticed that some of our calls to BAboutWindow
are actually not reacable because we removed Abutrequested from the apps.
Maybe we should clean them up (locale preflet and activity monitor are examples)
More annoying is the fact that opening a modal window from a deskbar replicant
is modal against the whole deskbar. Not sure what to do about that.
- debug_create_symbol_lookup_context() now takes an image ID
parameter that can optionally be used to restrict the symbols
it gathers to only those of the targeted image rather than the
entire team, allowing for significantly more lightweight usage
when the desired image is known. The previous behavior can still
be obtained if desired by passing -1 as said ID.
- Adjust callers.
... back to their previous void returning roles. AlertPosition() is used instead to
check that an alert fits within the sides of the screen and all that.
Also add another CenterOnScreen() method that takes a Screen ID
so you can center a window on another monitor that the one it is currently on
(theoretically someday anyway).
...to position alert's and open/save dialogs nicely inside of the parent window,
or if that is unavailable, the screen frame.
AlertPosition() is private (for now) but BAlert and BFilePanel are BWindow's friends so
BWindow allows those classes to touch it's privates.
BAboutWindow returned false in QuitRequested in order to hide instead of closing.
Not only this keeps a BLooper running for a rarely used window, but it also
prevents quitting an application in the window was not destroyed first.
* Remove aforementioned QuitRequested method,
* Add a static GetWindow method that returns the existing about window, if there
is one, or creates one if there is not. A boolean can be set to tell the caller
what happened,
* Adjust all callers to use that new method, instead of managing the window themselves.
* These methods now return the new point after centering.
* But more importantly CenterIn() does some new adjustments to keep the window
position inside the screen edge. If you pass the screen frame into CenterIn()
it skips these adjustments.
- Instead of implicitly registering and unregistering a service
instance on construction/destruction, DefaultNotificationService
now exports explicit Register()/Unregister() calls, which subclasses
are expected to call when they're ready.
- Adjust all implementing subclasses. Resolves an issue with deadlocks
when booting a DEBUG=1 build.
* Add "bool kernel" parameter to vfs_entry_ref_to_path(), so it can be
specified for which I/O context the entry ref shall be translated.
* _user_entry_ref_to_path(): Use the calling team's I/O context instead
of the kernel's. Fixes the bug that in a chroot the syscall would
return a path for outside the chroot.
* BActivationTransaction:
- Remove non-trivial constructor.
- Remove package list parameters from SetTo().
- Add AddPackageTo{Dea,A}ctivate().
* BDaemonClient:
- Add CreateTransaction(). It creates a transaction directory and
initializes a BActivationTransaction. Packages to de-/activate have
to be added afterwards.
- Add BCommitTransactionResult::FullErrorMessage().
The name of the package file is not part of the package-info.
CanonicalFileName() constructs the name the file should have (not
enforced anywhere (yet)).
* daemon: Handle new request B_MESSAGE_COMMIT_TRANSACTION. It activates
and deactivates given sets of packages. The new packages must be
placed in a directory in the administrative directory. The daemon
moves them to the packages directory and the deactivated packages to
a subdirectory it creates. It also save the old activation state
there.
* Add private BActivationTransaction, describing an activation change
transaction.
* BDaemonClient: Add CommitTransaction(), which sends a given
BActivationTransaction as a B_MESSAGE_COMMIT_TRANSACTION request to
the daemon.
Completely untested yet.
* ... to avoid confusion with the preRelease property. It's also called
"revision" in the HaikuPorts recipes.
* Update libsolv package. Was necessary due to the BPackageVersion
change, but also includes a few more changes.
In sake of consistency with other Windows CP encodings:
* print_name is expanded to "Windows Central European (CP 1250)";
* B_MS_WINDOWS_1250_CONVERSION id looks like should be added into UTF8.h;
* mime_name set to NULL as other windows codepages have. That prevents
at least from duplicating too much 1250's in the Terminal, Mail and
StyledEdit encodings menus.
* Rename PackageDaemonDefs.h to DaemonDefs.h.
* Replace the MESSAGE_GET_PACKAGES by the new
B_MESSAGE_GET_INSTALLATION_LOCATION_INFO, which not only returns the
packages, but also other information about the installation location.
* daemon: Volume: Implement a change count which is bumped whenever
packages are activated/deactivated/added/removed. Cache the reply
for a location info request, using the change count to check whether
it is still up-to-date.
* Add private BDaemonClient for communication with the daemon.
* BRoster:
- Add GetInstallationLocationInfo() using BDaemonClient.
- Reimplement GetActivePackages(), using
GetInstallationLocationInfo().
* Implement copy-on-write support.
* Add copy constructor and assignment operator.
* Remove Init(). Initialize lazily instead. Since AddInfo() can fail
and we check initialization anyway, there's no point in having an
explicit Init(). Given that there was only one invocation of Init()
in the package kit and its users, it was very likely missing in some
places.
* Fix a few places where we ignored that the PackageMap actually
contains lists of PackageInfo objects.