Commit Graph

6446 Commits

Author SHA1 Message Date
Alex Smith
a731ad19e6 ELF64 and x86_64 support in the debug kit. 2012-08-07 20:22:36 +01:00
Ryan Leavengood
e77304562d Actually sort the translator menu used in ShowImage.
There were two problems with the last commit:

* the list needed to be outside of the top-level loop.
* BList was just broken for sorting translation_format pointers.

I fixed this by moving the loop outside and converting the translation_formats
to translator_info, which has the translator_id, since that is needed to create
the menu item, and would otherwise be unavailable outside the loop.

I tried to get this working with BList, but the sorting was completely broken,
and converting to BObjectList made the code much, much better and worked great.
Screw BList and casting, hurray templated BObjectList.

Really fixes #6782.
2012-08-07 00:41:41 -04:00
Alex Smith
c802257bbb Merge branch 'master' into x86_64 2012-08-06 12:34:03 +01:00
Ryan Leavengood
adfe152ee2 Sort the translation formats in AddTranslationItems by name.
This is used by ShowImage and CodyCam to create a list of image formats which a
file can be saved as. Tracker sorts the image MIME types used in the Find
window by name, so this makes these Save As menus match that (minus the icons
which I think are superfluous.)

Fixes #6782.

If the use of BList is no longer recommended, I welcome better suggestions
for sorting which will work in both GCC2 and GCC4. But this works ;)
2012-08-06 02:08:37 -04:00
Ryan Leavengood
57c5b09e1a Use be_control_look != NULL everywhere in the Interface Kit.
Should not be a functional change. It is not in the Haiku Coding Guidelines but
I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus
in this case of be_control_look that is the more common style.
2012-08-05 18:07:23 -04:00
Humdinger
aed3510485 Close alerts with ESCAPE key.
Added SetFlags(B_CLOSE_ON_ESCAPE) or SetShortcut(index, B_ESCAPE) to BAlerts
depending if the result gets used later in the code, or if it's a one-button
BAlert.
2012-08-05 19:32:46 +02:00
Alex Smith
adf8818ec0 Compilation fixes for Terminal, add to image.
It runs, but has shown up various bugs: app_server crashes, kernel
panics, rendering problems. Working on fixing these now.
2012-08-05 10:24:22 +01:00
Alex Smith
3fed1a15f5 Get app_server working on x86_64.
With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.
2012-08-05 08:46:30 +01:00
Alex Smith
049d149cf7 Handle 64-bit types correctly. 2012-08-04 18:58:26 +01:00
Alex Smith
54393c0379 Merge branch 'master' into x86_64 2012-08-04 09:59:17 +01:00
Ryan Leavengood
bab4f5ad7d Use the parent menu's font when truncating labels.
Fixes the other bug uncovered by #8829, but my other fix was valid too.
2012-08-04 00:24:56 -04:00
Ryan Leavengood
4ffc27fcc1 Fix incorrectly truncated menu labels.
An off-by-one error (> instead of >= really) was causing truncation when it
wasn't needed. But for some reason this only showed up when the main font size
was increased. I may or may not look into that, but this fixes the issue.

Maybe one of the faster bug logged to bug fixed times in Haiku history? ;)
2012-08-03 23:56:00 -04:00
John Scipione
593808d96a Return authors name's to DeskCalc headers.
No functional change.

* Surround email addresses in angle brackets.
* Add myself to ExpressionParser.cpp and .h
* Remove myself from ExpressionTextView.cpp and .h
* Alphatetize authors by last name.

Thanks Ingo and Axel.
2012-08-03 11:16:23 -04:00
Ryan Leavengood
0eed2a7c98 Fix flickering menus, especially menu bars.
Figured out by Stephan originally and only hacked in WebPositive, I knew
something about WebPositive was different because it did not flicker when
everything else did.

Since we fully draw the menus there is no need to have app_server fill in the
background with the view color. That is what was causing the flickering.

Should fix #484, #532 and #4335. Thanks diver for confirming the patch against
those tickets.
2012-08-02 23:25:29 -04:00
John Scipione
57e436840b Revert "Remove the ellipses for About App in the replicant menu."
Apparently ellipses are used for all dialog boxes on Haiku.
Sorry for the noise.

Thanks AnEvilYak

This reverts commit 147ef3a9e8.
2012-08-01 07:54:39 -04:00
John Scipione
147ef3a9e8 Remove the ellipses for About App in the replicant menu.
The ellipsis character (...) after a menu item means that
the command needs more information from the user before
the operation executes.

The ellipsis character doesn’t simply mean that a dialog
box or window will appear.

The window appearing completes the command and doesn’t
require additional input from the user before it executes.
2012-08-01 07:46:44 -04:00
Alex Smith
e6b3188fcb Merge branch 'master' into x86_64 2012-08-01 10:44:38 +01:00
Alex Smith
f7010474bb Changed resource alignment behaviour for ELF64 binaries.
The current behaviour of aligning to the maximum value of p_align seen
is problematic for x86_64, as the default segment alignment is 2MB.
This causes all x86_64 binaries to be padded to at least 2MB when
resources are added to them. There is no need to align to p_align in
the file itself (it's only an in-memory requirement), therefore
instead just align up to an 8-byte boundary. The current behaviour is
retained for ELF32, so this won't cause any compatibility problems
(there are no existing ELF64 BeOS/Haiku binaries to worry about).
2012-08-01 10:35:34 +01:00
Alex Smith
d4ec857af3 Merge branch 'master' into x86_64 2012-07-31 12:10:24 +01:00
John Scipione
8ffd0477dd Implement degree mode in DeskCalc.
Default is radian mode,  You set the option in the right click menu
like the other options.

Note: degree mode does not affect hyperbolic trigonometric functions.
This is how Mac Calculator, Windows Calculator, and Google Calculator
work.
2012-07-30 22:35:57 -04:00
Alex Smith
9be774b553 Compilation and 64-bit fixes to libbe.so sources.
Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.
2012-07-30 21:27:21 +01:00
Alex Smith
e27109c167 Merge branch 'master' into x86_64 2012-07-30 08:24:31 +01:00
Alex Smith
6e2f6d1ace Changed cookie type for get_next_area_info() to ssize_t.
The cookie is used to store the base address of the area that was just
visited. On 64-bit systems, int32 is not sufficient. Therefore, changed
to ssize_t which retains compatibility on x86 while expanding to a
sufficient size on x86_64.
2012-07-29 09:31:14 +01:00
Ryan Leavengood
6a03786cc9 Draw menus using the user chosen colors. 2012-07-28 23:02:17 -04:00
Ryan Leavengood
688e878807 Don't check for double click if it was a right mouse click.
Fixes #8714.
2012-07-28 19:58:28 -04:00
John Scipione
e51854a127 Add 96x96 and 128x128 icon sizes to tracker including scaling of BeOS icons using scale3x and scale4x algorithms. 2012-07-28 14:07:43 -04:00
John Scipione
ea001e585a Round 2 of style changes to Tracker
* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes
2012-07-28 14:02:35 -04:00
John Scipione
a51764c53e WIP: Yet more style fixes, mostly 80 char violations. 2012-07-28 14:02:34 -04:00
John Scipione
96a1e39a63 An error while emptying trash is not that dramatic. 2012-07-27 20:46:48 -04:00
John Scipione
caaec0198e A for loop with just an end condition is better as a while loop. 2012-07-27 20:46:48 -04:00
John Scipione
b05aa8b5b1 Style changes in Tracker, no functional change.
Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments
2012-07-27 20:46:47 -04:00
Philippe Saint-Pierre
b866f1fa54 Tracker: Files created from templates are now monitored
fixes #2796.
2012-07-24 14:53:57 -04:00
Philippe Saint-Pierre
4c45f003ed Tracker: Right clicking on Pose triggered Rename prompts
Right clicking on a Pose to get the contextual menu would quite often
trigger a rename action of that pose. Don't allow to rename a pose
by releasing the secondary mouse button.
2012-07-23 22:38:44 -04:00
Philippe Saint-Pierre
fb678bc3d0 Tracker: Sorting in filtered view led to crash
Fixes #6992.
2012-07-23 19:06:08 -04:00
Philippe Saint-Pierre
c082e8f2e2 Tracker: Variation between Saved and Restored widths
When restored, an overlap was wrongly detected in offsets for
failure to take into account the width of the border line.

This was causing the horizontal scrollbar to show unnecessarily.
2012-07-23 17:05:57 -04:00
Philippe Saint-Pierre
50d739dee5 Tracker: Regression fix
A crash of Tracker was triggered when accessing AddOn menu (by
shortcut or context-menu) for Pose on Desktop, because of it's
incapacity to read the mime type list (that wasn't built in
those cases).
2012-07-23 16:15:19 -04:00
Philippe Saint-Pierre
5cdd07a814 Tracker: Optimisation of AddonMenu menu construction
1. Build the list of mimetypes of files in selection only once and
reuse it for all further tests.

2. Fix a regression introduced in hrev44384 where the MimeType()
wouldn't get recognized when just changed by tracker (by that same
right click).  It would be on subsequent clicks.

3. Rename the static map variable to better fit our coding style
and be more understandable.
2012-07-23 14:47:24 -04:00
Philippe Saint-Pierre
516cac7817 Tracker: Coding style violations fixes and typos
No functional changes, thanks Axel!
2012-07-23 08:21:43 -04:00
Philippe Saint-Pierre
674ff0df2f Tracker: Various sorting issues in Tracker
When sorting files by Modified dates, right clicking on a file was leading
to a sorting issue where files were changing positions (without reason).

1. Any changes to stats (size, modification, creation, mode) was triggering
the sorting. Now only stats fields currently used as a Sort criteria will
trigger such event.

2. The Mimeset of file was set (in case of unknown file format) once per checked
add-on when building AddOn Menu. Now it's checked once per file in selection.
(so, once per file, rather then once per file, per add-on).

3. Now rely on registrar to force the mimeset (to trigger the sniffer in case
the attribute already exist) rather than trying to duplicate the feature in Tracker.

4. When Sorting, if there is a old position known, check if it's working by looking
if you should come after the previous item, and before the following item.  Previously,
the item would be pushed at the top if the group of item all fitting the criteria
(same file size, same file kind, etc.. depending on the sorting criteria).

Fixes #8478.
2012-07-22 22:16:19 -04:00
Philippe Saint-Pierre
1236c746af Tracker: a file leaving Trash won't appear in QueryPoseView
Fixing #1592.

A feedback FSNotification()->EntryMoved->PendingNodeMonitorCache->FSNotification
was seemingly introducing some race condition, as it was working 1 time
on several tries.
2012-07-21 22:09:45 -04:00
Philippe Saint-Pierre
2d5785ba12 CID 611239: Fix resource leak 2012-07-20 21:50:13 -04:00
Rene Gollent
902a98ad83 Fix #8753.
- Store whether or not the use of the horizontal scrollbar is desired
  on the class itself. If the CLV was set to use the horizontal scrollbar,
  and then asked to lay itself out while hidden, it would incorrectly assume
  the horizontal scrollbar wasn't in use, and consequently repositioned its
  views such that the horizontal scrollbar and outline view overlapped.
2012-07-20 19:35:21 -04:00
Ingo Weinhold
af350aa218 Add private shared class ArgumentVector
The parser is based on the FS shell's ArgVector.
2012-07-20 23:32:58 +02:00
Rene Gollent
03aa456e2e Fix mouse down handling error.
- When handling a mouse click, the button was hardcoded instead of
  passing the actual button clicked by the user. Spotted by Chris
  Roberts.
2012-07-18 23:21:06 -04:00
Rene Gollent
ed15f1b8fb Fix scrollbar handling when removing rows in BCLV.
- If removing a row results in there no longer being any rows whatsoever
  visible, force a scroll back into the visible range. Fixes #8287.
2012-07-18 23:02:30 -04:00
Alex Wilson
2d4288086f Make SpaceLayoutItem compose spacing using BControlLook.
This allows for passing spacing/inset flags to BSpaceLayoutItem.
Eg. in a builder, you could AddStrut(B_USE_ITEM_SPACING)
2012-07-16 14:59:32 +12:00
John Scipione
4bb5af765f Add control mark color setting. #8054
An enhancement adding a setting to Colors under Appearance to
set the mark color of radio button and check box controls.
2012-07-15 15:09:04 -04:00
Rene Gollent
975867a4ff Fix drawing bug in BStringField.
- If a string column was exactly the correct pixel width for the strings
  contained within it, they would skip attempting to truncate the string.
  However, the truncated string was always used for final drawing, with
  the end result that the fields would be drawn blank. This would sometimes
  manifest itself in Debugger where things like ID columns wound wind up
  showing no data until one resized the column.
2012-07-13 19:38:41 -04:00
Hamish Morrison
639ac47052 BTextView should not accept disallowed chars being pasted.
* Patch from #6885: This filters out any disallowed characters from text
  being pasted or dropped in. If the resulting filtered text is zero
  characters long, it beeps. Works with styled text too.
* Coding style: variables renaming by korli.
2012-07-12 23:56:36 +02:00
Rene Gollent
36c85ca8df Fix add-on image unloading for shelf replicants (ticket #8708).
- The version of instantiate_object() that returns the image id from which
  the object was reinstantiated was not correctly returning it in all
  circumstances, only if it had to find/load the add-on itself. This caused
  problems for BShelf since the latter relies on that image id in order to
  determine what image to unload when replicants are removed. To remedy this,
  introduce an additional version of find_instantiation_func() that returns
  the image id in which the instantiation function was found, and make use
  of it in instantiate_object() in order to also be able to return the image
  id in that case.
2012-07-10 18:41:49 -04:00
Humdinger
851c719d02 Small text changes in alert when renaming/moving special folders.
Since the button was renamed from "Do it!" to the specific action,
an additional explanation in case of special user folders isn't
needed any more.
Split text into paragraphs for better readability.
2012-07-04 08:42:38 +02:00
Philippe Saint-Pierre
8d87f2b43a StringForRate()
Introduce a function to generate the string representation of a bitrate
(kbps, mbps, gbps, etc..)

* Factor out the code from MediaPlayer InfoWindow
* Allow different bases (/1000 or /1024)
2012-06-25 13:29:22 -04:00
Ryan Leavengood
9f5864ab09 Handle the scroll wheel changing over scrollbars.
* Extract the scrollbar change based on the mouse wheel delta into a protected
  method of BView.
* Call that method from BScrollBar's MessageReceived.

With this change it is now a bit easier to scroll horizontally around the
system by putting the mouse cursor over a horizontal scrollbar and using the
wheel.

Fixes #8631.
2012-06-24 10:50:42 -04:00
Axel Dörfler
bea2387b68 Made constants static, coding style cleanup. 2012-06-05 23:15:54 +02:00
Reznikov Sergei
72b7db341b Added resize to fit shortcuts. Partially fixes #7467.
* Adjusted initial tracker windows width to fit modified column.
* Resolved a TODO: Added get info shortcut to Open with window.

 Author:    Sergei Reznikov <diver@gelios.net>

Signed-off-by: Alexandre Deckner <alexandre.deckner@uzzl.com>
2012-05-28 16:29:43 +02:00
czeidler
875b218202 Calling the BView version of {Enable,Disable}LayoutInvalidation() seems to be more natural. 2012-05-10 10:36:42 +12:00
czeidler
31f768577e The layout checks the target view now if the layout invalidation has been disabled in the view. 2012-05-10 10:36:41 +12:00
czeidler
58f3387d56 Workaround to not trigger a relayout in DoLayout when adding the label view again. 2012-05-09 14:34:44 +12:00
Philippe Saint-Pierre
78614977b0 Tracker: Removing the Desktop Background Image don't clear a pointer
fBackgroundImage wasn't being cleared when removing the desktop
background image because the loading process wasn't ignoring
loading failures (as is the "no background for this workspace" setting).

fBackgroundImage not being NULL was causing crashes mainly in
ScreenChanged(), where it was trying to re-center a non-existant
background.  Was causing #7376 and maybe others.
2012-05-06 20:00:15 -04:00
Philippe Saint-Pierre
4dad975dda Tracker: Consider extra column margin in PoseView::Extent()
In List Mode, consider the extra margin added to the right of
the last column when computing the Extent of the PoseView. This
was causing the ResizeToFit to resize a bit too small.

Fixes #4318
2012-05-06 18:43:59 -04:00
John Scipione
c645f9bcbe Rework tooltip method in BView again.
Passing NULL or a blank string to SetToolTip(const char*) sets the
tooltip to NULL by calling SetToolTip(BToolTip*) with a NULL argument.

Calling SetToolTip(BToolTip*) with a NULL argument calls HideToolTip()
because sometimes the tool tip can change without the mouse moving,
for example because the user clicked.

Thanks Axeld and Stippi.
2012-05-04 19:55:24 -04:00
John Scipione
5ccf455f7e Fix another tooltip related bug that appears in Deskbar.
The bug is that in horizontal mode the tooltip will remain set to
the last moused over team menu item even if the mouse is no longer
over a menu item. The bug can be seen in the following screenshot:

http://26.media.tumblr.com/tumblr_m3gze8s1xi1r0f0hfo1_400.png

To fix this bug, allow you to set the tooltip text to blank or NULL
in SetToolTip(const char* text). In ShowToolTip() check to see if
the tooltip text is blank or NULL and if so, don't show the tip.
Setting the tooltip to blank or NULL effectively unsets the tooltip
on a view.
2012-05-03 20:49:18 -04:00
John Scipione
4daa7647c9 After setting the tooltip text, invalidate the layout.
This fixes a bug introduced in hrev44075 (I think) where the internal
tooltip window wouldn't resize itself after setting new tooltip text.
So if you set the tooltip to a short string then set it to a long
string the tooltip would get cut-off or if you set it to a long string
and then set it to a short string the tooltip window would be too wide.
The result can be seen in Deskbar in the following screenshot:

http://30.media.tumblr.com/tumblr_m3fg327NsV1r0f0hfo1_400.png

After invalidating the layout the internal tooltip window gets resized
correctly.
2012-05-03 01:13:16 -04:00
John Scipione
7f7f5eac6e Refactor ToolTipManager a bit.
* Change ShowTip() point parameter name to where.
* Add a parameterless ResetWindowFrame() overload that get's the current
  where and calls ResetWindowFrame(BPoint where) which does the actual
  work. FrameResized() calls this parameterless ResetWindowFrame()
  method instead of doing the work in that method. This is functionaly
  the same but allows me to call the parameterless ResetWindowFrame()
  elsewhere.
2012-05-02 23:51:49 -04:00
Alex Wilson
4ca2a44779 Make ownership-taking idempotent during unarchiving.
The previous scheme made it hard to deal with reference-counted objects,
which may be owned by many objects.
2012-05-03 08:45:29 +12:00
czeidler
a937ffd238 Make the menu window not resizable.
Right clicking the menu border showed the resize arrow and sometimes even made it possible to resize the menu.
2012-05-01 11:03:27 +12:00
Axel Dörfler
8e2140fa5e Fixed a large client side memory leak for app_server memory.
* The areas allocated for BBitmaps were never deleted, even though the
  app_server deleted its part when the memory got freed.
* This resulted in a constant memory increase if the application in question
  would operate on many changing large bitmaps, like photos.
* Since the bitmaps are reference counted, we don't actually know when to delete
  the areas, so that the app_server now notifies the client whenever that is
  possible.
* This might fix #6824.
2012-04-29 20:26:14 +02:00
czeidler
6eb2e6b47f Use the timeout in poll. 2012-04-29 16:53:40 +12:00
Axel Dörfler
2f2f3fa042 Moved stable tool tip concept into the BToolManager class.
* This removes the fVisibleToolTip member from BView, and fixes bug #5669;
  BToolTipManager::ShowTip() now gets the owner of the tool tip as an extra
  parameter.
* Removed the work-around to hide that bug.
* Improved ToolTipTest application to include more test cases like a view that
  periodically update its tool tip via SetToolTip(const char*), and one that
  sets a new tool tip every second.
* Furthermore, added a test that shows that inner views inherit the tool tip
  of their parents.
* Fixed another bug in BToolTipManager::ShowTip() that would release an
  extra reference to the tool tip currently shown.
2012-04-28 22:14:03 +02:00
Axel Dörfler
f790fa299e Added a tool tip for the detailed progress info.
* Got rid of the parentheses around the progress text.
* Automatic whitespace cleanup.
2012-04-28 22:14:02 +02:00
Axel Dörfler
254640bfcd Remove the tool tip if an empty or NULL string is set. 2012-04-28 22:14:01 +02:00
Fredrik Holmqvist
11ff194b97 Use strnlen instead of own impl, as it probably will have platform specific optimisation. 2012-04-27 22:15:48 +02:00
Humdinger
163e02d670 Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-04-18 15:16:29 +02:00
John Scipione
41651bb3fd Small code simplication cleanup and add comment. 2012-04-17 23:20:37 -04:00
John Scipione
889692191d Fix Deskcalc drawing rounded corners on the desktop as a replicant, although I am not sure why I'm even bothering at this point. 2012-04-17 20:52:32 -04:00
Reznikov Sergei
ba747b26ac Fix #5586: Add missing shortcuts to FilePanel. 2012-04-17 18:27:52 +02:00
Oliver Tappe
546208a539 More catalog-related cleanup.
* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
  B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.
2012-04-16 21:31:22 +02:00
John Scipione
3244c2bcf2 Whoops, remove constraints after drawing slider bar. 2012-04-16 03:23:01 -04:00
John Scipione
a884b43bb1 Added support for buttons and menuframes with rounded corners.
* Not turned on for default buttons and menuframes right now.
* Updated Deskcalc and Keymap to use buttons with rounded corners.
* Overloaded methods with radium parameters are not virtual right
  now so as to not break vtables. Added /*virtual*/ before each
  method that should be made virtual in ControlLook.h
* Added a light line to the left border of the down arrow frame
  on menu frames as a small visual tweak.
* Replace StrokeRect() with StrokeRoundRect() when drawing the
  default button indicator. This gives them a rounded
  appearance if the button is also rounded.
* Added protected methods _DrawMenuFieldBackgroundOutside and
  _DrawMenuFieldBackgroundInside.
* Created some protected methods to get the edge, frame, and bevel
  colors from a passed in base color because it was a mess and I
  needed to calculate the colors from mutiple methods. It is much
  cleaner now.
* Added myself to ControlLook.cpp authors list. Assigned copyright
  to Haiku, Inc. Stippi also retains his copyright.
* Tons of style fixes.
  - Change all instances of `if (flags & B_FLAG)` to
    `if ((flags & B_FLAG) != 0)`
  - Reorder some methods.
  - Reorder includes.
  - Spacing.
  - Updated comments.
2012-04-16 02:10:03 -04:00
Oliver Tappe
248f2283dd Final part of cleanup in Catalog.h.
* move versions of the B_TRANSLATE_...-macros used during collecting
  of catalog keys to a specific header file, which will only be picked
  up when running collectcatkeys
* fix a couple of build problems during the preprocessing of the libbe-
  sources when extracting catalog keys, all due to private headers not
  being found
* move ZombieReplicantView.h from kits/interface to
  headers/private/interface, as this way it can be picked up when
  building the libbe catalog
2012-04-16 00:04:41 +02:00
Oliver Tappe
541ff51a6e Cleanup BCatalogAddOn.
* rename BCatalogAddOn to BCatalogData, since it doesn't represent an
  add-on, but rather the catalog data provided by an add-on
* move BCatalogData out of Catalog.{h,cpp} into its own header and
  implementation file
* drop BCatalogData::MarkForTranslation() methods, they're not needed
* drop BCatalog::GetNoAutoCollectString() methods, they're not being
  used anywhere
* cleanup the B_TRANSLATE_... macros somewhat
* add versions of the B_TRANSLATE_MARK_... macros that are meant to be
  used in void context (when the string isn't being used by the program,
  just meant to be picked up by collectcatkeys).
* adjust several apps to use B_TRANSLATE_MARK_..._VOID where needed
* adjust users of BCatalogAddOn accordingly
2012-04-16 00:04:41 +02:00
Oliver Tappe
5ac65b7f11 More cleanup in locale kit, this time regarding namespaces.
* it's bad practice to do a 'using <namespace>' in a header, as that
  is very likely to have unintended effects, so drop those from a couple
  of private Locale headers
* adjust files all over the locale kit in order to fix the problems
  (by explicitly importing the required classes in the implementation
  files)
2012-04-16 00:04:40 +02:00
Oliver Tappe
16e5092306 Extract EditableCatalog from Catalog.{h,cpp}.
* move EditableCatalog to its own header and implementation file
* move problematic BCatalog::CatalogAddOn() to EditableCatalog
* adjust Locale tools accordingly
2012-04-16 00:04:40 +02:00
John Scipione
a2bea84d34 Override the LayoutAlignment method in BStringView.
Left align StringViews using layout API by default falling back
to the alignment settings set by SetAlignment() only if
SetExplicitAlignment() is not used.

This way StringViews are left-aligned by default, can be changed
using the Layout API, and the pre-Layout API legacy method is used
as a fallback.

See this thread for details:
http://www.freelists.org/post/haiku-development/Can-we-make-BStringViews-MaxSize-BSizeB-SIZE-UNLIMITED-B-SIZE-UNSET-by-default
2012-04-15 16:06:29 -04:00
John Scipione
3cf2d117e5 Change Time Format Options in Deskbar preferences.
Added two new methods to the Locale Kit in order to create a custom time
formats from a format string. One method is outputs into a char* array,
the other into a BString() and you can set the timezone.

These methods should be cleaned up, we only need 2, one to get
the time in a predefined style, the other to get a custom time format.
Also should probably do the same for dates and datetimes. But I'll let
this go for now.

I added myself to the Locale.cpp file. I retained the copyright instead
of assigning it to Haiku, Inc. because the file is under the OpenBeOS
license and I don't know what the concequences of copyright sharing are
for that license, unlike MIT.

These new methods are used to generate custom time formats in Deskbar.
Instead of using a set of Radio Buttons to choose between the predefined
time options I build my own by creating a format string and passing it
to the Locale Kit. The format string is generated from 3 checkboxes,
show seconds, show day of week, and show time zone. You can mix and match
between them choose any that you like. By default they are all off.

There are 3 new deskbar settings associated with these new options:
showSeconds, showDayOfWeek, and showTimeZone. timeFormat has gone away.

The time format string gets cached and updated only when Update() gets called
on the TimeView class.

In order to fit all the options in (there is 1 more than before) I had to
reduce the font size of the clock to 11pt when all options are turned on in
12 hour mode. For those with no imagination it looks like this:

http://imagebin.org/208162

Renamed "Open time preferences..." menuitem to "Time preferences...".
Renamed "Show Time" and "Hide Time" to "Show time" and "Hide time".

Other changes include refactoring the header files a bit. There were a lot
of headers included by header files uneccessarily. For instance BarWindow.h
now only includes <Window.h> and <Deskbar.h>. This change is mainly to
to speed up the compile time since it takes a while right now.

I copy the fBarView pointer from BarWindow in the BarApp constructor and then
use that throughout the file rather than getting the pointer from the window
each time by calling BarView(). BarView() is still available in the header
for other classes though.

I moved some message constants around since it was getting a bit jumbled.
Most of the messages related to settings are in PreferenceWindow.h.
fChangeState is moved to BarView.h since that is where the ChangeState()
function is and BarView.cpp uses that constant.

The time interval and format constants are in TimeView.h.

Make some methods public in their respective classes where it made sense.
The preference window methods to update dependent items are public, that
might get called from BarWindow when a message gets received at some point.

Also made ShowHideTime() and Time() public in StatusView.h. These methods
activate showing and hiding the clock and return the fTime clock object.
No reason they should be private.

I reindented the StatusView.h and PreferenceWindow.h headers to the standard
style. Question here, are the public: protected: and private: lines inside
of classes suppose to get indented 1 tab or not? I've seen both, the style
guide says no indent but 1 indent seems reasonable and looks pretty good.

Style fixes here and there. That's enough for one commit I think.
2012-04-15 00:17:54 -04:00
Oliver Tappe
eaa5e0936d Fix #8452 (app's crashing for non-existent system catalog)
* make the system catalog a BCatalog instead of a BCatalogAddOn*,
  such that using a non-existing system catalog won't crash but
  simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
  and adjust it to use BCatalog::SetTo() in order to replace the
  data used by the given catalog
* adjust all users of gSystemCatalog accordingly
2012-04-14 17:58:58 +02:00
Oliver Tappe
cc52f0df3a Make BCatalog threadsafe.
* use a locker to protect the CatalogAddOn-chain against parallel
  access
* rename BCatalog::SetCatalog() to SetTo() and make it a proper
  initializing function
* adjust implementation of BLocaleRoster accordingly
2012-04-14 17:38:58 +02:00
Oliver Tappe
250eca3254 Start cleanup of Catalog.{h,cpp}
* unify pointer style (to type* )
* always use boolean expressions in if
* introduce some spacing for better readability
* make a couple inline methods non-inline
2012-04-14 17:24:20 +02:00
Oliver Tappe
ec48d27ca3 Revert "Fix access to system catalog strings."
This reverts commit 6d2186615f.
2012-04-14 16:52:59 +02:00
John Scipione
40b6c14db7 If full time format, don't abbreviate the time zone. 2012-04-10 01:05:54 -04:00
Rene Gollent
3da13b8038 Fix typeahead cancellation in file panels.
- Add accessor to PoseView that reports whether the view is currently
  typeahead filtering.
- Use said accessor in the file panel's filter in order to detect whether
  to tell the latter to cancel filtering vs closing the panel.

Fixes #8140.
2012-04-07 20:20:39 -04:00
Oliver Tappe
635df64352 Add BLocaleRoster::GetAvailableTimeZonesWithRegionInfo()
* allow locale kit clients to get all timezones with their corresponding
  country/region ID piecemeal
2012-04-07 20:51:43 +02:00
Oliver Tappe
6d2186615f Fix access to system catalog strings.
* fix regression introduced in hrev43950:
  HashMapCatalog::GetString() didn't return the non-translated
  string in case there was no translation found, which e.g.
  caused AboutWindows to trigger a debugger message about the
  alert not having any buttons.
Thanks to diver for the hint.
2012-04-06 13:54:50 +02:00
John Scipione
3cee15aac2 Keymap changes from recent activity. No AltGr yet.
Below is a mostly complete summary of the changes in this commit.

* Set the DeadKeys for the US-International Keymap to use the Option map.
* Rename American keymap to US
* Update the US, US-International, and United-Kingdom keymaps to take
  out unneeded spaces in the option layer. Also updated the dead keys
  and some other keys on the US-International keyboard to use UTF-8
  characters rather than there ASCII equivalents when different.
* Make the Option key fall-through when there is no mapping in the Option
  table. Option is for special characters, if none, print the regular one.
  This is mostly meant for the US keymap which has an empty option map. But
  also so that you don't have to repeat the normal, shift, and caps maps in
  the option map needlessly. Although the keymaps are still not empty in
  some cases that it could be like numpad keys and space.
* Update the /bin/keymap app to use fputs() instead of printf() when there
  is no actual formatting taking place. I've gotten into trouble for doing
  this before and it is faster to not process the string unnecessarily.
* Also several 80-char limit style fixes and updated comments.
* In Keymap class Reorder the modifier keys to match the keymap files.
  Put B_CONTROL_KEY check above B_OPTION_KEY. Neither change has any effect,
  they are purely aesthetic.
* Update DumpKeymap() method to use the abbreviated modifier letters so it
  will fit in your 80-char wide terminal.
* Tiny style fix in InputServer
* 80-char limit style fix in BWindow and add a comment that the shortcut
  gets eaten in the case of Cmd+Q
* Implement IndexForModifier() in KeyboardLayout, although I am not using it.
* Take Caps Lock out of the Modifier keys window because I couldn't get
  it to work the way I wanted it to.
* Move key roles to the left column, and the key label on the left. Add column
  header labels. Thanks Rimas!
* Add validation and improve marking menu options. Add a 'Disabled' option
  to control, option, and command menus to disable the key. Make the key
  role text grey if the key roles is disabled. Validation ensures that you
  cannot repeat the same key twice in the Modifier keys window since that
  won't work. You can't define 2 sets of option keys even if you really want
  to. You can disable your control, option, and command keys if you
  want, but that is not recommended.
* Rename kUpdateModifiers to kUpdateModifierKeys message to differetiate
  it from kUpdateModifier.
* Add shift key to Modifier keys window, use the stop icon instead of the
  warning icon to indicate conflicts.
* Allow the Layout system to control the size of the Modifier keys window
  again, set the width's of the key role lables to the widest, set the width
  of the menu fields to take up the rest of the space minus room for the
  conflict views. I didn't like it that the Modifier keys window would change
  size based on what options you had selected in the menu fields. Now it
  doesn't, but, the layout system still makes it all fit.
2012-04-06 02:42:54 -04:00
Oliver Tappe
84c93bfba0 Attempt at #1586 (queries not being case-insensitive for umlauts):
* adjust corresponding query predicate to use BUnicodeChar instead
  of ctype-functions

Alas, this does not help as of now, since BUnicodeChar is missing
support for any codepoints above 0x9f ...
2012-04-04 22:54:08 +02:00
Oliver Tappe
60f75e901c Merge liblocale.so into libbe.so.
* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
  other places, too) in order to access system catalog strings. 
  This is now done via gSystemCatalog, which is provided and initialized
  by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
  that rely on it in a working state.

TODO: the documentation hasn't been updated.
2012-04-04 22:44:42 +02:00
JackBurton
577265d14f Avoid calling BMenu::HitTestItems() if the cursor is over a submenu. 2012-03-31 13:30:21 +02:00
luckypower
5dca884fa5 Fix #8257: Locale not showing 24h/12h mode.
* apply patch from 'luckypower', that fixes the problem
  in BFormattingConventions - thanks!

Signed-off-by: Oliver Tappe <zooey@hirschkaefer.de>
2012-03-28 22:39:49 +02:00
JackBurton
aae7ed37e0 Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-03-21 15:18:58 +01:00
John Scipione
12c10314f9 Remove MimeType docs from MimeType.cpp and cleanup style issues in that file. Create a MimeType.dox file and add the docs there. 2012-03-18 00:09:53 -04:00
JackBurton
131811f6b4 Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-03-16 21:06:38 +01:00
John Scipione
84bfb380c3 Update the behavior of uninitialized and NULL BMimeType objects.
* Two uninitialized BMimeType objects are considered to be equal,
  this is a purposeful break from BeOS R5.

* An uninitialized BMimeType object is considered to be equal to a
  BMimeType object initialized to NULL. This is a purposeful break from
  BeOS R5.

* Update the doxygen documentation comments to reflect this change which
  will hopefully make there way into the Haiku Book at some point.

* In BMimeType::SetTo() replace an instance of strcpy() with strlcpy()
  CID #something probably.

* Store the result of a few more strlen() function in size_t instead of
  int to prevent overflow bugs.

* Make sure BMimeType::GetSupertype() returns either B_OK or B_BAD_VALUE.

* Undo my previous "optimization" in IsValid() to declare ch outside the
  for loop.
2012-03-15 14:44:00 -04:00
John Scipione
4b4e216449 Fix another overflow bug in BMimeType
* The static toLower() method had the same overflow bug that isValid()
  had. However, since it is a private static method, rather than fix the
  method I replaced with a call to strcasecmp() in the operator== overload.
  When this method was written strcasecmp() must not have been available.

* Declare ch outside of the the loop in IsValid() so that it only gets
  initialized once.
2012-03-14 20:10:14 -04:00
John Scipione
395167071d * Fix a bug where a string longer than INT_MAX can cause IsValid() to falsely
report a valid mimetype because strlen() returns a result than when stored
  in an int is treated as a negative number.

* Style fixes in the same method
2012-03-14 18:56:54 -04:00
JackBurton
54687869ef Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-03-11 10:16:35 +01:00
Jérôme Duval
38d688ccbe BHandler: hopefully fixes a regression introduced in hrev43777.
* BHandler scripting handles bad scripting syntax by returning the Messenger property.
* Thanks to Siarzhuk Zharski for pointing this out.
2012-03-03 20:09:30 +01:00
Rene Gollent
8f5079af02 When changing the tab height, also update the layout insets if needed.
Fixes #8374.
2012-03-03 08:32:05 -05:00
JackBurton
9289418325 Fix Indentation 2012-03-03 10:24:06 +01:00
JackBurton
417c123cc4 Fix indentation 2012-03-03 10:06:42 +01:00
Rene Gollent
4183675895 Move black/white color constant definitions to header.
Previously, there were two instances of the actual variables, named in
ControlLook.cpp and Utilities.cpp. This caused clashes on gcc4 builds, leading
to various crashes during initialization. Instead we now declare them as
static constants in the header itself as is done for various other interface
color constants elsewhere. Fixes ticket #8358.
2012-03-02 20:39:12 -05:00
Oliver Tappe
d9dc0dda43 Fix #8350: clockconfig has to use the current offset from GMT.
* instead of re-applying the fixed offset that had been set when the
  Time preflet was used last, use the stored timezone name in
  clockconfig in order to determine the current GMT-offset for that
  timezone
* clockconfig now requires liblocale.so
* drop the offset field from the settings as it is no longer used,
  clockconfig was the only client
* automatic whitespace cleanup
2012-02-26 19:07:29 +01:00
Axel Dörfler
d452ff664c Added some reserved fields to BControlLook.
* This makes future changes less troublesome, although we should also add
  some virtual slots there (probably just dozens of it, though, that's why
  I was being lazy).
* Don't pass messages by value; they are copied twice this way.
* Minor coding style corrections, automatic whitespace cleanup.
2012-02-26 14:58:52 +01:00
Jerome Duval
8adaa6c544 interface kit: added compatibility symbols for GCC4
* InvalidateLayout method for BBox, BButton, BCheckBox, BMenuField,
  BScrollView, BSlider, BStringView, BTextControl.
2012-02-26 10:36:04 +01:00
Jerome Duval
44c991efdb interface kit: added compatibility symbol for BeAE
* added  _ZN9BTextView16InvalidateLayoutEb for GCC4
2012-02-26 00:55:22 +01:00
Jerome Duval
7327891c90 interface kit: added compatibility symbols for BeAE for #8354
* _ZN5BMenu16InvalidateLayoutEb for GCC4
* InvalidateLayout__7BSliderb for GCC2
2012-02-25 18:31:07 +01:00
Jerome Duval
5c6b9eb00d Some fixes for GCC 4.6 warning: variable set but not used 2012-02-23 20:32:13 +01:00
Jerome Duval
4bbb27e3cc More 'GCC4.6 variable set but not used' fixes. 2012-02-23 20:32:12 +01:00
Philippe Saint-Pierre
d63b75faf8 Outline of labels/strings drawn to desktop
* Rather than duplicating the decision taking logic involving wheter or not to draw
the outline or glow in every replicant, update be_control_look to make it more
generic.
* The Monitoring of the background preferences is now only done in Tracker (where it
was already being done).
* Add a BControlLook::B_IGNORE_OUTLINE flag to avoid this new behaviour.
* Remove that said logic from ActivityMonitor and use be_control_look.
* Use the ignore flag in DeskCalc to avoid the outline in its case.

Should fix #7716, #7291.
2012-02-22 19:06:22 -05:00
Axel Dörfler
f1553a0fc4 Made it pass the tests, simplified number comparison.
* Space after a number was not correctly handled (must be ignored).
* Better conceal the fact that I'm not always the brightest - the number
  comparison was pretty questionable :-)
2012-02-22 23:43:22 +01:00
Axel Dörfler
f88aa5f760 Made NaturalCompare() accept NULL strings. 2012-02-22 23:32:09 +01:00
Jérôme Duval
9d46237ba1 TabView.cpp: Use B_IF_GCC_2 to simplify things 2012-02-19 15:47:49 +01:00
Ingo Weinhold
7e2730f048 View.cpp: Use B_IF_GCC_2 to simplify things 2012-02-19 15:16:07 +01:00
Jérôme Duval
48d21c1299 added BView::_ReservedView12() symbol for GCC4
* added _ZN5BView15_ReservedView12Ev
* helps with #8336
2012-02-19 14:36:53 +01:00
Fredrik Holmqvist
3e2017d24e Some cleanup in interface kit. From unused code warnings (before I updated buildtools). 2012-02-11 18:43:19 +01:00
Fredrik Holmqvist
37ea4f77f7 Removing unused code. 2012-02-11 18:39:57 +01:00
Alexander von Gluck IV
2c3ab1bed6 kits: Fix a few missed spelling issues 2012-02-08 18:06:03 -06:00
Alexander von Gluck IV
2066acfbc5 game kit: Style and whitespace cleanup. No functional change. 2012-02-08 17:38:59 -06:00
Alexander von Gluck IV
1b6bc2675f kits: Some spelling cleanup of common mistyped words
* Little whitespace cleanup
* No functional change
2012-02-08 16:50:18 -06:00
Fredrik Modéen
e817f41e8b Fixing debug in Media Kit.
* Only fixing debug i the media kit.
* Help with ASSERT(flavorID == testFlavorID) would be nice, don't know what ASSERT do.
2012-01-29 00:06:13 +01:00
Fredrik Modéen
d456de037d Fixing an "error" in how BMediaDecoder was built.
* If reading BeBook the class should be B_NO_INIT until we have called SetTo
* When I at it, any suggestion on how a test tool for BMediaEncoder should look like?
2012-01-27 22:47:12 +01:00
Alexander von Gluck IV
47452375a7 opengl: Clear up a few header issues, no functional change
* Philippe voiced that he was the original author in the ML,
  adding Philippe to the headers to ensure credit is given.
* Adding Precision Insight copyright back *just incase*
  It's unclear if Precision Insight code was used given
  Philippe's comments in the ML, lets be safe and add it back.
  As we have Brian's permission for these changes I feel
  comfortable with it.
2012-01-26 13:19:34 -06:00
Alexander von Gluck IV
a80293e0cf opengl: Pointer, newline cleanup, no functional change
* Clean up pointer positions
* Clean up function line returns
2012-01-26 09:47:08 -06:00
Alexander von Gluck IV
a42877a6e4 opengl: Header / whitespace cleanup
* I received the ok via email from Brain Paul at mesa to
  relicense the GLDispatcher sources to MIT + him as the
  author.
* Update include ordering
* Remove HAIKU_TARGET_PLATFORM_HAIKU ifdefs for boot options
2012-01-26 09:27:31 -06:00
Alexander von Gluck IV
19affa2725 mail kit: Use errno vs return codes, gives better results. 2012-01-22 09:31:36 -06:00
Alexander von Gluck IV
fd391ef3c2 mail kit: Improve debugging of internal mail kit network code
* Return the correct error code if there is a connection error
* Be more verbose if there is a problem
  network connection problem instead of showing "Login error: "
* IMAP inbound: Show a valid error message if there is a
* Show server name resolution, fishes out IPv6 bug #8293
2012-01-22 00:12:53 -06:00
czeidler
958ac01d5f Reconnect window and recreate all views. 2012-01-22 15:30:16 +13:00
czeidler
6c40fc5dfc Reconnect BApplication and trigger reconnect of all BWindows in an application.
* handle bitmap reconnect request in the app server
2012-01-22 15:30:16 +13:00
czeidler
40c34878fa Reconnect BPicture to the app_server.
* maintain a list of all BPictures to do so
* BView downloads the BPicture data after recording the picture. This could probably done more efficiently using shared memory in the first place.
2012-01-22 15:30:15 +13:00
czeidler
577f58763b Make it possible to reconnect BBitmap to the app_server.
* maintain a list of all BBitmaps
* refactor the client memory allocator class, its possible now to just clone existing client area
2012-01-22 15:30:15 +13:00
Alexander von Gluck IV
2a14f70ce8 opengl: Remove unneeded visibility flag 2012-01-17 14:59:04 +00:00
Alexander von Gluck IV
3c0d5dcaf1 opengl: Improve libGL linking and Mesa optional package
* Move compiled binaries into lib.haiku within Mesa optional
  pacakge, this enables us to use Make or scons to build Mesa
* Untangle libGL linking and order library inclusion
* Remove zmuldef hacks
* Compile libgallium into the libGL on Mesa 8.0 / gcc4 images
* Don't Mesa calculate cpu optimizations due to visibility
  issues, use Mesa cpu functions for this.
* Don't allow undefined symbols in libGL.so to ensure sanity.
* Move Mesa optional packages to haiku-files
2012-01-17 14:57:49 +00:00
Alexander von Gluck IV
7b2c1ed631 glut: build and link into libGL 2012-01-11 16:55:15 -06:00
Alexander von Gluck IV
3e0c69a0e6 Add hacks for older gcc2 Mesa 7.8.2 support
* Call different functions depending on Mesa version
* The --no-warnings is for the GL headers which produce
  large numbers of attribute directive ignored warnings
  that cannot be disabled on gcc2
2012-01-10 05:13:19 +00:00
Alexander von Gluck IV
f6a611ebf0 Use Mesa optional package to build opengl kit 2012-01-08 00:31:03 -06:00
Philippe Saint-Pierre
581a96616a Tracker: Fix inconsistent "Open parent" behaviour
1. When in /boot, you couldn't go to the parent (which is fine by itself),
but the menu item wasn't disabled.

2. In Single Window Browsing, doing "Open parent" wasn't respecting that
setting and was opening new windows.

3. In filepanel, when navigating to Desktop folder, the "Go to parent" was
still proposed even though it would do nothing choosing it.

4. Opening a Pose in Single Window Browsing was repopulating the menus and
putting the shortcuts again.  That was an issue if Navigator bar was used
since it conflicts with its shortcuts.

Fixing ticket #6851.
2012-01-05 21:44:11 -05:00
Philippe Saint-Pierre
8df5e79d2c Tracker: FSMoveToTrash(): needless check and possible crash fix
In an earlier commit, I removed a memleak, but it was covering more cases
than intended.  Thanks to Alex Wilson's insight, it seems that simply removing
the check is better (since that check is essentially redone in FSMoveToTrash()).
2012-01-05 17:55:12 -05:00
Philippe Saint-Pierre
97f16764c7 Tracker: Memory leak fix
The leak occured everytime a folder, or queries where opened while
navigating.

CID 5848.
2012-01-04 19:51:26 -05:00
Philippe Saint-Pierre
dafbb16406 Tracker (FSUtils): negative passed to unsigned parameter
BVolume::BlockSize() might return a negative value (error code) and it
was passed as parameter of CalcItemsAndSize() as a size_t (unsigned).

Thus the check for an error code failed.

CID 4171.
2012-01-04 19:31:17 -05:00
Philippe Saint-Pierre
aa11dcae4d Tracker (InfoWindow): small memory leak fix
In the case of a broken symlink, a Model object was leaked when trying
to get the icon of the target.

CID 5844.
2012-01-04 19:23:12 -05:00
Philippe Saint-Pierre
c56f0ce1c3 FindPanel: Avoid NULL deference; CID 352. 2012-01-04 18:44:21 -05:00
Philippe Saint-Pierre
d390c06551 PoseView: Fix assertion in InitDirentIterator
The dynamic_cast was called twice, and the assert was
done on the first attempt. Now it just cast once, assert on this
and pass it further as before.

CID 3122.
2012-01-04 18:11:12 -05:00
Philippe Saint-Pierre
fcfd687380 Tracker: memory leak fix
In MoveRefsToTrash(), the srcList wasn't deleted after usage.

CID 5849.
2012-01-04 00:01:26 -05:00
Philippe Saint-Pierre
f08709bbea No functional change; invert the order of includes. 2012-01-03 18:51:25 -05:00
Philippe Saint-Pierre
7cd8f5f9b9 TextView: initialize buttons variable
CID 10751.
2012-01-02 22:46:30 -05:00
Philippe Saint-Pierre
be6c4d6a5d mail kit: fix memory leak.
CID 896.
2012-01-02 19:13:28 -05:00
Philippe Saint-Pierre
9e4224613c SoundFile.cpp: do a NULL check before deferencing.
CID 296.
2012-01-02 14:26:07 -05:00
Philippe Saint-Pierre
b6e4d1a9dc BufferedDataIO::Flush(), use ssize_t rather than size_t
Write() was returing an ssize_t and Flush() was expecting a ssize_t,
but a size_t was instead used. CID 11052.
2011-12-29 13:43:15 -05:00
Alex Wilson
981c729bdc Fix potential uninitialized variable bug in BLayout::AllUnarchived().
BMessage::GetInfo() doesn't set the count output var in error cases.
2011-12-28 22:57:20 -07:00
Alex Wilson
9f0292314d Fix typo in BLayout::AllArchived().
BLayout::AllArchived() was forwarding to BArchivable, skipping BLayoutItem.
2011-12-28 22:37:59 -07:00
Alex Wilson
f1e81e6172 Fix bug in BLayout::RemoveView().
Fix typo-induced bug causing (in many cases) the wrong item to be removed from the layout!
Also, improve performance from O(n * m) to O(n), although n and m will always be quite small in practice, we might as well.
2011-12-28 22:29:58 -07:00
Oliver Tappe
d68d73f7a6 Improve timezone names returned by BTimeZone.
* Use TimeZone::SHORT specifier instead of SHORT_COMMONLY_USED, since
  the former yields more appropriate (textual) values. Strangely enough,
  it used to be the other way around, which is why we didn't used SHORT
  in the past.
2011-12-27 14:15:21 +01:00
Aleksas Pantechovskis
d38ae623c3 Textencoding Kit localization support added.
* Textencoding Kit now uses localized names of available encodings;
* Default encoding for composing new messages in Mail application is now
  configurable through localization feature. Fixes #8147.
* This contribution was made as part of GCI 2011 task.

Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>
2011-12-22 23:10:32 +00:00
Alex Wilson
61084e53b5 Remove clamping in new BSplitLayout methods.
Since clamping the index for these methods could lead to confusing side effects, we'll just avoid the clamping, and let things segfault when the programmer goes out of bounds.

Closes #7902
2011-12-22 14:16:44 -07:00
Urias McCullough
4ad0585ebc Partial fix for DEBUG=1 build on a 64bit host
Signed-off-by: Matt Madia <mattmadia@gmail.com>
2011-12-21 17:21:38 +00:00
czeidler
9472a1d6f7 Small style changes. Thanks Axel. 2011-12-21 17:21:51 +13:00
Rene Gollent
f6c8d24294 Use the correct perform invocation for these functions. 2011-12-19 08:49:58 -05:00
John Scipione
d4fa97f8f8 Moved documentation for the BEntry class into a dox file to include it into the Haiku book. 2011-12-18 21:28:55 -05:00
John Scipione
2ac1eb67b3 Move the doxygen documentation comments from src/kits/storage/Directory.cpp to docs/user/storage/Directory.dox and update it both the language, fix a few errors, and bring the syntax up to snuff. The documentation for the BDirectory class is now added to the Haiku Book. 2011-12-18 18:53:46 -05:00
Rene Gollent
c8df0c9b27 BePDF needed this one to be added as well. 2011-12-18 15:54:01 -05:00
Rene Gollent
466f2b8f99 Add compatibility symbols for removed LayoutChanged() calls. 2011-12-18 15:34:44 -05:00
czeidler
14fc524be2 Style and performance fixes. Thanks Ingo and Stephan. 2011-12-17 14:36:36 +13:00
Alex Wilson
a84e14ca84 Merge branch 'master' of git://github.com/haiku/haiku 2011-12-15 20:50:28 -07:00
czeidler
ed77847ca4 Remove private BStringList implementation from mail. Tested it but however please be careful an review. This fixes bug #8174. 2011-12-15 19:45:07 +13:00
czeidler
779061f0cd Make BStringList derive from BFlattenable. The implementation is more or less copied from the mail version to stay compatible. Fix IndexOf which
was the implementation of HasString.
2011-12-15 19:45:06 +13:00
John Scipione
0e35d5d2e5 Change instances of wether in comments to whether. No functional change intended. 2011-12-12 14:41:49 -05:00
Fredrik Holmqvist
76375d6811 Point don't use any math functions. 2011-12-10 17:11:55 +01:00
Alex Wilson
29ef6eb52d Fix BMenu behaviour/ABI by reinstating BMenu::InvalidateLayout()
It turns out,this is an old method added by Be, and is not really related to BView::InvalidateLayout(bool). In fact BMenu::InvalidateLayout() does something separate, but related to the BView method. I was wrong to delete this method, since it needs to have action taken each time it is called, so moving these actions into LayoutInvalidated() only worked sometimes (when the BView was considered to have a valid layout).

I have added a comment for future hackers so that they don't delete this method.
2011-12-08 14:09:35 -07:00
Alex Wilson
ea0a06e213 Remove redundant checks for fParent before calling _InvalidateParentLayout(). 2011-12-06 22:35:46 -07:00
Michael Lotz
011002e5e4 Fix uses of member after deleting the object. CID 10535, 10534. 2011-12-06 19:37:46 +01:00
Michael Lotz
8eec72dcab Use safe length measure function and fix length usage.
* We may get non-terminated strings so we need to use the
  UTF8NextCharLen() version that works with a length. Previously we may
  have read beyond buffers, possibly leading to crashes.
* Also the length parameter is used as an actual length and not as
  buffer size. The length check was wrong before, which resulted in the
  function returning too early if an offset was supplied.
* Added a comment about the guaranteed 0 termination in one case.
* Minor cleanup.
2011-12-06 19:15:36 +01:00
Michael Lotz
9f65f3dd66 Rename variable so it is clear what is measured (bytes). 2011-12-06 19:13:26 +01:00
Michael Lotz
fb3c47ebad Fix passing non-terminated string to font functions.
The string that is built for hashing the escapements for missing
chars was not 0 terminated, leading to accesses past the string.
Depending on what followed an allocation that could lead to too long
strings being sent to the app_server for evaluation (where, due to
defensive, programming nothing bad would actually happen). In the
unfortunate case that nothing followed the allocation (i.e. end of
heap area), it could also lead to an application crash.

Therefore ensure 0 termination of the string, check for allocation
failure and use memcpy() instead of a for loop to copy the bytes from
one string to the other.
2011-12-06 15:46:36 +01:00
Axel Dörfler
410018c3ad Made mail_encoding a proper C++ file.
* This unbreaks the GCC2 build, thanks Matt!
2011-12-03 02:00:22 +01:00
Axel Dörfler
4bd5da8275 Minor cleanup, no functional change. 2011-12-03 01:10:00 +01:00
Alex Wilson
182e2ee973 Add a bit more FBC stuff for the Layout API, which I missed before. 2011-12-01 22:47:46 -07:00
Alex Wilson
d56e7bd64d Make archiving hooks protected in layout classes.
Furthermore,
* remove a stray blank line in Layout.cpp
* make BLayoutItem::SetLayout() private, as it should have been
2011-12-01 20:45:50 -07:00
Alex Wilson
f98f5ca48b Fix bug in BView::RemoveSelf() that lead to a segfault.
Once again, the BObjectList removal behaviour leads to a null dereference. It's my fault of course, but there you have it. Comments have been included for future devs.
2011-12-01 19:08:56 -07:00
Philippe Saint-Pierre
04847eccdf Fix style coding violation (possibly causing confusion) 2011-11-28 12:58:31 -05:00
Philippe Saint-Pierre
4d5d809045 No functional changes. Improve readability.
Thanks Axel!
2011-11-27 18:13:13 -05:00
Philippe Saint-Pierre
ec9e2f9018 No functional change, avoid confusion in Coverity about exceptions
CID 9248, CID 9250, CID 10844, CID 10977, CID 10978, CID 10979, CID 10980,
CID 10981, CID 10982, CID 10983
2011-11-27 17:47:45 -05:00
Philippe Saint-Pierre
8e844f63e9 Fix bogus argument validation
* The comparaison couldn't ever not match. Based on the comment above the
  function, I made it so that flags must contain at least one of B_WATCH_NAME,
  B_WATCH_STAT or B_WATCH_ATTR

CID 2586
2011-11-27 13:24:43 -05:00
Ingo Weinhold
9213e9d6a8 Add BPackageRoster::GetActivePackages()
The implementation is temporary. Currently it reads through the packages
in the respective packages directory and checks against the package
links. Once package activation is tracked explicitly we'll use the
activation file/directory.
2011-11-25 06:19:49 +01:00
Ingo Weinhold
26265b7b4d Add class BPackageInfoContentHandler
A BPackageContentHandler subclass that initializes a BPackageInfo from
the read package attributes. Pulled out of RepositoryWriterImpl's
PackageContentHandler.
2011-11-25 06:19:48 +01:00
Ingo Weinhold
e35a99be4c Pull class BPackageInfoSet out of BRepositoryCache 2011-11-25 06:19:47 +01:00
Ingo Weinhold
f96d3856e1 Removed left-over code 2011-11-25 06:19:47 +01:00
Ingo Weinhold
9968845d69 Use BStringList in package kit
Replace all instances of BObjectList<BString> by BStringList.
2011-11-25 06:19:46 +01:00
Ingo Weinhold
7de6af25e9 Add a BStringList class 2011-11-25 06:19:45 +01:00
Ingo Weinhold
ad07ecd821 BString::Private class to access BString internals 2011-11-25 06:19:45 +01:00
Ingo Weinhold
4f5f15f080 BRepositoryCache: Add iteration, etc.
* Remove InitCheck() and the initializing constructor.
* Rename PackageCount() to CountPackages().
* Use BOpenHashTable instead of HashMap for the internal PackageMap.
* Allow multiple packages with the same name. Equally named packages are
  in a singly linked list after the first package with that name.
* Add an Iterator inner class and a GetIterator() method, so one can now
  iterate through the packages in the repository.
2011-11-25 06:19:44 +01:00
Ingo Weinhold
156ea481b3 Add HashValue() methods to BString 2011-11-25 06:19:44 +01:00
Ingo Weinhold
1524eed163 Handle the newer package attributes
This unbreaks reading repository cache files using the respective
attributes.
2011-11-25 06:19:43 +01:00
Ingo Weinhold
d0b2d58a4e Add error output in case of invalid compression ID 2011-11-25 06:19:42 +01:00
Ingo Weinhold
84f50b1ce9 GetRepositoryCache/Config(): return valid entry
Always create the common repository cache/config paths so the BEntry
that is returned is valid at least. Fixes BRefreshRepositoryRequest
failing when the common repository cache path didn't exist yet.
2011-11-25 06:19:39 +01:00
Ingo Weinhold
ad4fba78b2 Initialize BRepositoryInfo::fInitStatus 2011-11-25 06:19:39 +01:00
Ingo Weinhold
56fed01db3 Handle the newer package attributes 2011-11-25 06:19:38 +01:00
Ingo Weinhold
0a9478a707 Force package names and versions to lower case 2011-11-25 06:19:37 +01:00
Ingo Weinhold
6ae0ecd49a Add a package info "install-path" attribute
The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.
2011-11-25 06:19:35 +01:00
Ingo Weinhold
7efa133cb4 BPackageWriter: Add SetCheckLicenses()
The default is still "true", but now it is possible to disable the
license check.
2011-11-25 06:19:34 +01:00
Ingo Weinhold
e7c648e06d PackageWriterImpl::_AddEntry(): Fix update logic
* Don't only look up the entry attribute when the entry is implicit.
  Look it up, when it is a directory instead. This aligns it the logic
  with _UpdateCheckEntryCollisions().
* When the entry attribute exits and the entry is not implicit, add file
  attributes, but not stat data. This also aligns the logic with
  _UpdateCheckEntryCollisions(), which removes colliding attributes, but
  keeps stat data.
2011-11-25 06:19:03 +01:00
Ingo Weinhold
420a5c3e42 Remove copy'n'paste left-over 2011-11-25 06:19:02 +01:00
Ingo Weinhold
4d63965914 Fix "package add" heap compacting
PackageWriterImpl::_CompactHeap(): Incorrectly used fHeapEnd instead of
the heap size. So the last copied chunk was too large.
2011-11-25 06:19:02 +01:00
Ingo Weinhold
f4417e14fa PackageWriterImpl::_MoveHeapChunk(): better output 2011-11-25 06:19:01 +01:00
Ingo Weinhold
8ffba2a6cb Write uncompressed package file TOC, if necessary 2011-11-25 06:19:00 +01:00
Ingo Weinhold
00bc8e9cbd Add support for adding/updating package entries
Add flags parameter to BPackageWriter::Init() (and the private
implementation classes) to indicate that an existing package file shall
be updated instead of created. Currently that always happens in-place.
2011-11-25 06:18:58 +01:00
Ingo Weinhold
de9e64b235 Write uncompressed package attributes if necessary
When compression doesn't save space, using it nonetheless results in a
file that the reader complains about. So we fall back to writing an
uncompressed package attributes section in such a case.

The same still needs to be done for the TOC section.
2011-11-25 06:18:57 +01:00
Ingo Weinhold
443be501c0 Use fHeapOffset instead of sizeof(hpkg_header) 2011-11-25 06:18:57 +01:00
Ingo Weinhold
e6ebdaaf21 Move RegisterPackageInfo() to Finish() 2011-11-25 06:18:56 +01:00
Ingo Weinhold
78811461b1 Add BLowLevelPackageContentHandler section hooks
* Add hooks HandleSectionStart() and HandleSectionEnd(). They are
  invoked to bracket package file section, so the handler can
  discriminate which section the attributes belong to.
  HandleSectionStart() features a return parameter _handleSection, which
  allows to handler to pick which sections it wants to handle.
* "package dump" does now print the section names.
2011-11-25 06:18:55 +01:00
Ingo Weinhold
b6d9fe9a6b PackageWriterImpl::_AddEntry(): Improve output
Print the relative path instead of only the leaf name.
2011-11-25 06:18:52 +01:00
Ingo Weinhold
8524dd3660 SubPathAdder: Check for overflows, omit initial / 2011-11-25 06:18:51 +01:00
Ingo Weinhold
2fce201893 BLowLevelPackageContentHandler interface extension
HandleAttributeDone(): Add parentToken parameter.
2011-11-25 06:18:50 +01:00
Ingo Weinhold
37880dd0a7 Remove debug output 2011-11-25 06:18:49 +01:00
Ingo Weinhold
0f9a98a419 Add optional FD parameter to AddEntry()
If a FD is specified, instead of using the file with the given the FD is
used. Allows for adding entries without first copying them into the
directory structure.
2011-11-25 06:18:45 +01:00
Ingo Weinhold
cd8f03a8cc BPackageInfo::ReadFromConfigFile() BFile& version 2011-11-25 06:18:44 +01:00
Ingo Weinhold
85e13d1ef8 Remove the build platform work-arounds 2011-11-25 06:18:42 +01:00
Ingo Weinhold
4ebd3de828 Support package info [source] URL attributes 2011-11-25 06:18:37 +01:00
Ingo Weinhold
4b6a3a9c5f Change source URL package info attribute name
Use "-" instead of "_".
2011-11-25 06:18:36 +01:00
Ingo Weinhold
029f6d0d05 Simplify BPackageInfo::Parser::_Parse() further
* Match the attribute in a loop, use an attribute ID switch, do the
  "seen" checks without the switch.
* Explicitly handle the case when encountering an unknown attribute.
2011-11-25 06:18:36 +01:00
Ingo Weinhold
208b212c56 Simplify BPackageInfo::Parser::_Parse()
This also fixes the memory leak due to the previously used on-stack
BObjectLists not having been defined owning the elements.
2011-11-25 06:18:35 +01:00
Ingo Weinhold
3a802b3d7f Add URL/source URL hpkg package attributes 2011-11-25 06:18:35 +01:00
Ingo Weinhold
eb7e89518a Add url and sourceURL properties to BPackageInfo
Also extend the parser to accept "url" and "source-url" attributes.
2011-11-25 06:18:34 +01:00
Ingo Weinhold
1338e7b6ae Make .PackageInfo more driver-settings-ish
* Use braces instead of brackets for lists.
* Semicolons and newlines separate items now. Remove handling for comma.
* Allow '\'' as quotation character.
* Remove assignment after variable name.

This should make the .PackageInfo format driver settings compatible, but
not vice versa. It is still stricter.
2011-11-25 06:18:33 +01:00
Ingo Weinhold
c53e9146c2 Allow single-element string/flag lists without []
As syntactic sugar string and flag lists no longer need to be enclosed
in brackets when they have exactly one element.
2011-11-25 06:18:31 +01:00
Ingo Weinhold
2df5441165 Remove "copyright" and "license" keywords
There's "copyrights" and "licenses" which can be used.
2011-11-25 06:18:30 +01:00
Ingo Weinhold
53da7df201 Small cleanup 2011-11-25 06:18:30 +01:00
Ingo Weinhold
c719d46563 Support for reading compatible version attribute 2011-11-25 06:18:28 +01:00
Ingo Weinhold
9e93bb4bfc Write resolvable compatible version to the package
To avoid a clash with the regular version or an extra attribute level we
use the "package:provides.compatible" package attribute instead of
"package:version.major".
2011-11-25 06:18:27 +01:00
Ingo Weinhold
dd2ab027fe Support for parsing the compatible version
In the .PackageInfo the compatible version for a resolvable can
optionally be given after the resolvable version via
"'compat[ible]' '>=' <version>".
2011-11-25 06:18:27 +01:00
Ingo Weinhold
622ca02bc1 Add package attribute for compatible version 2011-11-25 06:18:26 +01:00
Ingo Weinhold
4438ef7a2c BPackageResolvable: Add compatibleVersion property 2011-11-25 06:18:25 +01:00
Ingo Weinhold
8730aba210 Coding style: Fix indentation 2011-11-25 06:18:24 +01:00
Ingo Weinhold
8f314372a8 Introduce a pre-release version component
* The version string pattern is now:
  <major>[.<minor>[.<micro>]][-<pre>][-<release>]
* Introduce B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_PRE_RELEASE package
  attribute.
* Add "preRelease" field to BPackageVersionData.
* Add "preRelease" property to BPackageVersion and packagefs's Version.
* Adjust package reader and writer code accordingly.
2011-11-25 06:18:24 +01:00
Ingo Weinhold
7ea4dbcecf Hard code "Public Domain" as acceptable license 2011-11-25 06:17:41 +01:00
Ingo Weinhold
0f15206ac9 ReaderImplBase::ParseStrings(): Avoid new[0] 2011-11-25 06:17:38 +01:00
Ingo Weinhold
fab5eddca9 Split package kit DataReader.cpp
Pull AttributeDataReader and FDDataReader implementations out of
DataReader.cpp into own source files. Thus we can avoid dependencies
(e.g. to fs_attr code) we don't need/want.
2011-11-25 06:17:37 +01:00
Ingo Weinhold
caa4217eb5 PackageWriterImpl: Build platform symlink issues
On a non-Haiku build platform map openat(), fstat(), and
FileDescriptorCloser to _kern_open(), _kern_read_stat(), and
BuildFileDescriptorCloser respectively, so symlinks can be opened and
stat()ed.
2011-11-25 06:17:37 +01:00
Ingo Weinhold
7162cff6b0 <build>package: attribute iteration, license dir
PackageWriterImpl:
* Iterate through attributes using fs_read_attr_dir() instead of
  readdir(). Makes it work correctly on the build platform.
* On the build platform look up the system licenses in their source
  directory rather than based on find_directory().
2011-11-25 06:17:36 +01:00
Ingo Weinhold
d62ec0bd75 Fixed host build issues/warnings 2011-11-25 06:17:33 +01:00
Oliver Tappe
323b65468e Filtered flat import of Oliver's svn package management branch
Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
  deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
  <directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
  DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
  ~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.
2011-11-25 06:17:07 +01:00
Oliver Tappe
02606f712c Provide BReferenceable in libreferenceable.a, too.
* the upcoming multibyte-implementation in libroot's ICU locale
  backend is going to use this, so it's not good enough to provide
  BReferenceable only in libbe.so
2011-11-22 16:43:53 +01:00