Commit Graph

9272 Commits

Author SHA1 Message Date
Adrien Destugues
759ee24c4c Game Kit: do not allocate BBuffers before initializing the Media Kit
The port pool now being created in BMediaRoster init, we must make sure
the media roster is initialized before doing anything else.

Change-Id: I5a3cc61c993e9be4078772bbf341b637d951d239
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1734
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-23 03:22:49 +00:00
Ryan Leavengood
d2a69b8bd9 Tracker: Improve pose loading speed, add comments
If a new pose is going to be placed below the current view bounds, we
definitely do not need to do any drawing. If it is above or inside the view
bounds we do this special drawing method.

Overall this method of doing updates is complicated and hard to adjust without
introducing drawing artifacts. As noted in the TODO, this should be rethought
from scratch.

But for now in one case of over 8000 files in a single directory this improved
the loading speed from about 8 or 9 seconds to 1. Queries results also load
much faster. I am testing in a VM with a single CPU on a host with an SSD, so
others may see better performance with more CPUs, or less with a spinning hard
drive.

But at least now the drawing won't be the bottleneck.

Should finally fully fix #3011, or at least good enough for close.

Change-Id: I3806ffa7674e404c9db24edb33d6ab4eb2d825f7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1726
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-21 02:10:10 +00:00
Simon South
a7536efa8b BKeymap: Add unit tests and fix issues
Add a preliminary set of unit tests for BKeymap and fix these issues:

* BKeymap::operator=() caused a crash by allocating a zero-byte array to hold
  the other object's character data.
* BKeymap::SetToCurrent() and SetToDefault() leaked memory by not freeing an
  existing character array before allocating a new one.
* BKeymap::SetToCurrent() incorrectly determined the size of the current
  keymap's character array, causing GetChars() to fail whenever the current
  keymap was loaded. Now SetToCurrent() uses the _get_key_map() private
  function, which accurately reports the size of the array.

This commit also updates a Jamfile by replacing a use of "UseHeaders" to
include private header files with the more concise and expressive
"UsePrivateHeaders".

Change-Id: If6f71b209f1bd395be57835c4dd89f0e3f845994
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1724
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-08-20 07:49:49 +00:00
Ryan Leavengood
472d26a3c0 Media Kit: Delete the PortPool in a more deliberate way
Letting it get deleted statically can cause segfaults since it is needed for
some final quit messages.

This mimic changes Axel made for the DormantNodeManager and
TimeSourceObjectManager.

I also pulled PortPool into its own file and header.

Fixes #15135.

Change-Id: Ie64753e1876d58b52f7cb95536c6be3df2e6d40c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1721
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-16 23:55:07 +00:00
Ryan Leavengood
fe08f0b3d0 Media Kit: Clear the BufferCache of buffers for disconnected clients
Without this, the BufferCache keeps a reference to these buffers inside the
media_addon_server until the media_addon_server quits, which is pretty much
never.

Should fix #4954 and #14755, and possibly #13614 and #14047, though I think
they may be something else.

Switched from std::map to our HashMap to get something which works in gcc2 and
gcc8.

Change-Id: I26463899724b9d1520d97fec785e435f536eaf3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1717
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-16 03:56:27 +00:00
Augustin Cavalier
2c4232b853 BMediaRoster: Mark publishing areas as cloneable. 2019-08-14 20:06:30 -04:00
Alexander G. M. Smith
31d70c106b package kit: Skip over future package attributes.
Ignore unknown fields (also called attributes) which are from a package
file with a different minor version number.  Previously it would halt
with an error when encountering such a field, even though it can safely
be skipped over (if it was unsafe, we would have incremented the major
version number).

The use case is a future package attribute for pre-uninstall scripts.
If they're not run, that just leaves some debris after uninstalling
(like symbolic link desktop icons).

* Use the B_NOT_SUPPORTED error code when reading unknown package
  attributes.  Don't treat it as an error if the package is a
  different minor version, just skip it.
* Print unknown package attribute index numbers rather than stopping,
  since they may be from future package file formats and can be safely
  skipped otherwise.  Mention the relevant enum so you can find it in
  the source code.  It's a pity that the previous abstraction layer
  isn't present, since it tells us what data type the attribute is
  (string, number, etc), so we could have printed its value too.

First step of two for enhancement #13427

See https://review.haiku-os.org/c/haiku/+/1504 to generate packages
with a different minor version number (second step of the enhancement).

Change-Id: I6db1897824a1713b3d5fab6fdfb990ee5923cd52
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1714
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-14 02:08:35 +00:00
Augustin Cavalier
96e64e6e14 Application Kit: Add B_CLONEABLE_AREA permission to cloned server areas.
The Media Kit needs this for overlays.
2019-08-11 15:27:51 -04:00
Augustin Cavalier
964cab4615 media: Set B_CLONEABLE_AREA where applicable.
Cloning cloned buffers seems especially strange, but
apparently it is actually done. The buffer management
code really needs to be cleaned up...
2019-08-10 17:55:27 -04:00
Ryan Leavengood
f5953f6155 Package Kit: Purposely ignore an error getting package cache
Fixes #15230.

The comment pretty much explains it. I think needing this means this code could
be redesigned, but I don't know enough yet to make that fix.

It also feels like this whole job system and Command pattern is overly
complicated when good old functions would be fine, certainly for pkgman. But
maybe this is used more heavily in HaikuDepot.
2019-08-09 23:13:52 -04:00
Ryan Leavengood
b711002d34 HaikuDepot: Set package state when loading single package
Without this, even installed packages still get an "Install" button.

Fixes #14821.

This was implemented by adding BPackageRoster::IsPackageActive. I decided to
have this take a location since GetActivePackages also did, but as noted in my
TODO comment, I think this is awkward.

It would also be nice to show the user they have a different version of a
particular package, but that would require some changes to IsPackageActive.

Change-Id: Iab0d35eb6b671a17711b0214b15164d296927e5a
Reviewed-on: https://review.haiku-os.org/c/1694
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-08-08 07:09:35 +00:00
Augustin Cavalier
dfbf1c8a0a Package Kit: Avoid discarding potential error values.
Spotted by Clang and the [[nodiscard]] patch.
2019-08-02 21:06:09 -04:00
CodeforEvolution
2846db2e99 Implement is_app_showing_modal_window()
Also do some cleanup in private headers, I can't imagine why the build
libraries would need this function.

Change-Id: Ib08810b6efe4738dad596a735d741582a3781b28
Reviewed-on: https://review.haiku-os.org/c/1670
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
2019-08-03 00:41:10 +00:00
Ryan Leavengood
5e7114c1e4 Tracker: Do a duplicate when pasting files into their own directory
Fixes #2755 (blast from the past!)

Change-Id: I5faff0563ca8c65cd78c8d1414517a652223d0fd
Reviewed-on: https://review.haiku-os.org/c/1673
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-03 00:39:05 +00:00
Ryan Leavengood
ecba7b5c7e Tracker: Ensure loading the Node works before passing to a Filter
Checking errors is important. This properly fixes #10365 and resolves a few
TODOs.

This DirectoryFilter is also used in Expander, though with a lower level
implementation that did not trigger this bug. This feels like it could be
in the the Tracker or shared kit.

Change-Id: Icd2ddc241c1879a7c4235726bf089570ba00dc0a
Reviewed-on: https://review.haiku-os.org/c/1672
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-02 04:31:43 +00:00
Augustin Cavalier
10d876dede Tracker: Add missing close-paren from previous commit. 2019-07-31 18:29:22 -04:00
Adrien Destugues
5bc378608a PVS V1039: useless use of multichar constants
Bitshifts and masks are a lot more readable here.

Change-Id: I94c8603b75d42456843a0b53bf2a0547aaffdb74
Reviewed-on: https://review.haiku-os.org/c/1669
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-31 22:00:53 +00:00
Adrien Destugues
7bdc1a190c PVS V522: PathMonitor: NULL pointer dereference
Change-Id: I77df9c18960eee0183145441d3a1bd4ceb112147
Reviewed-on: https://review.haiku-os.org/c/1662
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-29 21:31:36 +00:00
Adrien Destugues
4950607607 Add a features.h to auto enable _DEFAULT_SOURCE
Unless __STRICT_ANSI__ is defined (as it is when running the compiler in
--std=c89 or --std=c99, but not when running it without any specific
args), we can enable these by default and behave like most other
systems. I don't know why no one has done this yet despite suggesting it
multiple times and people prefer to #define _BSD_SOURCE manually
everywhere.

Remove all places in our Jamfiles and sources where it had been defined.
_DEFAULT_SOURCE is now enabled by default for all sources of Haiku, since we
let the compiler use GNU extensions (no strict C standard specified on
command line)

Use _DEFAULT_SOURCE as the define name to match current versions of
glibc. Enable it if _BSD_SOURCE is #defined in compiler flags, for
backward compatibility.

Change-Id: I6db04da5f6db437723cdfba3478f5094a69d7727
Reviewed-on: https://review.haiku-os.org/c/1633
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-07-29 20:26:46 +00:00
Augustin Cavalier
565155afa1 Remove unnecessary usages of BLocker::Sem().
Most of these should have been BLocker::InitCheck() anyway.
The one that was actually using the sem (MessageLooper)
should just store the name parameter, which simplifies
things anyway.

Done as a result of a branch where I'm experimenting
with making BLocker not even create a semaphore in
"benaphore" mode.
2019-07-27 18:31:58 -04:00
Adrien Destugues
6967695c4e PVS V547: always false comparisons
Change-Id: I1c7790ff0aa537b974bdc0fd65d76f277ea5f8cf
Reviewed-on: https://review.haiku-os.org/c/1647
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-27 15:16:31 +00:00
Murai Takashi
319c399d61 PVS V739: EOF compared with a value of the char type.
Change-Id: Icfaff590359381fbdd3bbd7993dab92111da3ed1
Reviewed-on: https://review.haiku-os.org/c/1618
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 15:47:48 +00:00
Adrien Destugues
194c483884 Move SettingsHandler to libshared
It's used by both Tracker and Codycam and others might find it useful.

Change-Id: I585d3a1bdc7f8fce7d36bedf6867464cd541ba2e
Reviewed-on: https://review.haiku-os.org/c/1637
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 15:47:48 +00:00
Adrien Destugues
72bfb14432 PVS V1028: cast result of operation instead of operands
If an overflow occurs before the cast, we can't fix it. If we cast
first, we can rely on integer promotion to make the result use the
appropriate size.

Change-Id: I7462e28422456c07f179f94d39c10c408d9bec36
Reviewed-on: https://review.haiku-os.org/c/1623
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:17:22 +00:00
Murai Takashi
e081b9cd7e PVS V611: Use delete [] for memory allocated by new [].
Change-Id: I712350ae7f742aaa8e0ea58186265fac4bbac73e
Reviewed-on: https://review.haiku-os.org/c/1627
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:09:10 +00:00
Adrien Destugues
994c85678d PVS V603: useless creation of objects
Change-Id: Ia40d26a9a5c1f4b3383b05f94eb8220fbb36583d
Reviewed-on: https://review.haiku-os.org/c/1615
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
4a1d8b1afb PVS V575: strange values passed to well known functions
Change-Id: Id6008d93777f860d0b341bcd012fe6f86c99cf35
Reviewed-on: https://review.haiku-os.org/c/1610
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
fcf7cbe79e PVS V522: null pointer dereferences
Change-Id: Iaa753ef3a93c36031789a85f87e569fc410d3304
Reviewed-on: https://review.haiku-os.org/c/1604
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:44:32 +00:00
Adrien Destugues
ca72c6784d PVS V517: two times the same comparison
Change-Id: I93bfdb8cb09d61f537228c4b0a53ee603240d00d
Reviewed-on: https://review.haiku-os.org/c/1602
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:37:25 +00:00
Adrien Destugues
1ec8732c71 PVS V506: using pointer to deallocated stack space
Change-Id: I43f7d0208f7d644d6f4274a9a718773f7a1346a0
Reviewed-on: https://review.haiku-os.org/c/1600
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:35:56 +00:00
Adrien Destugues
16d463ae1d PVS V501: redundant checks
There are some more in telnetd and agg but I'm not sure if they are
intentional, the code is so ugly there.

Change-Id: I9cc2bf8a919c3b1d6c68f2ded8622730497b0f91
Reviewed-on: https://review.haiku-os.org/c/1598
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:33:24 +00:00
Kacper Kasper
17c9e98743 TextView: add shortcuts for wordwise delete
Change-Id: Ie67f6255c3f5d9d8ccc6699ed42dd71ae593fa16
Reviewed-on: https://review.haiku-os.org/c/1573
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-14 14:14:39 +00:00
Adrien Destugues
ca68cae76f PluginManager: remove unneeded buffering.
The plugin manager was attempting to buffer the IOs. However, the ffmpeg
plugin already handles this (it reads in 64K chunks, the same size as
the buffer here, so this buffering was effectively useless), and the
media extractor already runs the decoding in a separate thread thanks to
the chunk cache. So, we do not need an extra level of buffering here.

We should leave any extra buffering to the upper layers (BMediaTrack or
Media Extractor), if it's needed, as they would have much more control
on the creation of the data io object.

Change-Id: I65b67919da107c8b910dd08f8cdb8e3745af92c7
Reviewed-on: https://review.haiku-os.org/c/1588
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-13 16:14:01 +00:00
Adrien Destugues
727e49c611 Media Kit: remove MediaExtractor::Source
The idea was that the Media Extractor could wrap the original source
given by BMediaTrack, but all operations on the data go through
MediaExtractor anyway.
We could probably move ownership of the BDataIO completely into
MediaExtractor instead.

Change-Id: I846b34b543fb983e60f6adf86cb17e835303267b
Reviewed-on: https://review.haiku-os.org/c/1587
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-13 16:14:01 +00:00
Augustin Cavalier
9d06690ede userland: Pass more sizes with ioctls where we can.
No "functional" change intended.
2019-07-11 23:41:52 -04:00
Jérôme Duval
d2e519391f Messenger: style fix.
Change-Id: I5b1b7e745de91bd1bedbbbe13faf848fdd284785
Reviewed-on: https://review.haiku-os.org/c/1565
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-07-08 18:53:48 +00:00
Augustin Cavalier
ebb0db62d1 kits: Only export private dummy copy constructors for R5 ABI.
Fixes #546 (after all these years!)
2019-07-04 15:24:23 -04:00
Augustin Cavalier
57e40b4406 Debugger: Use the BVariant default constructor in Token().
The value-based constructor does the same. Fixes an "ambiguous
call" error on ARM builds.
2019-06-17 19:59:40 -04:00
Adrien Destugues
f74f860085 BitmapButton: move from WebPositive to libshared
Remove a currently unused copy of it from HaikuDepot.

Change-Id: Idb97fae8e7190da6bc1049b3c1f1df929ea91bab
Reviewed-on: https://review.haiku-os.org/c/1506
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-06-16 14:51:01 +00:00
Augustin Cavalier
3ca2e85bfd Interface: Add casts to memcpy/memset invocations on BPoint & BRect.
Their copy constructors are exactly what GCC would generate,
but we can't remove them because doing so would make them
trivially copyable, and so they would be passed in registers
on x86_64, an ABI breakage.

So instead we have to add explicit casts to void* here.
2019-05-24 16:10:13 -04:00
Augustin Cavalier
057b69a774 Deskbar & Translation: Use assignment operator instead of memcpy. 2019-05-24 16:00:38 -04:00
Augustin Cavalier
f7397837e8 BMessage: Use assignment operator instead of memcpy().
The only non-POD types the macro is used on are BPoint, BRect, BSize,
and rgb_color, so the first change should essentially be a no-op.

The second change will technically have different behavior,
as the BMessenger copy constructor does not touch the _reserved_
field; but this shouldn't break anything, of course.
2019-05-24 14:28:19 -04:00
Augustin Cavalier
632e7fd0a8 Interface Kit: Remove no-op TARGET_PLATFORM_HAIKU_COMPATIBLE. 2019-05-24 14:25:44 -04:00
Augustin Cavalier
a1ad8af64e Change a number of sprintf to snprintf.
Fixes a number of -Werrors about format overflow from GCC 8.
2019-05-24 14:23:56 -04:00
Augustin Cavalier
1705656eac Add (void*) casts to memcpy/memset invocations to appease GCC 8.
A lot of these classes are not *technically* "trivially copyable"
for one reason or another, but in all of these cases it seems
OK to me to use memcpy/memset on them. Adding a cast to void*
tells GCC that "I know what I'm doing here" and shuts up the
warning.
2019-05-24 14:21:37 -04:00
Augustin Cavalier
7a73df5e2c Debugger: Remove needless explicit copy constructors.
These worked in identical fashion to what the default copy
constructors would be, but their mere presence marks the class
as being "non-trivially copyable," which means that memcpy'ing
it is now a -Werror on GCC 8.

We have to be careful when making this change, though: classes
which *are* trivially copyable can be passed inside registers
on x86_64, so changes like these break ABI in a dangerous way.
These classes is private, so it should not be a problem, but
for other classes (e.g. BRect, BPoint) we cannot fix them
properly right now.
2019-05-24 14:17:02 -04:00
Adrien Destugues
66cb2efaa8 Move StripeView to libshared
Change-Id: Ib8ff2f731f9d34e04854f1c2ec288a3db1036793
Reviewed-on: https://review.haiku-os.org/c/1458
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-05-21 06:55:45 +00:00
Augustin Cavalier
218a8c03cb Revert the Codec Kit.
All of Barrett's individual reverts have been squashed into this
one commit, save a few actual bugfixes.

Change-Id: Ib0a7d0a841d3ac40b1fca7372c58b7f9229bd1f0
2019-05-17 14:43:32 -04:00
François Revol
629397f222 Add basic support for loading ControlLook add-ons
app_server just passes the add-on path around.

Maybe we should make sure the add-on can be loaded when setting it.

Change-Id: I3acd3299782a22c1666bd5435dbf3d8053e359fa
Reviewed-on: https://review.haiku-os.org/c/1430
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-13 22:15:30 +00:00
François Revol
1b48852e84 Fix doxygen + whitespace
Change-Id: Ief0b2646e95841604a0396f15a054ff2086db198
2019-05-03 19:22:38 +02:00
Adrien Destugues
088cebb96f BFileGameSound: remove annoying printf.
Change-Id: If12c4031e7ec245a79cca51fe1304f6cc21f28e4
Reviewed-on: https://review.haiku-os.org/c/1415
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
2019-04-28 07:32:42 +00:00
Augustin Cavalier
f1fafe317f kernel/OS.h: Include sys/types.h instead of pthread.h.
This avoids polluting the namespace significantly. Also adjust
all files which depended on this behavior to include pthread.h
directly.
2019-04-12 15:26:25 -04:00
Augustin Cavalier
95587710d1 Debugger: Call the GCC2 get_next_argument directly.
This codepath is only hit when we are using the GCC2 demangler,
so we should not use get_next_argument which tries to autodetect
what kind of symbol this is.
2019-04-03 10:42:35 -04:00
Augustin Cavalier
ad38b80fd5 BMessage: Fix R5 checksum calculation on 64-bit.
Change-Id: I0d418883bb66c6ad9e351c955e213f5cbc975e56
Reviewed-on: https://review.haiku-os.org/c/1336
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-31 17:39:11 +00:00
Augustin Cavalier
5ffbe7d778 Change all references to "__INTEL__" to "__i386__".
They are functionally identical, but the former is a BeOS/Haiku-specfic
macro that we include in the compiler specs, and the latter is defined
by GCC.
2019-03-30 16:54:01 -04:00
Augustin Cavalier
1e60bdeab6 Remove all invocations of SetSubDirSupportedPlatformsBeOSCompatible. 2019-03-30 15:19:38 -04:00
PulkoMandy
8ff82ee2d4 sparc: fix debug support
Declare and use the correct registers to define a stack frame.

Change-Id: Ice3ba8f8715313a715f6b1cb553a6883541f5cc4
Reviewed-on: https://review.haiku-os.org/c/1327
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-03-30 15:23:15 +00:00
Alexander von Gluck IV
c085f38639 riscv64: Fill in more bulk architecture items around libroot/kernel
Change-Id: Ia2a86d8814d06950ea2d2d19d966c642d26f81d6
Reviewed-on: https://review.haiku-os.org/c/1302
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-25 17:16:03 +00:00
CodeforEvolution
e2c7bb900c Add Reboot Check to BPackageRoster
A bit of an explanation for these weirdly named functions:
LatestActivePackageInfos() returns the packages on the system that are
both installed and fully set up. When packages are in the middle of being
installed, LatestInactivePackageInfos() shows the packages in the process
of being installed. Once the installation process is done,
LatestInactivePackageInfos() returns nothing. If there are packages that
can't be fully activated without a reboot, CurrentlyActivePackageInfos()
will return the same information as LatestActivePackageInfos(), or if
everything has been installed and activated, it will return no packages.

Change-Id: Ia1814a5abda6d815c46e0b46dc812b4e7af81de3
Reviewed-on: https://review.haiku-os.org/c/1129
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-18 14:10:42 +00:00
Lee Mon
d04d9b2519 BugFix 2: fix errors found by cppcheck
Change-Id: I262af4dcf3ad1dca9d7e7d88838ae90323303c1d
Reviewed-on: https://review.haiku-os.org/c/1294
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-16 17:28:06 +00:00
Murai Takashi
5f48948f7f Roster: Fix PVS 460
Replace do...while(false) loop with while(true)... loop,
so that 'continue' at line 1968 can continue loop.

Change-Id: I4d64ff2699ad0837f29d49c63b683b134c4ccc1e
Reviewed-on: https://review.haiku-os.org/c/1149
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-03-05 22:39:24 +00:00
Zach Dykstra
579b9cd9b9 Adjust the magic incantations to fix spacing
This is my first commit, so bear with me if I've violated any standards here!

I've bumped a few offsets to fix text clipping in the Get Info window. The proper
long-term fix is to recreate this window with the layout library, but that's
a substantially larger job.

Patch set 1
Before: https://i.imgur.com/S7Pl5Qv.png
After: https://i.imgur.com/bd3H1Kw.png

Patch set 3
French: https://i.imgur.com/rpmUb5T.png
German: https://i.imgur.com/ca9DecW.png
Portuguese: https://i.imgur.com/dE8sKFI.png

The font size in the Permissions drop-down is fixed. I had previously bumped it to
12, to be inline with the default font size present in a new Haiku install. However,
that produced text clipping for French and other locales. I reverted it back to 10,
and now longer strings fit as-is.

Change-Id: I7f4412b10074c76eb5b023a231bdb6b230c8f35a
Reviewed-on: https://review.haiku-os.org/c/1073
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-28 19:10:12 +00:00
Murai Takashi
1f0635d227 Game Kit: Fix -Werror=class-memaccess
Replace memset() with media_format.Clear() to fix
-Werror=class-memaccess, pointed by gcc8.

Change-Id: I87a72ac06947e90c468deda6bf6d7bb3b5fb4003
Reviewed-on: https://review.haiku-os.org/c/1113
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-28 18:58:46 +00:00
Adrien Destugues
5629675a32 sparc: add defines and minimum set of required files
Gets the stage0 bootstrap to run.
Imlementation is probably nonsense at this point.

Change-Id: I10876efbb54314b864c0ad951152757cdb2fd366
Reviewed-on: https://review.haiku-os.org/c/1061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-23 16:30:50 +00:00
Barrett17
83a69e16c5 MediaExtractor and MediaWriter fix constness
* Fixes an ugly hack, where the codec was initialized in the
InitCheck and prevented the method to be const too.
2019-02-21 17:43:11 +01:00
Barrett17
662583b300 MediaStreamer: Extend API to support DVD navigation
* This is a general review of the code and includes a rework
 of the sniffing API.
2019-02-21 16:39:58 +01:00
Adrien Destugues
a6a6e3a842 Package kit: add likely-useful architectures
Required for bootstrapping them.

Change-Id: I179d8c73b08688946049bf18ff9151ef047e449b
Reviewed-on: https://review.haiku-os.org/c/1071
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-20 22:29:36 +00:00
Barrett17
784c192df2 AdapterIO: Don't inclue RWLocker header in public file 2019-02-17 14:22:30 +01:00
Barrett17
eb6626e962 MetaData: Implement copy constructor 2019-02-17 11:54:10 +01:00
Barrett17
d0064da6a5 MetaData: Introduce missing keys 2019-02-17 11:54:09 +01:00
Augustin Cavalier
fc8e5be1c8 HashMap: Fix the build with GCC 7. 2019-02-14 19:52:45 -05:00
Augustin Cavalier
de48af7a58 Adapt all consumers of HashSet and HashMap to the slightly-different APIs.
No functional changes intended. Tested and verified as working.

Change-Id: Iaa67c2e5f0d9aff433ac7348e63e901a6a80e589
Reviewed-on: https://review.haiku-os.org/c/1043
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-15 00:34:36 +00:00
Augustin Cavalier
eff1e73cef shared: Merge BOpenHashTable in; remove OpenTracker's OpenHashTable.
The HashMap and HashSet classes are copied from userlandfs. The
HashMap one works as-is as it's already used in userlandfs; the
HashSet does not even compile yet.

Change-Id: I1deabb54deb3f289e266794ce618948b60be58c0
Reviewed-on: https://review.haiku-os.org/c/1041
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-15 00:34:36 +00:00
Augustin Cavalier
514aaae7b1 Tracker: Remove list view menu from virtual directory window.
This reverts commit ed99a95f35.

It isn't needed now that list view sizing is dependent
on system font size.

Fixes #14897.
2019-02-11 16:07:22 -05:00
Adrien Destugues
e89985cc31 Fix drawing of B_GRAY1 bitmaps.
- Colors were reversed
- Padding was not handled properly because of a roundeing error

Add a test that shows the issue (behavior confirmed against BeOS)

Change-Id: I4c6e954fb6bdab92ad4e0e96897e78b26eb4727b
Reviewed-on: https://review.haiku-os.org/c/1025
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-02-10 09:59:38 +00:00
Adrien Destugues
7232789211 Extract parse_size function from ramdisk command.
Change-Id: If7dd36321e1ed2feb20b4c76ddaf303bc997d8b7
Reviewed-on: https://review.haiku-os.org/c/1018
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2019-02-08 07:19:26 +00:00
Murai Takashi
7db28d3803 kits/locale: Fix PVS 495
Fix memory leak when realloc() fails.

Change-Id: I9062bb177919805e9973c5afd6bc01f8fbb753b6
Reviewed-on: https://review.haiku-os.org/c/1016
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-02-07 11:43:00 +00:00
Murai Takashi
f465c7fa61 kits/midi2: Fix PVS 820
Fix memory leak when realloc() fails.

Change-Id: Ic787ca714e4a106cc22e6186078a8e72d0a0553d
Reviewed-on: https://review.haiku-os.org/c/1006
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-03 18:05:55 +00:00
Murai Takashi
6c67c7d635 support/String: Fix PVS 626
Fix memory leak when realloc() fails.

Change-Id: I5b44df57bdd251e5164938ed70412c909ce09df1
Reviewed-on: https://review.haiku-os.org/c/1004
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-03 18:05:55 +00:00
Augustin Cavalier
e5d0c9094d BView: Add a B_SCROLL_VIEW_AWARE flag.
* This indicates the view will manage whatever scrollbars are targeted
   to it.
 * Use _B_RESERVED7_ for this. It's been RESERVED since BeOS R5
   (I guess it was probably something on some older BeOS version?)
   and we don't really care about BeOS R4 ABI compatibility, so
   that should be fine.
 * Update BScrollView to not touch BScrollBar range/proportion
   when the target view has this set.
 * Update BListView to set this flag, always.

Fixes #14871.

Change-Id: I17027f3b63ef28da1e735c5393593496c415dce3
Reviewed-on: https://review.haiku-os.org/c/998
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-03 18:04:13 +00:00
Augustin Cavalier
d65ffc926c libnetapi: Remove __gNetAPIStart.
Not used by anything.
2019-02-02 13:26:18 -05:00
Augustin Cavalier
67ef9f72fc network: Utilize image_id argument to initialize_before.
We don't need to search for our own image_id, we already have it now,
so just use it.
2019-02-01 20:33:41 -05:00
Augustin Cavalier
c5e4e4ffb4 headers/kernel: Include declarations of initialization functions in image.h.
No "real" functional change, but this causes GCC7 to throw errors when
these functions are declared without the image_id argument, which
in some files they were (as this commit repairs.)

This change is largely inconsequential on x86, but on callee-cleanup-args
targets, leaving out the argument would probably cause stack corruption.
2019-02-01 20:30:39 -05:00
Augustin Cavalier
475172337b headers/kernel: Move B_WAIT_TILL_LOADED to a syscall header.
It is only used as an argument to _kern_load_image directly, not to
any of the load_image functions in image.h, so it belongs in a syscall-
specific header like other such constants.

No functional change intended.
2019-02-01 19:45:56 -05:00
Augustin Cavalier
a396188f23 BSound: Add explicit cast to bigtime_t.
Fixes the GCC2 build.
2019-02-01 11:30:08 -05:00
CodeforEvolution
aad79bda85 Implement Duration() in BSound
Change-Id: I45244cd958acd7856a065af01625d2164b9ad033
Reviewed-on: https://review.haiku-os.org/c/963
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-02-01 15:49:07 +00:00
Rob Gill
d27546c10f kits/interface Fix PVS902
*	replace unformatted printf with puts

Change-Id: I06b5f436bf51423c60ddd3cc81d86217d06c78cd
Reviewed-on: https://review.haiku-os.org/c/961
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-29 12:20:56 +00:00
Rob Gill
df9641c548 kits/Geolocation Fix PVS404
*	Prevent use of uninitialized 'lon' by checking for successful
		result prior call

Change-Id: Ifbd649a8c0c0c37f285cda11e307013929cefa12
Reviewed-on: https://review.haiku-os.org/c/958
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-28 07:27:06 +00:00
Augustin Cavalier
4854630d29 BScrollView: Resize scrollbars dynamically based on target's B_SUPPORTS_LAYOUT...
...instead of the BScrollView itself's layout flag. Thanks to Adrien and
Kacper for discussion on the mailing list.
2019-01-27 14:35:32 -05:00
Murai Takashi
1342ec2c91 Storage Kit: Fix PVS 692
Merge two if statements that has same conditional expressions
at line 198 and 201.

Change-Id: I797a77d7f2b88ae2cacd8569fdd09c0d1a19d038
Reviewed-on: https://review.haiku-os.org/c/915
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-27 16:18:06 +00:00
Adrien Destugues
20312cfe7b BSecureSocket: cleanup, no functional changes
Change-Id: I3355067efe4c5d71f8656d244e17bb11175600eb
Reviewed-on: https://review.haiku-os.org/c/910
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 07:55:55 +00:00
Adrien Destugues
1322d50732 HttpRequest: write whole request to socket
Better performance by using a single write, and some servers may not be
happy about getting so many TCP fragments for the HTTP header.

Change-Id: If7139e2a7748ea423d470676e70bd523a89031b2
Reviewed-on: https://review.haiku-os.org/c/909
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 07:55:55 +00:00
Augustin Cavalier
4bf8cf7a1b DefaultMediaTheme: Properly set control targets.
In removing the "GroupView" class and replacing it with a real BGroupView,
I missed that it its AttachedToWindow() implementation iterated over all
child controls and set their targets to themselves. It seems this is how
the Media Kit gets change messages from them, and so the lack of this
broke changing parameter values. Whoops.

But it seems that changing menu option values has been broken for a long time
(perhaps forever?), as in order for a BOptionPopUp to send messages to anything,
its AttachedToWindow() must be called (as this sets the BMenuItem's targets
to itself, so it can forward the messages.) So now that is fixed too.
2019-01-26 15:36:43 -05:00
Augustin Cavalier
9e7d077d1b Media Kit: Remove DynamicScrollView from DefaultMediaTheme.
As of the last commit, a BScrollView in layouted mode now behaves
this way by default.

Change-Id: I07bd17d6d20e494c0e2f08172c0d54b10fa5d26d
Reviewed-on: https://review.haiku-os.org/c/893
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-24 18:52:39 +00:00
Augustin Cavalier
5b0e5c0ac6 BScrollView: Automatically update the scrollbar proportions in layout mode.
Since we know what size the target view is / wants to be, we can automatically
set the range, steps, and proportion trivially. In non-layout mode, we retain
the old behavior. Applications or views that need custom scrolling behavior almost
certainly will be using BScrollBars directly and not this, so this should not be
"wasted computation" in pretty much any case.

Greatly improves the appearance and UX of the default case of a layouted
view inside a BScrollView.

Change-Id: Ia6ff6ee14df96799c579e15d274fd4c849675577
Reviewed-on: https://review.haiku-os.org/c/892
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:52:39 +00:00
Augustin Cavalier
a4f5124fcc Media Kit: Rewrite DefaultMediaTheme to use layouts.
The old fixed-rect method was very error-prone in corner-cases,
resulting in half-visible (cut off) parameters, incorrectly
sized controls, etc. on various devices, which often made it
impossible to use.

While there are still a few rough edges (scrollbar behavior could
be further improved, though it's already much better than it was before),
this method is much better than the previous one.

Fixes #11592 and related tickets.

Change-Id: I65175f760bda98e42d1fc68ba8e526470bf17c25
Reviewed-on: https://review.haiku-os.org/c/889
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-22 14:25:09 +00:00
Adrien Destugues
5f603da01a Better shape for submenu arrow
Just use BControLook where appropriate. It already provides a nice arrow
drawing function (also used in DeskBar expander and in scrollbar
buttons).

Fix second part of #8900

Changes by John Scipione:

Update menu mark and submenu arrow color with menu text color

Use text color for checkmark and submenu arrow colors, tint less black.
This means that colored bg/white text menu item will also draw a white
checkmark and submenu arrow.

Break out BMenuItem::Draw functionality into private methods _IsActive,
_LowColor() and _HighColor() methods and use them to set the mark colors.

Scale submenu arrow and checkmark with item height (which scales with
font size.)

does not align shortcuts with submenu arrows... but if you were to do
that you'd add item->Bounds().Height() / 2.

Signed-off-by: John Scipione <jscipione@gmail.com>

Change-Id: I8299094ef88bf227510b116eb1b84c261dc94723
Reviewed-on: https://review.haiku-os.org/c/341
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-14 15:59:57 +00:00
Augustin Cavalier
0a973154a8 BMenu: Look for ASCII characters < 128, not < 255.
Otherwise we will include ISO 8859-15 (é, à, etc.)
Thanks to PulkoMandy for pointing this out!
2019-01-08 19:50:52 -05:00
Augustin Cavalier
753c7e0805 freebsd11_wlan -> freebsd_wlan.
FreeBSD 12's net80211 layer contains only 2 small KPI breaks from FreeBSD 11,
so we can upgrade it, apply those 2 changes to the drivers which are affected
(as the changes are in some lesser-used functions), and then upgrade all drivers
one at a time.
2019-01-07 20:17:51 -05:00
Stephan Aßmus
954a0a0c33 Fix some cases of updating draw state while recording a BPicture
* Also implemented recording DrawString(string, length,
   BPoint[] locations), which was previously not recorded at all.
 * Also implemented playing back recently added drawing commands
   in PicturePlayer.cpp. I don't quite understand what this is
   actually used for, but it seemed it was forgotten. I just followed
   the pattern already established in the code.
 * The other important bit in this change is to update the pen
   location when it is needed while recording a BPicture. Often
   the BView will use PenLocation() in order to transmit drawing
   commands to the app_server which use absolute coordinates only.
   This isn't actually so nice, since it means the client has to
   wait for the server to transmit the current pen location. If there
   were dedicated link-commands for pen-relative drawing commands,
   the client could just keep sending without waiting for the server.
   In any case, the app_server needs to update the pen location in
   the current DrawState and even the DrawingEngine even while
   recording a picture, because some next command may need up-2-date
   state information, such as the font state and the pen location.
 * I have not yet tried to find /all/ instances where the DrawState
   needs to be updated while recording. This change should repair
   /all/ font state changes, all versions of drawing a string, and
   all versions of StrokeLine().

Change-Id: Ia0f23e7b1cd058f70f76a5849acb2d02e0f0da09
Reviewed-on: https://review.haiku-os.org/c/817
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-06 00:06:56 +00:00
Barrett17
e7933432e9 BCodecRoster: Remove MakeFormatFor
* I want to introduce a new way for plugins to
register for a format. Supporting the old FormatManager is
too painful at this point and not worth the effort.
2018-12-28 23:01:02 +01:00
Barrett17
fa911df6e6 Move FormatManager back to the media_kit
* We don't aim to replicate this functionality. I don't
think this will be useful at all in future iterations.
Originally I planned to rewrite it on top of the new
BMediaFormat, but now I am of the hopinion this is
greatly unneeded.
2018-12-28 22:55:25 +01:00
Barrett17
f3e317617f Move GetNextEncoder implementations to BCodecRoster 2018-12-28 22:24:07 +01:00
Barrett17
e98351d3bc MetaData: Revert types to uint32 and define framerate as float
* Adds some missing methods signatures.
* integer vs float framerate is a longstanging debate. In theory,
in digital a/v there should not be need for floating point framerates.
This is because unless the software is run on exoteric hardware, there
is not need for it. Unfortunately, some legacy from the past like the
29.7 hz debate (NTSC) still may need to work under floating point framerates.
Even if in pratice it'd be run at 30 hz anyway.
* In theory, to handle all those correctly we should use a rational framerate,
however most code should be rewritten to support that correctly, and
it'd add some excessive complexities.
* All integer types are reverted back to unsigned ones. There's really
no reason to use signed integers there, and more importantly the danger
for integer underflows and the attached security concerns is very big.
2018-12-27 12:26:45 +01:00
Barrett17
ec75b9fc8e MetaData: Add missing keys 2018-12-27 12:26:44 +01:00
Murai Takashi
ab6bcb08bc Roster: Fix PVS 456-459
Remove unneed if condition, since 'error' is initialized to B_OK.

Change-Id: I2fd0edb99a3d055beafaf15f1140071a31140892
Reviewed-on: https://review.haiku-os.org/798
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-25 17:49:46 +00:00
Murai Takashi
09a5380d0c CharacterSetRoster: Fix PVS 528-530
Remove unneed if conditions, since unsigned type value is never < 0.

Change-Id: I76621f79883752cd3560c6e02f18384b1ddd9cf3
Reviewed-on: https://review.haiku-os.org/797
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-25 17:49:36 +00:00
Murai Takashi
26c68df839 MediaDefs.cpp: Fix PVS 593
Remove unneed if condition, since 'size_t size' is unsigned.

Change-Id: I283afe6c1c24713b8efa21bd70747293fbc61899
Reviewed-on: https://review.haiku-os.org/796
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-25 12:36:42 +00:00
Augustin Cavalier
dba28784c2 freebsd11_network -> freebsd_network.
FreeBSD 12 has no major changes to the ifnet KPIs that constitute a
source compatibility break, save a single one related to locking
which doesn't really apply to us, and so we don't need to create
a "freebsd12_network" directory to work through the upgrades.
2018-12-24 19:49:35 -05:00
Augustin Cavalier
52a022f201 BMenu: Accept any alphanumeric ASCII character on the first trigger pass.
Since we use sentence-cased menus, there is probably only one capital
letter in the line, so looking for only capitals won't be very useful.
Instead, accept any ASCII character (< 255) which is alphanumeric,
as these are more likely to be command-able in any given keymap.

(IsAlNum returns true for accented Latin characters also, which may
be un-command-able if they require dead keys to type.)
2018-12-22 00:36:30 -05:00
Adrien Destugues
588a0c9f67 BMenu: Use BUnicodeChar for unicode char manipulation.
It is not allowed to use isspace, tolower, etc, on character outside of
the char type range (and EOF). Use BUnicodeChar instead to avoid out of
bound accesses.

Fixes the second crash in #14753.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Some changes by me to make "index" a byte instead of character index
as it needs to be.
2018-12-22 00:25:10 -05:00
Augustin Cavalier
1ac98e3ab4 BWindow: Prevent CenterIn from moving the decorator bar offscreen.
The MoveTo() call is not restricted in any way; it can easily move the
window's titlebar offscreen, which is very confusing for users as if
they don't remember the window manipulation keyboard shortcuts,
dealing with such windows is often very tricky (or impossible
if the window is actually larger than the screen.)

Now we also call MoveOnScreen with DO_NOT_RESIZE and
MOVE_IF_PARTIALLY_OFFSCREEN set, which will simply get the size of
the decorator bar and then ensure it is entirely on-screen.

Fixes #11763.
2018-12-21 12:37:10 -05:00
Augustin Cavalier
9effbd7e00 Remove some unused cruft from the early days.
These lines were added in 2002...
2018-12-15 20:26:13 -05:00
Augustin Cavalier
707c912e12 Tracker: Remove "launch broken link" cruft.
As the comment says, this was a pre-R5 (!) hack for Be's CIFS driver.
2018-12-15 18:11:20 -05:00
Augustin Cavalier
901de869a3 BDirectory: Rewrite some functions for clarity.
No functional change intended. Whoever wrote these functions before
seems to have been allergic to more than one "return" statement
in a function...
2018-12-14 18:56:53 -05:00
Augustin Cavalier
26d14a317c BDirectory: GetNextEntry() should unset entry when one is not found.
Fixes #1692.
2018-12-14 18:48:38 -05:00
Murai Takashi
e3af9ff0bf kits/tracker: Fix PVS 923
Fix 'entry' is assigned values twice successively.

Change-Id: I86456bf156eb48f3966439a854256e27ee87caaf
Reviewed-on: https://review.haiku-os.org/765
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-14 22:52:42 +00:00
Augustin Cavalier
4089701dbd interface: Remove some unreachable "break"s.
Spotted by Clang.
2018-12-09 23:04:45 -05:00
Barrett17
b6c5bdbd39 MediaFile: Properly use BMediaExtractor::GetMetaData 2018-12-07 18:53:48 +01:00
Adrien Destugues
151343ebc8 BLooper: API to hijack existing thread.
I need this to use loopers in WebKit, which spawns threads and expects
to be able to turn them into event loops later on.

This is the pattern already used in BApplication, we may as well make it
available elsewhere.

Change-Id: I5939ca89d33cb3bcc92567b302c2038d976af598
Reviewed-on: https://review.haiku-os.org/735
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-02 21:36:31 +00:00
Barrett17
b6802a9530 MetaData: Remove support for uint32 keys
* We try to conform to what ffmpeg does, it is
unuseful to support metadata keys formats which
aren't really used anywhere.
* Add TODO with some infos for future improvements.
2018-12-01 12:30:54 +01:00
Murai Takashi
f0a1a07c73 RegionSupport: Fix PVS 338-346
Fix 'true / false' value is implicitly cast to the integer type.

Change-Id: I2f72fcd34d2d97d20e2a98ed5efe25919a485c9d
Reviewed-on: https://review.haiku-os.org/739
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-30 21:13:14 +00:00
Barrett17
278d03da22 media_kit: Remove most private dependencies from codec_kit
* Move to BCodecKit namespace and make extensive use
of BCodecRoster.
* This is a first step in the right direction of
decreasing private dependencies. Some APIs are being
translated to the CodecKit. I am doing an investigation
on which APIs are really used among apps, so that the new
kit can be more slim and oriented toward easy development
and can be extended in the right direction instead to
continue maintaning unuseful code.
* BMediaFormats needs still a bit of love.
* General improvements in style and code maintainability.
2018-11-27 11:38:05 +01:00
Barrett17
fe9542fdb5 BCodecRoster: Add useful functionality from MediaFormats 2018-11-27 11:38:05 +01:00
Barrett17
d33bd9ec7b Codec Kit: Introduce BCodecKit namespace 2018-11-27 11:38:04 +01:00
Barrett17
f20ff4faec CodecRoster: Add GetDecoderInfo 2018-11-26 07:41:27 +01:00
Augustin Cavalier
aa6411e23e libnetwork: Move from src/kits to src/system.
Properly speaking, this is part of POSIX and not of the Be-style
"kits", and so it should live in system/ alongside libroot.
No functional change intended.

Change-Id: I0fcf78a09c76e220ad4f1719d147978ef4a3bc52
Reviewed-on: https://review.haiku-os.org/726
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-25 17:49:00 +00:00
Barrett17
1b96c34179 ChunkProvider/ChunkWriter: Move method to protected
* Remove inline destructor.
2018-11-25 14:07:46 +01:00
Barrett17
ee09c29148 Media Kit: Update private code 2018-11-25 13:02:02 +01:00
Barrett17
be805d02d7 Codec Kit: Rename classes to BFoo pattern 2018-11-25 13:02:02 +01:00
Barrett17
082e4ae4a7 Codec Kit: Rename files 2018-11-25 13:02:02 +01:00
Augustin Cavalier
df4074fbed Remove a lot of unused constants.
Spotted by Clang. No functional change intended.
2018-11-24 19:21:16 -05:00
Murai Takashi
137ac19964 String.cpp: Fix PVS 625
Fix 'newBuffer' is assigned values twice successively.

Change-Id: Id6ec9d40ba279a68e17922931098a6a908eb7156
Reviewed-on: https://review.haiku-os.org/728
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-24 12:04:41 +00:00
Murai Takashi
a9002af95e UndoBuffer.cpp: Fix PVS 471
Fix 'fTypedText' is assigned values twice successively.

Change-Id: Ibadf2fced0f448441e541293d04b86bc14909c35
Reviewed-on: https://review.haiku-os.org/729
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-24 12:04:32 +00:00
Augustin Cavalier
62c7ec5c06 Fix various instances of -Wset-but-unused.
Largely no functional change; most of these are just
removing the unused variables.
2018-11-23 18:04:38 -05:00
Barrett17
e0a6d5ceeb MediaClient: Fix -Werror=set-but-unused
* The error wasn't checked.
2018-11-23 23:46:31 +01:00
Murai Takashi
26b2733af3 Locale kit: Fix PVS 550, 551
Use BStackOrHeapArray instead of applying auto_ptr to array.

Change-Id: I204dcb97a1bc2d047783bc6015f86b36ca0cc15b
Reviewed-on: https://review.haiku-os.org/725
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-23 18:57:02 +00:00
Barrett17
44fc903a8f Codec Kit: Introduce BCodecRoster
* This class include almost everything you need to
manage codecs and iterate over them.
2018-11-22 17:41:26 +01:00
Barrett17
af34e7abcc Codec Kit: Beauty fixes 2018-11-22 09:47:11 +01:00
Barrett17
32bcb26dfc Remove inadvently added merge-conflict file
* Sorry about that, I've been splitting the
commits and it did end up here.
2018-11-21 17:35:04 +01:00
Barrett17
b1c8bb2c46 MediaFile/MediaTrack: Use MetaData API internally 2018-11-21 17:24:33 +01:00
Barrett17
608c9d9ae1 Codek Kit: Introduce BMetaData in Writer/MediaWriter
* Remove SetCopyright as well.
2018-11-21 17:22:58 +01:00
Barrett17
9b50ad1db8 MediaFile/MediaTrack: Use metadata to retrieve copyright 2018-11-21 16:57:05 +01:00
Barrett17
3e8f721b3b Codec Kit: Introduce BMetaData in Reader/Extractor
* Remove superfluous Copyright method.
2018-11-21 16:55:02 +01:00
Barrett17
9bbd53a288 BMetaData: Add missing functionality
* Add more metadata keys needed to support ffmpeg.
* Implement methods allowing to embed BMetaData into
BMetaData.
* Add methods to handle more types.
2018-11-21 16:51:19 +01:00
Barrett17
f722040584 BMetaData: Finalize implementation
* Use string keys. I am still convinced we need BValue.
* Use boolean instead of status_t in return, this is
much more handy in pratical use given that there's no
really a status to check.
2018-11-21 12:46:54 +01:00
Augustin Cavalier
2897df9676 bluetooth: ioctls always pass size on Haiku. 2018-11-18 14:42:09 -05:00
Augustin Cavalier
966c60f355 BMetaData: Fix GCC7 build. 2018-11-18 13:04:10 -05:00
Barrett17
1f2ddf2fd0 Codec Kit: Initial BMetaData implementation 2018-11-18 16:57:12 +01:00
Barrett17
b4d8bbd540 Codec Kit: Move Managers to private headers
* Those classes are not ready for public consumption. Ideally,
I'd add a well designed BCodecRoster wrapping them. This is part
of the general cleanup I am doing to get the code in a good state
before going to finalize the design.
* I don't plan to reintroduce BMediaFile in the media2 API, and
I'd like to remove any (explicit) usage of entry_refs and things
like that.
* I plan to introduce BMetaData and BMediaFormat which is going
to be different than what we do now.
* We need to explicitly use the mime type when it's available and
it is another design consideration when CodecRoster will be introduced.
2018-11-18 13:15:35 +01:00
Barrett17
3fe994ba28 MediaExtractor: Move stream_info to private 2018-11-18 12:53:14 +01:00
Barrett17
121db87f5f Revert "codec_kit: Remove Perform"
This reverts commit a9ccd74af7.
2018-11-18 12:06:14 +01:00
Augustin Cavalier
9cc0f06a01 kernel: Remove the B_KERNEL_AREA protection flag.
It is now no longer used.
2018-11-17 16:46:49 -05:00
Barrett17
a9ccd74af7 codec_kit: Remove Perform
* Undocumented and apparently unuseful pattern.
2018-11-17 18:42:50 +01:00
Barrett17
9d90a8381d StreamerPlugin: Add ctor 2018-11-17 18:39:39 +01:00
Adrien Destugues
a4ba432352 Fix line counting in StringView.cpp
- if fText is an empty string, we would start searching past its end,
  possibly leading to a crash (noticed this in HaikuDepot).
- if fText is NULL, BString would report a size of 0 lines, it makes
  more sense to report a size of 1 line.
2018-11-17 14:12:25 +01:00
Augustin Cavalier
05f730b0f8 More WriteAttr -> WriteAttrString cleanup across the tree.
Some of these were correct as they were ... but most weren't.
There are a variety of other correct ones I didn't change over yet
that someone else probably should (GCI task?).
2018-11-11 16:22:10 -05:00
Peter Kosyh
fea29e79c7 write_read_attr: fix truncated B_MAIL_ATTR_STATUS
This fix garbage attributes on e-mail messages on status changes.

Change-Id: I5293a0e71a1b84c04889fa3375488b0075aad12e
Reviewed-on: https://review.haiku-os.org/682
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-11-11 14:26:55 +00:00
Axel Dörfler
b791e997bf Tracker: Improved NavIcon spacing
* The spacing between icon and text now scales with the font size, too.
2018-11-05 22:41:32 +00:00
Axel Dörfler
a55e9f5235 Tracker: NavMenu icons scale with font size
* Moved icon size computation into separate utility function.
2018-11-05 22:20:55 +00:00
Axel Dörfler
fa584266d5 Tracker: Simplified test; fColumnList cannot be NULL 2018-11-05 22:20:55 +00:00
Kacper Kasper
35a074e071 BStringView: fix #14680 2018-11-05 19:41:38 +01:00
Augustin Cavalier
6ccc2b9f89 Tracker: Add some missing NULL checks.
Fixes #14685.
2018-11-04 15:38:21 -05:00
Axel Dörfler
efafab643c Deskbar: Resizable tray
* Adds max width and height arguments to
  instantiate_deskbar_(item|entry).
* Old applications just stay with a 16x16 scaled icon, though.
* All used apps within the repository are converted to the new call
  besides the input_server input method icon (that will need further
  API changes in the input_server).

Change-Id: I29cc439396917be2c24135888459d31364997dff
Reviewed-on: https://review.haiku-os.org/656
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-04 19:00:49 +00:00
Axel Dörfler
0f03d737b9 Tracker: List view icons now grow with font size
* This also removes the mini/large icon mode for list views; it's now
  simply always matching your font size.

Change-Id: Ieedd86cc3a50dd0f950d97bbd9839384d44f8bd3
Reviewed-on: https://review.haiku-os.org/662
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-04 17:36:50 +00:00
Axel Dörfler
5fd3bc6d2c BDeskbar: Moved constants to shared header
* Instead of duplicating them in different files.
2018-11-03 20:03:15 +00:00
Kacper Kasper
800e6fe412 BStringView: add support for multiline strings
* Actually draw the string at the bottom of the frame.
* Unfortunately BStringList cannot be cached because there is no
  space left in the class.
* Change SGI and PNG translators to use it in place of BTextView.

Change-Id: I07e12bf1a8dc956d18c9624604c7b63453ad15a2
Reviewed-on: https://review.haiku-os.org/620
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-03 16:44:10 +00:00
Adrien Destugues
ffd9d565d2 BDate: do not use strftime
Using BDateFimeFormat avoids going through libroot and up again to ICU
throuhg the locale add-on. Moreover, it uses the Locale settings
directly instead of relying on the LC_* environment variables.

Fixes day names in Web+ history menu always showing in english. Tnaks to
Oco for noticing!

Change-Id: I0c7f321a6147e8f5ab31f82de836c5ad23bb321b
Reviewed-on: https://review.haiku-os.org/650
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-01 23:03:41 +00:00
Alexander G. M. Smith
78b0cfc712 Remove debug printf from BListView.
Change-Id: Ic3f3359305e066c27bfb071cc18a455d6f1c179f
Reviewed-on: https://review.haiku-os.org/648
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-10-30 22:46:08 +00:00
Barrett17
7257735529 codec_kit: Some more style and cosmetic fixes 2018-10-29 10:15:26 +01:00
Barrett17
5e4fd31ed7 codec_kit: Style fixes
* Remove superfluous newlines at EOF.
* Add newlines in file's head.
2018-10-28 16:26:27 +01:00
Barrett17
8ccd9c0741 codec_kit: Add some padding 2018-10-28 16:14:25 +01:00
Barrett17
de42fb602e Welcome Codec Kit!
* Fix MediaDebug header.
* Add codec lib name mapping.
2018-10-24 16:12:10 +02:00
Barrett17
50cb5283a0 media/codec: Share media_format defs until libmedia2.so 2018-10-24 16:12:04 +02:00
Barrett17
df2639bf60 Move adapter_kit API to libcodec.so 2018-10-24 16:12:04 +02:00
Barrett17
1275248a77 codec_kit: First half
* Move all codec stuff into libcodec.so
2018-10-24 16:12:03 +02:00
Humdinger
bc622f6b59 Fix missing localization
This addresses some of what's reported in ticket #14637.

* Keymap preferences: Localize key labels. Translators have
  to be careful not too use too long words here...

* Media preferences: Fix typo "SoundFonts" -> "SoundFont"
  The two popup menus, Video input/output, both use "<none>",
  which when the catkeys are collected is reduced to one item.
  Apparently, Italian likes to have different tranlsations for
  them. I hope to fix that by using B_TRANSLATE_COMMENT with
  differing comments. Not sure if that'll work...

* Network preferences: Localize "on/off" and "Enable/Disable"
  in the Services.

* Repositories preferences:
  Add RepoRow.cpp to DoCatalogs.

* Shortcuts preferences: Localize "Left/Right/Both/Either/None"

* Bluetooth replicant: Localize menu items and alerts.

* DeskCalc: Localize button names.

* HaikuDepot:
  - Use BStringFormat and variables to replace for the WorkStatusView.
  - Put package name in single quotes; nicer if you have package names
    with spaces.
  - Avoid leading and trailing spaces in translatable strings. Those
    can be overlooked b the translator.
  - Use B_UTF8_ELLIPSIS instead of "...".

Change-Id: Ia32908f9faad5188aa87c918c31229277decbda9
Reviewed-on: https://review.haiku-os.org/631
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-10-24 09:01:06 +00:00
Barrett17
b84955d416 media: Remove debug.h, finalize MediaDebug.h
* Funny rust from 0 AD.
2018-10-23 15:19:14 +02:00
Augustin Cavalier
7deac31935 interface: Fix -Wuninitialized in RegionSupport.
Also trim trailing spaces...
2018-10-17 18:05:06 -04:00
Murai Takashi
5723e0b250 RegionSupport: Fix memory leak
In XXorRegion(), memory allocated in if statement might be leaked.
Pointed by Clang Static Analyzer.

Change-Id: I6b8b68bc5fea7b7c1fd354f05f03d3ebb0b11b62
Reviewed-on: https://review.haiku-os.org/633
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-10-17 11:42:58 +00:00
Murai Takashi
5475c081e2 AddResource(): use index instead of count
In AddResource(), parameter 'index' is not used.
It seems AddItem() use index instead of count.

Change-Id: I997ac96b7d32c5705606cdbf23c7fd71550c9aa6
Reviewed-on: https://review.haiku-os.org/630
Reviewed-by: Rene Gollent <rene@gollent.com>
2018-10-15 12:33:24 +00:00
Murai Takashi
af567e32be storage_support.cpp: add NULL check
check_path_name() had NULL check of path, but its result was not used.
So, add if statement to return B_BAD_VALUE when path is NULL.

Change-Id: I8ceec5d592267bf0f00f606eba44c0ecaef5a209
Reviewed-on: https://review.haiku-os.org/628
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-10-14 17:34:05 +00:00
Alexander von Gluck IV
20e420cdbe kits/shared/JsonTextWriter: Correct misaligned while compare 2018-10-08 15:23:10 -05:00
François Revol
4a3dae2bac package kit: add a NULL check on requests
This avoid crashing on malformed repository URL (like missing http://).
2018-10-08 00:56:11 +02:00
Andrew Lindesay
15fed7905d Json : Fix String Writer
Tidy-up and correct logic around writing JSON
encoded strings.

related #13832

Change-Id: I1eca33e11dff4457f85a896c02331c1cd9ae1110
Reviewed-on: https://review.haiku-os.org/617
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-10-06 19:58:35 +00:00
Augustin Cavalier
906af5f58c storage: When fs_mount_volume returns < 0, it's a status_t.
The "mount" command which calls fs_mount_volume direclty handled this
properly, but this class did not; which meant that user-visible error
messages about partitions failing to mount just said "general system error"
instead of the real one.

Fixes #14540.
2018-10-06 14:23:16 -04:00
Kacper Kasper
ebb4be2aef Make spinner buttons look consistent with other controls
Change-Id: Icb29772c91687f4c7e4795a726636cf588b83f16
Reviewed-on: https://review.haiku-os.org/610
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-10-02 19:24:23 +00:00
CodeforEvolution
106ae4ec35 Remove Curl, Switch to NetApi in Package Kit
Change-Id: I92213ab60dc987175c323d1d9ed11ac8b3517f2f
Reviewed-on: https://review.haiku-os.org/475
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-29 17:23:52 +00:00
Augustin Cavalier
48a6df083d Tracker: Eliminate the double border in the OpenWithWindow.
Change-Id: I43e9b15c4cd7f4986fa7c1231cc8ca89676866bf
Reviewed-on: https://review.haiku-os.org/575
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 23:21:36 +00:00
Augustin Cavalier
497f099f5a Tracker: Clean up AddPoses threads properly.
They may still be running at the point we detach from the window, and
as we stop watching everything else at that point (and the threads
themselves depend on the window looper as the global "lock"), we
need to tear them down then.

We especially cannot do this in the destructor, as there are some
virtual methods that the threads need during their teardown which
obviously will not work in ~BPoseView.

Fixes #13371, and potentially other Tracker crashes that occured
as a result of closing the window while the add-poses tasks were
still operational.

Change-Id: Ib7ec0d1d413096be899a05887399f5b087eb8f99
Reviewed-on: https://review.haiku-os.org/574
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 23:21:36 +00:00
Augustin Cavalier
f436972c14 BString: Treat NULL passed as replaceWith as an empty string.
Fixes the tests added in the previous commit, and also #8552.

Change-Id: Idf9459474bc66054f94cf66065ed6fcf9c60cece
Reviewed-on: https://review.haiku-os.org/572
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 17:57:02 +00:00
Augustin Cavalier
043b00fb2c BNetworkDevice: Fix memory leaks and address comments.
Thanks Axel and Jerome for the reviews!

Change-Id: I4f116c540cf59ba74b79d9d2f95ed40edc9c4174
Reviewed-on: https://review.haiku-os.org/557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 19:53:33 +00:00
Augustin Cavalier
4e5aaaa700 BNetworkDevice: Implement Scan().
This depends on the previous commit to return the correct error code
from ioctl().

If there are no VAPs running (which is the case after a forced disconnect
from an access point), scans will fail. In that case, we call
IEEE80211_IOC_HAIKU_COMPAT_WLAN_UP, which will restart a VAP, and then
initiate the scan.

Change-Id: I732aefe67e386dbb0ed3d232ed9deda678132601
Reviewed-on: https://review.haiku-os.org/551
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 04:13:19 +00:00
Janus
aa39f874dc BColumnListView: hscrollbar matches visible columns
* _VirtualWidth() ignores invisible columns
   This makes the horizontal scrollbar match the width of the visible columns.
   Also trigger an initial update of the scrollbars.
* Fixes #14480

Change-Id: I7d4b27a8fdca58c150ac47f9b948b127fb275fdf
Reviewed-on: https://review.haiku-os.org/543
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-09-12 11:53:09 +00:00
Augustin Cavalier
c3ac0a72a6 BMenuItem: Remove ourselves from the super menu on destruct.
This fixes the (intermittently) crashing test added in the previous commit,
and should also fix #12024 and #14348.

Note that this is a slight behavioral departure from BeOS, though since
BeOS crashed when this was done previously, it shouldn't cause any
other problems.

Change-Id: I90b6132ff7741b8d6cb601375a9b11fc3ffacb40
Reviewed-on: https://review.haiku-os.org/541
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-12 01:15:48 +00:00
David Murphy
81d0a0e0a7 BColumnListView: Always update the reference rect in ::FindVisibleRect...
...if the row is present in the list, but continue to return false if the
row is not currently visible on the screen.

Part of #11675. Cherry-picked from https://review.haiku-os.org/442.
2018-09-11 18:59:32 -04:00
Andrew Lindesay
a609673ce8 Support : Fixes for Relative URL Handling
When URLs combine a base URL with a relative part, the relative part's
path component was being pre-processed.  This removed any ".." from the
path and in some cases in the unit test cases, the ".." should have been
retained and then only later applied to the base URL.  This changes
fixes this so that the relative part is not pre-processed and is applied
with it's path in a raw state.

Completes Fixes for #14377
Change-Id: I9cebb8599889494e11f40a3b54c87ebca3ed1a21
Reviewed-on: https://review.haiku-os.org/529
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-09-11 18:39:53 +00:00
JackBurton79
5706737797 PictureDataWriter: Fix invert rect.
Resetting the drawing mode to B_OP_COPY was not right, since the previous mode could be anything.
Use WritePush/PopState() instead.

Change-Id: If9cba2c46bf372fd0164d951fcc49696cf72d576
2018-09-10 16:14:49 +02:00
Andrew Lindesay
3cc5e76f2d Support : Fixes for Verbatim Regeneration of URL String Form
A URL in string form should be able to be parsed and then verbatim
regenerated according to 'UrlTest'.  This change fixes this ability
for the case where there is a '?' initiating a query or a '//'
initiating a host/authority section.

Partly Fixes #14377

Change-Id: I6547253c3cdc22d79514edf75284e9725d1a2d17
Reviewed-on: https://review.haiku-os.org/512
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-09-05 09:05:10 +00:00
Jérôme Duval
89780a095e ZstdCompressionAlgorithm: handle ZSTD_error_dstSize_tooSmall.
Change-Id: Ib6dca7ac8457afae845fad24514945b4ecd521cc
Reviewed-on: https://review.haiku-os.org/509
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-09-04 12:33:14 +00:00