Commit Graph

8927 Commits

Author SHA1 Message Date
Dario Casalinuovo
0844ddf4d9 MediaClient: Polish destructors
* Make Release() the only public way to destroy a connection.
2017-01-18 20:19:02 +01:00
Dario Casalinuovo
d64dd7beea MediaClient: Fix style for private methods and other cleanup
* Cleaned up some unneeded callbacks.
2017-01-18 20:19:02 +01:00
Andrew Aldridge
8b9c75d67f Fix copying special files in Tracker
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2017-01-17 17:31:45 +01:00
Dario Casalinuovo
7561d9ac5d Populate media/experimental with future media_kit classes
* Node implementations headers are move into src/kits/media.
2017-01-16 23:04:14 +01:00
Jessica Hamilton
9c7d2b4668 DefaultMediaTheme: improve watching for parameter value changes.
* Addresses TODO of sub-classing controls, registering with the
  media roster for parameter changes.
* Also adds support for discrete parameter controls, which didn't
  have this functionality.
* With this change, the controls no longer need to be focused or
  modified for the parameter changes to register.
2017-01-16 12:28:49 +13:00
Dario Casalinuovo
fdfd8a502e General MediaClient cleanup
* Avoid setting fRunning in different places.
* Fix SimpleMediaOutput kind mismatch.
* Other minor fixes.
2017-01-15 19:28:14 +01:00
Dario Casalinuovo
550e05af20 MediaClient: Start/Stop force argument doesn't make sense 2017-01-15 19:28:14 +01:00
Dario Casalinuovo
728c730c45 MediaClientNode: Fix little night's mixup 2017-01-15 19:28:14 +01:00
Dario Casalinuovo
2c9fa0f278 MediaClientNode: Schedule outgoing connections on start
* Add preliminary binding support.
2017-01-15 14:45:24 +01:00
John Scipione
26d4164481 AbstractSpinner: Make TextView resizable
Fixes #13168
2017-01-12 14:16:43 -08:00
John Scipione
5973288e11 BSpinner: Fix copy-pasta bug, min=>min, max=>max
fMinValue was getting set to INT32_MAX then set to INT32_MIN
fMaxValue was not getting set

now set fMinValue to INT32_MIN, fMaxValue to INT32_MAX

also in _InitObject()
2017-01-12 14:16:42 -08:00
John Scipione
3705d40cd9 BSpinner: Set min value then max value
... reverse this to avoid confusion, you'll see why in next commit.

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

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

Also fixes a copypaste error in FormattingConventions.cpp.
2017-01-11 20:50:41 +01:00
Dario Casalinuovo
e6004b7729 MediaClient: Move WIP min/max functions into BMediaConnection 2017-01-10 22:54:53 +01:00
Dario Casalinuovo
e7aa210bca MediaClient: IsRunning() status is set at handle time 2017-01-10 22:44:16 +01:00
Dario Casalinuovo
3ef4b20086 Make BMediaRecorder public
* Fills a functionality lack of the classic media_kit.
2017-01-10 21:34:20 +01:00
Tsimblist
5f8edc9c51 Fix for ticket #12978 - Tracker GetInfo window layout problem
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2017-01-08 23:20:57 +01:00
John Scipione
e1304871bb Revert "BWindow: CenterOnScreen a bit above center"
This reverts commit a5be1832cc.
2017-01-01 12:25:05 -08:00
John Scipione
a5be1832cc BWindow: CenterOnScreen a bit above center
BWindow docs: Document changes to CenterOnScreen()

https://68.media.tumblr.com/d8dff7a17b9d90b41e32c5a2a0312513/tumblr_oj2wg1tmKs1r0f0hfo1_1280.png

Will revert if not appreciated.
2016-12-31 18:06:55 -08:00
Adrien Destugues
1942b3b1ee Missing include.
Make gcc5 happy.
2016-12-30 17:50:06 +01:00
Adrien Destugues
f621b750f6 BSoundFile: implement most of it.
Based on the amazing work of puckipedia, this gets BePac Deluxe to play
fine on Haiku (complete with sound effects and music).

This is based on his original patch, but the irrelevent parts (working
around bugs in ffmpeg that were fixed since then) are removed.

Fixes #9939.
2016-12-30 17:32:48 +01:00
Adrien Destugues
2c26ad4b39 move BUrl to the support kit
It is used by the media kit, which created a dependency from libmedia to
libbnetapi to openssl.
It is not entirely specific to the network kit, there are some use cases
that don't involve network at all.
2016-12-29 16:38:53 +01:00
Murai Takashi
682adeb3aa IconButton.cpp: fix memory leak.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Ticket : #13127
2016-12-29 11:48:28 +01:00
Murai Takashi
b50d53dd19 NodePreloader.cpp: fix memory leak.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #13115.
2016-12-29 11:48:28 +01:00
Rene Gollent
4ee47fe9e8 BListView: Cleanup, no functional change.
- Rename _FontChanged() to _UpdateItems() to more accurately reflect its
  purpose, as discussed on commits list. Adjust callers accordingly.
2016-12-25 16:16:43 -05:00
Jessica Hamilton
4419d699ec partitioning: pass along reference to parent when uninitializing.
* Fixes problems with setting the partition name after uninitializing
  a partition in DriveSetup. Previously, UninitializeJob() was
  followed by SetStringJob(), but the kernel was updating the
  change counter for the parent partition when uninitializing a
  partition, leading to SetStringJob() having an incorrect change
  counter for the parent partition. Now the parent change counter
  will be correct when SetStringJob() runs.
2016-12-23 18:53:15 +13:00
Rene Gollent
078b08e4ed BListView: Fix missing update for list items.
- According to the Be Book, one of BListItem::Update()'s responsibilities
  is updating the item's internal height/width. However, while we were
  providing such updates in the case of the item initially being added
  to the view, or when the list view's font was changed, we were not doing
  so on frame resize. This would lead to items having a stale width field
  in such a circumstance, leading to possibly incorrect behavior in apps
  relying on that field to be correct.
2016-12-20 22:33:26 -05:00
Dario Casalinuovo
51844723d3 MediaConnection: Remove redundant IsInput/IsOutput 2016-12-18 15:15:30 +01:00
Dario Casalinuovo
75b90c42e5 MediaConnection: Fix buffer size and duration redudancy
* There's no need to supply ways to mismatch the buffer duration
and size. Anything should reflect the media_format, this is at least
fixed on API level.
2016-12-17 19:10:50 +01:00
Dario Casalinuovo
2fdc256d60 BMediaOutput: API cleanup 2016-12-17 19:10:50 +01:00
Dario Casalinuovo
a9a63d1ba5 MediaClient: First valid ID for connections is 1 2016-12-17 19:10:50 +01:00
Dario Casalinuovo
ab96594f4c MediaEncoder: Fixes CID 1347183: Control flow issues (NO_EFFECT)
* An unsigned value was checked for negative values.
2016-12-13 00:22:06 +01:00
John Scipione
3db3193290 BNode: CID 602323 explicitly ignore fCStatus return value in ctor
This is what it this whole push was all about
2016-12-12 10:36:59 -08:00
Dario Casalinuovo
83cd87d033 SimpleMediaClient: Use virtual inheritance to reduce duplication 2016-12-11 19:16:19 +01:00
Dario Casalinuovo
d1742cc336 MediaInput/Output: Inherit base virtually 2016-12-11 19:16:18 +01:00
Rene Gollent
c5dcedecae Debugger: Fix oversight.
DebugReportGenerator:
- In the case where the function was already disassembled beforehand,
  we weren't retrieving the statement, leading to a null pointer
  dereference.
2016-12-11 11:09:53 -05:00
Adrien Destugues
fda0bf77fb Revert "repo rework: Re-add compatibility url field"
Revert "repo rework: Remove stubs; Breaks repo compat."
Revert "repo rework: Remove need for repos to be self-aware"

This reverts commit a2b2f4d642.
This reverts commit 602076ef82.
This reverts commit 5ffaf72c8a.

These changes break the build on Haiku and the ability to create repo
mirrors, for the lack of a replacement for the URL (an UUID was evoked
on the mailing lists, but not implemented).

We are due for a release soon, please don't break the build.
2016-12-10 12:55:56 +01:00
Adrien Destugues
f901d7f587 Revert BNode changes resulting in non bootable system
Revert "BNode: CID 602323 explicitly ignore fCStatus return value in ctor"
Revert "BNode: Set fCStatus in SetTo() explicitly"
Revert "BNode: Style fixes, see below for details"

This reverts commit ede463195d.
This reverts commit 6e3445098a.
This reverts commit 89c0b71c9a.

We are due for a release soon. Please keep things working.
2016-12-10 12:55:06 +01:00
Rene Gollent
7bdeef54a2 Debugger: Rework parts of report generation.
Team:
- Adjust report generation event to include a final status code for listeners.

CliContext,TeamWindow,ReportUserinterface:
- Use aforementioned status code to indicate whether report generation
  succeeded or failed.

DebugReportGenerator:
- Notify listeners if report generation fails. This may have previously
  been responsible for some bug reports where it was indicated that the
  debugger hung without exiting after being asked to save a report from
  a crashed app.
- When dumping disassembly, retrieve it directly if necessary rather than
  requesting it via the user interface listener. This also fixes the quirk
  that requesting to save a crash report while looking at the source code
  of a function would trigger switching it to disassembly visually.
- When walking the list of threads to dump, acquire references to all of
  them before starting. Otherwise, it was potentially possible for a running
  but not crashed thread to exit while we were generating the report, leaving
  us with a pointer to a deleted thread. This was most likely the cause of one
  of the crashes reported in #13082.
- When receiving the notification that source code state has changed, clear
  the waiting function. Otherwise, it was potentially possible for us to get
  other state change notifications, leading to the data semaphore being
  released too often. This would then cause later potential waits such as
  the stack frame memory dump to not actually wait when they should,
  potentially leading them to dereference objects that weren't yet ready.
  This fixes another of the crashes in #13802.
2016-12-09 23:11:23 -05:00
John Scipione
ede463195d BNode: CID 602323 explicitly ignore fCStatus return value in ctor
This is what it this whole push was all about
2016-12-09 15:13:23 -08:00
John Scipione
6e3445098a BNode: Set fCStatus in SetTo() explicitly
instead of setting it in _SetTo() and then again in SetTo()

fCStatus could be set even fewer times but this is a good compromise
(logically, performance wise it is not an issue).

Update copyright, add myself to Authors
2016-12-09 15:13:23 -08:00
John Scipione
89c0b71c9a BNode: Style fixes, see below for details
Remove superfluous parens
Rename result variable to bytesWritten
Sync() Unwrap ternary style fix (for consistency)
* Shouldn't this return fCStatus instead of B_FILE ERROR?
* BeBook says "returning B_OK on success and an appropriate error message otherwise."
* Has returned B_FILE_ERROR since "it is accomplished ..."
Rename result variable to bytesWritten (again)
Remove superfluous space
explictly cast status_t to ssize_t
Remove superfluous parens, remove space, add newline
Explicitly cast status_t to ssize_t (again)
WriteAttrString() cleanup
* rename error to result
* rename sizeWritten to bytesWritten (consistency and clarity)
* check if error cede from WriteAttr and cast to status_t
* > not entirely style but functionaly same
* if length is different then written return B_FILE_ERROR
* > not a style change but a very minor functional change
* add some comments
Tiny documentation fix precede vars with \a
More style fixes
* Rename error to result
* Put parens around conditional of ternary instead of whole thing
* Compare against NULL explicitly
* Don't set fCStatus here, we're going to set it in the calling function instead
* > note that Unset() sets fCStatus to B_NO_INIT but that's ok
80 char limit style fix
More style fixes and don't set fCStatus
* remove superfluous parens
* compare ref to NULL explicitly
* > Also don't set fCStatus here since we will do that in calling function
    Unset() sets fCStatus to B_NO_INIT but that's ok
Unwrap ternary style fix (consistency)
Rename error to result (again)
2016-12-09 15:13:23 -08:00
Dario Casalinuovo
b8d4709eb9 MediaEventLooper: Remove soft real time lateness bounding
* The media_kit isn't an hard real time beast. Bounding lateness
looked like the perfect way to enable reasonable soft real time
performance and thus limiting port writes and reads between producers
and consumers. It seems to don't work very well so I just remove it.
* The result of the recent code simplification makes it equal to my
first version, before any discussion on it happened.
* Thanks to AlienSoldier for testing such issues.
* Fixes #13069.
2016-12-08 17:13:49 +01:00
Alexander von Gluck IV
a2b2f4d642 repo rework: Re-add compatibility url field
* We saw 3rd party repos break as well oddly.
* Reintroduces the url field in a little bit cleaner
  way.
* Should solve "Failed to open repository file" errors
* Once everyone updates beyond hrev50723 this is
  no longer needed.
2016-12-08 07:57:47 -06:00
Rene Gollent
67e0301477 Debugger: Adjustments to report generator.
DebugReportGenerator:
- Due to the changes made with respect to correctly handling switching to
  disassembly explicitly, the report generator needs to request loading
  source files as it walks the stack trace in order to get source-based
  line number information. Fixes crash reports having -1 as the line number
  in cases where debug information was available, but the user hadn't yet
  looked at the source file in question.

LoadSourceCodeJob:
- Cleanup.
2016-12-07 23:58:36 -05:00
Alexander von Gluck IV
602076ef82 repo rework: Remove stubs; Breaks repo compat.
* These stubbs satisfied older Haiku releases that
  required the URL
* Users running nightly images will need to upgrade
  to hrev50723 - hrev50744 before upgrading further
* Getting this out of the way now before the beta
  comes out.
* New installations shouldn't suffer any problems.
2016-12-07 21:27:56 -06:00
Rene Gollent
7cfc043e00 libdebugger: Fix a regression with ELF loading in some cases.
ElfFile:
- The refactoring in commit 2c50fbb8e1
  inadvertently introduced a failure case if a section in the ELF file
  is skipped, since it was explicitly passing in the insertion index
  to BObjectList::AddItem(). Since in the skipped case, this would be
  out of bounds for the list's current size, this would cause the whole
  operation to fail with an out of memory error, and consequently halt
  all further loading of debug information for that particular file.
  This manifested itself with libroot on at least gcc5, where no symbols
  could be seen.
2016-12-07 22:17:34 -05:00
Dario Casalinuovo
f1f0956504 MediaClient: Just some interface review 2016-12-06 21:16:36 +01:00
Rene Gollent
692fe55503 libdebugger: Add initial version of network interface.
NetworkTargetHostInterface{Info}:
- Barebones classes for implementing a target host interface over TCP.
2016-12-05 18:17:50 -05:00
Rene Gollent
25ec63dbf5 libdebugger: Add string setting type.
- Needed in order to properly implement a settings description for
  a remote interface.
2016-12-05 18:17:48 -05:00
Rene Gollent
9e4d0fd483 libdebugger: Implement remaining remote request/response pairs. 2016-12-05 18:03:14 -05:00
Rene Gollent
bcca096ae5 libdebugger: Fix header order in RemoteDebugRequest. 2016-12-05 18:03:13 -05:00
Alexander von Gluck IV
5ffaf72c8a repo rework: Remove need for repos to be self-aware
* See #12917 for details.
* Squashed to one commit to make revert easy if we
  run into any issues.
* pkgman is now pre-attached to the 'current' repo
  version within nightly images so they can be updated
  by default.
* This shouldn't impact us keeping older sets of package
  versions by commit hash for building older hrevs.
* There are XXX stubs with "Kill me". These will need
  to be dropped after users are given sufficent time to
  upgrade. We're dropping a previously required field (url)
  so making this a slowish roll out.
* Makes the repos a lot less restrictive which should
  help PM package building automation be a bit easier.
* Once this stuff smooths out, we'll add UUID's to the
  repo definitions for duplicate repo detection.
2016-12-02 00:41:06 -06:00
Axel Dörfler
852e09d61f launch_daemon: Added stop target ability.
* Before, you had to stop each job by itself.
2016-11-29 23:14:36 +01:00
Dario Casalinuovo
ecb395852e Introduce BSimpleMediaClient
* The idea is to move the callback based mechanism into a derived
class. The objects can be composed to create working systems.
* The BMediaClient class supply RegisterInput/RegisterOutput
and BeginInput/BeginOutput is moved to BSimpleMediaClient.
* Various minor fixes.
2016-11-29 01:22:35 +01:00
Humdinger
945566ff43 Switch from DejaVu to Noto font
As discussed, Noto renders much better with freetype 2.7 [1].
The DejaVu package is still in the HaikuPorts repo and can be installed
manually just like all the other available fonts.

[1] http://www.freelists.org/post/haiku-development/freetype-update-from-265-to-27
2016-11-27 19:04:26 +01:00
Dario Casalinuovo
209b520fa0 MediaClient: Add some padding and reserved functions 2016-11-26 17:30:49 +01:00
Dario Casalinuovo
05e29ea1ad MediaConnection: Remove Reset() 2016-11-26 17:24:10 +01:00
Dario Casalinuovo
9ee6577e2d MediaClient: Distribute callbacks across derived classes 2016-11-26 17:13:02 +01:00
Dario Casalinuovo
9e9655ed55 MediaClient: Use CurrentTime for both offline and performance time 2016-11-25 17:38:44 +01:00
Dario Casalinuovo
6d0255216e MediaClient: Introduce BMediaInput and BMediaOutput 2016-11-25 17:38:44 +01:00
Dario Casalinuovo
eebedf8f1a MediaClient: Use unique id for both inputs and outputs 2016-11-25 17:38:44 +01:00
Dario Casalinuovo
902701e6bf MediaClient: Use higher level structs for the remaining methods 2016-11-24 21:37:14 +01:00
Dario Casalinuovo
d3523cb2ce MediaClient: Fix connection and tests
* Remove some bran related to the Faber audio engine heritage,
this fixes connections and all tests.
2016-11-24 18:21:51 +01:00
Dario Casalinuovo
a546d1f8f6 MediaClient: Rename FindConnection into FindInput/FindOutput
* The first used for destinations and the second for sources.
2016-11-24 00:54:24 +01:00
Dario Casalinuovo
300e9786ef MediaClientNode: Fix PrepareToConnect with unknown media_type. 2016-11-24 00:46:13 +01:00
Dario Casalinuovo
f506f3056f MediaClient: Improve internals and API
* Capabilities() become Kind()
* Use media_client and media_connection to better model
the different situations of the API. Reduce code duplication
and move media_kit structs/methods into private.
* Various API and beauty improvements.
* Introduce id management for media_connections.
* Fix different issues preventing to correctly begin a connection.
2016-11-24 00:27:58 +01:00
Dario Casalinuovo
23d5326e2b MediaClient: Introduce media_client and media_connection
* Those structs are provided as replacement for the classic
media_kit ones. They provide better encapsulation of the data
and the resulting code is heavily simplified. It's planned to
introduce BMediaRoster functions to provide conversion from
media_node and media_input/media_output to media_client
and media_connection.
2016-11-24 00:27:58 +01:00
Rene Gollent
a9d53d9e7e Debugger: Fix regression introduced in hrev50534.
FunctionInstance:
- Add new state FUNCTION_SOURCE_SUPPRESSED. This signals that the user
  explicitly forced disassembly to be loaded despite source code being
  available.

LoadSourceCodeJob:
- When forced to disassembly, use the above suppressed state accordingly.

SourceView/TeamWindow/TeamDebugger:
- Adjust to take new state into account as needed.

TeamDebugInfo::GetActiveSourceCode:
- When looking at a function to decide whether to return line information
  based on source or disassembly, first examine the source code state. If
  the source has never been loaded for that function, but we have it available,
  set it on the function at that point. This lazily addresses the fact that
  LoadSourceCodeJob is called on behalf of a specific function, and
  consequently only sets the source code onto that function, and not all others
  present in the same file. This allows us to differentiate between the case
  where a function doesn't have source code available at all, versus a function
  that has simply been forced to disassembly view at this point in time.

The primary symptom of the above issue was that attempting to set a breakpoint
outside of the currently active function, but within the same file would result
in the breakpoints view indicating that the breakpoint was at line 0 rather
than the appropriate line, and breakpoints would also not be drawn in the
source view for such locations.

Thanks to Humdinger for the heads up!
2016-11-22 23:06:09 -05:00
Dario Casalinuovo
2082b5d25f MediaClient: Use media_client_kind for client capabilities 2016-11-18 17:56:51 +01:00
Dario Casalinuovo
5ec9bd1eff MediaClient: general cleanup 2016-11-18 17:46:19 +01:00
Dario Casalinuovo
0253ecbd9e MediaClient: Remove BeginConnection for external connections
* While it looked like a good formalism, there's no need to add
unneeded complex steps to the user of the API.
2016-11-17 02:43:40 +01:00
Dario Casalinuovo
34619a6fd7 Revert "MediaRoster: Don't allow rosters without a BApplication"
This reverts commit f3c2f6665f.
2016-11-17 01:38:23 +01:00
Dario Casalinuovo
2740a716ea Style fixes 2016-11-14 19:21:58 +01:00
Dario Casalinuovo
f3c2f6665f MediaRoster: Don't allow rosters without a BApplication
* The BeBook states that any media_kit app should have BApplication
behind. Beware the app don't need to be running, but the object
should be present. This is because we use BApplication as a safe
exit point to free the memory allocated.
* While I was a bit reclutant in doing that, after a developer
discussion we agreed this would be the cleaner way to solve this
problem without eluding it.
2016-11-14 19:21:58 +01:00
Dario Casalinuovo
ad7255c892 MediaRoster: Use messaging instead to call Quit on exit
* As far as the bebook states loopers shouldn't be quit from
other threads, using a B_QUIT_REQUESTED message should be more
safe.
2016-11-14 19:21:58 +01:00
Dario Casalinuovo
521f41dd5a Fix typo and build 2016-11-11 15:50:32 +01:00
Dario Casalinuovo
9b410c41e8 Initial merge of the BMediaClient branch
* The BMediaClient is an higher level API to the media_kit. It
corresponds to what the layout API was for the interface_kit.
The main idea is to allow the developer concentrate only on
higher level details and avoiding handle with the tricky parts
of the media_kit. At the same time the general purpose node that
is implemented inside would allow implementing the best techniques
around thus at the same time reducing code duplication and increasing
efficiency.
* BMediaClient is WIP, this is the initial merge of the branch.
The initial development stone was set long time ago and walked
through various design/implementation phases.
2016-11-11 13:47:56 +01:00
Adrien Destugues
956c2f5fb0 Replace "All BeOS disks" with "All Haiku disks"
- In mount menu and mount preferences.

Fixes #12623.
2016-11-11 10:58:10 +01:00
Humdinger
97a5f78d9f Use driver settings API for the MIDI settings
Suggested by Adrien, to make the MIDI settings more future proof when
more settings will be added, and to make manual editing less error prone.
Moved the settings from B_USER_SETTINGS_DIRECTORY/midi to
B_USER_SETTINGS_DIRECTORY/Media/midi_settings.
2016-11-06 15:17:01 +01:00
Adrien Destugues
156b6cd596 BMediaFile: fix destruction order.
The fSource can point to a source with code inside a media plug-in (in
particular, the HTTP source from the http_streamer plugin). However,
deleting the extractor can cause the plugin to become "unreferenced" and
unloaded. If we try to call code to delete the source later, we find
that the code is already unloaded, and the app crashes.

This happens in Web+ when navigating away from Youtube or otherwise
interrupting a video while it is being played.

Fixes the crashing part of #13058.
2016-11-05 21:18:39 +01:00
Adrien Destugues
f4db7fdc68 BUrl: allow URLs without protocol or authority again.
Parsing an URL can never fail. The regexp is designed to match any
input. In the worst case, everything will end up in the "path"
component. WebPositive relies on this to generate file URLs from a plain
path.

URLs without a protocol are also possible, and can be used with an
implicit protocol. A typical example is network shares sometimes noted in
"//host.domain/path/file" form.

Add tests for these two cases and fix the parser to behave as expected.
2016-11-05 13:01:36 +01:00
Humdinger
c9275bf517 Fix loading of MIDI SoundFonts with spaces in filename 2016-11-03 10:45:09 +01:00
Adrien Destugues
1674f60dae Implement uninitialization for GPT
This makes it possible to format a GPT drive back to MBR without too
much effort.

Fixes #8823.
2016-11-02 21:57:16 +01:00
Jérôme Duval
7e9b90f7e4 Midi: use fluidlite as fluidsynth replacement.
* SF3 support.
2016-11-01 08:50:03 +01:00
Dario Casalinuovo
8023d6bafd PluginManager: Move reference counting in the MediaPlugin
* Ideally we should support this feature by default to allow
future improvements to the plugins management.
* Fixes the major memory corruption that lead to various
crashes on exit in MediaPlayer.
2016-10-31 23:39:32 +01:00
Dario Casalinuovo
42a3f9477d PluginManger: Remove BReferenceable and add locking 2016-10-31 23:39:32 +01:00
Adrien Destugues
ed31589c37 URL Disaptching/Async listeners: forward debug messages
This makes it possible for the Asynchronous listener to get the
messages. It can then process them in a more fancy way.

The default implementation will still log the messages to the console
(if debug is enabled), but it will do so from the Async listener for
asynchronous requests now. This means they will probably be logged from
the same thread, and show up in a more readable way.

This also makes it possible to listen to several requests and log them
in a nice way (in a status window or whatever).
2016-10-31 22:14:39 +01:00
Adrien Destugues
ed6d3d88c1 SecureSocket: add code to trace SSL events.
Under a #define TRACE_SSL, should you need it.

Also load error strings when initializing the SSL context, so we get
human readable errors from SSL (also in the ser reported ones).
2016-10-31 22:12:50 +01:00
Adrien Destugues
a9665fc66a HttpRequest: use data from the input buffer first
The HttpRequest protocol loop is designed using an input buffer storing
data from the socket. At each loop, we try to parse some of the data,
and then read more from the socket.

However, in some cases (in particular with chunks, which we parse only
one at a time in a loop iteration), we may not use all the data from the
buffer. Eventually, we will be left with an "empty" socket (nothing to
read from there) but the request not completed because there is still
data in the input buffer.

In that case, we would hang waiting for a read on the socket, instead of
processing data from the input buffer.

Change the code to read from the socket only if a loop iteration did not
manage to read anything from the input buffer. This means the input
buffer is too small for the next thing to process (it contains less than
one line of data, for example), and in that case we can safely read from
the socket without being blocked.

This should fix several cases where the network code was stuck doing
nothing, including https://my.justenergy.com/ reported in #13010.
2016-10-31 22:00:40 +01:00
Humdinger
05574d9b2f Tracker: Fixed alert button label for renaming of home folder
Fixed copy&paste error for button label of renaming action.
2016-10-31 10:09:49 +01:00
Andrew Lindesay
cf65729463 Url: implement same URL parsing logic in C/C++ code
- Remove uses of group matching regular expression, not available on all
  build hosts,
- Parsing is faster than our old regexp engine.

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

- Fixes #13002
- Fixed some indentation (tabs vs space), please configure your editor
  properly.
2016-10-31 09:14:44 +01:00
Adrien Destugues
f004acb098 HttpDate: fix parsing of 2-digit year dates.
Fixes #13043.
Added the affected cookies to the testsuite to avoid future regressions.
2016-10-31 08:59:23 +01:00
Adrien Destugues
cec123b4de More fixes to the cookie parser.
- Fix parsing of strings shorter than 24 bytes (which can only happen if
  the year has only 3 digits, or the day in month, hour, minute or
  seconds have only 1).
- Only allow the GMT and UTC timezone specifiers, as all HTTP dates
  should use the GMT zone (but still use a format that allows specifying
  a timezone name).

All cookie tests are now passing.
2016-10-30 20:23:43 +01:00
Adrien Destugues
2215451b39 BNetworkCookie: fix overflow in date computation.
Fix one of the two failing tests from the cookie testsuite.
2016-10-30 20:23:43 +01:00
Mark Hellegers
a61218b10d Fix #13042: Make sure all cookies are saved 2016-10-30 20:23:43 +01:00
Jérôme Duval
6c2abee2f5 Debugger: use localhost if gethostname() fails. 2016-10-29 14:02:40 +02:00
John Scipione
134ed61451 ListView: Fix off-by-1 bug introduced in hrev50574
7687a6ef13

jgt^He

Fixes #12990 more better

Thanks Humdinger for noticing this bug and reporting it.
2016-10-26 13:36:49 -07:00
Augustin Cavalier
3798bf90cb Use the kDesktopWindowLook/kDesktopWindowFeel constants from WindowPrivate.h...
... instead of redefining them, or including a private Tracker header to
get them.
2016-10-22 04:24:49 -04:00
Augustin Cavalier
cfe0adf0fb Tracker: Remove unused definition. 2016-10-22 02:07:27 -04:00
Augustin Cavalier
13cf3fecae Tracker: Remove unused Cursors.h header. 2016-10-22 02:07:27 -04:00
Dario Casalinuovo
3588e74aef BMediaEventLooper: Return to simple lateness computation
* Remove enqueue_time again.
* Lateness seems generally useless. No way to get something useful
experimentally. The commit noise however was useful, the port wait is
behaving more in accordance with the lateness calculus.
* Fixes #12817 and possibly #12594.
2016-10-20 03:11:01 +02:00
Dario Casalinuovo
0c98ab27d3 BMediaFile: Add BUrl SetTo
* Also fix the server version of BUrl constructor
to use a const reference.
2016-10-20 02:26:25 +02:00
Dario Casalinuovo
1c5cb31fef BAdapterIO: Implement SeekModes 2016-10-20 02:26:25 +02:00
Augustin Cavalier
45e5951b88 Tracker: Fix the TitleView appearing sometimes in icon-view folders.
It appears this would only happen when opening a new window (not an
existing one) for a folder that was set to icon-view.

Regression from hrev48734 (Layout API commit). Fixes #13000.
2016-10-17 15:19:31 -04:00
Augustin Cavalier
6a42abb28a BView: Add missing NULL checks to GetMouse().
Fixes #12821.
2016-10-17 15:00:17 -04:00
Adrien Destugues
534f22038c Catalog stub: fix undefinied initiamization order.
As investigated by korli in #13001.
2016-10-15 09:28:56 +02:00
Adrien Destugues
0dbb85e285 Style fix 2016-10-09 22:21:14 +02:00
Adrien Destugues
069c569704 Fix incorrect use of _SendMonitorUpdate
Icon size is only a boolean here (true for a large icon, false
otherwise). Using B_LARGE_ICON directly is not appropriate.

As found by Murai Takashi, but there was a second case in the same file
which I also fixed.

ticket : #12955
2016-10-09 21:25:53 +02:00
John Scipione
7687a6ef13 ListView: Don't change selection while dragging
This allows you to drag and drop list items more easily, but,
removes the ability to drag and drop color squares in Appearance from
one list item to another. Changing selected list items while dragging
was more of a helpful side-effect for Appearance but isless reasonable
default behavior.

Fixes #12990
Partially regression on #8618
2016-10-06 15:56:11 -07:00
Adrien Destugues
f638c82a22 StyledText: fix reading of utf-8 documents
BNode::ReadAttrString does not check for the attribute to actually be a
string. It will return B_OK (and useless data) if called on a
B_INT32_TYPE attribute. Check the attribute type before reading.

Also remove various debug ouput leftovers.

May fix #12976.
2016-09-29 22:56:37 +02:00
Adrien Destugues
a71b10d760 BTextEncoding: fix naming and move to BPrivate namespace. 2016-09-27 20:38:58 +02:00
Adrien Destugues
2c9528d291 BNetEndpoint: improve timeout handling
Based on a patch by Duggan.

A timeout of 0 means "no timeout". Avoid an overflow case. Translate
B_INFINITE_TIMEOUT to a NULL timeout for select().

Fixes #7870
2016-09-27 20:32:18 +02:00
Adrien Destugues
08e5249142 TextEncoding: add Encode/Decode methods.
This replaces convert_from/to_utf8 in a way that doesn't leak memory.

Use the new method in StyledEdit.

Fixes #6252, #3065.
2016-09-25 23:16:19 +02:00
Adrien Destugues
fbb725bbdc Add text encoding detection to the Locale Kit.
As usual we ask ICU to do the actual work. The TextEncoding constructor
is fed with a sample of the text to identify (ICU docs recommend a few
hundred bytes). The text is analyzed in various ways (bytes patterns
such as UTF-8 escaping schemes, common letter sequences from known
languages, byte order marks) and an encoding is determined.

Replace code in StyledEdit by this new implementation.

Note that ICU seems to always return some valid encoding, even with fed
with obviously non-text data. This makes StyledEdit open the files no
matter what, where it would error out before.

Fixes #9395.
2016-09-25 18:50:29 +02:00
Adrien Destugues
09bb8269ac Tracker: localize RegExp errors.
These were left out because the same RegExp.cpp file is also used by
collectcatkeys. This needed some jam file changes to get collectcatkeys
to build on both the host and target.

Fixes the last remaining part of #6374.
2016-09-25 15:10:12 +02:00
Adrien Destugues
ccb55f969c Tracker: localize query templates.
Tracker can create query templates when they don't exist yet. This was
done with an hardcoded archive of BColumns for the pose view, which did
not allow for an easy way to replace the strings. Now the archive is
created on the fly when the function is run, which makes it possible to
build it with localized strings (and in the system's endianness, which
will make it load faster).

Based on patch by mt, but with a lot of rework.

Fixes part of #6374.
2016-09-25 13:20:18 +02:00
Humdinger
f8c5cdace0 Use new Device_NAS vector icon for shared volumes
...and remove old bitmap icons.
2016-09-17 18:24:44 +02:00
Rene Gollent
b65adbdfbc Debugger: Fix #12940.
- Add new interface TeamFunctionSourceInformation. Currently this
  exposes a single function allowing one to query for the currently
  active source code given a FunctionDebugInfo instance.
- Implement TeamFunctionSourceInformation on TeamDebugInfo.
- Pass TeamFunctionSourceInformation to Dwarf{Team,Image}DebugInfo.
  In turn, make use of it in DwarfImageDebugInfo::GetStatement() in
  order to determine whether to return the corresponding assembly
  or source statement.

With this piece of information, the debugger is now correctly able to
determine that the user is currently looking at disassembly despite debug
info being available, and consequently adjust its stepping behavior based on
that. Previously, the source code statement was always used, leading to it
not being possible to single step assembly lines in such a circumstance
without manually using run to cursor.

Other related cleanups:
- TeamDebugInfo now inherits BReferenceable directly, rather than relying on
  indirectly inheriting it from TeamTypeInformation.
- Remove BReferenceable from TeamTypeInformation. The latter is only an
  interface anyways, and inheriting that base class from multiple locations
  was causing GCC5 trouble when resolving BReference<TeamDebugInfo>, even
  when virtual inheritance was used.
2016-09-13 22:14:10 -04:00
Dario Casalinuovo
ac8ca41623 Fix StreamerPlugin reference counting
* BReferenceable deleted itself when the latest
reference was released causing a double free.
* The code now avoid to call the function when
we are about to delete the object.
2016-09-07 20:42:43 +02:00
Dario Casalinuovo
e3f2079964 AdapterIO: Remove unuseful Close() 2016-09-07 18:21:13 +02:00
Dario Casalinuovo
79bd3b4837 StreamerPlugin: Add reference count
* Keep the Streamer around until everyone released it.
2016-09-07 18:19:10 +02:00
Dario Casalinuovo
95a5e62515 MediaFile: Correctly delete the source on exit
* The delete flag of BUrl constructors was reset by _Init,
this lead to a zombie thread on the background under certain
conditions.
2016-09-07 18:02:34 +02:00
Rene Gollent
584fd9619c libdebugger: Fix #12944.
LocatableFile:
- If there is no parent path, don't insert a path separator between parent
  and filename. This may be the case depending on how the source file was
  specified during compilation.

FileManager:
- When constructing an EntryPath from a LocatableEntry, ensure that the
  parent folder actually has a path string that isn't simply empty to ensure
  consistency with the raw dir/file case. Otherwise, hash lookups that are
  dependent on the parent dir being NULL if not specified will fail, causing
  us to not locate the file successfully. This was preventing us from updating
  source location information for make 4.2's main.c, as the latter was
  specified in such a way that the above combination of conditions would
  occur, and consequently when asking the FileManager to update the source
  location with the actual file, the entry couldn't be found in the table,
  and no information would be updated.
2016-09-06 22:56:52 -04:00
John Scipione
ed99a95f35 Tracker: Add list view menu to virtual directory window 2016-09-03 12:06:45 -07:00
John Scipione
8fdd2629eb Tracker: 32x32 icon size option in list mode
16x16 is same old default
32x32 is new and fun

Adjust start offset to depend on icon size

Remove the kColumnStart variable and instead use StartOffset()
method which calculates the column start offset based on the icon
size. When you switch between icon sizes in list mode recalculate
the first column width to make room for the icon or more text.

Add some padding to list height in large icon mode.
2016-09-03 12:06:44 -07:00
John Scipione
41b9b4ad9d Tracker: Remove some left behind code
A couple of lines of code were left behind in a previous
refactor. Code just checked some list items.
2016-09-02 22:01:08 -07:00
John Scipione
b339ee18c5 Tracker: Make mini mode default for list mode
but if you are in icon mode (like Desktop) use large icons instead.

This change will be important going forwards.
2016-09-02 21:59:49 -07:00
John Scipione
ee20ff95a4 Tracker: Style fixes
More style fixes
2016-09-02 21:02:06 -07:00
John Scipione
5cf9407148 Revert "Tracker: Add some zoom padding in list mode"
This reverts commit f76147aa9a.
2016-08-30 13:40:48 -07:00
John Scipione
27c911e8bb Revert "Tracker: Add zoom padding in list mode take 2"
This reverts commit 7d009616aa.
2016-08-30 13:40:35 -07:00
Adrien Destugues
6980817672 Remove pthread.h include from netdb.h
- It is not needed in the .h, and makes gawk build fail.
2016-08-27 09:04:22 +02:00
John Scipione
7d009616aa Tracker: Add zoom padding in list mode take 2
Add 16px to right and bottom of content when zoom

fixup of last commit
2016-08-26 23:07:18 -07:00
John Scipione
f76147aa9a Tracker: Add some zoom padding in list mode
Add some padding to the right and bottom of the content when
you zoom.

16px the size of a mini-icon
2016-08-26 23:00:14 -07:00
Adrien Destugues
5298c29729 Fix regressions introduced in hrev 50503
- Missing "dontAsk" when renaming some files,
- Missing exceptions in the warning alert construction to automatically
  allow modifying some files (anything inside the settings folder)
- Missing translations

Fixes #12925.
2016-08-24 07:26:53 +02:00
Adrien Destugues
e43cfe781f netresolv: Remove or disable unused variables
Fixes #12746.
2016-08-21 16:53:56 +02:00
Adrien Destugues
4072c4f1b3 Tracker: fix localization of warning when editing system dirs
Programatically generating a string usually doesn't work well with
localization. Better unfold all the possiblities.

Moreover, the callers of the functions had a long if condition with
3 B_TRANSLATE calls embedded in, and there was an erroneous ; at the end
of those, so the supposedly protected statement was executed anyway.

Fixes #12747.
2016-08-21 16:53:52 +02:00
Murai Takashi
777ff37166 Tracker: Fix -Wlogical-not-parentheses
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

With style fix: comparison must still be a boolean value.

Fixes #12892
2016-08-21 16:53:42 +02:00
Adrien Destugues
36a9daf663 Package kit: more style fixes.
Pointed out by Axel this time. Thanks!
2016-08-21 16:53:27 +02:00
Adrien Destugues
a22f114f7d chroot support in package kit: style fixes
- Catching an exception in the normal flow is not a good thing, instead,
  test before calling the function (I've been doing too much python
  lately)
- Avoid using uninitialized nodeRef if there is no system root and also
  no specified root in the message.

Thanks to Ingo or the code review.
2016-08-21 10:38:23 +02:00
Adrien Destugues
6262ccbbe8 Fix use of findpaths from inside chroot
The package kit needs to provide the package daemon with the node_ref of
the root directory, so the package daemon gives the correct results when
the request comes from inside a chroot.

Moreover, the package kit must be able to handle a root with a system
but no home package dir, as is the case inside the chroot environment
created by haikuporter.

Fixes #12602.
2016-08-20 07:57:52 +02:00
John Scipione
2446f53bc8 BListView: Impliment autoscroll
BeOS had a feature where you could click on a list and while holding
down the mouse button scroll through the list items selecting them
as you went. I implemented the same feature on Haiku.

Did the work in separate thread which makes sure that the mouse
is held down the whole time even if you leave the view.

Thanks Diver for bringing this feature to my attention.
2016-08-18 16:36:46 -07:00
John Scipione
a98f98b744 BListView: check message not NULL, grab buttons and modifiers 2016-08-18 16:36:45 -07:00
John Scipione
ccd7f24f11 BListView: Initialize all fTrack params to default 2016-08-18 16:36:45 -07:00
John Scipione
dc6233fcf4 BListView: Check index non-negative, not only not -1 2016-08-18 16:36:44 -07:00
John Scipione
e10ca8cd1b BListView: Use std::max() and std::min()
... in place of max_c() and min_c() respectively.
2016-08-18 16:36:44 -07:00
John Scipione
9dfd244e92 BListView: Style fixes
* Rename kDoubleClickTresh to kDoubleClickThreshold
  and use floating point in rval
* Pointer (*) goes with type for property var
* Use {}'s for multi-line if conditional
* rename point to where (consistent with header and rest of IK)
* Explicitly compare with 0 for bitwise operator statements
* Rename InitiateDrag() params
2016-08-18 16:36:28 -07:00
Rene Gollent
8471ec3d56 libdebugger: Fix #12913.
ThreadHandler:
- When single stepping, verify that current instruction pointer is
  actually within a valid image. Otherwise we'll crash attempting to
  retrieve debug information for it.
2016-08-13 21:24:00 -04:00
Rene Gollent
b7012e6c46 libdebugger: Fix #12914.
DwarfImageDebugInfo:
- While computing return value locations, we need to re-evaluate
  the availability of debug information as we're forced to traverse
  around images to resolve the location of a function call. Otherwise,
  we may crash as one of the called functions may belong to an image
  that wasn't compiled with debug info.
2016-08-13 21:23:11 -04:00
John Scipione
bd4ea6563f BMenuItem: Style fixes
* explict NULL check
* explicit boolean comparison and pointer style fixes
2016-08-09 16:08:59 -07:00
Adrien Destugues
8efb6db7b9 elf.h: rename ELF_MAGIC to ELFMAG
- This is how it is named in other versions of elf.h (Linux, glibc, possibly more)
- ELF_MAGIC is used by libelf for the same thing, and the defines conflicts,
  breaking libelf build on Haiku.
2016-08-06 20:32:47 +02:00
John Scipione
9d37e7411c Tracker FindPanel: Make a copy of fDeviceIcon
... so that it gets deleted by destructor and not the original
2016-07-31 19:42:39 -07:00
John Scipione
4a319b9c40 Tracker FindPanel: SetMarked() and SetTargetForItems()
in AttachedToWindow() rather than the constructor.

This does the action at the appropriate time to draw the initial
state correctly.
2016-07-31 19:42:39 -07:00
John Scipione
d7fa9d357b Tracker FindPanel: Use const char* instead of BString
Use String() to get the const char* out of the BString where appropriate

Also rename msg variable to message
2016-07-31 19:42:39 -07:00
John Scipione
717b47e75d Tracker: Style fixes
indentation, spaces, explicitly compare to B_OK
2016-07-31 19:42:39 -07:00
John Scipione
d8c4f7b54a IconMenuItem: Make icon_size B_MINI_ICON by default 2016-07-31 19:42:39 -07:00
John Scipione
caf0a129d6 Tracker: Draw IconMenuItem in closed state
Add an Icon() and SetIcon() method. Override SetMarked() to set the
parent menu field icon.

Don't move the label right if icon is NULL. Make the first menu item
an IconMenuItem with a NULL icon. This allows the icon to draw in the
closed menu state.

icon gets updated even if you select an item in a submenu
2016-07-31 19:42:39 -07:00
John Scipione
81364c9d82 BColorMenuItem: add custom color menufield
http://insightfactory.tumblr.com/image/142366356207

* Make the color box a rectangle with proportions of golden ratio.
* Override GetContentSize() to make menu item area larger.
* Label should never truncate since I make sure there is enough room.
* Draw the label using BMenuItem parent class
* Carefully adjust the spacing so that there is an attractive amount of
  padding between the checkmark and color box and the color box and label.

Add _AddMenu method to BMenuField that adds BColorMenuItem as its
base menu item. This shows the BColorMenuItem in the closed state.

Create BPrivate::MenuItemPrivate

Add a SetSubmenu() method to MenuItemPrivate that gives you
the ability to add a submenu after creating the object. This
method should be public

Skip disabled items

Color gets updated even if you select an item in a submenu
2016-07-31 19:42:39 -07:00
John Scipione
ca766a50fe BMenu: Offset the menu field's menu window left 8px
...so that the text when the menu is closed lines up with the text
when the menu is open.

The checkmark is draw to the left of left edge of the closed menufield.
2016-07-31 19:42:39 -07:00
John Scipione
e8d4db8e0b MenuPrivate: Add SetItemMargins() method 2016-07-31 19:42:39 -07:00
John Scipione
b75a2e9d22 BMenu: Add default padding to ctor 2016-07-31 19:42:39 -07:00
John Scipione
dcecaf60ad BMenu: Remove _ from protected method _DrawItems 2016-07-31 19:42:39 -07:00
John Scipione
61dfdec415 BMenu and friends: style fixes
BMenuBar: style fix: msg => message

MenuPrivate: style fixes

MenuItem: 80 char limit style fix

MenuBar: tiny style fix

Menu: tiny style fix, indentation

Menu: Small refactor

Implement _SetIgnoreHidden() in header
Change on to ignoreHidden
Change on in _SetStickyMode to sticky

_BMCItem_: tiny whitespace style fix

Menu: style fixes, rename msgr => messenger

BMenu: style fix, pointer != NULL

BMenu::Archive rename ret to status

Also check pointer against NULL explicitly

BMenuItem style fixes: rename abbreviation, pointer style
2016-07-31 19:42:39 -07:00
Rene Gollent
17954f2e22 libdebugger: Initial work for remote support.
- Introduce base classes RemoteDebug{Request,Response} and the first set of
  implementing subclasses for the various types of debug requests. These
  encapsulate the information needed to make a request to the target debugger
  interface, as well as a means to flatten/unflatten to a BMessage. These will
  be used to marshal the relevant information for transmission across the
  eventual transport interface. Not used anywhere yet since there still remain
  some requests and responses to implement, among other things.
2016-07-31 17:30:23 -04:00
Rene Gollent
9c9c24ce08 libdebugger: Add accessor for cpu state size.
Architecture:
- Store and provide accessor for the size in bytes of the low-level
  debug_cpu_state size of the respective target CPU. Adjust subclasses
  to pass in the appropriate size information.
2016-07-31 17:30:12 -04:00
Rene Gollent
b02ee147b1 libdebugger: Reorganize debugger_interface subdir.
- Split into separate subdirectories for each interface type, as is done in
  the target_host_interface subdir. Preparation for the remote interfaces,
  which will have quite a few more components than the existing local ones.
2016-07-31 17:30:04 -04:00
Augustin Cavalier
ebb20270fd Tracker: Don't show warning alert when working in /system/cache/tmp.
Originally, the tmp folder was in /boot/common, where it didn't show
an alert box. Since the move to /system, it simply fell into the general
"is in system directory" case.

Fixes #10173.
2016-07-29 20:41:46 -04:00
François Revol
e0a322db92 netresolv: remove asserts from inet_pton()
There are still asserts in inet_pton4 and 6 anyway.

libgit2's tests expect inet_pton() to fail with EAFNOSUPPORT on unsupported
address families instead of crashing...
2016-07-26 23:52:29 +02:00
Augustin Cavalier
606ae81af4 Tracker: Move deprecated FSUtils functions to FBCPadding.cpp.
This includes FSCopyAttributesAndStats as well as an older version of
FSGetDeskDir, and adds another alias of FSGetTrashDir. Fixes BeIDE
compatibility.
2016-07-21 22:19:01 -04:00
Augustin Cavalier
c1cd54a0e1 FSUtils: Add a "bool copyTimes" argument to FSCopyAttributesAndStats().
BPoseView::NewFileFromTemplate does not want to copy the times. Fixes #11702.

We have to keep a 2-argument version of this function because it looks like
some third-party applications might call it (e.g. Dockbert), and even
though it's technically private API, it's easy enough to preserve binary
compatibility.
2016-07-21 21:23:18 -04:00
Augustin Cavalier
e944dacae0 Tracker: Remove special filtering case from NewFileFromTemplate.
If the pose matches the current type-ahead filter, it will be added
by the node watcher anyway, so this just created duplicate poses
which messed up internal data structures. Fixes #11122.
2016-07-21 21:12:09 -04:00
looncraz
04039d6f30 BStringView: Proper color inheritence.
Legacy applications setting colors manually on BStringView would prevent
the BStringView from inheriting theparent view color.  Most legacy
applications that did this also set the view color manually, so this went
unnoticed except in Beezer's Preferences window.

This fix introduces another, minor, issue for legacy applications that do
the same thing - they will not receive the system default panel text color.
In most instances, you don't want that happening anyway, so it's not much of
an issue.

Fixes #12868.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2016-07-19 20:28:38 -04:00
Axel Dörfler
a449e2305c Tracker: Made open-with menu scale with font size. 2016-07-19 23:57:26 +02:00
Axel Dörfler
36c80cff6e Tracker: Fixed CachedEntryIterator::GetNextEntry() debug build.
* A "style fix" introduced in 54e2dd7272
  broke the debug version by reversing the assertion logic.
2016-07-19 23:57:26 +02:00
Axel Dörfler
0bcb836563 Tracker: Remove adding BeOS trash icons in trash watcher.
* The icons have been removed in 4e38bdba17
  which caused a debugger call in the debug build.
2016-07-19 23:57:26 +02:00
Augustin Cavalier
00a3a794e0 BSecureSocket: Let OpenSSL choose the most appropriate D-H curve. 2016-07-16 18:55:46 -04:00
Augustin Cavalier
b515f3b4b4 BSecureSocket: Print SSL error message as well as the error code.
Helps with debugging failed SSL connections.
2016-07-16 18:44:04 -04:00
Augustin Cavalier
44ffe7c28f BSecureSocket: Explicitly set the list of ciphersuites.
OpenSSL's default cipherlist has a lot of spurious and arguably insecure
suites left in it for compatibility reasons. We have no need for all that,
so let's just use the suites Firefox/Chrome do.
2016-07-16 14:47:17 -04:00
looncraz
7cdea13cf9 BBox: Correct low color for drawing label.
Includes some simplification for existing code.

Fixes #12628, which was mostly exhibited in FilWip and a few other legacy
applications which used the default low color and a custom background color.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2016-07-16 12:50:51 -04:00
looncraz
de9c53f8f5 BButton: Revert to using B_CONTROL_TEXT_COLOR for text.
Fixes #12604.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
The switch to using HighColor() was made in the "Set*UIColor" commit,
but as some applications set it for some reason, it broke BeOS compatibility.
2016-07-16 12:44:18 -04:00
Augustin Cavalier
b39f9357bc BSecureSocket: Disable SSL/TLS compression to prevent the CRIME attack.
See wikipedia:CRIME (Compression-Rate Info-leak Made Easy) for details.
2016-07-10 17:56:01 -04:00
Dario Casalinuovo
0162e27293 AdapterIO: Create seek sem only when requested 2016-07-10 19:11:41 +02:00
Murai Takashi
e019775491 TrackerString.cpp: fix comparison between pointer and integer
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Ticket: #12842
2016-07-10 17:11:23 +02:00
Dario Casalinuovo
0474db50d0 AdapterIO: Add IsRunning method
* The backend need to know if we can really get data.
* Adapt WaitForData to be more reliable using this method.
2016-07-09 16:18:09 +02:00
Rene Gollent
05fc1277c4 Debugger: Fix team restart request.
UserInterface:
- Add Clone() function to set of required virtuals. This asks the subclass
  to create a new instance of its respective type.

{CommandLine,Graphical,Report}UserInterface:
- Implement the above function.

TeamDebugger:
- Add accessor for the currently active UI.

TargetHostInterface:
- Set correct request type when setting up the options for a team restart.
- Ask the TeamDebugger for its user interface and clone it in order to fill
  in that aspect of the debug options. This fixes a regression introduced in
  commit 880a64, which inadvertently resulted in team restarts no longer
  working.
2016-07-03 13:53:51 -04:00
Dario Casalinuovo
9f2deec26f AdapterIO: Seeking and flags access improvements
* Backend seeking is done only if explictly requested in
BAdapterIO Seek.
2016-07-03 15:28:06 +02:00
Dario Casalinuovo
3ad928de3f BAdapterIO: Refine size inheritance
* Wait evaluation is done considering both position
and buffer size.
* Set back position to 0 after seeking.
* Simplify EvaluatePosition to take advantage of inheritance.
* Use back position to determine the current size of the buffer.
* Add more debug tracing.
* Other minor fixes.
2016-07-02 21:19:27 +02:00
Dario Casalinuovo
1acb1f504d Style fixes 2016-06-30 16:54:40 +02:00
Dario Casalinuovo
345dba5416 AdapterIO: Further development of the interface
* Implement Open/Close mechanism.
* Implement SetBuffer.
* Implement timeout handling.
* Improve Seek mechanism, this is now working by locking the
thread until the backend call SeekCompleted.
2016-06-30 16:54:40 +02:00
Dario Casalinuovo
4dd09daff7 Streaming: Use const reference in place of copying
* Thanks to Markus for reporting.
2016-06-25 01:13:10 +02:00
Dario Casalinuovo
0ba82236bd Streaming: Remove any pointer BUrl argument
* There's no need to pass BUrl by pointer, this is
potentially dangerous and leaky without any advantage,
copying is definitely safer.
2016-06-24 19:00:38 +02:00
Dario Casalinuovo
bcab157e9d AdapterIO: Size could be 0
* Also avoid seeking completely when we are sure
we have to block.
2016-06-23 00:38:33 +02:00
Dario Casalinuovo
6b697577fe AdapterIO: Add debug 2016-06-23 00:38:33 +02:00
Dario Casalinuovo
6903cf9bda AdapterIO: Increase consistency
* Moved data locking in the internal buffer class, includes handling
of backend writes.
* Takes advantage of inheritance for getting the size. The choice is
made depending on the flags. This allow the implementer to easily
return a custom size by reimplementing GetSize. At the same time
a plain BAdapterIO can still have it's total size set, but the behavior
will change depending it's mutable or not.
* Some decisions are now made by considering everything in absolute
values.
* Other minor fixes.
2016-06-23 00:38:33 +02:00
Dario Casalinuovo
ad89985e7e PluginManager: Assign the BBufferIO pointer 2016-06-23 00:38:33 +02:00
Dario Casalinuovo
59ff587d70 Style fixes 2016-06-23 00:38:33 +02:00
Mark Hellegers
e1c98ceaf7 Add support for TLS SNI
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2016-06-20 19:42:24 -04:00
Andrew Lindesay
fa2dd9c45f BPackageInfo::Parser: Validate URL strings.
Fixes #12710.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
I fixed the modifications to the Jamfiles in src/bin, they were all wrong
in the patch.
2016-06-18 18:40:07 -04:00
Mark Hellegers
ac315db012 locale: Fix 24 hour format for DateTimeFormats.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Fixes #12575. I checked with PulkoMandy on IRC before merging this,
and fixed some whitespace violations of the coding style.
2016-06-18 18:09:56 -04:00
Dario Casalinuovo
3faf39eb5d BAdapterIO: Add initial seeking support
* This is by default provided using a relative buffer. When the
client request a seek over the range we currently have, we will
ask the backend with a SeekRequested. When the backend operation
ended successfully, the client is required to call SeekCompleted
before to return. This will cause the offset to change and the
buffer is cleaned as result. Next data received will be considered
to be at a position equal to the offset plus the relative position.
2016-06-07 16:12:39 +02:00
Rene Gollent
0b20cac7c3 libdebugger: Remove unnecessary header dependency.
- The library does not depend on libedit/ncurses, these were contained
  entirely within the application level code.
2016-06-05 18:25:33 -04:00
Rene Gollent
9968f34302 Debugger: Adjust header order.
- Ensure that the debugger lib's headers are included before those of libshared
  to minimize conflicts between the respective Thread classes. Fixes gcc2 build.

Thanks to Jerome for reporting.
2016-06-05 18:25:32 -04:00
Rene Gollent
fce4895d18 Debugger: Split into core library and application.
- Add subfolder src/kits/debugger which contains the debugger's core
  functionality and lower layers. Correspondingly add headers/private/debugger
  for shared headers to be used by clients such as the Debugger application
  and eventual remote_debug_server. Adjust various files to account for
  differences as a result of the split and moves.
- Add libdebugger.so to minimal Jamfile.
2016-06-04 13:18:39 -04:00
Dario Casalinuovo
be67b1022b AdapterIO: Fix problem with RWLocker
* Originally this code didn't use an AutoLocker, when I changed it
I didn't realize I created an anonymous temporary inadvertently.
* Thanks to hamishm for catching this.
2016-06-02 22:57:57 +02:00
Dario Casalinuovo
228b5c174e Implement SetSize in AdapterIO
* Give this choice to inherited classes.
2016-06-02 19:06:10 +02:00
Dario Casalinuovo
53058b8afc Fix x86_64 build 2016-05-31 03:26:36 +02:00
Dario Casalinuovo
0a2584e464 PluginManager: Refactor to make use of new API
* General refactor, moved BDataIO emulation in a
BAdapterIO derived class, BDataIOAdapter.
* This allowed to simplify the wrapper that is now
considering everything to be seekable or pseudo-seekable.
2016-05-31 01:15:09 +02:00
Dario Casalinuovo
b660d95f88 Introduce BAdapterIO
* This class is provided as a safe multithreaded communication channel
between a BMediaIO-like interface and a Read/Write backend.
* Includes internal buffering and can be used to provide multithreaded
edit of the data.
* Current limitations include missing BOutputAdapter and
correct timeout handling.
* Future plans provide a BRemoteAdapterIO that using ports
and areas allow to easily send big data between processes.
2016-05-31 01:15:09 +02:00
Dario Casalinuovo
2ceb090f2f media_kit: Follow up fix to use only portable codes
* My previous commit fixed x86_64 but broke all other archs.
2016-05-20 04:25:31 +02:00
Dario Casalinuovo
f4ba347b33 media_kit: Fix debug printf werrors
* When debugging was enabled in the media_kit those were
causing the build to fail complaining about werrors.
2016-05-20 03:36:50 +02:00
Dario Casalinuovo
9d6d0aea63 PluginManager: Missing return in printf 2016-05-19 02:11:02 +02:00
Dario Casalinuovo
51c8ec34d0 MediaKit and MediaPlayer Style Fixes
* Suggested by korli, thanks!
2016-05-17 02:02:37 +02:00
Dario Casalinuovo
6646363eba MediaExtractor: The source is always owned by BMediaFile
* While originally I think it was a good idea to make it own the source,
then I decided to uniform the code by making the BMediaFile to be the
only responsible of that.
2016-05-17 01:45:13 +02:00
Dario Casalinuovo
21cf69c709 AddOnManager::GetStreamers: Consider maxCount and outCount
* Fix a little issue when getting the plugin.
2016-05-16 19:57:07 +02:00
Dario Casalinuovo
dc94132564 BMediaFile: Set for deletion a source obtained from url
* Added some TODOs and comments for future things that
are not priority now.
2016-05-16 19:57:07 +02:00
Rene Gollent
b8a716965a BSocketMessenger: Further improvements.
- Messages that expect a reply are now tagged with a unique ID field to
  indicate that expectation to the receiving socket messenger.
- The messenger now maintains a map of received reply IDs and their
  corresponding messages, along with a message queue of other unsolicited
  replies.
- After successfully connecting, the messenger now spawns a thread
  whose sole responsibility is receiving and parsing all incoming messages,
  and consequently sorting them into the aforementioned data structures based
  on the presence of the reply ID. Callers who are awaiting either replies or
  other messages are signalled appropriately via a semaphore. This allows
  multiplexing of both types of messages on the same socket.
2016-05-14 21:31:24 -04:00
Mark Hellegers
213ddbf656 ResourceFile: Handle version info in resource in other endianness than host.
Fixes #12779.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Includes some minor whitespace fixes by me.
2016-05-14 14:52:47 -04:00
Augustin Cavalier
d455c57ea2 Tracker: Change QueryPoseView over to using a BRefFilter.
Fixes #12640 (was broken by hrev44493).
2016-05-14 13:22:14 -04:00
Augustin Cavalier
44d19f4d32 GameSoundDevice: Don't use operator= on BLocker. 2016-05-13 23:16:40 -04:00
Augustin Cavalier
f0a5e33a55 HttpAuthentication: Add explicit copy & assignment constructors.
So that we don't copy the BLocker. Fixes part of the build.
2016-05-13 16:49:52 -04:00
Murai Takashi
3ab5be9f77 PicturePrinter.cpp: fix gcc6 build
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2016-05-13 15:26:00 -04:00
Murai Takashi
9e9c5cae83 DiscoveryAgent.cpp: fix gcc6 build
* Reindent souce code, to fix gcc6
  '-Werror=misleading-indentation' warnings.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2016-05-13 15:25:12 -04:00
Dario Casalinuovo
b18c444994 BMediaEventLooper::SetBufferDuration: Clamp if negative
* For the sake of making the code more backward compatible,
and safer eventually.
2016-05-07 22:23:28 +02:00
Dario Casalinuovo
6d63bc5e60 launch_media_server: Use BLaunchRoster::Start
* Remove SyncToServices and the related code from BMediaRoster.
2016-05-07 22:22:55 +02:00
Dario Casalinuovo
f2bb946bd8 BMediaEventLooper: Handle events in past differently
* When the loop didn't handle an event in performance time, we will
attempt at reading the port only if there are messages using a null
timeout.
2016-05-07 22:22:55 +02:00
Dario Casalinuovo
e042d9ebff MediaEventLooper: Calculate lateness from the nearest value
* When the event is late there are two major situations, the first
is when the enqueue time is in past compared to the performance time.
The second happen when the performance time is in past compared to the
enqueue time. The purpose of this change is to calculate the lateness
considering always the nearest of the two values. This way the exceding
latency is trimmed out from the calculus depending on what the actual
source of delay is.
* There is a lot more that could be done by looking at the previous
lateness value.
2016-05-07 22:22:55 +02:00
Murai Takashi
109459c8a5 MailProtocol.cpp: fix gcc6 build
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2016-05-03 21:01:48 +02:00
Murai Takashi
56d0435fd2 LocaleRoster.cpp: fix gcc6 build
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2016-05-02 19:18:31 +02:00
Murai Takashi
33bb983188 netresolv: Fix gcc2 build
Change suppress warnings options to -Wno-sign-compare
since -Wno-error= can be used with gcc 4.2 or later.

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2016-05-02 19:07:24 +02:00
Rene Gollent
6d4e35f60e BSocketMessenger: Fix size mismatch.
- The header size was accidentally being included in the flat buffer size,
  leading to a mismatch error when reading the incoming message.
2016-05-01 14:23:58 -04:00
Rene Gollent
6dd98243c2 BSocketMessenger: Style fixes. 2016-05-01 09:53:42 -04:00
Rene Gollent
493cced1ef libbnetapi: Add socket messenger class.
- Introduces new network API class BSocketMessenger, allowing one to send
  and receive BMessages across a network socket in a BMessenger-like
  fashion. Still very much WIP, hence currently not exposed via public headers.
  Based partly on previous work by Axel.
2016-04-30 18:32:50 -04:00
John Scipione
65d0cbfdaf BTabView: Draw bottom tab border in DrawTabs()
...instead of DrawBox().

Also use ceilf when calculating tab height to prevent non-integral height.

Fixes #12683

More Todo:

You have to understand way too much about how this class draws if you
want to have any hope of overriding one of its Draw... methods and have
it do what you expect.

e.g. The BeBook implies that the tabs are drawn first, then the box, but, we
draw them in the opposite order. Probably better this way but not intuitive.

There are a number of remaining questions:
1. Why don't we need to draw the bottom of tabs if B_FANCY_BORDER?
2. Why do we need to expand tab border horizontally if B_PLAIN_BORDER?
3. Why is the bottom border color (152, 152, 152) instead of (151, 151, 151)?

Add a bunch of TODOs for these questions and more.

There can be some unitiutive gaps between the box border and view
depending on if you choose B_FANCY_BORDER or B_PLAIN_BORDER.
You don't notice the gaps unless the view draws right on it's edge. Some
views, including in Devices and Media Prefs do this though. Media Prefs
further complicates matters by overriding BTabView.
2016-04-29 14:31:32 -07:00
John Scipione
76b2ce77bf BTabView: Remove borderOffset, no longer useful 2016-04-29 14:31:32 -07:00
John Scipione
1eb0579044 BTabView: Don't use std, just call std::nothrow 2016-04-29 14:31:32 -07:00
John Scipione
24cb14bc3d BTabView: Style fixes
Fix misleading indentation

remove extra newline

just a newline

selTabRect => selectedTabRect
2016-04-29 14:31:31 -07:00
John Scipione
3490eda827 ControlLook: Rename border param to borderStyle
border vs. borders is confusing.

BTabView: Rename border param to borderStyle

BTabView docs: rename border param to borderStyle

enumerate border styles in docs
2016-04-29 14:31:05 -07:00
Rene Gollent
c9dd7d0ddf libbnetapi: Extend socket classes.
B{Abstract,Datagram,Secure}Socket:
- Add functionality to listen for and accept new connections, thus allowing
  one to use the socket classes for server functionality as well.

BSecureSocket:
- Adjust to take into account differences between how SSL needs to be called
  when accepting an incoming connection vs initiating an outbound one.
  The handshake on the accepted connection stills fails for unknown reasons
  at the moment though.

Note that these changes break the ABI, and thus any packages making use of
them directly will need a rebuild.
2016-04-28 22:30:40 -04:00
Alexander von Gluck IV
42b7678198 netresolv: Fix build issues under Ubuntu 16.04 and OS X
* Either gcc or bison version changes are throwing a
  sign-compare Werror in the generateda irs nslexer.c
* This simply targets that Werror and disabled it in irs
2016-04-28 00:16:32 -05:00
John Scipione
22097d7aee Style fixes to BPeropertyInfo class 2016-04-27 11:10:34 -07:00
Alexander von Gluck IV
e29ff32374 bluetooth_server: Fix multi-arch build 2016-04-22 14:32:51 -05:00
Dario Casalinuovo
20802959d3 shutdown_media_server: Rely on actual instance
* Makes the shutdown process to rely on the instance that was
running at the time the function is called. While it's unlikely
anyone will see any change from that, this way we will not conflict
in any case with the launch_daemon.
* The reply could have been confused in a remote situation, make
every request to use an it's own object.
* In launch_media_server there was a wrong variable redefinition
too.
2016-04-22 15:55:15 +02:00
Dario Casalinuovo
e4704eb6f9 MediaDefs/MediaRoster: Increase code consistency
* Also fix a possible issue with List::Get, the code returned
after a Get() error. While I doubt if this happens the next
items will be still valid, I prefer to continue until we reach
the end of the items, and in case of a SyncToRoster request we will
at least get the list empty. We might have a blocking call
on the other end, so it's our own duty to at least try to avoid
this in any case. As final result at least we will get the list
empty.
2016-04-22 15:53:34 +02:00
Dario Casalinuovo
76889670db shutdown_media_server: Finalize rework of synchronization
* When the user isn't requesting a custom notification, it will
be a BMediaRoster job to do it.
* Reintroduce BMediaRoster::SyncToServices, this time based on local
message passing rather than a global semaphore.
* SyncToServices is used in launch_media_server to make the process
more launch_daemon safe and faster in the average case.
* It was an error to add notifications in the media_server.
* Fixes #12717.
2016-04-21 19:02:27 +02:00
John Scipione
e9208b6876 ScreenSaver: Rename BuildScreenSaverDefaultSettingsView
...to just DefaultSettingsView

It is just as obvious what it does in context, but shorter.

Rename the function it contains from
BuildDefaultScreenSaverSettingsView to
BuildDefaultSettingsView
2016-04-13 15:50:30 -07:00
John Scipione
3801c37b90 Screensaver: Update Default Settings View to use Layout
and standard insets so that they match other screen savers
2016-04-13 15:50:30 -07:00
Dario Casalinuovo
f441a1e2ce BControllable: Fix real_time and perf_time mismatch
* It caused parameters to change with delay, because the
event has been enqueued in the event queue with real time.
* Please don't rely on system_time.
* Fixes #5106.
2016-04-07 16:01:40 +02:00
Dario Casalinuovo
2f611cf798 BParameterGroup: Fix memory leak
* Fixes #12706.
* The issue has been reported by Cédric Degea with the fix
included. Thanks!
2016-04-06 00:28:42 +02:00
Dario Casalinuovo
99741be9f2 shutdown_media_server: Rework shutdown process
* Fixes issues with launch_daemon restart.
* Rely on what the actual response from the server is
instead to naively try to kill it.
* Remove snoozing and make the restart process very fast.
* Any app should rely on notifications anyway.
* Due to some reason a few months ago the media_addon_server
locked up very often making the notification service unreliable,
today this issue looks like solved. This made possible the recent
improvements.
2016-04-05 15:25:30 +02:00
Dario Casalinuovo
11c7bd86e2 Replace synchronization semaphore with async messages
* Remove SyncToServices, I will probably readd it in future
but this time using a local synchronization service more than
relying on the media_server to release the semaphore.
* Due to some discussions today in mailing list I decided
to step back and retry the initial way to notify media rosters
about media services status. It is woking by using two different
notifications for reconnecting to the media_server and notifying
the local subscribers.
* This speed up the media services restart.
* Sorry for the noise and very thanks for reviewing my code to
everyone.
2016-04-05 00:41:20 +02:00
Dario Casalinuovo
a0b3904a33 launch_media_server: Remove notifications handled elsewhere 2016-04-04 01:27:15 +02:00
Dario Casalinuovo
53c3fa5137 Introduce functionality for syncing with the media services
* The global synchro semaphore is provided with the purpose of
being used to avoid threads lock up when the media_server is in
an undefined state. There's still room for improvements.
* BMediaRoster::SyncToServices lock up on a semaphore until
the multi_audio correctly connected to the mixer.
2016-04-04 01:27:09 +02:00
Dario Casalinuovo
7eaa054b87 StreamerPlugin: Use BDataIO as base interface
* There's no need to force the streamer plugin to use a
BMediaIO. This class is supplied to accomodate more smart uses,
but in certain cases it makes just things more complex. If a
plugin doesn't need to have an internal caching method, then it
will be simpler to implement a block-consuming BDataIO and let
the internal BMediaIOWrapper to deal with caching.
2016-03-31 18:06:19 +02:00
Dario Casalinuovo
9ab61bb71c PluginManager: Fix build for x86_64 2016-03-26 00:39:14 +01:00
Rene Gollent
a204259b1c BShape: Fix issues for debug build.
As part of the refactoring that was done for app_server layer support,
the private shape_data struct was updated to derive from BReferenceable.
However, BShape's destructor was never updated to reflect this, and
consequently attempts to use a debug build of libbe would consistently
throw the user into the debugger due to BReferenceable's sanity check
against non-zero deletes that weren't on the stack.

It should be noted though that there are probably a few things that could
be factored out and/or simplified with that class in general, since e.g.
when copying its data from another shape_data instance, it uses C++ array
allocations, while when being manipulated by BShape directly, the latter
uses alloc/realloc/free.
2016-03-25 19:32:58 -04:00
Dario Casalinuovo
8c7679851f Move MediaIO in it's own header 2016-03-25 22:44:56 +01:00
Dario Casalinuovo
2250435e4c PluginManager: Add debug to wrapper 2016-03-25 22:23:35 +01:00
Dario Casalinuovo
25527aff5c MediaIOWrapper: IsEndless was not used the right way
* The idea is to just identify when a BMediaIO is able
to tell the whole size of the data, but caching needs
more complex policies to be successful.
2016-03-25 22:22:31 +01:00
Dario Casalinuovo
22c9314255 MediaExtractor/PluginManager: Add plugin deletion when extractor die 2016-03-25 22:20:35 +01:00
Dario Casalinuovo
3733e4b2ab PluginManager/AddOnManager: Add streamers support code 2016-03-25 22:20:03 +01:00
Dario Casalinuovo
b777602827 MediaFile: Rework to support BUrl sources 2016-03-25 22:19:47 +01:00
Dario Casalinuovo
20ae088fa5 MediaWriter: Add new BUrl functionality 2016-03-25 22:19:03 +01:00
Dario Casalinuovo
a2b3f12698 MediaExtractor: Adapt to new BUrl functionality 2016-03-25 22:18:15 +01:00
Dario Casalinuovo
b1ccc05864 AddOnManager: Initial support for streamer addons 2016-03-25 22:17:13 +01:00
Dario Casalinuovo
63e1708eee Finalize StreamerPlugin
* Add cpp file.
* Make Sniff virtual.
2016-03-25 22:16:36 +01:00
Dario Casalinuovo
0d88bf3ac4 MediaIO: Review behavior regarding object inheritance 2016-03-25 22:07:50 +01:00
Dario Casalinuovo
050118ef53 Remove TODOs 2016-03-25 22:06:19 +01:00
Dario Casalinuovo
382c78dfac BMediaIOWrapper: Check if we can really seek the data. 2016-03-25 22:06:09 +01:00
Dario Casalinuovo
36ffce0a14 BMediaIOWrapper: Delete data in destructor 2016-03-25 22:05:07 +01:00
Dario Casalinuovo
ef167f1150 BMediaIOWrapper: Refer on fallback buffer Position()
* Write the data into the fallback buffer when emulating
pseudo seeked writes.
2016-03-25 22:04:53 +01:00
Dario Casalinuovo
deb9166054 PluginManager: Refactor of MediaIOWrapper
* Use BPositionIO version of Read/Write.
* Implementation of fallback buffering.
* Other cleanup.
2016-03-25 22:00:27 +01:00
Dario Casalinuovo
6efbc4bb54 BMediaFile: Move BBufferIO usage into the plugin manager
* Add InitCheck for the wrapper status.
2016-03-25 21:55:13 +01:00
Dario Casalinuovo
b42aac7bf5 PluginManager: Initial switch to BMediaIO 2016-03-25 21:54:46 +01:00
Dario Casalinuovo
7b79e0694e Add prototype BMediaIO interface 2016-03-25 21:54:24 +01:00
John Scipione
6a8276c464 BSlider: Remove non be_control_look drawing code 2016-03-22 12:00:37 -07:00
John Scipione
8e7b383abf Slider: Replace min_c and max_c with std::min and std::max 2016-03-22 12:00:37 -07:00
John Scipione
8be1a5f082 Slider: Style fixes
Pointer style
Newlines
Indentation
Compare against NULL or 0 explicitly
use single floating point precision for float literals (i.e. use 0.0f)
2016-03-22 12:00:36 -07:00
John Scipione
8b902d940a IK: Use panel text color for select control labels
NOTE: This should have no effect on the colors of these labels unless
you have changed the panel text color and control text colors to be
different. Both are black by default.

In the case of the menu field, spinner, check box, radio button,
slider, and text control labels we want to draw these labels using
the panel text color instead of the control text color because they
are drawn on top of the panel color. (the menu field label color was
changed in a previous commit in this push).

In all cases except the menu field the label color is specified by
temporarily unsetting the B_IS_CONTROL flag while drawing the label.
All use control look to draw the label.

The control text color is meant to be used for text INSIDE the control,
not the label text that accompanies the control -- at least that's the
way I understand it.
2016-03-22 12:00:36 -07:00
John Scipione
5b2aa7f856 ControlLook: style changes only
whitespace
indent fix (tiny)
2016-03-22 12:00:35 -07:00
John Scipione
59e1b2f4ce BMenuField: Change label to panel text color
...instead of menu item text color when the label is unselected.

Menu item text color seems to make sense when the control is unselected
because we use selected menu item text color when the control is
selected, but, this isn't the case. We color the label background using
the menu item color because we are reproducing similar behavior of
BeOS R5. However, when the menu field is unselected the label needs to
draw so that it goes on the panel bg color.
2016-03-22 11:59:15 -07:00
Zoltan Mizsei
846a5b0272 printf's converted to TRACE
Signed-off-by: Dario Casalinuovo <b.vitruvio@gmail.com>
2016-03-20 18:12:45 +01:00
John Scipione
b001655640 BWindow & WebPostive: Move TextView detection code
... from WebPositive to BWindow. This way every window will detect
Command+Arrows and send them to BTextView if a BTextView has focus
instead of just WebPositive.

https://www.freelists.org/post/haiku-development/Wordwise-jumping-with-CTRL-in-BTextView

This trick doesn't work in Vision though...

Fixes #9913
2016-03-17 17:54:20 -07:00
John Scipione
105a543e3d BWindow: Rename string to bytes 2016-03-17 15:19:45 -07:00
John Scipione
2ab6ca298a BWindow: Style fixes 2016-03-17 15:19:32 -07:00
John Scipione
a99b9010f8 BWindow: Reorder includes 2016-03-17 15:18:14 -07:00
Julian Harnath
310238937c Network Kit: add BNetworkDevice::Control
* Allows to do an arbitrary ioctl on the network device

* For ifreq and ieee80211req requests
2016-03-15 21:59:03 +01:00
John Scipione
53f75ce5d6 BColorControl: Remove fOffscreenView pointer
...and rename fBitmap to fOffscreenBitmap to make it more clear what it is.

We don't need to save a pointer to both the offscreen bitmap and
the offscreen view, just the bitmap. We can access the view by calling
fOffscreenBitmap->ChildAt((int32)0). This gives us back a _reserved private
variable slot.

In the (unlikely) case that _InitData() is called with offscreen = false but
the fOffscreenBitmap is not NULL, delete fOffscreenBitmap before
setting it to NULL so that memory is not leaked.
2016-03-12 19:14:26 -08:00
John Scipione
76b9d53bd0 BColorControl: Rebuild control after mode switch
App Server sends each window a message that the screen has changed:
https://www.haiku-os.org/legacy-docs/bebook/BWindow.html#BWindow_ScreenChanged
Propegate B_SCREEN_CHANGED message to all child views first

Tell BColorControl to read the B_SCREEN_CHANGED message and reinitialize itself.

* Only reinit if switching to or from B_CMAP8
* Initialize all pointers to NULL in constructor
* Don't destroy and rebuild offscreen view (and text views) on reinit
* Reinitialize offscreen view on reinit.

Fixes #8035

Also initialzing the pointers to NULL in constructor fixes #12673
2016-03-12 19:13:35 -08:00
John Scipione
0e3b3f92ef BColorControl: Awesome style fixes 2016-03-12 19:10:58 -08:00
John Scipione
8db20d05cb BColorControl: Standardize on useOffscreen
...instead of doubleBuffered for the flag that specifies whether or not to
draw using an offscreen buffer.

Also remove the (not currently used) text from the docs since the parameter
is being used.
2016-03-12 19:10:38 -08:00
John Scipione
27c801a130 BTabView: Draw right border even if 1 tab
The right border is seen on active tabs giving them a bit of a shadow.
2016-03-10 18:57:38 -08:00
John Scipione
a0ea818b3f BTabView: Move first tab over by B_WINDOW_SPACING
BTabView::DrawTabs() got a makeover:
Draw the tab background across the whole view, then draw the tabs,
finally draw the rightmost tab's right border.
2016-03-10 18:14:58 -08:00
John Scipione
31c8f7b193 BTabView: Style fixes 2016-03-10 18:14:40 -08:00
Augustin Cavalier
9bd7e4014f Tracker: Restore original PoseView/TitleView names except in BFilePanel.
Should've fixed #12635, but it doesn't. No idea why; perhaps
	request.AddSpecifier("Window", "/boot/home/Desktop");
doesn't work anymore?
2016-03-07 18:04:49 -05:00
Augustin Cavalier
80bc632afd BStatusBar: Restore the old blue-ish color from before the Set*Color changes. 2016-03-07 16:08:00 -05:00
Jérôme Duval
214f8799db try to fix gcc5 build on buildbot.
* I'd only reproduce the kernel build failure locally, weird.
2016-03-04 20:23:17 +01:00
John Scipione
fad740e391 DeskCalc: Estimate n! using 9 term Stirling's
Approximation for n >= 1000

Factorial
Actual Value (truncated)
Approximation

1000!
4.0238726007709377354370243392300398571937E2567
4.0238726007709377354370243392307         E2567

10000!
2.8462596809170545189064132121198688901480E35659
2.8462596809170545189064132121197         E35659

100000!
2.824229407960347874293421578024535518477E456573
2.824229407960347874293421578024         E456573

Close enough!
2016-03-03 12:03:49 -08:00
John Scipione
261bdbab6d Use 5 factor Stirling's Series 2016-03-03 10:07:25 -08:00