Commit Graph

7504 Commits

Author SHA1 Message Date
Ingo Weinhold
77ca66cdb7 BPathMonitor: make the node watching mechanism configurable
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.
2013-06-27 21:57:41 +02:00
Ingo Weinhold
ad1875fd70 BPathMonitor: use pthread_once for initialization 2013-06-27 21:57:40 +02:00
Ingo Weinhold
5fa3519dec BString::Private: Add IsShareable() 2013-06-27 21:57:40 +02:00
Ingo Weinhold
105511275e Move PUuid from shared to support 2013-06-27 21:57:39 +02:00
Jérôme Duval
b027a0a2f7 pci: change offset type to uint16 in config space API.
* 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().
2013-06-24 19:29:00 +02:00
Jérôme Duval
26a4510e59 pci: added pci_find_extended_capability().
* added PCI Extended Capabilities definitions.
* pci_find_capability() parameter offset is now optional.
2013-06-22 19:48:56 +02:00
Jérôme Duval
786a38f555 scsi: typo adapaters=>adapters 2013-06-18 18:39:25 +02:00
Ingo Weinhold
c625c5fd36 <langinfo.h>/<select.h>: don't use C++ comments 2013-06-12 14:55:16 +02:00
Ingo Weinhold
a1832a0e83 <resolv.h>: Make self-contained 2013-06-11 15:23:18 +02:00
John Scipione
8b3b14fdfa BColorControl: Introduce a _PaletteFrame() method
... eliminating duplicate code.
2013-06-10 19:15:09 -04:00
John Scipione
62fec205dd BColorControl: Size text rect based on font size
* 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.
2013-06-10 19:15:07 -04:00
John Scipione
1186916f06 BColorControl: Create _SetCellSize() method
...eliminating duplicated code.
2013-06-10 19:15:07 -04:00
John Scipione
0289f92063 BColorControl: Style fixes
* Update copyright in header, add my name, alphabetize.
* Rename _ColorRamp() to _DrawColorRamp().
* Rename update parameter to updateRect
2013-06-10 19:15:06 -04:00
Jérôme Duval
6e6c121b84 virtio: added several devices ids. 2013-06-07 18:00:17 +02:00
John Scipione
1c95f72222 Don't set MaxContentWidth on the menu bar of a BMenuField
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.
2013-06-07 03:25:36 -04:00
Ingo Weinhold
01176bd944 Add basic BUuid class
ATM it's only able to generate random UUIDs.
2013-06-07 02:03:16 +02:00
Rene Gollent
7d4a7ce33e Add ability to specify case insensitive matching. 2013-06-05 22:02:43 -04:00
Rene Gollent
47fedeb598 Import RegExp classes from Ham.
Minor adjustments made by myself to fit into Haiku better.
2013-06-05 22:02:42 -04:00
Ingo Weinhold
4489c88b61 hpkg format: Generalize user/global settings file attributes
* 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.
2013-06-06 00:17:02 +02:00
Ingo Weinhold
a532c57308 Remove /boot/{apps,preferences} symlinks
And adjust all remained occurrence in the tree accordingly (->
/boot/common/{apps,preferences}).
2013-06-04 23:36:46 +02:00
Ingo Weinhold
10e9f49914 QueryParser: Equation::Match(): Fix generic attribute case
Init size to the buffer size before passing it to
QueryPolicy::NodeGetAttribute(). Since size was 0 by default, we would
only read 0 length data.
2013-06-01 03:58:11 +02:00
Ingo Weinhold
d055934e36 QueryParser: Fix some debug macros 2013-06-01 02:40:08 +02:00
John Scipione
fc77b031d7 Revert "BBox: Always offset the top border by the same amount"
This reverts commit 39899cf662.

Checked with BeOS R5, and this is not how it works, to remain
compatable we need to go back to how this was before.
2013-05-30 21:47:04 -04:00
John Scipione
39899cf662 BBox: Always offset the top border by the same amount
...so that the top border of BBox's with no labels, BBox's with
text labels, and BBox's with BControl labels will all line up.
2013-05-30 20:38:04 -04:00
John Scipione
f9954bfc69 Style fixes to BBox, update copyright header 2013-05-30 20:35:42 -04:00
John Scipione
ca3a1c0451 BMenuField: If fixed size always set max content width
When you resize, also set max content width.

Create a SetMaxContentWidth() method that includes the margins.
2013-05-30 00:05:17 -04:00
John Scipione
92c12506ac Move kMinMenuBarWidth to MenuField.cpp 2013-05-30 00:05:16 -04:00
John Scipione
a1cf3ead5f Resize menu field if below minimum width in auto-size mode
... 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.
2013-05-30 00:05:16 -04:00
John Scipione
6031e62420 Move constants to BMCPrivate.h and refactor
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.
2013-05-30 00:05:15 -04:00
Ingo Weinhold
56b43eca03 BPackageInfoContentHandler: Handle new attributes
Also add respective *Data constructors to BUser, BUserSettingsFileInfo,
and BGlobalSettingsFileInfo.
2013-05-28 02:44:13 +02:00
Jérôme Duval
78b461d6a1 Merge branch 'virtio' 2013-05-26 17:12:25 +02:00
Jérôme Duval
6bbf9c9da9 Virtio: added drivers for PCI busses, bus manager and block device.
* 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.
2013-05-26 17:02:50 +02:00
Ingo Weinhold
a3e070a7ff WriterImplBase: Add _AddStringAttributeList()
... and simplify some code by using it.
2013-05-25 01:12:38 +02:00
Ingo Weinhold
c0ab140961 hpkg format: Add attribute for declaring post install scripts 2013-05-25 01:12:37 +02:00
Ingo Weinhold
0f4e11e75c hpkg format: Add attributes for declaring users and groups 2013-05-25 01:12:37 +02:00
Ingo Weinhold
c82776b2fa BString: Add Split() 2013-05-25 01:12:36 +02:00
Ingo Weinhold
8698ee4521 BStringList: Declare Join() const 2013-05-25 01:12:36 +02:00
Ingo Weinhold
79d5ddb77b ReaderImplBase: Verify that the attribute type matches
... 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.
2013-05-25 01:12:35 +02:00
Ingo Weinhold
a8de2761c7 Move package attribute ID definitions to a separate file
... <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.
2013-05-25 01:12:35 +02:00
Ingo Weinhold
fe707a23fc hpkg format: Add attributes for declaring settings files
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.
2013-05-25 01:12:34 +02:00
Ingo Weinhold
5497f08e5e hpkg attribute tags: use 7 bits for attribute ID
ATM the 6 bits suffice, but there isn't that much headroom.
2013-05-25 01:12:34 +02:00
Ingo Weinhold
47039b852e Package/repository file format: Add a minor version header field
* 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.
2013-05-25 01:12:33 +02:00
Ingo Weinhold
5dae1541d6 Add "source" package architecture 2013-05-25 01:12:33 +02:00
Ingo Weinhold
bc306e210f Declare some string constants actually const 2013-05-25 01:12:33 +02:00
Ingo Weinhold
46122852f1 packagefs: Add caching for the package file heap reader
* 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.
2013-05-25 01:12:32 +02:00
Ingo Weinhold
d59e0feb59 package: Suppress version mismatch errors where V1 is supported
* 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.
2013-05-25 01:12:31 +02:00
Ingo Weinhold
5261923e87 Add dvprintf() 2013-05-25 01:12:29 +02:00
Ingo Weinhold
521545f7fb Add padding in HPKG/HPKR headers
... so that the different alignment on 32 and 64 bit machines doesn't
change the layout.
2013-05-25 01:12:28 +02:00
Ingo Weinhold
d03ac965a2 ReaderImplBase: Fix gcc 4 build 2013-05-25 01:12:28 +02:00
Ingo Weinhold
b05413ed78 PackageFileHeapWriter: Fix update case
* 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.
2013-05-25 01:12:27 +02:00
Ingo Weinhold
520a7a76c7 PackageFileHeapAccessorBase: small refactoring
* Pull method DecompressChunkData() out of ReadAndDecompressChunkData()
  for potential reuse.
* Also fix/improve some error output strings.
2013-05-25 01:12:27 +02:00
Ingo Weinhold
796343ed73 Allow specifying the compression level for package creation
* 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.
2013-05-25 01:12:26 +02:00
Ingo Weinhold
18b19ba49d ZlibCompressor: Allow setting the compression level 2013-05-25 01:12:26 +02:00
Ingo Weinhold
1f633814fa hpkg format: compress the whole heap
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.
2013-05-25 01:12:25 +02:00
Ingo Weinhold
16e5e5e4ec Some *DataReader improvements
* BFDDataReader: Add SetFD().
* BBufferDataReader: Derive from BAbstractBufferedDataReader.
2013-05-25 01:12:25 +02:00
Ingo Weinhold
0ee1651856 Rename BBlockBufferCache and friends to *Pool*
Also move BBlockBufferPoolNoLock into BHPKG namespace with the other
classes. Not sure why it wasn't there before.
2013-05-25 01:12:25 +02:00
Ingo Weinhold
7adfd76b17 Add "base package" package attribute 2013-05-25 01:12:24 +02:00
Ingo Weinhold
df29539688 Remove resolvable provides type
* Remove BPackageResolvableType and respective property from
  BPackageResolvable.
* Remove package attribute B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES_TYPE.
2013-05-25 01:12:24 +02:00
Ingo Weinhold
2c32402da5 package kit: internalize BPackageDataReader
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.
2013-05-25 01:12:23 +02:00
Ingo Weinhold
175ff8ec77 package kit: Add BAbstractBufferedDataReader
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.
2013-05-25 01:12:23 +02:00
Ingo Weinhold
b5786b0f68 BPackageDataReader: Remove unused Size(), BlockSize() 2013-05-25 01:12:23 +02:00
Ingo Weinhold
dd0b33cb63 BPackageInfo: Support reading both HPKG format versions 2013-05-25 01:12:22 +02:00
Ingo Weinhold
fc0cec5396 Bump HPKG format version 2013-05-25 01:12:22 +02:00
Ingo Weinhold
7575abbca2 Clone read support functionality for HPKG format version 1
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.
2013-05-25 01:12:22 +02:00
Ingo Weinhold
171fd58c4b package kit: some fixes for multi-version support
* 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.
2013-05-25 01:12:21 +02:00
Siarzhuk Zharski
3bbef9dd76 Discard Termcap and switch console apps to use Terminfo
* 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.
2013-05-23 14:07:50 +02:00
Pawel Dziepak
07e1875ea2 libroot: explicitly check ABI version
As Axel suggested use simple, explicit checks for legacy ABI version
instead of obscure "compatibility mode".
2013-05-22 19:31:05 +02:00
Jérôme Duval
21f6b3ea28 agp_gart: switch to phys_addr_t as suggested by Urias and Axel.
* this is a follow-up to hrev45621
2013-05-16 19:01:33 +02:00
Pawel Dziepak
5d0a1da8bf libroot: make all areas executable for old binaries
* 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.
2013-05-15 00:06:39 +02:00
Ingo Weinhold
c663ca2171 Merge branch 'master' into package-management
Conflicts:
	build/jam/HaikuImage
	src/system/kernel/arch/x86/64/arch.S
2013-05-12 00:18:19 +02:00
Ingo Weinhold
1848fdc329 util/khash: Add hash_hash_string_part() 2013-05-11 23:17:55 +02:00
John Scipione
f6d93b80f3 Remove the unused bounds parameter from DrawLabel
Also refactor BMenuField::Draw()
2013-05-09 21:29:13 -04:00
John Scipione
91810d8efd Use better variable names in SetDivider 2013-05-09 21:29:12 -04:00
John Scipione
df5d08a718 Style fixes to BMenuField
Rename resize to resizingMode, whitespace fixes, compare to 0 explicitly
2013-05-09 21:29:12 -04:00
Adrien Destugues
2b67ff2420 Add AddText method to AboutWindow
* 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 ?
2013-05-09 21:27:43 +02:00
Ingo Weinhold
204dee708a Use libbe_build also on Haiku
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.
2013-05-09 18:08:55 +02:00
Ingo Weinhold
baadb25955 Add te MimeInfoUpdater to libbe_build 2013-05-09 03:19:25 +02:00
Ingo Weinhold
5fb3348319 MimeEntryProcessor: Add DoRecursively()
While Do() only process the specified entry, DoRecursively() also
recurses into directories.
2013-05-09 03:18:46 +02:00
Ingo Weinhold
00090d290d boot loader: print max heap usage info before entering kernel 2013-05-09 03:14:35 +02:00
Ingo Weinhold
865ab2816d Pull class MimeInfoUpdater out of UpdateMimeInfoThread
* 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.
2013-05-09 01:48:36 +02:00
Ingo Weinhold
d0815ca03b Add private MIME DB classes to libbe_build
* 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.
2013-05-08 04:39:56 +02:00
Ingo Weinhold
b6a89f410e Pull class AppMetaMimeCreator out of CreateAppMetaMimeThread
Instead of using a BMimeType to set the MIME type properties, it
operates directly on the Database object, though.
2013-05-08 01:08:16 +02:00
Ingo Weinhold
b94857b322 Refactor MIME DB access
* 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.
2013-05-07 23:15:36 +02:00
Ingo Weinhold
9cda9c9905 Move MIME DB code back from registrar to src/kits/storage/mime
* 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).
2013-05-07 17:54:29 +02:00
Ingo Weinhold
59a653b51c Support multiple MIME DB directories
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.
2013-05-07 04:43:51 +02:00
Ingo Weinhold
38e3973ecf Add private class BMergedDirectory to storage kit
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.
2013-05-07 04:43:50 +02:00
John Scipione
e28ba280de BMCPrivate: Cleanup
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.
2013-05-06 18:29:34 -04:00
John Scipione
c1a7e89fc2 Put the label truncation code back in BMenuItem.
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.
2013-05-06 17:55:33 -04:00
John Scipione
c333966291 Draw truncated menu label in BMCPrivate, fixes #9735
...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.
2013-05-06 17:15:20 -04:00
John Scipione
2bf1592a70 Rework layout-enabled contructor for BMCMenuBar
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.
2013-05-06 17:15:19 -04:00
John Scipione
d5c51ba676 Update header comments 2013-05-06 17:15:18 -04:00
John Scipione
d97b434060 Style fixes to BMenu and related classes. 2013-05-06 17:15:17 -04:00
Ingo Weinhold
7c6bff1734 Complete outsourcing of zlib
* 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.
2013-05-06 04:37:18 +02:00
Ingo Weinhold
25a7b01d15 Merge branch 'master' into package-management
Additional changes:
* Add src/system/kernel/lib/zlib, which builds a kernel version of zlib,
  needed by packagefs.
* BuildFeatures: Add a build feature "gcc2" to allow for easier checks.
* Referenceable.cpp: Include <OS.h> instead of <debugger.h>. The latter
  is not needed and prevents building for the build platform.
* zlib/zutil.h: Fix gcc 2 build. We really should use the external
  package instead.

Conflicts:
	.gitignore
	build/jam/BuildSetup
	build/jam/FileRules
	build/jam/FloppyBootImage
	build/jam/HaikuImage
	build/jam/ImageRules
	build/jam/KernelRules
	build/jam/NetBootArchive
	build/jam/OptionalBuildFeatures
	build/jam/OptionalLibPackages
	build/jam/OptionalPackageDependencies
	build/jam/OptionalPackages
	build/scripts/build_haiku_image
	configure
	data/bin/installoptionalpackage
	data/system/boot/Bootscript
	headers/os/app/Message.h
	headers/os/package/PackageInfo.h
	headers/os/package/PackageInfoAttributes.h
	headers/os/package/PackageInfoSet.h
	headers/os/package/PackageRoster.h
	headers/os/package/PackageVersion.h
	headers/os/package/hpkg/PackageInfoAttributeValue.h
	headers/os/storage/FindDirectory.h
	headers/os/storage/Node.h
	headers/os/support/StringList.h
	headers/private/system/directories.h
	src/add-ons/kernel/drivers/audio/ac97/es1370/Jamfile
	src/add-ons/kernel/file_systems/packagefs/AttributeIndex.cpp
	src/add-ons/kernel/file_systems/packagefs/Jamfile
	src/add-ons/kernel/file_systems/packagefs/Package.cpp
	src/add-ons/kernel/file_systems/packagefs/Package.h
	src/add-ons/kernel/file_systems/packagefs/PackageDomain.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageDomain.h
	src/add-ons/kernel/file_systems/packagefs/PackageFSRoot.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.h
	src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.h
	src/add-ons/kernel/file_systems/packagefs/PackageLinksDirectory.cpp
	src/add-ons/kernel/file_systems/packagefs/PackageNode.h
	src/add-ons/kernel/file_systems/packagefs/ResolvableFamily.cpp
	src/add-ons/kernel/file_systems/packagefs/Version.cpp
	src/add-ons/kernel/file_systems/packagefs/Version.h
	src/add-ons/kernel/file_systems/packagefs/Volume.cpp
	src/add-ons/kernel/file_systems/packagefs/Volume.h
	src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp
	src/add-ons/kernel/file_systems/userlandfs/shared/driver_settings.c
	src/apps/deskbar/BarApp.cpp
	src/apps/deskbar/BarMenuBar.cpp
	src/apps/deskbar/BarMenuBar.h
	src/apps/deskbar/BarView.cpp
	src/apps/deskbar/BarView.h
	src/apps/deskbar/BarWindow.cpp
	src/apps/deskbar/BarWindow.h
	src/apps/deskbar/DeskbarMenu.cpp
	src/apps/deskbar/DeskbarMenu.h
	src/apps/deskbar/DeskbarUtils.cpp
	src/apps/deskbar/DeskbarUtils.h
	src/apps/deskbar/ExpandoMenuBar.cpp
	src/apps/deskbar/ExpandoMenuBar.h
	src/apps/deskbar/TeamMenu.cpp
	src/apps/processcontroller/ProcessController.cpp
	src/apps/remotedesktop/RemoteDesktop.cpp
	src/bin/bash/config-top.h
	src/bin/finddir.c
	src/bin/package/Jamfile
	src/bin/package/command_add.cpp
	src/bin/package/command_create.cpp
	src/bin/package/command_list.cpp
	src/bin/package_repo/command_list.cpp
	src/bin/pkgman/command_refresh.cpp
	src/build/libbe/support/Jamfile
	src/build/libpackage/Jamfile
	src/build/libroot/Jamfile
	src/build/libroot/fs.cpp
	src/build/libroot/remapped_functions.h
	src/kits/locale/MutableLocaleRoster.cpp
	src/kits/opengl/GLRendererRoster.cpp
	src/kits/package/PackageInfo.cpp
	src/kits/package/PackageInfoSet.cpp
	src/kits/package/PackageRoster.cpp
	src/kits/package/PackageVersion.cpp
	src/kits/package/RepositoryCache.cpp
	src/kits/package/hpkg/PackageWriterImpl.cpp
	src/kits/package/hpkg/ReaderImplBase.cpp
	src/kits/package/hpkg/WriterImplBase.cpp
	src/kits/print/PrintTransport.cpp
	src/kits/print/Printer.cpp
	src/kits/screensaver/ScreenSaverRunner.cpp
	src/kits/support/StringList.cpp
	src/kits/tracker/ContainerWindow.cpp
	src/kits/tracker/DeskWindow.cpp
	src/kits/tracker/PoseView.cpp
	src/libs/print/libprint/Transport.cpp
	src/preferences/printers/AddPrinterDialog.cpp
	src/preferences/screensaver/ScreenSaverWindow.cpp
	src/servers/debug/DebugServer.cpp
	src/servers/input/AddOnManager.cpp
	src/servers/media_addon/MediaAddonServer.cpp
	src/system/boot/Jamfile
	src/system/boot/loader/Jamfile
	src/system/boot/loader/loader.cpp
	src/system/boot/loader/vfs.cpp
	src/system/kernel/fs/vfs.cpp
	src/system/kernel/fs/vfs_boot.cpp
	src/system/libroot/os/find_directory.cpp
	src/system/runtime_loader/runtime_loader.cpp
	src/tools/package/Jamfile
2013-05-05 15:03:26 +02:00
Rene Gollent
69d85497fd Fix update issues in BStringColumn.
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.
2013-05-04 21:17:47 -04:00
Jérôme Duval
c162f52eaa intel_extreme and radeon_hd: some 64 bit fixes 2013-05-04 20:20:33 +02:00
Jérôme Duval
dc4e3ce337 added B_PRIxOFF 2013-05-04 15:31:04 +02:00
Philippe Houdoin
1a84d6b362 Skip timeout computation in is_syscall_restarted case. 2013-05-04 11:27:04 +02:00
Jérôme Duval
843a122fd9 MediaPlayer: some 64 bit fixes 2013-05-04 11:15:41 +02:00
Jessica Hamilton
4898c615d6 BMenu: scroll marked item into view when menu has scrollers attached.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2013-05-03 21:10:51 +02:00
Axel Dörfler
4e78098e7c DatagramSocket: don't use absolute timeout 0.
* Use relative instead, or else the return value will be B_TIMED_OUT instead
  of B_WOULD_BLOCK.
* This fixes bug #9734.
2013-05-03 21:03:54 +02:00
Jérôme Duval
e5d65858f2 Fix more GCC4 narrowing conversion warnings.
* Code style would be to fix.
2013-05-03 19:42:04 +02:00
Axel Dörfler
3bf9915247 Removed superfluous class definitions from OutlineListView.h
* Why?
2013-05-03 13:24:30 +00:00
John Scipione
f56bf5b03e Add class declarations to header 2013-05-02 20:13:47 -04:00
John Scipione
01b1b8bdaa BPopUpMenu style fixes 2013-05-01 22:18:56 -04:00
Rene Gollent
736cc3dcb4 Move comment to correct function. 2013-05-01 19:52:00 -04:00
Adrien Destugues
31535ac63b Make BAboutWindow modal
* 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.
2013-05-01 10:10:37 +02:00
Rene Gollent
196ab88d06 Extend debug_create_symbol_lookup_context().
- 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.
2013-04-30 21:34:45 -04:00
John Scipione
f3decd2060 Fix #9726 Revert CenterIn() and CenterOnScreen()
... 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).
2013-04-30 20:15:33 -04:00
John Scipione
6723d9fc94 Create a BWindow::AlertPosition() method and use it
...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.
2013-04-30 20:15:32 -04:00
Adrien Destugues
fd19c7366d Fix BAboutWindow lifecycle
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.
2013-04-30 21:50:24 +02:00
Ingo Weinhold
c10119fa42 BStringList: Add Join() 2013-04-29 19:32:23 +02:00
Ingo Weinhold
87a36d2227 PackageFSMountType: Add *_ENUM_COUNT 2013-04-29 15:31:13 +02:00
John Scipione
54153cc8b2 Update CenterIn() and CenterOnScreen() methods in BWindow
* 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.
2013-04-28 20:30:21 -04:00
Ingo Weinhold
274ca38fd1 BOpenHashTable::Clear(): Set fItemCount to 0
If not empty, the count would afterwards be out of sync with reality.
2013-04-27 16:21:41 -04:00
Rene Gollent
aa366c07b1 Add an information blurb option to PromptWindow.
- PromptWindow now takes a parameter which contains optional
  informational text to display above the text control.

- Adjust callers.
2013-04-27 14:04:33 -04:00
Jérôme Duval
f92b1f2eaf GCC 4.7.x finds that 1 << 31 is a signed integer, use the unsigned notation
* error: narrowing conversion of '-2147483618' from 'int' to 'uint32 {aka long unsigned int}'
 inside { } is ill-formed in C++11
2013-04-26 21:17:33 +02:00
Ingo Weinhold
3f85cfc132 Add a few missing directory_which constants 2013-04-24 14:55:03 +02:00
Rene Gollent
c24adb2950 Rework DefaultNotificationService registration.
- 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.
2013-04-22 18:42:21 -04:00
Ingo Weinhold
237127fbe4 Fix _user_entry_ref_to_path() in chroot
* 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.
2013-04-22 18:06:28 +02:00
Ingo Weinhold
212c636f41 BSolver/LibsolvSolver: Add Update() 2013-04-21 13:55:38 +02:00
Ingo Weinhold
de62d76176 BSolver/LibsolvSolver: Add Uninstall()
Also fix incorrect check in LibsolvSolver::GetResult().
2013-04-21 12:48:39 +02:00
Ingo Weinhold
c128275ede <Archivable.h>: Fix conflict with BPackageKit::BPrivate
... when "using BPackageKit::BPrivate".
2013-04-21 12:29:41 +02:00
Ingo Weinhold
8e6c3631a3 BSolver/LibsolvSolver: Add problem solution selection support
... and re-solving.
2013-04-21 02:48:52 +02:00
Ingo Weinhold
6a1430716c BDaemonClient: Add support for creating activation transactions
* 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().
2013-04-20 21:40:11 +02:00
Ingo Weinhold
69a53ac5b4 Add DownloadFileRequest
Downloads a file and optionally checks its checksum.
2013-04-20 21:40:11 +02:00
Ingo Weinhold
e14b247176 Add StringChecksumAccessor
A ChecksumAccessor implementation for an already known checksum.
2013-04-20 21:40:09 +02:00
Ingo Weinhold
4ea7f45bc5 BRequest: Change attribute protection from private to protected
Particularly fInitStatus is of interest for derived classes.
2013-04-20 21:40:09 +02:00
Ingo Weinhold
be8f5e00f1 BPackageInfo: Add CanonicalFileName()
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)).
2013-04-20 21:40:08 +02:00
Oliver Tappe
74233e2c88 Re-apply cf0a957 for the build-version of libbe.
* fixes build on non-Haiku platforms
2013-04-20 15:16:00 +02:00
Ingo Weinhold
f71be99bd9 BRequest: Add Process()
The method creates the initial jobs for the request and processes the
jobs from the job queue until empty or an error occurs.
2013-04-20 13:26:34 +02:00
Ingo Weinhold
85d2badf00 package daemon: Add support for activation change request
* 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.
2013-04-20 01:28:18 +02:00
Ingo Weinhold
7a27bcd113 BPackageInfo: Make use of BMessage::{Add,Find}Strings() 2013-04-20 00:33:13 +02:00
Ingo Weinhold
cf0a957ff6 BMessage: Add {Add,Find}Strings()
They add a BStringList to/extract it from a B_STRING_TYPE field.
2013-04-20 00:29:24 +02:00
Ingo Weinhold
7fa369956e BOpenHashTable::Clear(): Set fItemCount to 0
If not empty, the count would afterwards be out of sync with reality.
2013-04-18 15:53:34 +02:00
Pawel Dziepak
46575667eb Merge branch 'aslr' 2013-04-17 20:07:32 +02:00
John Scipione
af84ce79da Rename B_COLOR_WHICH_COUNT to kColorWhichCount 2013-04-16 03:44:42 -04:00
Pawel Dziepak
8614737f71 elf: restore correct region protection after relocation 2013-04-16 03:44:38 +02:00
Ingo Weinhold
202c1daaed BPackageVersion: Rename property release to revision
* ... 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.
2013-04-16 00:05:19 +02:00
Alexander von Gluck IV
88e9c0961a libnetwork: Check for ipv4 flag in resolv.conf
* Add option for forced IPv4 resolution.
* Helps with #8293
* Very slightly modified patch by donn
2013-04-14 17:03:32 -05:00
Siarzhuk Zharski
1f8d927251 Make Windows-1250 encoding consistent with other
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.
2013-04-14 21:39:13 +02:00
Ingo Weinhold
e6216e372a Implement getting a BInstallationLocationInfo
* 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().
2013-04-14 17:06:26 +02:00
Ingo Weinhold
d7d9497e31 Add BInstallationLocationInfo 2013-04-14 17:06:26 +02:00
Ingo Weinhold
b2d96da589 BPackageInfoSet::Iterator: Fix NULL pointer dereference
Since the BPackageInfoSet's map is created lazily, it can be NULL when
an Iterator is constructed.
2013-04-14 17:06:25 +02:00
Ingo Weinhold
8a4ebe2c46 Make BPackageInfo archivable 2013-04-14 17:06:25 +02:00
Stefano Ceccherini
501201761b In case the BMenu is inside a BMenuField, override the items width to
span over the BMenuField's width. Note that if the BMenu is already
wider, we don't shrink it, at least for now.
Fixes #5015.
2013-04-13 10:31:20 +02:00
Rene Gollent
d04cbc3f3c Add missing const. 2013-04-12 23:28:46 -04:00
Ingo Weinhold
711a2a6eea BPackageInfoSet: Add copy constructor, assignment operator
* 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.
2013-04-13 02:08:43 +02:00
Ingo Weinhold
82ce8682f2 Add missing build header Referenceable.h 2013-04-13 02:04:00 +02:00
Ingo Weinhold
0d8ed3f2a8 BSolver::Install(): Add optional unmatched specifier return param 2013-04-12 14:21:54 +02:00