Commit Graph

2775 Commits

Author SHA1 Message Date
Augustin Cavalier
95c9effd68 Migrate the BMailComponent docs to the Haiku Book.
I've updated the docs to match the current BMailComponent, documented
new functions, and cleaned up the MailComponent.h file to at least
somewhat match our coding style.

First in a series (there are 3 more old API docs on the Mail Kit in that
"Public API" folder.)
2017-12-25 19:43:51 -05:00
Augustin Cavalier
0be0fba248 BHttpForm: Clang also uses pair<> now. 2017-12-18 17:58:04 -05:00
Augustin Cavalier
02c9c92ae2 BeBuild: Treat TinyCC as GCC4 ABI.
Since it's just a C compiler "technically" the ABI does not matter,
but since it also can target other ABIs from one toolchain (e.g. x64),
just treat it as GCC4 ABI unilaterally.

Fixes #13847.
2017-12-11 19:28:45 -05:00
hyche
1750cd1e92 block_cache: Implement cache_has_block_in_transaction function that will check the existence of block in one specific transaction.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:56 -05:00
Augustin Cavalier
acf02fd2cf locale: Fix another class/struct mixup. 2017-12-03 13:44:30 -05:00
Augustin Cavalier
7c234361eb Fix more class/struct mixups. 2017-12-02 22:24:06 -05:00
Augustin Cavalier
764c402a69 GraphicsDefs: Revert back to casting structs to integers to compare them.
This reverts commit d3abf525c5.
Clang's warning was a little overzealous; this is not a problem on x86.
2017-12-02 17:36:20 -05:00
Augustin Cavalier
841d719fc8 MediaDefs: May be included as C not C++, so accommodate for that. 2017-12-02 09:32:28 +01:00
Augustin Cavalier
2b1481f0dc Fix a few more miscellaneous (harmless) Clang warnings. 2017-12-02 00:12:51 -05:00
Augustin Cavalier
d3abf525c5 GraphicsDefs: Do not cast structs to integers to compare them.
That requires more padding (1 byte vs 4 or 8 depending on integer size),
so just use regular loops and chained ==s.

Caught by Clang. No functional change intended.
2017-12-01 20:26:20 -05:00
John Scipione
fc23c09758 BDeskbar & Deskbar: export window bool settings to BDeskbar
Add methods to get and set "Always on top", "Auto raise", and "auto hide"
which are all booleans which control aspects of the Deskbar window to
BDeskbar.

Set the bool to the default value initially. Check if sending the
message succeeds, if so check the reply which also fills out the bool.
Don't check to see if reply succeeded because the bool will only be
overwritten if it did.

Follow the BDeskbar convention Is...() for getter, Set...() for setter
e.g IsAlwaysOnTop() is the getter, SetAlwaysOnTop() is the setter.

Define new message constants to call the newly created methods.
Follow BDeskbar convention: 'gtla' is used for getter, 'stla' for setter.
g/s for getter/setter, tla is an all-lowercase code unique to each
getter/setter pair.

Copy/paste these message constants into BarApp.h unchanged. Replace four
letter codes with imported message constants in BarApp.cpp and
BarWindow.cpp. Much nicer than using bare codes.

The new BDeskbar methods are all handled by TBarApp. The getters send
back a reply message containing the bool while the setters fall through
to existing setter cases.
2017-11-27 11:05:22 -08:00
John Scipione
f8811591e1 BDeskbar: Style fixes
Update Copyright in cpp, add myself, alphabetize, standardize
Pointer style in cpp
Update some comments
Some 80 char stuff
pragma section headers
whitespace
2017-11-26 20:40:00 -08:00
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