Commit Graph

9272 Commits

Author SHA1 Message Date
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
Augustin Cavalier
e54f86aa6a libshared: Change string_for_rate to use KiB/s instead of Kbps.
string_for_size uses KiB, etc., and so when the two are combined (e.g.
pkgman's progress display), it looked especially strange to have two
different units.
2018-09-02 00:10:30 -04:00
Augustin Cavalier
372195500d Versioning: Add BETA_1 and PRE_BETA_2 version constants.
* PRE_BETA_2 is now the default in master.
 * For libbe: R1/alpha4 used internal=8, but nobody bumped master
   at the same time, so now we are on internal=9.
2018-08-28 00:21:13 -04:00
Augustin Cavalier
8636e31a55 BNotification: Fix copy-n-paste bug in OnClickRefAt.
Fixes #14405.
2018-08-26 13:48:51 -04:00
Andrew Lindesay
8f30879b98 Support : Validation for Host Portion of URL
Partly Fixes #14377

Change-Id: Ia611d3653d2c16c6dcdc48ce57bd61bb6e6db366
Reviewed-on: https://review.haiku-os.org/476
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-08-25 18:50:36 +00:00
JackBurton79
6ec69f4426 Small style fixes
Change-Id: I1db785122efe70e416b4073c06148c856c5a5e8d
2018-08-23 13:55:09 +02:00
Rene Gollent
fc48ae3f80 Debugger: Fix #14375, #12343.
TeamDebugger:
- When a job is aborted, instead of calling into the user interface directly
  to reset the status message, post a message to do so. Also, only post the
  message if we aren't already in a terminating state. Otherwise, if jobs
  were still running while the team debugger is executing its destructor, it
  would attempt to make calls to the already destroyed user interface. This
  bug has likely been with us for quite some time, but was hidden by incorrect
  ref counting in the past (see #12343).
2018-08-20 16:44:20 -04:00
Adrien Destugues
44cff45d3d HttpRequest: chunk length are in hex
Thanks to mmlr for spotting this. The wrong format specifier was used,
which would lead the server to get the wrong size and do strange things.

Chunked uploads should now work a lot better.

While I was at it, put the line termination in the printf to save a
write to the socket (these are unbuffered and each of them costs us a
syscall, and in some cases this has been found to confuse webservers as
we end up sending super small TCP packets).
2018-08-20 08:02:34 +02:00
Murai Takashi
3a50df1bd0 Network kit: Fix -Wformat-overflow
Increase array size, since gcc8 x86_64 warns 'sprintf' output
between 2 and 20 bytes into a destination of size 16
[-Werror=format-overflow=].

Change-Id: I641db97d963b64b0c3434cd498f29f4dcb61c373
Reviewed-on: https://review.haiku-os.org/472
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-19 20:35:53 +00:00
John Scipione
466b81b6c2 Window: Max-Zoom windows with Shift+Ctrl+Alt+Z
Since hrev52136 holding Shift while clicking the zoom button will
ignore the Deskbar and resize the window to take whole screen area
(the original behavior).
It'd be nice if the keyboard shortcut for zooming - Ctrl+Alt+Z
recognized an additionally held Shift in the same way.

Add shortcut to window.

Fixes #14365

Change-Id: I919ff2c3e8c41e022f8c675ea631daf18ff41eb3
Reviewed-on: https://review.haiku-os.org/470
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-16 20:30:48 +00:00
Augustin Cavalier
fd25b902be BControlLook: Add FBC padding.
Fixes #14295.
2018-08-14 13:54:37 -04:00
Augustin Cavalier
0e44a703e5 BTabView: Don't assume BControlLook is in BPrivate.
Eventually it won't be, and we have a "using" directive so it is
accessible from the global namespace, so we can make this change
already.
2018-08-14 13:54:36 -04:00
Augustin Cavalier
7457ccb4b2 BMessageFormat: Rename to BStringFormat.
The ICU class is named MessageFormat, but on Haiku, it sounds too much
like something related to BMessage (which it isn't in the slightest)
and not part of the Locale system. It works almost entirely with BStrings,
so naming it BStringFormat makes much more sense.

OK'ed by PulkoMandy and Humdinger.
2018-08-13 20:49:00 -04:00
Sean Healy
2f3e1117f9 BOutlineListView::EachItemUnder gets too many items
EachItemUnder selects items that are not in fact under the superitem
passed to the method.

ticket: #13730
Change-Id: I12a2e29204e1b9bbecd5704e60a02e3613a7f4fd
Reviewed-on: https://review.haiku-os.org/52
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-11 23:15:10 +00:00
Jérôme Duval
81375d4fbb Package Kit: add Zstd compression.
Change-Id: Idbdb7cf1bde659046a88ea69a76e3b5fc4cd7013
Reviewed-on: https://review.haiku-os.org/323
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2018-08-11 23:10:00 +00:00
Murai Takashi
00cbe4ccca Replace strncpy with strlcpy
Since destination size equals number of characters to copy.
Pointed out by gcc8. [-Werror=stringop-truncation]

Change-Id: I8f2118129ec2324bb1f93857f5abfdf121c864f0
Reviewed-on: https://review.haiku-os.org/450
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Skipp_OSX <jscipione@gmail.com>
2018-08-10 00:17:07 +00:00
Rene Gollent
57893202f1 Debugger: Fix #14321.
DIESubprogram:
- Adjust to inherit from DIENamespace, as gcc can and will use it as a
  container in some circumstances.

DIEClassBaseType:
- Add accessor for member functions.

DwarfImageDebugInfo:
- Adjust recursive walking for types to take into account any DIENamespace,
  not just DW_TAG_namespace specifically.
- Factor out adding function to list into a helper.
- When retrieving the list of functions, perform a similar recursive walk as is
  done when building the types table, as some subprograms are apparently not
  always added to the root compilation unit entry. Curiously, this behavior
  seems to be relatively specific to a struct/class type declared inside a
  function in GCC's case, but based on the DWARF spec, there does not appear to
  be any specific restriction as far as where these can be nested, so be a bit
  more paranoid to ensure we don't encounter similar cases in the future.
2018-08-07 22:28:04 -04:00
Augustin Cavalier
0779294800 Package Kit: Fix logic reversal in PackageInfoStringBuilder.
This function is used when serializing a BPackageInfo object, which is not
done very often, and flags are used even less often. But both of these things
are done for the system packages, as they have the "system_package" flag
set, and are processed by "update_package_requires", and so this meant
that the "system_package" flag was turned into the "approve_license" flag.
2018-08-05 18:26:41 -04:00
Jérôme Duval
9a90ee3a38 Revert "Switch default fixed font from NotoMono to NotoSansMono"
This reverts commit b2acee1cb9.

Reason: NotoSansMono is not per se a fixed font.
2018-08-02 14:19:33 +02:00
Humdinger
b2acee1cb9 Switch default fixed font from NotoMono to NotoSansMono
Change-Id: Ib9eab5a2e266393b234cf7f4a6934fd58e31c943
Reviewed-on: https://review.haiku-os.org/48
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-08-02 10:43:57 +00:00
Augustin Cavalier
a31d07a2a9 libnetapi: Fix style issues in previous commit. 2018-08-01 22:50:08 -04:00
Augustin Cavalier
0dc3ab4f37 libnetapi: Do not use the freebsd11_network headers globally.
Since they were being Use'd at global scope, the FreeBSD versions
of a number of POSIX headers were being used instead of the POSIX ones,
which breaks the build on non-x86 as these headers presently do not work
elsewhere.

Instead, just include the base directory, and then include the compat
headers manually in the one place that actually requires them.
Also fix all the other files that expected errno.h and others to
be included implicitly, which they now are not.

This should fix the PowerPC and (part of the) ARM builds.
2018-08-01 22:35:47 -04:00
Augustin Cavalier
b3b69f8178 netresolv: Merge a patch to getaddrinfo from NetBSD.
This block was originally disabled in libbind, and we enabled it
independently; and so did NetBSD. But they also made one other
fix:

From: christos <christos@netbsd.org>
Date: Thu, 28 Dec 2017 15:12:15 +0000
Subject: [PATCH] PR/52837: Michael Kaufmann: getaddrinfo() resolves "127.0.0.1
 www.example.com" to 127.0.0.1. Apply the patch from FreeBSD and explain the
 rationale.
2018-08-01 18:23:15 -04:00
Augustin Cavalier
c9431a6752 netresolv: Mark code changes with __HAIKU__.
I attempted to merge NetBSD's new irs code, but their changes turned
out to be too invasive to do trivially, but in the process I had to
read our commit logs to find what we've changed, so at least I can
mark that.
2018-08-01 18:23:15 -04:00
Augustin Cavalier
4cc9ce9ddd netresolv: Merge patches from 2017 to current HEAD.
Commits merged from the semi-official Git mirror of NetBSD
trunk (https://github.com/IIJ-NetBSD/netbsd-src/).

Commit authors/messages in chronological order follow:
---------------------------------------
From: christos <christos@netbsd.org>
Date: Thu, 28 Sep 2017 23:32:01 +0000
Subject: [PATCH] PR/52578: Benjamin M. Schwartz Set the AD bit when DNSSEC is
 enabled (RFC 6840 Section 5.7).

From: lukem <lukem@netbsd.org>
Date: Fri, 2 Mar 2018 06:31:53 +0000
Subject: [PATCH] PR/48585: Set errno when returning NULL for AF_INET
In inet_ntop4(), errno wasn't set before returning NULL.
Seems like an oversight in the existing fix for PR/48585.
Noticed by code inspection.
2018-08-01 18:23:15 -04:00
Fredrik Holmqvist
004094b574 Bug found by unused-but-set-variable, entry should be updated
Verfied by DeadYak
2018-08-01 18:22:49 +02:00
Barrett17
2d93cf97c7 AdapterIO: Fix -Wtautological compare.
* B_MEDIA_SEEKABLE was once a flag with one bit set. Due
to the complexity of streaming mediums, I had to split
this flag into B_MEDIA_SEEK_BACKWARD and B_MEDIA_SEEK_FORWARD
and never noticed that this broke the flag check.

* Reported by Murai Takashi through gcc8.
2018-07-31 23:41:12 +02:00
JackBurton79
55557aa162 CURLOPT_XFERINFOFUNCTION is available since libcurl 7.32.0 only.
Since it's just cosmetic, allow compiling with older libcurl, too.
fixes build on RedHat/CentOS 7

Change-Id: I169ad84d15e61012d1d38a9b41af7eef81683bf7
2018-07-27 17:21:14 +00:00
John Scipione
fb7812fab0 BWindow: default Zoom() maximizes window when shift held down
In hrev51623 the default BWindow::Zoom() method was changed to respect
Deskbar, that is to say that the Window will zoom to screen area minus
the area taken up by Deskbar.

Some have complained that they miss the old maximize to full screen
frame behavior. This commit updates the default BWindow::Zoom() method
so that pressing Shift+zoom will maximize the window ignoring Deskbar,
the window will resize itself to take up the entire screen frame.

Note that if you override Zoom() in your app window then shift+zoom
will no longer work, this trick only works for apps which use the
default BWindow::Zoom() method.

Change-Id: Ic9f8fcb54f58663663db737103f6a7b42171ef46
2018-07-25 02:33:30 +00:00
Hrishi Hiraskar
46bf100be4 Tracker: Fixed wrong error message in ContainerWindow.cpp 2018-07-22 18:28:39 +00:00
waddlesplash
fe66a314c8 Revert "BScrollBar: Add lines and dots knob styles to scroll bar"
This reverts commit ec1b18c58a.

This was not well enough reviewed, and it seems that at least some
consumers of the old API (e.g. WebPositive) need more than the new one provides.

Change-Id: Ie7ad1fc70dab889922424298661504b00f66d31d
2018-07-22 18:26:06 +00:00
Adrien Destugues
56a7cb3137 Fix build. 2018-07-19 19:28:19 +02:00
David Murphy
d8d6c65576 BListView: Restore selection to MouseDown and fix multi-select drag'n'drop
* Moves list item selection logic back to MouseDown from MouseUp to improve
  application compatibility and responsiveness
* Fixes multi-select drag and drop by not modifying the existing
  selection if a MouseDown event is on a selected item.

Fixes #9190, #14264, #14289
Change-Id: I58050b403dac985f98e03faa72de1ebc5d24f95b
2018-07-19 14:01:35 +00:00
Hrishi Hiraskar
bc8427c522 Tracker: Allow add-ons to dynamically extend popup menu.
An add-on may now add custom entries to the popup menu, in order
to provide more than one action.

Change-Id: Ib4726c0c1e70c59e3ba4d752df24b76cfee1c4a4
2018-07-19 14:00:48 +00:00
Augustin Cavalier
1e29bfd7d8 Update all remaining consumers of the FreeBSD compat headers. 2018-07-18 20:10:04 -04:00
Augustin Cavalier
3c42c902d9 Revert changes to BTextInput's text-rect calculation.
This reverts commit 11dee0444f.
This reverts commit 1641a0516d.
This reverts commit 484f64f315.

These changes break various edge-cases in BTextInput (e.g. typing off the end
of a long string, using the arrow keys to navigate while out-of-bounds),
and nobody has found any fixes for them in the nearly-a-year since they've
been instanted, so they are now being reverted.

Reopens #12608, #13796.
2018-07-18 19:31:02 -04:00
David Murphy
9ece492008 BMenu: BMenuBar submenus at screen edge moved onscreen instead of scrolling
Fixes #9093
Change-Id: I1322c0cd8ba4bbfddace037ed8a8ef666ebe7fe3
2018-07-17 21:21:40 +00:00
David Murphy
e3f7fe948d BMenu: Submenu opening direction follows parent opening direction
Fixes #4859
Change-Id: I8e89afc3ad982d899428e3038fed354a78d04981
2018-07-17 04:12:21 +00:00
John Scipione
ec1b18c58a BScrollBar: Add lines and dots knob styles to scroll bar
Fixes #9137

Move scroll bar drawing into HaikuControlLook

Added B_SCROLLABLE flag to BControlLook

Update FakeScrollBar in Appearance to also draw using HaikuControlLook.

Focus works on scroll bars again, used by FakeScrollBar... and probably
nowhere else.

Added private _ScrollingEnabled() convenience method to BScrollBar and
use it in a few places making.

Create ScrollBarPrivate.h header to share a couple of scroll bar related
enums with HaikuControlLook that come from BeOS Scroll Bar prefs.

Stuff arrow_direction enum into BScrollBar::Private as it has been
succeeded by a similar enum already present in BControlLook and is only
around now for BScrollBar::Private::DrawScrollBarButton.

Change-Id: Idc31ee41de091ba45ded2f0315a004af00143803
2018-07-16 16:11:46 +00:00
Janus
70f1070b6f BColumnListView: BSizeColumn sort with big files works as expected
- Use off_t to compute the difference
- Fixes #14279

Change-Id: I253f16bb75501904ff59ac603a4680c66cfec33f
2018-07-16 16:09:36 +00:00
David Murphy
e4433ad0fa BMenu: Fix crash and keyboard navigation on 'recent items' menus
* Prevents crash mentioned in Trac, but also enables keyboard navigation
  to 'recent items' menus such as "Open files..." in MediaPlayer and DiskProbe
* Check selected menu and submenu exist in menu tracking thread before accessing
* Update BMenu::AttachedToWindow to pass in keydown param to _AddDynamicItems

Fixes #9251
Change-Id: I3031b8e9c1b9dd4ef1187c5a6b8ab7925e3496d2
2018-07-13 00:16:58 +00:00
Andrew Lindesay
3b17d8dd7f HaikuDepot / PackageKit: Repositories 'Identifier' URL
Repositories are identified with a 'url' in the
remote 'repo.info' file.  There is also a
'base url' which is the URL locally with which
the system is able to access the repository
data on.  There is some confusion between these
two terms in the source.  This change aims to
separate the two out and consistently name them.
The settings for the repository locally also was
not storing these values and that has been fixed.
Debug info about the repositories also did not
display the two urls consistently and will now
also do so.  Finally, HaikuDepot now correlates
locally configured repositories with the data in
HaikuDepotServer using the identifier URL; this
makes the use of mirrors with HaikuDepot possible.

Fixes #13888
Change-Id: I66dfe589b05c24e1ab123a6945352e0f24b60bf1
2018-07-05 20:06:54 +00:00
John Scipione
e2d19ae5b7 BListView: do not modify selection on MouseUp if drag & drop
bug seems to have been introduced only recently in hrev52062
2018-07-04 21:55:35 -07:00
John Scipione
6fdf2dd2b3 Tracker: center text horizontally again
We alwasys draw text at the bottom of the calculated TextWidget
rect, that's why it needed to be centered to get the desired
placement. However, there is two places
2018-07-04 16:35:06 -07:00
John Scipione
6b9353b4a3 Tracker: Revert to previous CalcRectCommon bottom calc
... in list mode. Fixes #12997

This bug was introduced in hrev50528 along with new 32x32 icon size
in list mode. I'm not sure what I was thinking on this particular
line but reverting it seems to fix the problem and logically the
original code makes sense.
2018-07-04 14:08:38 -07:00
David Murphy
f5face4114 BListView: Fix drag n' drop in multi-select mode
Move list selection logic into MouseUp instead of MouseDown
Change-Id: I4e7c7f6636dabce130578777b5e1203d6695499a
Fixes #9190
2018-07-04 00:47:01 +00:00
Murai Takashi
12ed45b60f Media kit: Suppress -Werror=class-memaccess
* Add media_format::Clear(), media_format::Unflatten().
* Replace memset() with media_format::Clear()
* Replace memcpy() with media_format::Unflatten()

Fix #14156

Change-Id: I38ebc2de4915b954a15b6f4f6b40d016506910e5
2018-07-02 21:14:30 +00:00
Augustin Cavalier
4215eb6003 Debugger: Fix some broken comparisons.
* Missing parentheses in integer comparison inversion
 * !=, not ! at the beginning of expression

Spotted by Clang.
2018-06-21 22:05:27 -04:00
Augustin Cavalier
582afd9a7f interface & app_server: Fix missing parentheses near ternary operators.
+ has greater operator precendence than ?, so we need parentheses when
using both in expressions. Both of these look like actual bugs.

Spotted by Clang.
2018-06-21 22:04:31 -04:00
Augustin Cavalier
9b83a2a043 BJoystick: Fix fJoystickInfo initialization.
joystick_info contains BLists which initialize themselves upon new(),
and Clang warned (correctly) that using memset() overwites that, as well as
RTTI and other data that they contain. So instead, only memset the first
part of the struct, and then manually initialize the other members.

Fixes #14217.
2018-06-21 17:52:39 -04:00
Augustin Cavalier
9216fc0178 More class/struct mixup fixes.
Spotted by Clang.
2018-06-18 23:16:50 -04:00
Rene Gollent
211cb77acf Debugger: don't auto-download packages non-interactively.
- When in non-interactive mode, i.e. saving a crash report, don't
  allow the image debug info loader to automatically grab missing but
  available info packages. Otherwise we potentially download very large
  packages with the user being entirely unaware, i.e. the 200MB debug
  information package now present by default for gcc7's libgcc. This
  should eventually be made a configurable preference though.
2018-06-14 16:51:32 -04:00
Jérôme Duval
cd6365c7ce style fixes 2018-05-17 22:23:36 +02:00
Murai Takashi
b08627f310 Fix catching polymorphic type by value
Replace catching polymorphic type std::bad_alloc 'by value'
with 'by reference'.
Pointed by gcc8
2018-05-16 13:49:46 +00:00
Jérôme Duval
356fc3bf06 BWindow: fix debug build. 2018-05-09 21:00:55 +02:00
Adrien Destugues
ad33fd78a5 BAffineTransform: de-virtualize some calls in flattening code
The Flatten and Unflatten method should check the size according to the
matching FlattenedSize method, not a possibly overriden version.

May also fix #14128 since we avoid use of the vtable by doing this.
2018-05-08 15:40:01 +00:00
Jérôme Duval
630e3f1410 View: move BAffineTransform out of ViewSetStateInfo.
the size of BAffineTransform is architecture dependent, so we transmit
its contents in a standard array instead.

Change-Id: I907110742168846a869a48bb2d116cc5292ec7d0
2018-05-07 07:02:57 +00:00
Jérôme Duval
27bba9c3fe registrar: flat_app_info size was arch dependent.
copy each member of app_info instead.

Change-Id: Ica8d0a195b2dbaaf57d28f2fe2f7efd73c37b2c4
2018-05-05 09:30:08 +00:00
Adrien Destugues
7dba237f7f BSecureSocket: re-enable RSA cipher suite
my.justenergy.com allows only RSA, so we can't connect there without
this. Other websites may have a similar problem.

Also improve the handling of the error, as it was giving a generic
"general system error" to the user.

Fixes #13975.
2018-05-05 08:48:22 +02:00
Axel Dörfler
a77aa747ea launch_daemon: Added basic logging facility
* The daemon now stores many events in am internal log.
* You can use "launch_roster log" to retrieve it.
2018-04-25 10:10:43 +02:00
Fredrik Holmqvist
e3becd53ee Ternary operator proper precedence.
Going through PVS Studio blogs on Haiku.
2018-04-23 23:25:16 +02:00
Jérôme Duval
b1f1332ebb PackageKit: use the correct kernel headers.
The debug build of the packagefs kernel addon failed because user_memcpy had no type.
Using the correct headers for user_memcpy and IS_USER_ADDRESS fixed the issue.
2018-04-05 17:51:13 +02:00
Andrew Lindesay
b45e8b1ef9 HaikuDepot : additional debugging for json-rpc invocations 2018-03-25 05:44:19 +00:00
Jérôme Duval
a25f7264b6 BString: fix Split() for multiple characters separators...
as suggested by Janus in #14045. Thanks!
* add a unit test for BString::Split().
2018-03-22 21:29:43 +01:00
hy che
7cf48d4e51 TextView: Remove redundant check in ScrollToOffset as PointAt() already does the check.
Change-Id: I2bf541fca84ef27749484ee1be05fb9debac32e2
2018-03-22 10:28:44 +00:00
Rene Gollent
364cbeb2e3 Debugger: Adjust type handling with namespaces.
DwarfImageDebugInfo:
- In some, but not all cases, gcc5 generates type information where the DIEType
  is a child of a namespace rather than of its containing compilation unit.
  This needs to be taken into account when building our name lookup table, as
  we'll otherwise not find the full definition of such types when attempting to
  locate them for corresponding variables. Fixes an issue reported by Axel.
2018-03-17 17:00:50 -04:00
Jérôme Duval
09320f38d7 Roster: fix debug build on x86_64. 2018-03-10 16:03:13 +01:00
Humdinger
d87eeceea5 Layout changes to AboutWindow
Most icons don't look that nice when blown up to 128px:

Before: https://lut.im/KNZw0f8j5r/3lnnRzzFXJSewq9Y.png
With this change: https://lut.im/3XcXJZv6ad/LsYKadFOiIJo1Kbz.png

* Use a 64px icon
* Make the window resizable
* Make the window a bit wider

Thanks Janus for hints where to insert SetExplicitMaxSize()...
2018-03-05 17:40:53 +01:00
Barrett17
2cb3cabcb0 MediaClient: Revert debugging edits
* The -a argument ended up in my git commit inadvently,
sorry about that.
2018-03-03 16:20:34 +01:00
Barrett17
6072c6f1cb MediaConnection: Cleanup after disconnect 2018-03-03 16:15:24 +01:00
Barrett17
65a94fbbaf MediaConnection: Fix Disconnect bug 2018-03-02 04:02:16 +01:00
Barrett17
852b62956b MediaClient: Rename IsRunning to IsStarted 2018-03-02 03:58:54 +01:00
Barrett17
a6ac14c71c MediaClient: Add ClientRegistered callback 2018-03-02 03:34:25 +01:00
Barrett17
1c15261f5a MediaConnection: Add connection name handling 2018-03-02 03:18:26 +01:00
Barrett17
83bcc405f3 MediaClientDefs: Cleanup unneded methods 2018-03-02 00:52:33 +01:00
Barrett17
d717df83d3 MediaClientNode::GetLatency use base version 2018-03-01 22:56:04 +01:00
Barrett17
9391114b8e MediaClientNode: Remove unuseful Disconnect calls
* While those calls were unharmful, better to remove them.
2018-03-01 22:55:03 +01:00
Barrett17
f015d06b84 MediaClient: Remove Preroll and SyncTo 2018-03-01 17:09:24 +01:00
Barrett17
6dc7d85423 MediaConnection: Review format negotiation mechanism 2018-03-01 17:09:24 +01:00
Barrett17
182ec76b44 MediaConnection: Remove format change protocol 2018-03-01 17:09:24 +01:00
Barrett17
444d8ec0e2 MediaConnection: Hide connection callbacks
* At this point we want to avoid the user calling the callbacks
in the form of BMediaConnection. Instead we force to use the
BMediaInput and BMediaOutput versions.
2018-02-27 02:43:38 +01:00
Barrett17
ff56eda570 MediaConnection: Move buffer management on producer side 2018-02-27 01:50:09 +01:00
Barrett17
9cf18a39cd MediaConnection: BufferSize should be inherited
* While it's trivial for audio to calculate the buffer size,
it isn't the same for video.
2018-02-25 23:44:33 +01:00
Barrett17
befa252fbf MediaConnection: Non simple connections should be inherited
* BSimpleMediaConnections are provided for that.
* Make SetOutputEnabled private.
2018-02-24 16:13:34 +01:00
Barrett17
c61ffa962e MediaConnection: Remove latency range interface
* In preparation for the introduction of BMediaGraph.
2018-02-24 15:42:16 +01:00
Barrett17
72958d8ba8 MediaClient: Remove SetRunMode 2018-02-24 02:30:40 +01:00
Rene Gollent
770075026c Debugger: Rework type handlers to allow for custom selection.
TypeHandler:
- Add name field for presentation purposes. Adapt subclasses accordingly.

TypeHandlerRoster:
- Add methods to count and retrieve all type handlers for a given type,
  and adjust CreateValueNode to allow for passing in an explicit handler.
  Adjust callers accordingly.

VariablesViewState:
- Add helpers to store an explicitly chosen type handler for a node.

TypeHandlerMenuItem:
- ActionMenuItem subclass that takes care of reference management
  for its contained type handler.

VariablesView:
- Add context menu for choosing type handlers if applicable. Implement
  support for invoking said type handlers in a similar manner to explicit
  typecasts.
- Adjust saving/restoring the view state so that hidden nodes are taken
  into account as well. This is necessary since it may be the case that
  the handler had to be applied to the hidden child rather than the visible
  node (i.e. the BMessage handler when applied to a pointer to a BMessage).

All together, these changes allow choosing to switch between views of a type
when the Debugger has multiple handlers for it. For example, for BMessages
this allows switching between displaying the raw underlying structure vs
the decoded message content.
2018-02-04 14:13:01 -05:00
Jérôme Duval
43e75989a6 libnetwork: link against the arch specific libbsd and libutil. 2018-01-30 19:19:18 +01:00
Axel Dörfler
08a4536b1f BMessage: Added missing [Get|Set]Pointer()
* SetPointer() was declared, but not defined.
2018-01-29 21:43:21 +01:00
Rene Gollent
ac9e464b78 Debugger: Fix various issues in the DWARF subsystem.
AttributeClasses:
- Fix typo in get_attribute_name_classes which resulted in us not
  handling DW_AT_linkage_name properly.
- Fix incorrect class specification for DW_AT_default_value due
  to inconsistencies in the DWARF documentation (the table of attribute
  classes indicates it is only a reference, but the detailed description
  indicates it also being possible to be a flag or constant, both of
  which gcc outputs).

DebugInfoEntries:
- Add accessor for DIEClassBaseType's inner types.

DwarfImageDebugInfo:
- When looking up types, create a basic target interface to pass on
  to the type context. Otherwise, type lookups that required DWARF
  expression evaluation would crash.
- When building the type name table, we now recursively walk a class's
  inner types, and add them to the list as well. This omission would
  cause the debugger to lack the type description for such classes,
  and consequently be unable to display their details in the variables
  view.
2018-01-12 22:23:57 -05:00
Rene Gollent
c0936b5a03 Debugger: Another set of #13800 fixes.
AbstractTable/Table/TreeTable:
- Let BColumnListView take care of deleting columns. The previous
  approach was resulting in the columns being leaked.

Debugger:
- Don't detach the UI reference, as TeamDebugger will acquire its own.

GraphicalUserInterface:
- Cleanup of file panel handler.

SourceView:
- Clean up marker manager.

*Roster:
- Clean up registered objects in destructors.

GlobalTypeLookup:
- Clean up hash tables.

NetworkTargetHostInterfaceInfo:
- Fix reference handling for settings.
2018-01-11 22:39:55 -05:00
Rene Gollent
ffe684b96c Debugger: Fix type issue in BList handler.
BListValueNode:
- BList's item count member is an int32. However, when the handler was reading
  said variable, it was mistakenly reading the number of bytes corresponding to
  to the address size of the architecture instead.This would cause the read to
  fail, and consequently BList and/or BObjectList variables to not display
  their contents properly on x86-64.
2018-01-11 22:39:55 -05:00
Rene Gollent
3995592cdf Debugger: Fix #13939, more work on #13800.
- Fix various cases where OpenHashTables weren't being cleared properly.
- Fix various reference counting errors.
- Simplify FileManager reference handling.
- Fix bug in LocatableDirectory where the directory named '/' would have its
  name returned as empty. This would lead to failed lookups for entries already
  in the table, and ultimately corrupted the hash table when deleting unused
  entries, leading to #13939. This was previously never noticed due to the
  entries not being freed properly.
- AbbreviationTable wasn't clearing its entries.
2018-01-10 19:29:36 -05:00
Jérôme Duval
8c44fc0f65 PackageKit: tweak classes used by packagefs to write to user buffers.
when compiled in kernel mode, BMemoryIO::WriteAt() and BBufferDataReader::ReadData()
now check the buffer to write to, and eventually call user_memcpy() instead of memcpy().
2018-01-09 20:40:12 +01:00
Rene Gollent
b1ab02c434 Debugger: More memory management fixes.
DwarfImageDebugInfo:
- Type name/info entries weren't being freed properly.

BaseUnit:
- The array of entries itself was being destroyed, but not the actual
  objects. Consequently none of the DIE objects were ever being freed.

CfaRuleSet:
- The register rules array wasn't being freed.

FileManager:
- References to entries weren't being released. Some more work remains to be
  done here though, as a subset of these objects still have a non-zero ref
  count in the end.
2017-12-31 17:52:59 -05:00
Augustin Cavalier
8a9e1e0d4a Removal of non-Haiku target platform logic from build system (part 1.)
Following recent changes to use libroot_build on Haiku also, it is now
actually impossible to build Haiku components on non-Haiku platforms
(BeOS R5, Dan0, BONE, Zeta), so we can remove any logic related to this.

This is only the first part; still to be removed are:
 * SetSubDirSupportedPlatformsBeOSCompatible
 * HOST_PLATFORM_BEOS_COMPATIBLE
 * TARGET_PLATFORM_BEOS_COMPATIBLE
2017-12-31 16:14:22 -05:00
Rene Gollent
3d9b569384 Debugger: Further work on memory leak hunting.
TeamWindow:
- Properly delete stack frame selection entries in destructor.

TeamDebugger:
- The reference to TeamDebugInfo wasn't correctly initialized to own,
  leading to TeamDebugInfo never being destroyed.

FunctionInstance:
- Also clear source code reference in destructor.

ImageDebugInfo:
- Release references to specific infos in destructor. These are acquired
  on our behalf when loading the image info, but were never released,
  leading to the latter never being freed.

DwarfManager:
- Release references to files in destructor.

FileManager:
- Release entries in various destructors.

Somewhat improves the situation in #13800, but is still far from complete,
as a thorough review of this nature hasn't ever really been done.
2017-12-28 23:22:13 -05:00
Rene Gollent
8bb774fc37 Debugger: Fix a memory leak.
TeamDebugger:
- In several cases, BReferences on thread handlers after a call to
  _GetThreadHandler() weren't correctly initialized to account for
  that function implicitly acquiring a reference on our behalf, leading
  to the reference count to spiral out of control, and consequently the
  handler would never be freed. Found while attempting to address
  #13800, likely more to come.
2017-12-27 23:52:13 -05:00
Augustin Cavalier
3305611025 Mail Kit: Delete now-unused DES implementation. 2017-12-26 13:59:25 -05:00
Adrien Destugues
197c659920 libnetwork: re-introduce gethostbyname_r and gethostbyaddr_r
These are needed by existing openjdk package. Let's keep them until we
get the OpenJDK build working again and can remove the requirement.
2017-12-19 21:22:14 +01:00
Adrien Destugues
a9020afcb6 BHttpHeaders: fix gcc5 build. 2017-12-07 22:45:44 +01:00