Commit Graph

2621 Commits

Author SHA1 Message Date
Axel Dörfler
5ab2b1457b BJob: Added SetState() method. 2015-10-17 14:16:26 +02:00
Jessica Hamilton
93244a65e6 BScrollView: _ComputeFrame(BRect,...) used incorrect insets.
Previously, the BRect would be expanded by the call to
InsetBy(), but the replacement _InsetBorders() forgot to
take this into account.

Fixes #12380.
2015-09-15 00:39:23 +00:00
Axel Dörfler
8e96ec340b BWindow::MoveOnScreen() now has a flags field.
* You can now specify whether or not you want to resize the window,
  and move it on screen, or center it.
* Removed PulseWindow::MoveOnScreen() method.
2015-09-14 20:45:38 +02:00
Axel Dörfler
14cc5b4c44 BMenuBar::SetBorders() added.
* This allows you to only draw some of the borders.
2015-09-09 20:58:57 +02:00
Axel Dörfler
fd79684a5f BScrollView::SetBorders() added to disable borders.
* You can specify which borders will be drawn using the
  BControlLook::B_TOP_BORDER, ... constants.
* Adapted Mail to no longer need the SetInsets() hack.
2015-09-09 20:51:49 +02:00
Axel Dörfler
f7c2983edc HaikuDepot: change window frame setting.
* Moved entirely into MainWindow.
* Moved duplicated code into separate methods.
* Resize the main window on larger screens by default, as we can make
  use of the extra space.
* Use BWindow::MoveOnScreen() instead of make_sure_frame_is_on_screen()
  as the former has more info. And is even smarter now as it can
  optionally resize windows to fit on screen.
* Center window on screen by default (ie. when there are no settings).
2015-09-08 17:58:02 +02:00
Michael Lotz
d64c7086d5 Various whitespace cleanup only. 2015-09-05 16:09:33 +02:00
Axel Dörfler
7bdee8beab BEmailMessage: added missing const, Date() returns time_t.
* Added missing const to some getter methods.
* Date() now tries to parse the date of the mail, and return it as
  a time_t; you can still retrieve the actual string via
  HeaderField("Date") if you have to.
* Mail now shows the time in the local time zone, and with the
  current locale.
2015-09-04 17:33:17 +02:00
Axel Dörfler
66078c7911 BMailComponent: made a few methods const. 2015-09-04 17:33:12 +02:00
Axel Dörfler
19d8cb703c BDate: added time_t constructor.
* This class is pretty much useless as it is.
2015-09-04 17:33:07 +02:00
Axel Dörfler
e047b40a2f Interface Kit: use different spacing constants.
* While this breaks binary compatibility with earlier Haiku releases,
  use values that are less likely to clash with actual use cases.
* Specifically, using a negative spacing is one way to get rid of the
  border of BScrollViews, to put them into a window neatly.
* Also, BControlLook now uses a switch to resolve them.
2015-09-04 17:32:44 +02:00
Axel Dörfler
ebf4cbe6e7 Incredibly smart BWindow::MoveOnScreen() method added.
* Makes sure that the window is as complete as possible on screen.
2015-09-03 21:30:37 +02:00
Michael Lotz
5b9f6b5485 BRoster: Add launchSuspended option to _LaunchApp().
It allows to launch the app, but keep its main thread suspended instead
of automatically resuming it.

Also add appThread argument which allows to retrieve the main thread of
the launched team.
2015-08-28 22:52:50 +02:00
Stefano Ceccherini
c34e5f4dd5 B_BIG_SYNTH_FILE and B_LITTLE_SYNTH_FILE are deprecated.
Small style change in midi headers.
2015-08-24 17:18:26 +02:00
Michael Lotz
efb0a3a853 EntryCache: Add entry_cache_add_missing() for negative caching.
It provides a way for filesystems to cache a lookup failure and
therefore prevents repeated lookups of missing entries. This is a
common scenario for example in command lookup and compiling, where
each directory in PATH or each include directory is searched for the
given entry.
2015-08-20 21:25:56 +02:00
Dario Casalinuovo
7771139cdf BMediaEventLooper: Rewrite ControlLoop()
* The first problem was the O(n^2) complexity of the algorithm, it's
  now linear and try to act in a circular way by dispatching
  events and reading the port in a balanced way. This exclude
  a certain degree of possible deadlocks.
* Add detection and escape when the system try to kill the
  thread. This solve some blocking issues on exit et similia
  that i had with libjackcompat.
* The algorithm choose soon which event to focus on.
* Lateness is calculated just before the event is dispatched
  as it is the more appropriate place, otherwise we would be
  calculating something imprecise/guessed.
* Remove timed_event_queue::queued_time. It's more precise to
  just use the RealTime() before to Dispatch the event.
* It should solve the BSoundPlayer lateness problems.
* With those improvements the media_kit is not going to lock
  completely under stress conditions, instead it try to work
  in a best effort shape.
* There's still room for improvements, for example i'm considering some
  strategies in lateness situations such as update scheduling latency,
  try to decrease waiting time and detect when we are too early on
  the other hand to recover when the load go down.
* Thanks to Julian Harnath for sharing his WIP patch which helped
  with some controls such as avoiding negative lateness.
* Comments are welcome!
2015-08-03 01:35:09 +02:00
Jérôme Duval
b4665f9a59 HttpForm needs another friend class for GCC6. 2015-07-30 22:25:19 +02:00
Axel Dörfler
7b0ff5c6e6 BAlert: use layout API, allow any number of buttons.
* Added default constructor; you can now alter the complete behavior
  via setters, and also add buttons afterwards.
2015-07-30 19:50:03 +02:00
Axel Dörfler
99b4affab6 Added BWindow::ResizeToPreferred().
* B_AUTO_UPDATE_SIZE_LIMITS only really makes sense for resizable
  windows, and it only sets the minimum/maximum window size.
* ResizeToPreferred() resizes the window to its preferred size, and
  also supports height-for-width layouts.
2015-07-30 19:49:48 +02:00
Dario Casalinuovo
8acd164f8c Add new version of launch_media_server
* Due to the needs to provide a peaceful UX, i moved out the
  notifications mechanism from the Media preflet and i have
  integrated it with the launch and shutdown functions of MediaDefs.h.
* This implied to introduce a new launch_media_server function
  similar to the shutdown_media_server allowing to specify a custom
  notification function too.
* Both functions then are reworked to send by default notifications
  to the Deskbar, this was needed because in a lot of situations
  the mechanism failed without correctly noticing the user.
* The one argument launch_media_server is considered to be deprecated,
  the default argument is removed to mantain binary compatibility but
  make new apps to automatically use the new one with just the default
  arguments. This is needed due to conflicts in overloading.
* Improve notifications by indirectly extending localization
  to old BeOS apps.
2015-07-29 18:03:32 +02:00
Dario Casalinuovo
32afe10ab2 BMediaRoster: Add B_MEDIA_SERVER_STARTED and B_MEDIA_SERVER_QUIT
* This is done by watching to registrar notifications
  and providing a minimal service to contact the
  media roster in private API. The roster use this
  service to automatically reconnect to the media_server.
2015-07-24 12:19:33 +02:00
Dario Casalinuovo
67483edabd Add BMediaRoster::IsRunning
* This function is provided to check
  if media services are running.
2015-07-24 12:19:31 +02:00
Axel Dörfler
fb7dad2b49 BRoster: Added ability to pass env on launch.
* Added BRoster::Private::Launch() that adds an additional parameter
  to pass a pointer to the environment of the launched app.
2015-07-22 20:44:03 +02:00
Axel Dörfler
78e39852fa launch_daemon: Use BRoster::Launch() without registrar.
* BRoster now allows settings a "no-registrar" mode that is currently
  only honored in _LaunchApp(), though.
* Job::Launch() is now using this, which also allows launching
  applications by signature (ie. if the job name matches the
  signature, you can omit the "launch" option).
2015-07-22 20:42:13 +02:00
Axel Dörfler
798ad3db30 BLooper: don't delete a launch_daemon port.
* Unless the service is really to be quit, the port should stay around;
  but that decision is to be made by the launch_daemon, not the service
  itself.
2015-07-22 20:40:52 +02:00
Axel Dörfler
1480e5da6f The beginnings of a launch_daemon for Haiku.
* This will be heavily inspired by Apple's launchd, as well as
  systemd -- for now it really doesn't do a whole lot, though.
* What works so far: the configuration files are read, parsed, and
  the jobs created.
* The jobs are even initialized, and their message ports created.
* BApplication now retrieves a previously created port from the
  launch_daemon for use with BServer.
* Only the registrar actually uses this for now.
2015-07-22 20:39:47 +02:00
Jérôme Duval
94887feb64 Added some support for GCC 5+. 2015-07-20 21:45:02 +02:00
Augustin Cavalier
6fd2553690 TabView: Lots of style fixes. 2015-07-14 11:22:44 -04:00
Augustin Cavalier
c432a83bf3 TabView: Add TabViewPrivate class, actually fix non-layout SetView.
Thanks to Axel and Stephan for reviewing!
2015-07-14 11:04:39 -04:00
Augustin Cavalier
6031dea0cb BTabView: Lots of fixes & cleanup.
* Address TODO about setting fSelected when nothing is done.
 * Pass a pointer to the tab view to the BTab so that it can call Invalidate().
  (Checked against BeOS).
 * Call Invalidate() from the BTab after SetView() & SetName().

Fixes #12108 & #12196.
2015-07-13 21:34:52 -04:00
John Scipione
c466b4daeb IK: Change orientation param name to direction
for ScrollView::ScrollBar in ScrollView.h and the documentation. This makes
the parameter name consisent and fixes a doxygen warning.
2015-07-07 16:22:22 -07:00
Adrien Destugues
f972422c66 Add a simple DNS caching system to BNetworkAddress
netresolv (and libbind) won't cache DNS requests, which can result in a
lot of DNS requests being made for the same host. Implement a simple
cache in RAM (local to each application) which will keep the most
recently requested addresses cached. This can speed up loading of an
HTTP page a lot, by saving a DNS request for each resource stored on the
same server as the main page.
2015-06-14 15:47:13 +02:00
Adrien Destugues
404cb7e310 BReference: missing const cast when building a BReference<const>
* The internal BReference is on a non-const object so it can increment
and decrement the reference count, so we need to cast the const away.
2015-06-14 15:46:53 +02:00
Axel Dörfler
e711e6e42f Moved BJob, and JobQueue into the support kit.
* Put it in the BSupportKit namespace, following the style introduced
  with the package kit for now.
* The BSupportKit::BJob class no longer knows about the package kit's
  Context class. However, the BPackageKit::BJob class does.
* Due to the namespace juggling, a lot of files had to be touched.
* The JobQueue class remains private.
* Due to the way Haiku is built on itself, you cannot build this change
  under Haiku with an older release.
2015-05-21 21:37:01 +02:00
Jérôme Duval
73de58376a Update icu x86_64 package with namespace renaming enabled.
"Renaming" means the icu namespace is suffixed with the version number,
atm icu_55. Using "renaming" allows to use two different versions of ICU,
thus easing upgrades. For instance haikuwebkit uses a current version of ICU,
while the system uses a newer one after an upgrade.

* Replace all uses of the icu namespace in our public headers, with a macro
defaulting to icu. As the namespace is only used for private fields pointers,
there should be no impact.
* Locale kit *.cpp have to import the macro from <unicode/uversion.h> *before*
including any locale headers. Ditto for a Time preferences cpp file. This way,
the correct current icu namespace is referenced.
* Fixes bug #12057.
2015-05-10 21:52:36 +02:00
François Revol
7dd1073833 ByteOrder.h: add explicit casts when using gcc builtins
Those return uintNN_t types instead of our own types,
but uint32 for example is long while uint32_t isn't,
giving some trouble with the PRI* macros for example on PPC.
2015-04-21 00:25:29 +02:00
Michael Lotz
0cc8c71bba BLayoutItem: Add RemoveSelf() convenience method.
It works analoguous to BView::RemoveSelf(), i.e. it removes itself from
the parent (layout in this case) and returns whether or not it had and
was successfully removed from said parent.
2015-04-15 00:34:05 +02:00
Michael Lotz
4198ccecf3 Whitespace cleanup only. 2015-04-15 00:30:56 +02:00
Michael Lotz
3b7b927dd0 libbnetapi: Add BNetworkRoute to replace use of route_entry.
The BNetworkRoute class manages a route_entry and the sockaddr's
associated with it. It replaces the direct use of route_entry in the
BNetworkInterface API.

Using route_entry is fragile and inconvenient as it only holds pointers
to the sockaddr's. When getting a list of routes from the kernel, each
route_entry is set up so that its pointers point into the single flat
buffer that is passed around. Creating a copy of the route_entry and
then deleting the flat buffer makes the pointers in the copy stale.
Returning these route entries therefore always lead to a use-after-free
when they were eventually used.

BNetworkRoute also takes over the code and functionallity of getting
routes from RouteSupport. The corresponding method in BNetworkRoster is
replaced by a static method in BNetworkRoute.

Also distinguish between the default route and gateway of an interface.
GetDefaultRoute() now gets the default BNetworkRoute for the interface
while GetDefaultGateway() gets the associated gateway address within
that default route. Adjust network preferences panel to this change.

Note that we currently only seem to have per interface default routes
and not an actual global default route. This was already the case before
these changes and I did not further investigate what this means.
2015-04-12 18:50:00 +02:00
Michael Lotz
e01de52283 More whitespace cleanup all over the place. 2015-04-10 15:05:14 +02:00
Michael Lotz
e25776bd83 Whitespace cleanup only. 2015-04-08 12:56:58 +02:00
Michael Lotz
5ae3af6cc5 SupportDefs: Add B_SCN* counterparts for some more types.
Namely for [s]size_t, [{phys|generic}_]addr_t and off_t.
2015-04-04 22:55:57 +02:00
Michael Lotz
a05bfeb4a9 Whitespace cleanup only. 2015-04-04 22:55:56 +02: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
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