Commit Graph

2763 Commits

Author SHA1 Message Date
Adrien Destugues
b140a1c340 NetworkAddressResolver: cache needs to be locked
It is not a good idea to have a thread get an address from the request
cache, while another thread is deleting said address as the cache has
grown too large. Add a lock around the cache access to make it safe.
2017-11-21 22:15:32 +01:00
François Revol
aef94baf32 ISA: fix ram_address() to use phys_addr_t for completeness
I don't know of any driver actually making use of it, but some weird
architecture might want to emulate an ISA bus to reuse a driver maybe...
2017-11-21 21:44:02 +01:00
François Revol
16bb99fdac PCI: fix ram_address() to use phys_addr_t
Since it handles physical address it should really be this.

It's not like many drivers actually used it anyway. It shouldn't harm
compatibility, drivers calling it with only 32bit would leave garbage in
the higher bits but since on x86 it's a noop anyway, it would end up in
the MSB register tha's ignored because it expects a 32bit result.
2017-11-21 21:44:01 +01:00
Adrien Destugues
24e63de5d3 Style fix: parameters should have a name. 2017-11-21 12:19:56 +01:00
Adrien Destugues
3a2b67b5ae Support for configuring screen backlight
Accelerant interface:
Introduce new hooks B_SET_BRIGHTNESS and B_GET_BRIGHTNESS. Brightness is
a float in the 0..1 range.

App_server:
Forward brightness things between BScreen and the accelerant.

intel_extreme:
Implement the hooks. Note that this only works for laptop panels, but
the driver will pretend to support it in other cases as well.

Screen preferences:
If the accelerant supports the B_GET_BRIGHTNESS hook, allow to set
brightness with a slider. Otherwise, the slidere is hidden and these
changes aren't visible.
2017-11-21 09:12:18 +01:00
Augustin Cavalier
7d8eb4d7f9 time: Address review comments.
* Use ENOSYS not B_DONT_DO_THAT (thanks korli)
 * Use unsigned long not uint64 (thanks axeld)
2017-11-16 20:53:14 +01:00
Augustin Cavalier
9a50e01ea6 set_real_time_clock: Change parameter from uint32 to uint64.
This should have been done along with the time_t change, but I forgot
to check this then.

Technically this breaks ABI against BeOS, but:
  1. BeOS used an int32, so we'd already slightly broken ABI here
  2. Only one thing at HaikuArchives (VMwareAddons) and one recipe at HaikuPorts
     (samba) uses this function at all.

If it turns out some critical BeOS app uses this, then I guess we can enclose
GCC2 guards around it, but since I can't find any evidence of that, I'm
pushing it without them for now.
2017-11-15 18:28:04 +01:00
Augustin Cavalier
581cd2a22d Nuke COMPILE_FOR_R5.
Not used in $long_time, almost certainly broken, so it's just cruft.
2017-11-15 17:52:27 +01:00
John Scipione
6f6c9e0069 BDurationFormat::Format docs, update method params
Also a tiny style fix in the header, put const qualifier
on same line
2017-11-10 14:59:33 -08:00
Augustin Cavalier
db68ff23c6 Interface Kit: Make BControlLook a proper pure-virtual base class.
All of its prior functionality has been moved into HaikuControlLook.
This paves the way for customizeable control looks, which I intend to implement
in the future as part of decorators.

This is being pushed now because libbe ABI was already broken due to the
Notifications changes, so this is riding that so we only have to do a mass
rebuild once.
2017-09-30 21:12:33 -04:00
Augustin Cavalier
d52572b31b BControlLook: Make all public methods virtual.
Solves a "TODO before R1". Breaks ABI, but almost nothing outside the
tree uses it.
2017-09-30 21:12:02 -04:00
Brian Hill
8856b51897 BNotification ABI padding
Add reserved functions and data to avoid future ABI breakage
2017-09-28 22:19:05 -04:00
Brian Hill
6aa0587222 Notifications preflet and notification_server
Notifications preflet:
-Use sliders instead of text fields for width and timeout
-Remove icon size choice (mini icon looks horrible)
-Consolidate both "Enable" checkboxes into one
-Fix Revert button, remove Apply button, add Defaults button
-All changes to settings saved immediately
-Live example notification message shown when settings changes are made
-Add setting for individual apps to specify whether their notifications
	should be muted
-Remove history list (to be implemented later)

BNotification class:
-BNotification records the signature and name of application that
	created it
-New functions to get source application signature and name

Notification Server:
-Notification pop up view layout fixes and bold font size fix
-Remove notifications history from AppUsage class (will be saved in
	cache instead)
-Remove vector of NotificationView objects which isn't needed
-Get source application info from notification object, not the received
	message which is not reliable
2017-09-23 11:41:33 -04:00
Akshay Agarwal
42745b94f8 BDateFormat: Properly map day values to ICU day-of-week.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-09-16 17:42:54 +02:00
Akshay Agarwal
ec3dbaa13f Use B_FULL_DATE_FORMAT as the default style value.
Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2017-08-31 10:27:09 +12:00
Akshay Agarwal
bb3ad41ada Implement functions to get localized long/short dayofweek name and short month name in BDateFormat.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-08-30 20:28:31 +02:00
Akshay Agarwal
1e4ab34cd7 Implement a formatter for relative dates.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

It can give results such as "in 2 hours", "2 days ago", etc.
This is different from BDurationFormat which will just say "1 hour, 2
minute and 36 seconds"
2017-08-25 21:14:27 +02:00
Kacper Kasper
cb13fce878 BTabView: implement drawing tabs on all sides.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-08-20 09:04:05 +02:00
Owen
d64c7746c7 Add B_TRANSLATE_MARK_CONTEXT to Catalog.h and tools/CollectingCatalog.h
Fixes #13656

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-08-07 06:55:28 +02:00
Humdinger
99e5e3fd08 Package daemon notifications
* Sentence casing
* Localize notification texts in the package kit
* Have "Package daemon" as group name and "Warning" as title
* Use ::BPrivate in Bitmap.h to solve an ambiguity (as pointed out
  by PulkoMandy). Though not needed for my changes any more, since
  a the icon of the notifying app is now shown by default.

Fixes #13590.
2017-07-31 19:09:38 +02:00
Jérôme Duval
d9823ef5a0 PrintJob: make struct print_file_header packed.
* also struct _page_header_: on x86_64, these would align to 8 bytes, which the code
doesn't handle well.
* remove beos leftovers.
2017-07-31 17:11:53 +02:00
Augustin Cavalier
a1ceb00059 Remove even more Locale Kit cruft.
Not included in the build and not used.
2017-07-30 14:46:41 -04:00
Adrien Destugues
01c1bb6223 Remove more Locale Kit cruft.
BNumberFormat is the way to go for all of this. This code was not even
compiled in.
2017-07-30 19:25:16 +02:00
Jérôme Duval
13dbf47109 Revert "BView: use off_t instead of long."
This reverts commit ab3a87ed6e.
2017-07-24 08:48:28 +02:00
Adrien Destugues
037ea84ba5 BNumberFormat: add Parse() and GetSymbol(). 2017-07-23 11:40:25 +02:00
Adrien Destugues
6cbcfc1911 BNumberFormat: cache ICU formatters
For performance reasons, it is a good idea to keep the formatters
instanciated, instead of re-creating them each time we need to format a
number.
2017-07-23 10:24:02 +02:00
Adrien Destugues
0e4ad75e47 Remove more unneeded files from the Locale Kit
All of this is replaced by the single BNumberFormat class.
2017-07-23 09:15:42 +02:00
Adrien Destugues
b7cc4ccde6 Remove remaining include of FloatFormatParameters.h. 2017-07-22 19:47:07 +02:00
Adrien Destugues
1d6af34b9a LocaleKit: remove obsolete files.
Formatting floats is handled by BNumberFormat already.
2017-07-22 12:59:12 +02:00
Jérôme Duval
ab3a87ed6e BView: use off_t instead of long. 2017-07-21 18:57:57 +02:00
Jérôme Duval
952318fe76 Bump B_HAIKU_VERSION to B_HAIKU_VERSION_1_PRE_BETA_1. 2017-06-12 21:03:36 +02:00
Augustin Cavalier
39efd913c1 Switch to a 64-bit time_t everywhere except 32-bit x86.
Thus, BeOS compatibility is preserved (and there is no risk of
breaking GCC5<->GCC2 interoperation on hybrid builds.)

This commit only makes the actual change, the build fixes are
in the next commit.
2017-06-06 17:38:17 -04:00
Adrien Destugues
2b204c565c Remove deprecated BCollatorAddOn and implementations.
Leftover from initial import of the locale kit from OpenTracker. We are
now using ICU for this, so specific add-ons for each language are not
needed.
2017-05-29 08:52:44 +02:00
Adrien Destugues
a19a18f553 Rework BCollator API
- Strength is now set once, instead of at each comparison, to improve
  performance and fix potential locking issues
- Add a way to enable "numeric" collation (aka "natural order")
2017-05-29 08:52:43 +02:00
Akshay Agarwal
f5c544b59a Fix style formatting issue in BTimeUnitFormat, update BDurationFormat accordingly.
* Issue: BTimeUnitFormat doesn't incorporate style formatting while
formatting a time unit. Format() does take style as an argument but the
style is not used anywhere. So currently the abbreviated style doesn't
work and by default the time unit is formatted to the full style.

* Fix: Move the style flag from BTimeUnitFormat::Format() to the
BTimeUnitFormat constructors and call the relevant icu::TimeUnitFormat
constructor. Map the Haiku defined style unit to the corresponding ICU
unit. Move the style flag from BDurationFormat::Format() to the
BDurationFormat constructors to map the changes in BTimeUnitFormat.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #13508
2017-05-17 19:53:46 +02:00
Jérôme Duval
133e4131fe Added some support for GCC 8. 2017-05-13 11:37:22 +02:00
Alexander G. M. Smith
5e7964b0a9 Remove Spurious B_BEOS_DATA_DIRECTORY
There is no DATA directory in BeOS, and its FindDir() doesn't implement
it.  No need for a confusing backwards compatibility to something that
doesn't exist (had my hopes up, was going to move some non-executable
files from AddOns to Data in a program that works in BeOS and Haiku).

The removed enum label doesn't change the directory_which enum order
or count, as it was aliasing the value of another existing enum label
(B_SYSTEM_DATA_DIRECTORY).

Fixes #13470

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2017-05-08 22:17:53 +02:00
dsizzle
9b6b158b88 Implementation of BFont::Blocks
BFont::Blocks is now implemented in ServerFont, via a call through the
app_server.  It uses fontconfig to iterate through a charset of a font
and stores the defined blocks in a bitmap.

A new API was added, BFont::IncludesBlock, that will allow for arbitrary
testing of a given Unicode block. Since nothing is cached, searching
through an entire charset for a series of Unicode blocks can be quite
slow. In a given block there may be only 1 or 2 characters actually
defined so every character within a block needs to be checked until one
is found, which in a degenerate case will mean the entire block is
checked.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2017-05-08 22:17:53 +02:00
Dario Casalinuovo
c0ef5b2b7c MediaFile: Little refactor to use the MediaStreamer class
* This clarify the ownership of the source when using the experimental
API.
* The extractor/writer are simplified and don't have to care about
adapters.
* MediaStreamer is able to provide a generic BAdapterIO that is
suitable also for different uses than the codecs API itself.
2017-05-04 14:08:07 +02:00
Adrien Destugues
b68cf9d6f6 elf.h: add more architectures.
Mostly I need EM_AVR to build avrdude on Haiku.
2017-04-11 18:59:06 +02:00
Alexander von Gluck IV
6516aed58b network preflet: Make InterfaceListItem dumber
* Allows us to use InterfaceListItem for non-physical
  interface things (like a VPN connection)
2017-04-05 18:46:10 +00:00
Fredrik Holmqvist
e5c95a01ff Use 64 bit addressing for ACPI on 32 bit builds.
32 bit builds with PAE are so much fun. It's like
64 bit without all the extra registers...
2017-03-28 21:34:42 +02:00
John Scipione
388ac82baa BString: Add IStartsWith() and IEndsWith() methods
Case-insensitive version of StartsWith() and EndsWith()
2017-02-21 18:03:03 -08:00
Adrien Destugues
f9e1854f19 libbnetapi: fix access to HTTP headers
The asynchronous listener had no reliable way to access HTTP result and
headers from the callbacks. As the callbacks are triggered
asynchronously, they can be run after the request has carried on and,
for example, followed an HTTP redirect, clearing its internal state.

The HeadersReceived callback now passes a reference to BUrlResult for
the request. There are two cases:
- Synchronous listener: passes a reference to the request's results
directly
- Asynchronous listener: archives a copy of the result into the
notification message, and passes a reference to the unarchived copy.

Unfortunately this comes with several ABI and API breakages:
- Change to the prototype of HeadersReceived()
- Change to the class hierarchy of BUrlResult (implements BArchivable)

All users of HTTP requests will need to be updated if they implemented
in HeadersReceived or used BUrlResult.
2017-01-30 20:27:52 +01:00
Kacper Kasper
2332ebfd52 ControlLook: Add side parameter to tab drawing functions.
* This allows drawing tabs on any side of the view.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-01-22 09:36:38 +01:00
Adrien Destugues
bdd02e0d9d BString: rename SetCharAt to SetByteAt
Makes it clear that it operates on bytes, not unicode codepoints.
Thanks to mmlr for remembering me of this subtlety.
2017-01-12 22:03:51 +01:00
Jérôme Duval
0c5219a1d6 Restore missing symbol _ZN7BStringixEi on x86 and x86_64.
* Vision and others were broken after 3eac8208df.
* this adds BStringRef in the backward compatibility section.
* fixes #13199.
2017-01-12 21:23:50 +01:00
Adrien Destugues
3eac8208df Remove BStringRef and users.
As discussed in 2008
(http://www.freelists.org/post/haiku-development/BString-on-GCC4,1),
this class was not efficient because of lack of inlining. Implement the
suggested solution of a SetCharAt method instead. Also add a CompareAt
which covers a specific use case in KeyboardLayout.cpp.

Adjust all places which were using this feature to safer APIs.

Also fixes a copypaste error in FormattingConventions.cpp.
2017-01-11 20:50:41 +01:00
Dario Casalinuovo
3ef4b20086 Make BMediaRecorder public
* Fills a functionality lack of the classic media_kit.
2017-01-10 21:34:20 +01:00
John Scipione
e1304871bb Revert "BWindow: CenterOnScreen a bit above center"
This reverts commit a5be1832cc.
2017-01-01 12:25:05 -08:00