Commit Graph

8413 Commits

Author SHA1 Message Date
Jonathan Schleifer
18941b085c
Import libc++ 2015-11-09 18:02:17 +01:00
Jonathan Schleifer
f2c0917eea
Import libcxxrt 2015-11-09 18:01:58 +01:00
Jonathan Schleifer
d77787f2a4
Import libunwind 2015-11-09 18:01:42 +01:00
Jonathan Schleifer
0e2547a80d
Import lib/Headers from Clang 2015-11-09 18:01:18 +01:00
Adrien Destugues
4849ab6c8b BHttpRequest: add SSL certificate exception management.
When an HTTPS request uses an SSL certificate that OpenSSL considers
untrusted, and the user decides to continue anyway, add the certificate
to an exception list. Match certificates against this list and don't ask
the user again if they are already there.

Fixes #12004. Thanks to markh for the initial patch and peeking into the
WebKit code!
2015-11-09 10:46:58 +01:00
Adrien Destugues
6c32f50a64 BCertificate: fixup the API
* Add an operator== and a copy constructor
* Make the getters const so they are easier to use
2015-11-08 23:47:29 +01:00
Jérôme Duval
7ccbb2f03f Add operator delete(void *, size_t) for C++14. 2015-11-08 00:38:20 +01:00
Jonathan Schleifer
456150599a
Add __clang__ to a few #ifdefs 2015-11-07 23:02:53 +01:00
Axel Dörfler
5860caae39 launch_daemon: Added basic ability to stop/start jobs via API.
* Stopping a job is very simplistic right now, and will have to be
  extended considerably, probably with its own job.
2015-11-07 21:58:12 +01:00
Axel Dörfler
d8c022250d BMailAccountSettings: use BPathFinder.
* This allows to put add-ons in non-packaged folders, too.
* Also, Set{In|Out}boundAddOn() only ever looked in the system dir.
2015-11-07 20:55:14 +01:00
Jonathan Schleifer
617793f41b Add back declarations to kernel_cpp.h for GCC
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2015-11-07 20:53:13 +01:00
Jonathan Schleifer
71e0324992
Move new / delete kernel_cpp.h -> kernel_cpp.cpp
new and delete may not be defined as inline, as Clang loudly complains.
The same is true for static.
2015-11-07 18:16:23 +01:00
Simon South
75c31ae28d system: Build using public elf.h header
Reduce duplication of code by

* Removing from elf_common.h definitions available in os/kernel/elf.h
* Deleting elf32.h and elf64.h
* Renaming elf_common.h to elf_private.h
* Updating source to build using public and private ELF header files
  together

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2015-11-07 11:49:56 +13:00
Simon South
e3616ca108 system: Provide elf.h to applications
Make a version of elf.h (assembled from the private header files
elf_common.h, elf32.h and elf64.h, and including Haiku's extensions for
C++) available to applications ported from UNIX.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2015-11-07 11:49:53 +13:00
Axel Dörfler
3282b758b0 launch_daemon: Add API to get information on jobs.
* Ie. a listing of all targets/jobs, as well as specific (basic) info
  on each.
* Also added a bit of optional debug output.
* Moved translating the path to launch time -- we should take the job's
  environment into account here at some point.
2015-11-06 22:47:56 +01:00
Simon South
078b88b12d runtime_loader: Randomly position only relocatable code
The use of an unreliable test for relocatability effectively broke
runtime_loader's support for non-position-independent executables, as it
would insist on randomly positioning these files' segments in memory
anyway causing the program to quickly crash.

With this change runtime_loader uses the object type specified in the
file's header to determine whether its segments can be safely relocated,
restoring support for non-PI executables.

Fixes #12427.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2015-10-26 21:19:25 +01:00
Murai Takashi
949cf6ac85 Fix GCC 5 build.
* Add -fgnu89-inline flag for libroot/posix/glibc
* Change __GNUC__ == 4 to __GNUC__ >= 4

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

Fixes #11990, most of the changes had already been done.
2015-10-26 19:05:24 +01:00
Axel Dörfler
2e17b6504f BLaunchRoster::ResetStickyEvent() added.
* Used to unflag sticky events that already have been triggered once.
2015-10-25 14:41:17 +01:00
Axel Dörfler
c80084b025 JobQueue: fixed incorrect requeuing.
* A dependent job was requeued even if it wasn't part of the queue
  before. The code relied on dependent jobs being already enqueued;
  but that cannot be guaranteed.
* If a job failed, its dependent jobs are now also set to failed, so
  that they won't be requeued at a later point.
* This caused some of the "Launching xxx failed: Operation not allowed"
  messages in the boot process. Those actually weren't harmless, and
  could mess up the natural job order.
2015-10-18 13:11:26 +02:00
Axel Dörfler
7cd19b7e5c launch_daemon: Implemented sticky events, and registration.
* Sticky events are events that keep their signal raised, ie. even if
  a job is initialized afterwards, it will still be triggered.
* Consolidated naming for external events.
* Events are now registered once they are actually being used. This
  allows them to allocate the resources they need to do their thing.
2015-10-17 14:16:26 +02:00
Axel Dörfler
5ab2b1457b BJob: Added SetState() method. 2015-10-17 14:16:26 +02:00
Alexander von Gluck IV
97aa078ef4 intel_extreme: Intial work for ValleyView support
* No impact to non-ValleyView chipsets
* Bump some register locations for VLV
* Only have HDMI port to test with on my ValleyView GPU
  and our driver seems to be missing all HDMI and
  sideband functionality.
* As ValleyView chipsets seem to be UEFI only, we don't
  have VESA fallback, so this shouldn't cause regressions.
  (unless we get UEFI framebuffer support)
2015-10-15 23:39:31 -05:00
Alexander von Gluck IV
a1ed294ff9 AHCI: Rework port reset and control
* Move to more standardized functions matching AHCI spec
* Don't perform unnecessary double port resets
* Begin implementing a software reset to try first per spec.
  Software reset needs more work, falls through to port reset
  for the moment which is stable.
* Don't duplicate ATA defines, use what we already provide.
* Tested working on VirtualBox 1-16 AHCI ports, Intel C200,
  and AMD FCH.
2015-10-05 19:46:03 -05: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
6adf7a0c75 VFS: prevent FD inheritance for the kernel completely.
* Each io_context now has a "inherit_fds" member that decides whether
  or not this context allows to inherit FDs to its children.
* This replaces the former O_CLOEXEC mechanism.
2015-09-11 17:08:35 +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
Stefano Ceccherini
ce27f9612e Implement ClipToPicture inside a BPicture. Not working yet.
BView::ClipToPicture doesn't work anymore, when nested inside a BPicture,
This happened when its implementation was moved server-side.
2015-09-05 21:35:54 +02:00
Michael Lotz
d64c7086d5 Various whitespace cleanup only. 2015-09-05 16:09:33 +02:00
Michael Lotz
eec73693e0 PicturePlayer: Rework to be more safe against corrupted data.
This introduces a more sane API (currently private) that allows for
safer and possibly more efficient implementations:

* It uses a struct of named and typed function pointers instead of just
  a void pointer array. This adds type safety to the callbacks so the
  compiler can figure out if things match up before subtle bugs get
  introduced.
* It provides bounds for all strings/buffers passed to the callbacks.
* It uses const references instead of implicitly copying arguments.
* It folds stroke_x/fill_x pairs into draw_x functions with a fill
  argument to reduce the amount of functions needed.
* It uses unsigned values where negative values make no sense.

The old API has been implemented on top of the new one using adapter
functions. It makes copies of all data passed to the callbacks which
effectively keeps the picture data from being modified. This matches
with the R5 behaviour.

This also reimplements the buffer parsing to be safe against corrupted
data by validating that the types actually fit in the provided sizes
and buffers (using a templated reader).

Since this class is used from the app_server with user provided data,
making it more safe is important even though it comes with a slight
overhead (replicating R5 behaviour, i.e. crashing the app_server when
corrupted data is fed, doesn't seem very appropriate here).
2015-09-05 16:09:31 +02:00
Axel Dörfler
6b8712663a BToolBar: made FindButton() public. 2015-09-04 17:33:46 +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
Dario Casalinuovo
7d337b23b7 BMediaRoster: Reintroduce the undertaker class
* This has been necessary due to the undefined call order of
of static objects. Fixes #12315.
* The bug has been caused by the linker which free unused resources,
making the BMediaRoster to run in a zombie state. In this state
anything such as a message could make the looper to crash.
* The class is reintroduced with some differences though, we are
going to protect it from another thread calling Roster() while the
BMediaRoster is quitting and implement BMediaRosterEx::Quit.
* Unregister registrar notifications before we quit our thread. Avoid
to uninitialize anything from QuitRequested as it may cause problems.
2015-09-01 15:08:57 +02:00
Adrien Destugues
75d1eb3a59 assert.h: reintroduce headers guard for function declarations.
The POSIX standard requires us to allow assert.h to be included multiple
times with differnt values of NDEBUG. So we can't have a global header
guard on the files. However, we must also make sure that we don't
declare functions multiple times in that case. Re-introduce an header
guard on the part of the file where we declare functions, only.

Fixes lots of warnings when building Netsurf.
2015-08-29 23:14:03 +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
d6039d2b23 Midi: Remove some duplicated code
Introduced new private read/write_midi_settings() and used them
in MidiSettingsView and SoftSynth.
2015-08-27 11:51:57 +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
John Scipione
a0ba79fbff Split BSpinner into BAbstractSpinner and...
2 concrete classes which are currently implemented:
* BSpinner (works on int32s)
* BDecimalSpinner (works on doubles)

In addition BAbstractSpinner now inherits from BControl instead of
BView/BInvoker. This allowed for code simplification at the cost of needing to
cast for the decimal version because SetValue(int32 value) comes from BControl.

Also, add a spinner_button_style enum with 3 options:
* SPINNER_BUTTON_HORIZONTAL_ARROWS
* SPINNER_BUTTON_VERTICAL_ARROWS
* SPINNER_BUTTON_PLUS_MINUS

which sets the spinner arrows to either use horizontal arrows (left/right)
vertical arrows, (up/down), or +/- symbols (the default).

If the spinner button is using horizontal arrows you can decrement and increment
the spinner value by pushing control+left/right, otherwise you can increment and
decrement by pushing up or down. The reason for needing control is so that you
can move the cursor in the textbox otherwise.

Switch the 3 apps that are currently using BSpinners to use the integer variety
in Deskbar preferences, WebPostive preferences, and Screen preferences.
2015-08-22 15:15:08 -07:00
John Scipione
d122938346 Spinner: Generalize actions into methods
Add an Increment(), Decrement(), and SetValueFromText() method.

These can be overridden by derived classes.
2015-08-22 15:15:07 -07:00
John Scipione
a9385e8e2e Spinner: Move ValueChanged up
... along with the other hook methods
2015-08-22 15:15:06 -07:00
John Scipione
adba4ce988 Add BSpinner class based on GCI2013 work 2015-08-22 15:15:03 -07:00
Michael Lotz
5d4501aa01 Assorted whitespace cleanup and typo fixes. 2015-08-20 21:54:41 +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
Michael Lotz
f474606ee9 libroot_debug: Merge guarded heap into libroot_debug.
The individual debug heap implementations are now exposed via a
structure of function pointers and a common frontend dispatches the
malloc and malloc_debug APIs through them.

The MALLOC_DEBUG environment variable can be used to select the guarded
heap by adding 'g', otherwise the debug heap is used as the default.
Consequently the separate libroot_guarded is not needed anymore and has
been removed.

To allow the use of environment variables this early, init_env_post_heap
has been added and the heap dependent atfork() moved there. This allowed
to fold the code of init_heap_post_env into init_heap so the former has
been removed.
2015-08-13 22:12:18 +02:00