Commit Graph

8413 Commits

Author SHA1 Message Date
Fredrik Holmqvist
251eb00d51 Use B_PRId32. 2015-04-01 20:18:00 +02:00
Axel Dörfler
1aaa0c2142 Package Kit: FetchFileJob now contains package size.
* So that you know how much already was, and still has to be downloaded.
* Automatic whitespace cleanup.
* The link in FetchFileJob.h did not fetch the correct header under
  Haiku anymore (since the addition of the private headers to the
  image).
2015-03-31 13:40:42 +02:00
Michael Lotz
ffba66060b UserlandFS: Make 64 bit clean and enable build for x86_64.
I did not bother to fix the BeOS kernel emulation, so this part is
still left out of the x86_64 build.
2015-03-29 16:25:17 +02:00
Alexander von Gluck IV
c6a4fee579 loader/u-boot: Use FDT serial info to create uart
* drop my fdt tests
* we have to call fdt parsing code *after* cpu_init (why?)
* pass fdt pointer to all FDT support calls to avoid confusion
  once we get into the kernel land
* look for PL011 compatible uart and use it
* Add some saftey checks to serial putc code to avoid null*
* fdt_node_check_compatible returns 0 on success not 1
* fdt_get_device_reg needs to add the SOC base to the result
* fdt_get_device_reg might need to add the second range cell
  instead of reg?
2015-03-28 15:52:16 -05:00
Jérôme Duval
4a9c56f6c7 x86_64: fenv.c needs __weak_reference()
* the weak symbol feenableexcept wasn't available.
2015-03-27 20:16:57 +01:00
Axel Dörfler
687d0bc272 DriverSettingsMessageAdapter: fixed converter signature.
* The ConvertFromDriverSettings() method missed the current value
  index.
* Completed unit tests, and enabled them all.
2015-03-27 13:25:28 +01:00
Axel Dörfler
3d7aaa308c Network: added notify settings updated method.
* And call it from the DNS client -- this is the only add-on that does
  not trigger a configuration or settings update, so we have to notify
  the changes manually.
2015-03-27 13:25:27 +01:00
Axel Dörfler
8bc3ecb054 Added BTextControl::TextLength() method. 2015-03-27 13:24:09 +01:00
Axel Dörfler
d26777c4e4 Network: added BNetworkSettingsListener.
* Same as the configuration listener, just for SettingsUpdated().
* This is now broadcasted to all list items, too.
2015-03-27 13:24:07 +01:00
Axel Dörfler
f7ccc9af85 BNetworkSettings: added const, server IsRunning() method.
* Get{Interface|Network|Service}() methods are now const.
* Added variants of Interface(), and Service() that are const.
* Added new BNetworkServiceSettings::IsRunning() convenience method that
  reflects the status quo rather than the settings.
2015-03-27 13:24:07 +01:00
Axel Dörfler
c3ef93915b net_server: Clients can now check if a service is running.
* Using the new kMsgIsServiceRunning command.
2015-03-27 13:23:01 +01:00
Axel Dörfler
1f94cdcdff BNetworkServiceSettings: Added missing functions/constructor. 2015-03-27 13:23:00 +01:00
Axel Dörfler
7ca40f60bc BNetworkSettings: made service stuff writable.
* And added the ability to disable a service without losing its
  configuration.
2015-03-27 13:22:30 +01:00
Axel Dörfler
d1f0b8db1d Network: fixed top item creation, sort entries.
* Need a way to access the NetworkWindow object from a static
  method in order to sort all entries correctly, though.
2015-03-27 13:22:29 +01:00
Axel Dörfler
5274e9b004 Network: added interface list item.
* Added BNetworkInterfaceListItem that can be used by interface protocol
  add-ons to represent their functionality in the list view.
* It will automatically update itself on changes, and will show the
  specified label, and address, if any, as well as indicate whether or
  not the family has been disabled (which doesn't work perfectly yet,
  as IFF_AUTO_CONFIGURED is on the interface level).
* Therefore, the interface list item will no longer show the address,
  but the type of the device instead.
* Introduced the BNetworkConfigurationListener interface that is used
  to broadcast network updates to.
2015-03-27 13:22:28 +01:00
Axel Dörfler
b00dcbcad2 BNetworkSettings: added some convenience methods.
* From InterfaceAddressView: FindFirstAddress(), and IsAutoConfigure().
* Removed some debug leftovers in InterfaceAddressView, too.
2015-03-27 13:22:27 +01:00
Axel Dörfler
e4f4658a1b BNetworkSettings: made interface settings writable.
* It also makes use of the new driver settings converter mechanism.
2015-03-27 13:21:51 +01:00
Axel Dörfler
3211cbcd15 DriverSettingsMessageAdapter: optional field converter.
* You can now optionally specify a converter that does the actual
  message to settings conversion, and vice versa.
* This allows for more sophisticated and custom conversions.
2015-03-27 13:21:50 +01:00
Axel Dörfler
07addd7ef5 Network: broadcast updates, remove apply button.
* Network now monitors all network, and network settings changes, and
  will notify all add-ons about those changes.
* Removed the global apply button. Instead, the static IP configuration
  now got that button. All other changes will be instant.
2015-03-27 13:21:49 +01:00
Axel Dörfler
f16f9ee4ee Moved more functionality from net_server to NetworkSettings.
* Added (still incomplete) helper classes for the settings messages.
* The net_server now uses these classes for its interfaces, and services.
* Renamed service_address to service_connection, as that better matches
  what it is used for.
2015-03-27 13:21:49 +01:00
Axel Dörfler
7a9c00732a BMessage: add default parameter to GetString()/GetBool().
* It's likely that you want NULL/false when the data is not available
  so you can now leave out the default value in that case.
2015-03-27 13:21:48 +01:00
Axel Dörfler
2864e4da5e Network: added global settings.
* NetworkWindow now manages a single BNetworkSettings object
  that is shared with all add-ons.
2015-03-27 13:21:48 +01:00
Axel Dörfler
db6d25ceba NetworkInterface.h: honor 80 character limit. 2015-03-27 13:21:47 +01:00
Axel Dörfler
d880e2d91f BNetworkSettings: added Get*() by name methods. 2015-03-27 13:21:46 +01:00
Axel Dörfler
fd55fb6615 Moved net_server's settings to libbnetapi.
* As experimental API class BNetworkSettings.
* Added add/remove methods for interfaces, and services, too.
* Moved the conversion of the wireless networks into the settings class,
  too, so that it only gives out converted ones (but accepts both
  variants).
2015-03-27 13:21:46 +01:00
Axel Dörfler
3401ff7c2f BNetworkSettingsAddOn: added missing destructor. 2015-03-27 13:08:44 +01:00
Axel Dörfler
f6c7cf44b5 Network: integrated former hardware view from add-on.
* The interfaces logic is within the main application, so is the
  new interface view.
* Disabling/renegotiating does not work yet.
* Reveals a bug in some interface code; when you click on an ethernet
  device first, there is no place for the wireless menu. When you then
  press on a wireless device, it crashes in BMenuField code.
  In the other direction, there is then an empty space.
* Fixed list item width reporting.
2015-03-27 13:08:44 +01:00
Axel Dörfler
021ff1ca46 Network: no need for public constants. 2015-03-27 13:08:42 +01:00
Axel Dörfler
77db25ddc7 Network: moved add-on headers to the correct position.
* Ie. they've moved to headers/os/add-ons/network_settings now.
2015-03-27 13:08:41 +01:00
Axel Dörfler
0690387cd2 BServer/BApplication: added constructor for looper name.
* Added an extra looperName argument to the private BApplication
  constructor that BServer is using.
* This is now used to fix the ugliness that gave the registrar
  a different looper name, and even saves a string comparison.
2015-03-26 21:47:24 +00:00
Axel Dörfler
b7a87fd137 find_paths_etc(): added user/system only flags.
* B_FIND_PATHS_(USER|SYSTEM)_ONLY cause only the specified paths
  to be included in the result list.
2015-03-26 21:47:22 +00:00
Dario Casalinuovo
fc601b54ff TMap/Tlist: set various methods as const.
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2015-03-17 21:50:18 +01:00
John Scipione
2c3505de79 PictureDataWriter: Style fixes only
No functional change intended
2015-03-16 20:19:52 -04:00
Alexander von Gluck IV
40eb7121b6 arm/fdt: Start using new fdt code in mmu_man's fdt_serial logic
* Expose fdt_get_device_reg for others to use
2015-03-14 14:29:30 -05:00
Alexander von Gluck IV
fe19a9b18b arm/fdt: Add functions to get device bases by name + alias
* Move more code into fdt_support
* We now can query FDT registers based on name or alias
* Return addr_t where it makes sense
* Copyright change ok'ed by mmu_man
2015-03-14 13:03:51 -05:00
Alexander von Gluck IV
f121867b87 arm/fdt: Initial reorg of fdt support code
* Makes FDT support code useable by everyone
  without all of the externs
* Further movement to be non-u-boot centic
  may still happen.
2015-03-14 09:50:46 -05:00
Alexander von Gluck IV
af056576ea bcm283X: Don't break all non-bcm arm builds, warn.
* Called via arm_mailbox_bcm2835 *and* arm_framebuffer_bcm2835
* This is a bit messy. We really should be getting these
  chipset-centric bases from the provided FDT / DTB.
* I can't think of a way to redo this without undoing
  work towards FDT.
2015-03-13 17:43:35 -05:00
Alexander von Gluck IV
deb4929b9a rpi1/rpi2: Use PL011 UART fallback in loader.
* Adjust UART base locations to reflect ARM pref base.
* We have a working haiku_loader_u-boot on Raspberry Pi 2!:q
2015-03-07 13:42:18 -06:00
Alexander von Gluck IV
196479ae96 headers/bcm283X: Don't depend on others to include board_config.h 2015-03-07 12:35:00 -06:00
Alexander von Gluck IV
427d40adb5 arm/targets: Add rpi2, rename raspberry_pi to rpi1
* The Raspberry pi 2 uses a new SoC which differs slightly
  from the Raspberry Pi 1.
* Someday these two board targets could go away when we get
  FDT support.
2015-03-07 12:31:12 -06:00
Alexander von Gluck IV
d05e5f1db6 bcm283X: Add new peripheral base for bcm2836
* BCM2836 == Raspberry Pi 2
2015-03-07 11:23:49 -06:00
Alexander von Gluck IV
523c77e052 arm: Rename BCM2835 SoC header to bcm283X.h
* Fix a few typos in hrev48873
2015-03-07 11:11:53 -06:00
Alexander von Gluck IV
f8e19d47fb arm: Rename BCM2708 to BCM2805
* To while there was some compatibility between
  BCM2708 and BCM2805, it makes the BCM2806 changes
  more confusing. We don't have any valueable BCM2708
  targets.
2015-03-07 11:03:01 -06:00
Alexander von Gluck IV
5906dbb4d4 platform/u-boot: Work towards using arm mailbox driver
* Reference bcm2708 framebuffer when it makes sense
* Add bcm2708 define to Raspberry Pi board_config.h
2015-03-06 07:47:32 -06:00
John Scipione
83d5a5313d MessageFormat: Use int64 instead of off_t
They are effectively the same thing, but int64 is more generic.

I used an off_t because that is what Tracker passed in, yet, this could be
used in other places where an off_t doesn't make as much sense.
2015-03-04 15:40:55 -05:00
John Scipione
b726ad9203 MessageFormat: Use off_t argument instead of int32
Which doubles the maximum width fixing #11809. I wanted to convert this to
a variadic functionbut that would require updating all of the instance that use
MessageFormat or a clever hack to get around the ambiguity of an off_t
argument and an int argument count with 0 arguments. Either way seemed
out of the scope of fixing this bug.

Fixes #11809

Another Beta1 bug down!
2015-03-04 14:28:47 -05:00
John Scipione
fab1340f2f MessageFormat: Add edn header guard comment 2015-03-04 14:22:56 -05:00
John Scipione
9cdba41add Tracker and Open Target Folder: Select result
Implement the todo in Open Target Folder to select the result by sending
Tracker a message with the refs to select.

Add a new kSelect message constant to tracker_private.h to hook into.

Tracker reads in the message and finds the window that the refs are located in,
activates it, then selects the corresponding poses scrolling the pose view
if necessary.

Bump version of Open Target Folder to 1.0.2
2015-03-03 18:47:06 -05:00
John Scipione
039f59262a Tracker, Deskbar, ShowImage: move public commands
... to tracker_private.h so they may be used by external apps
such as Deskbar and ShowImage. Remove PublicCommands.h
2015-03-03 18:47:05 -05:00
John Scipione
02b72520b6 Storage Kit: Tiny style fix 2015-03-03 18:47:03 -05:00
Adrien Destugues
0f94784a5e intel_extreme: fix vblank interrupt on Ivy Bridge and later
Intel changed the PCH interrupt bits between Sandy Bridge and Ivy Bridge
to make space for the 3rd display pipe. Take this into account and check
for the correct bits on the newer devices.

Fixes #11522.
2015-03-01 22:57:43 +01:00
Augustin Cavalier
7dc141827a Delete old rgb_color operators that are no longer needed. 2015-02-28 12:54:31 -05:00
Adrien Destugues
e3468ef600 ifaddrs: add extern "C"
We need this to be callable from C programs. Thanks to Diver for
reporting!
2015-02-26 22:02:37 +01:00
John Scipione
64182ccb20 Menu and Deskbar: Remove _SetMenuLayout() method
and remove TExpandoMenuBar as a friend class to BMenu hack.

In Deskbar, call the newly added MenuPrivate::SetLayout() method instead.

This is a much cleaner way to implement this, thanks Stefano Ceccherini
for the tip!
2015-02-20 14:38:43 -05:00
John Scipione
35384ab425 MenuPrivate: Add a SetLayout() method to MenuPrivate
that allows you to set the menu_layout of the menu after construction.
2015-02-20 14:35:36 -05:00
John Scipione
09d0a76b7b MenuPrivate: Style fixes to MenuPrivate.h 2015-02-20 14:24:46 -05:00
John Scipione
deaae5fc20 Deskbar: Persist ExpandoMenuBar
Add private BMenu::_SetMenuLayout() method. Set TExpandoMenuBar
as a friend class in BMenu to call this method. A little hacky,
but, this keeps SetMenuLayout() from being exposed as part of
the public API.

Don't destroy and rebuild the ExpandoMenuBar when switching from
horizontal to vertical mode. Instead build the TExpandoMenuBar
when the application starts and then switch it from B_ITEMS_IN_ROW
to B_ITEMS_IN_COLUMNS by using the newly added _SetMenuLayout()
method.

When we resize from vertical to horizontal, recalc the max
menu item widths, this resizes the application menu items so
that they take up the right amount of space.

Since we no longer destroy the menu bar we no longer have to
save whether menu items are expanded or not in a separate list.
Instead we can store that information in directly in
TExpandoMenuBar. This removes a lot of code.

Fixes #9350
2015-02-19 19:02:39 -05:00
Axel Dörfler
794c227e83 BView: fixed RemoveSelf() layout item handling.
* When RemoveSelf() is called, we do not own our own layout items, so
  we must not delete them.
* However, we do own them when we still have layout items left when
  we get deleted ourselves.
* This fixes removing/adding a child view to a view without deleting
  it inbetween (like the new Network preferences will do).
* Optimized item removal -- not a good idea to always remove item 0.
2015-02-13 22:34:34 +01:00
Axel Dörfler
b617d006f9 ViewPrivate.h: minor cleanup, no functional change. 2015-02-13 22:33:57 +01:00
Augustin Cavalier
7d226266e6 BToolBar: misc. fixes.
* Move common init. code to an _Init() function.
 * Create a layout constructor.
 * Make _AddView public and rename it to AddView.
2015-02-11 23:06:21 -05:00
Augustin Cavalier
94a4c1c456 BToolbar: rename to BToolBar.
"BToolBar" matches the current convention ("BStatusBar", "BMenuBar", etc.)
I've no idea what I was thinking when I renamed this before...

Also adjust all users of BToolBar (Tracker and ShowImage).
2015-02-11 22:54:48 -05:00
Axel Dörfler
7720614300 Revert "Move getifaddrs to libnetwork again."
This reverts commit 31ea76548a.

Adrien, please try again without clobbering the otherwise nice
BNetworkInterface API!

Conflicts:
	src/kits/network/getifaddrs.cpp
2015-02-05 11:07:53 +01:00
Axel Dörfler
e661df2980 BPathFinder: include StringList.h for convenience.
* You cannot do anything with a path finder object without a string
  list, so why go through all the hassle?
2015-02-02 22:13:51 +01:00
Axel Dörfler
85f43155fe BRoster: added missing const in Launch() variant.
* The argument array passed in is never touched.
2015-01-28 16:12:18 +01:00
Axel Dörfler
30238c0418 Added BApplication::Signature() getter. 2015-01-27 23:40:03 +01:00
Adrien Destugues
49e8a3c652 BReferencable: implement const references with specialization
This is simpler and cleaner than my previous attempt. Thanks to Ingo for
suggesting this.
2015-01-27 10:31:08 +01:00
Adrien Destugues
e9b8242868 Add a BConstReference class.
This is a BReference that allows only const access to the referenced
object. This was not easily possible with the existing BReference for
two reasons:
* BReference<const Type> would not work, as BReference needs to change
the reference count of the referenced object. Adding mutable and casting
where appropriate wouldwork but,
* It is now also possible to assign a BReference to a BConstReference
(to the same type, of course). The reverse is not allowed, making it
more difficult to "const cast" the referenced object (it's still
possible to "get" the object pointer and cast that).

BConstReference can be used to provide shared read-only access to an
object, for example this can be used to cache non-copiable or
expansive to create objects.
2015-01-26 10:50:48 +01:00
Axel Dörfler
95fdee0bc0 BStringView: added truncation support.
* Added new truncation mode B_NO_TRUNCATION.
* The Truncation()/SetTruncation() methods itself are Dano-compatible,
  however, there was no B_NO_TRUNCATION.
2015-01-23 21:00:28 +01:00
Axel Dörfler
1bfa46f230 BLayoutBuilder::Grid: added spacing setters. 2015-01-23 21:00:26 +01:00
Adrien Destugues
31ea76548a Move getifaddrs to libnetwork again.
* BNetworkInterfaceAddress is moved to libnetwork. It is modified to not
use BNetworkAddress (which is in libbnetapi) and instead use sockaddr
and sockaddr_storage directly. All callers are adjusted to this.
* Some support code is shared between BNetworkInterface and
BNetworkInterfaceAddress, move it to libnetwork but in the BPrivate
namespace.
2015-01-21 10:07:03 +01:00
Adrien Destugues
c299b09cff SupportDefs: make it C89-safe again
The atomic inlines were not implemented in a C89 safe way:
* Use of "static inline" not allowed, but static __inline__ is
* __inline__ is a GCC extension, but these are already in a __GNUC__
block (other compilers use a non-inline version)
* also fix a C++ style comment
2015-01-19 13:54:18 +01:00
Adrien Destugues
4bb4130ff2 Fix instanciate_catalog prototype
The prototype didn't match what the Locale Kit actually uses, making the
plaintext catalog (and any other add-on) unusable.
2015-01-17 17:02:40 +01:00
John Scipione
1f4de50d39 Style fixes to BMessageRunner, no functional changes intended 2015-01-16 18:00:27 -05:00
John Scipione
6fd099550f Style fixes to Messenger, no functional change intended 2015-01-16 16:43:33 -05:00
Adrien Destugues
e2fc7cd3c7 Implement getifaddrs.
This is a BSD extension also available in glibc, but is not POSIX.
Fixes #6279.
2015-01-16 13:10:57 +01:00
Adrien Destugues
0b90f99bc3 Mail server: fix disabling notifications
* The default notifier didn't always take the setting into account.
* The mail server was not using the setting from the settings file and
instead waiting for a message that wasn't sent anywhere.

Fixes #10852.
2015-01-14 16:27:33 +01:00
PulkoMandy
98731302d8 fssh_api_wrapper: fix build on non-Haiku.
* I'm not sure why strings.h needs to be included before <new>, but it
wouldn't work otherwise.
2015-01-14 10:16:32 +01:00
Adrien Destugues
ace74964f1 Remove khash from the sources.
Fixes #9552.
2015-01-13 15:48:58 +01:00
Adrien Destugues
9d053f5975 BOpenHashTable: document some subtleties
Mainly the interaction of resizing the table with iterators.
2015-01-13 15:48:57 +01:00
Hamish Morrison
683cf2ff58 BMediaRecorder: fix a few issues, fix style, remove unused SoundUtils
* Use the preferred time source (GetTimeSource) for the node
* Fix node releasing when creating the connection fails
* Add virtual slots and padding
* Refactor _Connect method
2015-01-12 18:31:27 +00:00
Barrett
739fd34cf5 Replace SoundCounsumer with modified BMediaRecorder.
Signed-off-by: Hamish Morrison <hamishm53@gmail.com>
2015-01-12 18:31:20 +00:00
Adrien Destugues
3395fdcd6a gcc4 build fix.
* offsetof is not allowed on non-POD types so we need to use
offset_of_member (gcc2 accepts offsetof, and C++11 relaxed the
constraints on where it is allowed so it should work there too)
* we have offset_of_member as a workaround until we switch to C++11,
move it from khash (which is soon to be removed) to list.h which is the
other place where it is used (for this one single call in our whole
codebase)

Also fix a typo in vfs.cpp.
2015-01-12 19:04:33 +01:00
Adrien Destugues
6235b4967b More useless inclusions of khash.h 2015-01-12 18:23:45 +01:00
Adrien Destugues
955d5259d0 Rewrite sample HashTable description to use the typedefs
This makes the code more readable (as KeyType and ValueType are clearer
than int and Foo) and easier to copypaste and edit.
2015-01-09 18:09:11 +01:00
Dario Casalinuovo
14896b937a Implement BMediaRoster::RollNode().
Fixes #9083.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>
2015-01-08 08:57:01 +01:00
Axel Dörfler
d33e4744df IMAP: downloading mails is now working.
* Changed the way the attributes are written to make sure that everything
  that can be written once is in fact written just once.
* The rename code in BMailProtocol::_ProcessFetchedHeader() was broken,
  and caused the hang of the last commit.
2015-01-06 15:26:47 +01:00
Axel Dörfler
549949b26f Mail Kit: Changed how filter changes work.
* BMailFilter::HeaderFetched() now only alters the entry_ref, and returns
  B_MOVE_MAIL_ACTION to move a mail.
* Instead of potentially moving the file around several times, the
  BMailProtocol now takes care of carrying out the filter action just once,
  including trying to make the file name unique.
* This also allows the IMAP add-on to know the final location of the mail,
  and thus downloading a message actually works.
* However, with my test inbox, it currently hangs, and a current Debugger does
  not work on my older system -- I guess I need to update.
* Replaced the duplicated space mechanism within the "HaikuMailFormatFilter"
  that is substantially faster, and handles all whitespace, not just spaces.
  It will also replace tabs with spaces.
2015-01-06 15:26:37 +01:00
Axel Dörfler
f8b5e17a23 Minor cleanup. 2015-01-06 15:24:47 +01:00
Axel Dörfler
93608baf60 Clarified progress parameter names for the MailProtocol. 2015-01-06 15:24:14 +01:00
Axel Dörfler
4a8448ce34 Major coding style cleanup. 2015-01-06 15:23:33 +01:00
Axel Dörfler
1da1e5a166 Renamed BodyDownloadConfig to BodyDownloadConfigView. 2015-01-06 15:23:15 +01:00
Axel Dörfler
518698c7e7 Removed commented out method in BMailSettingsView. 2015-01-06 15:23:10 +01:00
Axel Dörfler
57b305558b MailProtocolConfigView now is a BMailSettingsView.
* Changed the private settings base classes to follow the new style.
* Made BodyDownloadConfig use the layout API.
* Adapted SMTP to these changes.
2015-01-06 15:23:06 +01:00
Axel Dörfler
ca3341c7b4 Major mail protocol/filter settings rework.
* Instead of abusing BArchive::Archive() we now use a BMailSettingsView as
  a base view for all filter/protocol settings that works with
  BMailAddOnSettings.
* Cleanups in E-mail which is now completely layout friendly. But also still
  crashes when changing the views.
2015-01-06 15:22:56 +01:00
Axel Dörfler
f90a3bbd67 Added support for letting user mail add-ons override system ones.
* The path will now be relativized before storing it.
* On load, the add-on will be tried to load from the user, then common
  and finally system add-on directory.
2015-01-06 15:22:37 +01:00
Axel Dörfler
1f87386b0a Now also loads mail settings from common.
* Also removed the superfluous and unused timeout argument from Save().
2015-01-06 15:22:28 +01:00
Axel Dörfler
bcf60bbb83 Fixed Mail build.
* The former kMsgBodyFetched (now B_MAIL_BODY_FETCHED, following the other
  message constant names in AppDefs.h) must be public.
2015-01-06 15:22:18 +01:00
Axel Dörfler
146357b547 Completed transition to the new mail API; ie. it compiles.
* Completely untested yet. Unlikely to work yet.
2015-01-06 15:21:55 +01:00
Axel Dörfler
383b34adac Moved ProtocolConfigView to headers/private/mail.
* This is by no means meant as a public header.
2015-01-06 15:21:50 +01:00
Axel Dörfler
715bf3d17a Work in progress of mail rework.
* Not everything compiles; all protocols, and inbound filters do, though.
* Renamed a few classes to give a better idea what they are for; prefixed
  public classes with the 'B' prefix.
* Moved ProtocolConfigView's classes into the BPrivate namespace.
* Moved BMailFilter into its own file.
* Added BMailFilter::DescriptiveName(). This is now used by the RuleFilter
  in order to give a description of what it's doing (ie. no more dozens of
  "Rule filter" entries in the preferences).
* Removed no longer used MailAddon.h.
* Renamed Addon to AddOn where found, since that is more consistent with the
  rest of the API.
* Merged the former MailProtocol with the former MailProtocolThread; the
  differentiation between those two was pretty messy.
* All configuration views touched so far are now using the layout kit.
* The RuleFilter is currently broken functionality wise; I have not yet decided
  how to solve the stuff it uses (TriggerFileMove() does not exist anymore,
  for example).
* BMailAddOnSettings (formerly known as AddonSettings) now directly subclass
  BMessage; there are no Settings() and EditSettings() method anymore. The
  class uses a copy of itself to determine whether or not it has been changed.
* Lots of cleanup.
2015-01-06 15:21:36 +01:00
Axel Dörfler
0f11280e6d Minor MailNotifier cleanup.
* Renamed to BMailNotifier, as it's part of the public API.
* Renamed Notifier.{cpp|h} to DefaultNotifier.{cpp|h} as that's the class it
  implements.
* Made the mail counts uint32, and the byte counts uint64.
2015-01-06 15:21:31 +01:00
Axel Dörfler
e0676bb982 Fixed typo. 2015-01-06 15:21:26 +01:00
Axel Dörfler
9192d4dcf3 Started working on the IMAP add-on itself.
* Renamed imap_config.cpp to ConfigView.cpp, IMAPFolderConfig.(h|cpp)
  to FolderConfigWindow.(h|cpp).
* Got the latter to build.
* Added Settings class to simplify and unify the BMessage based
  settings access.
* Removed the InboundProtocol[Thread] implementation from the build for now.
2015-01-06 15:20:35 +01:00
Adrien Destugues
a6f1bc984d BMessage::ReplaceData: potential corruption on realloc fail
The method would update the field offsets first, and would not restore
them in case of realloc failure, leaving them pointing to the wrong
place.
2014-12-24 11:52:02 +01:00
Jérôme Duval
d6aaebc757 x86: added two MSR definitions. 2014-12-23 19:14:52 +01:00
Adrien Destugues
207212972e BMessage: remove unimplemented GetPointer from headers and docs
* This was never implemented and no one noticed until now.
* A default value for a pointer doesn't make that much sense anyway, so
using the FindPointer method is fine.
2014-12-22 15:01:56 +01:00
Timothy Gu
d1dc9cf655 stdint.h: use correct type for INT64_MAX (#11647)
int64_t is signed. Although it does not make a difference by itself, because
INT64_MAX is still a valid number for uint64_t (UL), the later INT64_MIN
declaration depends on INT64_MAX, and therefore got implicitly casted to
unsigned type.

This fixes the following program on a x86_64 system:

	#include <stdint.h>

	int main() {
		int64_t test = 5;
		if (test < INT64_MIN)
			return 1;
		return 0;
	}

This is a regression since commit 1d13a609 ("stdint.h: define [U]INT64[MAX|MIN]
with [U]L on x86_64").

Signed-off-by: Jerome Duval <jerome.duval@gmail.com>
2014-12-20 10:06:21 +01:00
John Scipione
b825666f3f Rename method parameter in header to match implementation 2014-12-19 19:58:56 -05:00
John Scipione
65dfd2c67c Documentation fixes for BTab and BTabView 2014-12-19 19:51:42 -05:00
John Scipione
f466445917 Changes to BTextControl for docs.
Also remove the non-ControlLook drawing code.
2014-12-18 20:45:44 -05:00
Adrien Destugues
9a539f9e80 Outsource ncurses. 2014-12-18 10:18:39 +01:00
Puck Meerburg
a5f30beaad Fix #7008: Add a64l and l64a from glibc, and add some missing definitions in wchar.h and stdlib.h
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2014-12-14 18:06:09 +01:00
Jérôme Duval
1d13a60901 stdint.h: define [U]INT64[MAX|MIN] with [U]L on x86_64
instead of [U]LL
2014-12-14 15:55:14 +01:00
Puck Meerburg
e4e2ce4ce3 When testing screensaver, don't have mouse move exit the screen saver.
Fixes #7463

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>
2014-12-10 21:18:30 +01:00
John Scipione
4a31c32620 Update locale docs to match new reality.
Created docs for NumberFormat, DateFormat, DateTimeFormat, and TimeFormat
and moved the docs from BLocale to the respective new file. Also
DurationFormat was updated as well.

doxygen once again compiles the docs without warnings.
2014-12-04 19:13:46 -05:00
John Scipione
5ae0cde363 Style fixes to BStringView related to docs 2014-12-04 17:56:24 -05:00
Adrien Destugues
529cd177b5 BFilePanel: allow to change the node flavors
There doesn't seem to be anything ini the implementation that would
cause a problem, as long as you don't try to change this while the
window is already open.
2014-12-04 09:26:49 +01:00
Theodore Kokkoris
249a4944c3 Removed dead code (CID: 1255314) 2014-12-03 21:14:24 +01:00
John Scipione
539dc1bc53 A bunch of style fixes
No functional changes intended
2014-12-02 19:23:51 -05:00
Adrien Destugues
4c7f391f32 Add a <limits> header for gcc2.
Hacked from the gcc4 version. There may be wrong values returned in some
cases.

Fixes #6701.
2014-11-27 12:14:39 +01:00
Adrien Destugues
56abf4aa37 Fix std::isnan and friends for gcc2.
gcc2 was relying on the c99 functions being there, but they are not in
the std namespace.
* Disable the C99 functions and macros in C++ mode
* Redefine them as inline functions in cmath in the std namespace.

Fixes #7396.
2014-11-27 10:58:49 +01:00
Adrien Destugues
3d06e082bc BOptionPopUp: move mennu setup to AttachedToWindow
* There is no need to delay this to AllAttached
* Apps may want to override the SetDivider, and doing it as late as
AllAttached can be annoying.

Fixes #10734.
2014-11-27 09:00:23 +01:00
Adrien Destugues
af218cc4e1 Notifications default to enabled on first boot.
* The server did this right, but the preflet would not check the
checkbox when there was no settings file.
2014-11-25 08:50:47 +01:00
François Revol
12533060d0 stdio.h: add missing typedefs
I should sleep more and build more :D
2014-11-19 15:45:17 +01:00
François Revol
e1f303c5ec Add fopencookie() to stdio.h
We already export it in libroot, and libassuan seems to require it.
2014-11-19 15:13:45 +01:00
Adrien Destugues
1d48729397 There is no B_PRIdTHREAD 2014-11-17 19:18:55 +01:00
Adrien Destugues
2922c4ab90 userlandfs: more 64bit fixes. 2014-11-17 18:51:49 +01:00
Adrien Destugues
5b1f411f57 UserlandFS: 64-bit fix. 2014-11-17 10:58:03 +01:00
Adrien Destugues
a358634d15 Update udis86 to current version. 2014-11-12 11:25:41 +01:00
Augustin Cavalier
0a74147e1d BToolbar: Allow the toolbar's orientation to be set by its creator.
I already made this patch in Heidi's clone of BToolbar. Adding it here
allows me to drop Heidi's version altogether.

I also relicensed the header file at the permission of Stephan. The .cpp
file still lists him as author and copyright holder.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-11-10 13:21:13 +13:00
Alexander von Gluck IV
57bc65034a Everything: Update lots of code to use B_COUNT_OF macro
* Likely not everything, but the obvious uses of B_COUNT_OF
2014-11-09 14:52:19 -06:00
Alexander von Gluck IV
f2b20f8804 SupportDef: Add B_COUNT_OF to get array element count.
* We implement this in a lot of places in a lot of
  ways. Lets add it to the SupportDef
2014-11-09 14:47:39 -06:00
Adrien Destugues
8007a392cf BMessage: add AddFlat taking a const BFlattenable
It seems the const was forgotten in the BeOS version. But there is no
reason not to have it.
2014-11-09 13:51:29 +01:00
François Revol
1436fe7448 Add TIOCM_CAR as a synonym for TIOCM_CD
Gnokii uses it.
2014-11-09 02:28:06 +01:00
Adrien Destugues
5ee2151e2c BHttpRequest: propagate SSL errors to listener
This way it's possible to handle them in applications.
2014-11-06 15:02:00 +01:00
Adrien Destugues
c86ad7f93b Add more features in BCertificate class
* Make it possible to extract more useful data from the certificate
* Also get the OpenSSL error message when a certificate can't be
validated. Send it to the verification failure callback so it can be
shown to the user.
2014-11-06 15:01:59 +01:00
Jessica Hamilton
9f8197a872 BToolbar: move into BPrivate namespace, as it's not public yet 2014-11-06 16:44:02 +13:00
Augustin Cavalier
6d93638b37 ToolBarView: rename to BToolbar and move to libshared.
Also adjust ShowImage for this, it's the only thing that's using ToolBarView
right now.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-11-04 12:45:47 +13:00
Michael Lotz
3fe7b3f72c BString: Add ScanWithFormat convenience method. 2014-11-02 11:38:45 +01:00
Michael Lotz
969af8044a BString: Add format attribute to SetToFormatVarArgs. 2014-11-02 11:38:44 +01:00
Michael Lotz
bf685cdf2e kernel: Fix missing reference release in CreateThreadEvent.
CreateThreadEvent::DoDPC() missed a reference release to balance the
acquired reference before queuing the DPC, resulting in the
CreateThreadEvent objects being leaked.

This also removes the destructor that tried to cancel the DPC. Since
the class is reference counted and only destroyed when the DPC has
run and released the last reference, this didn't make much sense.
2014-11-01 16:32:04 +01:00
Michael Lotz
6a80e6889a kernel: Fix missing reference to team/thread in signal events.
The signal to the team/thread is only actually sent in a deferred
procedure. To ensure that the team/thread stays valid between the DPC
being queued and it actually running, we need to acquire a reference.

Fixes #11390, where the DPC was run after the team was already
destroyed.
2014-10-31 16:16:37 +01:00
Ithamar R. Adema
778611c7e6 fdt: humble beginnings of Flattened Device Tree
This isn't really a bus_manager yet, but just minimal support so
we can get rid of hardcoded ARM SoC support from the core kernel
code.

Needs lots of work, like proper handling of #address-cells and
the like. Also, generic attribute handling, device_manager
integration, and I could go on for hours ;)
2014-10-31 11:14:05 +01:00
Oliver Tappe
b9c8e3de1b string.h: include strings.h for compatibility.
* Partly reverting hrev47655, as the moved declarations are expected
  by many ports to be accessable via string.h. 
  Following standards is a good thing in general, but not if it causes 
  more problems than it helps ...
2014-10-30 00:20:13 +01:00
Ingo Weinhold
6bbd25f071 Make vfs_resize_fd_table() accessible in the kernel
Also update some types from int to uint32.
2014-10-29 21:07:02 +01:00
Ingo Weinhold
078a965f65 vm_soft_fault(): Avoid deadlock waiting for wired ranges
* VMArea::AddWaiterIfWired(): Replace the ignoreRange argument by a
flags argument and introduce (currently only) flag
IGNORE_WRITE_WIRED_RANGES. If specified, ranges wired for writing
are ignored. Ignoring just a single specified range doesn't cut it
in vm_soft_fault(), and there aren't any other users of that feature.
* vm_soft_fault(): When having to unmap a page of a lower cache, this
page cannot be wired for writing. So we can safely ignore all
writed-wired ranges, instead of just our own. We even have to do that
in case there's another thread that concurrently tries to write-wire
the same page, since otherwise we'd deadlock waiting for each other.
2014-10-29 12:37:25 +01:00
Ingo Weinhold
9da590f73e Add vm_page_free_etc()
It additionally gets a vm_page_reservation* argument. If not NULL, the
page count of the reservation is incremented for the freed page.
2014-10-29 02:36:08 +01:00
Michael Lotz
52d500e5b4 kernel: Workaround for double lock of spinlock in user timers.
The thread that is being [un]scheduled already has its time_lock locked
in {stop|continue}_cpu_timers(). When updating the TeamTimeUserTimer,
the team is asked for its cpu time. Team::CPUTime() then iterates the
threads of the team and locks the time_lock of the thread again.

This workaround passes a possibly locked thread through the relevant
functions so Team::CPUTime() can decide whether or not a thread it
iterates needs to be locked or not.

This works around #11032 and its duplicates #11314 and #11344.
2014-10-29 00:25:37 +01:00
Adrien Destugues
4ed39e6a62 disk device manager: check that partitions are unmounted before uninitializing.
when uninitializing a partition or a disk (removing the partition
table), check that all partitions from that table are unmounted, as they
are about to become invalid.

Fixes #8827.
2014-10-28 23:52:57 +01:00
Adrien Destugues
04dbe5b1c5 safemode.h: make it usable from C code. 2014-10-28 23:52:22 +01:00
Adrien Destugues
5d5ec05b1d B*Format: make immutable and remove locking
The language and formatting conventions can now only be set when
creating the objects. This removed the needs for locking them when
formatting to avoid some other thread changing the format while it's
being used.

Adjust tests and DeskBar TimeView to the API changes.
2014-10-27 14:08:42 +01:00
Ingo Weinhold
fa80e7b28f x86 kernel args: Increase number of page tables 2014-10-27 10:57:28 +01:00
Ithamar R. Adema
475f00372b ARM: remove annoying #warning
Although done with the best intentions, the usage of #warning in the
ARM build makes it hard to see what's going on, or see any "real"
warnings.

Remove at least this particularly often triggered one, so we can
have a relatively "quiet" build again...
2014-10-26 23:40:17 +01:00
Adrien Destugues
850f2d1e58 Add the at() method to C++ vectors.
* There is no reason not to have this.
2014-10-26 20:28:21 +01:00
Ingo Weinhold
d228f29f6e BPackageManager: Add SetDebugLevel()
Sets the debug level of the solver.
2014-10-26 00:19:35 +02:00
Ingo Weinhold
74b582a4e5 BSolver: Add SetDebugLevel()
In LibsolvSolver set the debug level of the pool.
2014-10-26 00:19:35 +02:00
Axel Dörfler
50d274f7f9 fs_shell: Added missing new permission check function.
* Fixes the build.
2014-10-25 19:31:15 +02:00
Axel Dörfler
5a95af70a2 vfs/{b|btr|package|b}fs/ext2/exfat: common access check.
* Added VFS helper function check_access_permissions() that combines
  several partially correct versions to the one true version (tm).
* All but BFS (since recently) missed the S_IXOTH for root on directories,
  and all but packagefs missed proper group handling.
2014-10-25 18:47:15 +02:00
Michael Lotz
e9922e775f haiku_loader: Fix wrong size of gBootGDT on x86_64.
The BOOT_GDT_SEGMENT_COUNT was based on USER_DATA_SEGMENT on both
x86 and x86_64. However, on x86_64 the order of the segments is
different, leading to a too small gBootGDT array. Move the define to
the arch specific headers so they can be setup correctly in either case.
Also add a STATIC_ASSERT() to check that the descriptors fit into the
array.

Pointed out by CID 1210898.
2014-10-22 21:06:07 +02:00
Adrien Destugues
015a928b88 Notifications: use a single settings file.
There were 3 setting files, each an archived BMessage. Now there is only
one with all the data inside.
* Rework the SettingsPane class to save and load settings from a
message, rather than having each panel pick a file path on its own
* Move saving the app filters to the preference app, rather than the
server (so it's done at the same place as other settings)
* Rework loading prefs in the server so the settings message is read
from the file once and all settings are loaded from it.

This turns out to be more changes than I anticipated.
Fixes #9424.
2014-10-21 18:53:06 +02:00
Adrien Destugues
9bf4e99477 BUrl: IDNA ToUnicode and ToASCII conversions.
* Since DNS are normally restricted to ASCII, the use of UTF-8 in domain
names is implemented using a "punycode" encoding.
* The request to the DNS server must be sent with the ASCII
representation of the domain name, however the Unicode one should be
used for user-visible parts.
* ICU provides an implementation of the conversion, which we use here.
* Conversion is currently done in-place and modifies the BUrl object
(this is similar to UrlEncode/UrlDecode).
* Adjust existing IDN test to make use of these methods. It's passing
now.
2014-10-21 14:43:13 +02:00
Adrien Destugues
06f436b3ac Use strict mode when url-decoding file requests.
We don't want '+' to become a space here.
Fixes #11109.
2014-10-21 11:31:48 +02:00
Adrien Destugues
9c5d1aa295 Fix infinite recursion in agg when drawing bezier with invalid points
* Patch extracted from http://trac.osgeo.org/mapserver/ticket/3862
* Fixes #6738
2014-10-20 15:54:58 +02:00
Adrien Destugues
b10790de44 Radeon: fix warnings on 64bit. 2014-10-19 12:51:53 +00:00
Adrien Destugues
13af65c402 intel_extreme: fix warnings on 64bit. 2014-10-19 12:51:51 +00:00
Adrien Destugues
a7f7bf3dc9 Radeon: fix warning. 2014-10-19 11:49:53 +02:00
Adrien Destugues
00640ac82e Forgot to fix LDBL_MIN... 2014-10-15 13:08:10 +02:00
Adrien Destugues
1f792e1852 gcc2 float.h: use decimal floats. 2014-10-15 11:29:54 +02:00
Adrien Destugues
7f6fdce3c1 Update haiku copy of gcc2 float.h
Shouldn't be needed, but we may as well use the correct version here
too.
2014-10-14 22:11:27 +02:00
Adrien Destugues
bdb4ae32fd Fix unarchiving of BScrollView with layout
* We archive views using "managed" archives, and the children are not
attached in the BView(BMessage*) constructor, but later. So it's not
possible to find the target and scrollbars in the constructor of
BScrollView.
* Make BScrollView override AllUnarchived and find the target and
scrollbars again there. The code is slightly different as there is no
guarantee that the first child will be the target in that case. The
existing code in the constructor is preserved for non-managed archives.
2014-10-12 16:02:34 +02:00
Adrien Destugues
4cada3807c BDragger: add layout-aware constructor.
Somehow no one needed this yet.
2014-10-11 11:18:56 +02:00
Adrien Destugues
26b0a53d12 Add parsing support to BTimeFormat. 2014-10-09 13:35:23 +02:00
Adrien Destugues
961fdd8cc3 BMessageFormat: parse the pattern at construction
* Instead of parsing the pattern everytime Format() is called, parse it
only once when the object is created.
* Adjust all callers to make use of the feature and reuse the instance
as much as possible. This also allows calling B_TRANSLATE only once
instead of everytime the formatting needs to be done. We use either a
static instance (when the message pattern is constant) or a field (when
it is not known to be constant).
* Since the BMessageFormat instances are now reused, add locking to
avoid race conditions (ICU itself is thread safe, but the format pattern
is recreated when the locale is changed)
2014-10-08 15:12:48 +02:00
Adrien Destugues
97d07c8af2 Add API for parsing dates. 2014-10-07 17:40:18 +02:00
Adrien Destugues
090a0d7686 Add an API to get month names. 2014-10-07 16:08:22 +02:00
Adrien Destugues
4a3a474224 Reimplement BDateTimeFormat using ICU support
* Avoid hardcoding the format to "date, time"
* Allows using DateTimePatternGenerator to create custom formats from a
set of fields.
2014-10-07 13:06:40 +02:00
Adrien Destugues
0da7796e6c Add BMessageFormat class.
This can be used to format complex messages properly. It moves the
complexity of handling plural forms, gender, and anything else needed
into the localizable string, rather than hardcoding it in the code.

This moves the difficulty of handling these things properly to people
doing translations, rather than relying on developers to do it.

Fixes #10755, but our localization must now be updated to make use of
the feature.
2014-10-07 08:51:23 +02:00
Adrien Destugues
136884d011 Remove references to NumberFormatImpl.
The class and header file are gone, so don't try to use them.
Fixes #11312.
2014-10-06 08:35:50 +02:00
Adrien Destugues
e3857211d3 Move DateTimeFormat and NumberFormat out of BLocale
* ... and adjust all callers
* Remove NumberFormatImpl: we rely on ICU to provide this and it can be
fully wrapped into the C++ file. The class was a stub anyway.
* "Monetary" format is included in NumberFormat for now. There may be a
more generic solution to handle monetary and BTimeUnitFormat (and other
arbitrary units)
2014-10-02 09:19:54 +02:00
Oliver Tappe
3006031ac2 Move Geolocation to kits/shared and make it private. 2014-10-02 00:32:48 +02:00
Adrien Destugues
03b2550ef1 Move time formatting to BTimeformat.
* Harmonize API for all B*Format to take an output BString by reference
as the first parameter,
* Move the FormatTime methods from BLocale to BTimeFormat
* Adjust all callers for BTimeFormat, BTimeUnitFormat and
BDurationFormat.
2014-10-01 18:13:35 +02:00
Adrien Destugues
44f11d0982 Make BDateFormat inherit from BFormat again
* Move relevant parts up into BFormat so other format classes can use
those
* Adjust BDurationFormat and BTimeUnitFormat for the changes
* Remove the "default" date format, it is better to keep only a default
locale and let applications create B*Formats from it as needed.
* Creating a B*Format without arguments to the constructor now
configures it for the default locale, which allows for easy use in
standard cases (formatting something with the current language and
format)
* Creating a B*Format is potentially an expansive operation, it is
advised to keep the instance around and reuse it whenever possible.
However it must be "refreshed" when the locale changes, for apps which
supports that, since it keeps a copy of the language and formatting
convention, rather than a pointer to the locale as it did before.
2014-10-01 16:29:12 +02:00
Adrien Destugues
13d147b12b Introduce "invalid" text controls.
* MarkAsInvalid is used to enable or disable the mark
* The B_INVALID BControlLook flag is used
* invalid BTextControls are drawn with a red border.
* You ar encouraged to let the user know more precisely what's wrong, by
showing an helpful error message next to the control or in a tooltip.
2014-10-01 12:12:16 +02:00
Adrien Destugues
afd5ec11d2 Add setters to BDate and BCalendarView
* BDate setters don't perform any validation, use with caution.
* BCalendarView setters do perform validation checks, and will adjust
the day so it fits the requested month or year.
* Add tests for the BCalendarView setters.
2014-09-30 15:38:24 +02:00
Adrien Destugues
526d483999 Make BDateFormat mutable
* Add setters for the language and formatting conventions
* Add shortcut getter and setter for the date format
* Use those in the locale roster to make the BDateFormat actually use
the system preferred language and format.
* Applications can also use this to extract specific information from
the system format (eg. set date format to "LLLL" to extract month
names), or define specific formats more easily (eg. for parsing and
generating e-mail headers or HTTP cookies).
2014-09-30 11:49:47 +02:00
Adrien Destugues
f188c1defa BDateFormat: improve API
* Use a reference rather than a pointer for the output string, removing
the need for NULL checks (which were missing, anyway)
* Adjust callers to that change
* Add new Format variant taking a BDate argument
2014-09-30 09:47:02 +02:00
Adrien Destugues
1d38b7a86a Geolocation: avoid static init of BUrl
* Fixes #11290.
2014-09-27 19:20:39 +02:00
Adrien Destugues
2a5e33a980 Move date formatting from BLocale to BDateFormat
* There is a little code duplication. This will be moved to BFormat once
the time and datetime formatting is also moved out of BLocale
* The way to create a BDateFormat from a BLocale is still open for
discussion. I'm undecided between making BDateFormat a member of
BLocale, or adding a BDateFormat(const BLocale&) constructor.
* Adjust all users of the API.
2014-09-26 18:31:11 +02:00
Adrien Destugues
2f36873105 UrlRequest: add empty SetTimeout for ease of use.
* Requests that support this can implement it, NetworkRequest does
* Build fix: no need to return status_t.
2014-09-26 15:51:36 +02:00
Adrien Destugues
654ae69aa6 NetworkRequest: add a SetTimeout method. 2014-09-26 15:21:54 +02:00
Paweł Dziepak
ac97d35790 kernel/arch: remove leftover debug message
Polite fault handlers are nice, but we like the silent ones even more.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-25 21:57:32 +02:00
Adrien Destugues
13f0458896 Add BGeolocation experimental API.
A BGeolocation object can query an online service to get geolocation
and geotagging data:
 * LocateSelf() tries to locate the machine it is running on, by using an
online database of wifi access points
 * Locate() (not yet implemented) searches a BString and converts it to
lat/lon coordinates (reverse geotagging)
 * Name() (not yet implemented) finds a suitable name for the given
coordinates (address, building name, or anything fitting).

The default service used is openbmap.org, which is freely available but
not very accurate. A request has been sent to Mozilla to use MLS
(Mozilla Location Services), which is a bit more accurate but needs an
API key. MLS is used for geolocation on FirefoxOS, for mobile phones
which don't have a GPS, and the data can be contributed by Firefox for
Android or the dedicated MozStumbler app.

Alternatively, Google Maps also provide the service, but wants
people to pay for it. Google Maps data is more accurate as all Android
devices contribute data to it.

All 3 services use the same JSON-based API: we send a list of reachable
Wifi APs (mac address and signal strength), and we get lattitude and
longitude information, and possibly extra data which will currently be
unused.

This can be used to implement HTML5 geolocation with reasonably accurate
results, but it can also be used in other places. For example
FirstBootPrompt could try to guess a list of most likely languages and
keyboard layouts from it (if wifi is working at install time, that is).
2014-09-23 16:37:59 +02:00
Stefano Ceccherini
d553b90c86 BSynth/BSoftSynth: implemented GetAudio().
Patch by Pete Goodeve (modified by me, hopefully for the better and
without introducing bugs) which implements BSynth::GetAudio().
2014-09-21 19:46:04 +02:00
Adrien Destugues
c98378e51a Add HTTP proxy support.
* Move default context management to BUrlRequest since some code
(including the testsuite) bypass the BUrlProtocolRoster.
* Introduce proxy host and port in BUrlContext
* Have BHttpRequest use the proxy when making requests
2014-09-15 14:24:37 +02:00
Jessica Hamilton
fd7f53f049 storage kit: don't expose the dev_t in BPartition::Mount()
Comments to #9672 agree that there's really no need to
expose the dev_t handle, thus simplifying the API.

The dev_t handle, if required, can be retrieved via
BPartition::GetVolume() instead.
2014-09-15 16:28:41 +12:00
Paweł Dziepak
95e97463d2 kernel: add generic wrapper for accessing user memory
This patch adds user_access() which can be used to gracefully handle
page faults that may happen when accessing user memory. It is used
by arch_cpu_user{memcpy, memset, strlcpy}() to allow using optimized
functions from the standard library.

Currently only x64 uses this, but nothing really is arch specific here.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 22:39:07 +02:00
Paweł Dziepak
396b74228e kernel/x86_64: save fpu state at interrupts
The kernel is allowed to use fpu anywhere so we must make sure that
user state is not clobbered by saving fpu state at interrupt entry.
There is no need to do that in case of system calls since all fpu
data registers are caller saved.

We do not need, though, to save the whole fpu state at task swich
(again, thanks to calling convention). Only status and control
registers are preserved. This patch actually adds xmm0-15 register
to clobber list of task swich code, but the only reason of that is
to make sure that nothing bad happens inside the function that
executes that task swich. Inspection of the generated code shows
that no xmm registers are actually saved.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
b41f281071 boot/x86_64: enable sse early
Enable SSE as a part of the "preparation of the environment to run any
C or C++ code" in the entry points of stage2 bootloader.

SSE2 is going to be used by memset() and memcpy().

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
f2f91078bd kernel/x86_64: remove memset and memcpy from commpage
There is absolutely no reason for these functions to be in commpage,
they don't do anything that involves the kernel in any way.

Additionaly, this patch rewrites memset and memcpy to C++, current
implementation is quite simple (though it may perform surprisingly
well when dealing with large buffers on cpus with ermsb). Better
versions are coming soon.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
6156a508ad kernel/x86[_64]: remove get_optimized_functions from cpu modules
The possibility to specify custom memcpy and memset implementations
in cpu modules is currently unused and there is generally no point
in such feature.

There are only 2 x86 vendors that really matter and there isn't
very big difference in performance of the generic optmized versions
of these funcions across different models. Even if we wanted different
versions of memset and memcpy depending on the processor model or
features much better solution would be to use STT_GNU_IFUNC and save
one indirect call.

Long story short, we don't really benefit in any way from
get_optimized_functions and the feature it implements and it only adds
unnecessary complexity to the code.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:51 +02:00