[haiku-commits] r42984 - in haiku/trunk: docs/user docs/user/interface headers/os/interface src/kits/interface

  • From: niels.reedijk@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 29 Oct 2011 23:51:43 +0200 (CEST)

Author: nielx
Date: 2011-10-29 23:51:43 +0200 (Sat, 29 Oct 2011)
New Revision: 42984
Changeset: https://dev.haiku-os.org/changeset/42984
Ticket: https://dev.haiku-os.org/ticket/7994

Added:
   haiku/trunk/docs/user/interface/Screen.dox
Modified:
   haiku/trunk/docs/user/Doxyfile
   haiku/trunk/headers/os/interface/Screen.h
   haiku/trunk/src/kits/interface/Screen.cpp
Log:
Apply the patch by jscipione on ticket #7994.

 * Update BScreen class style and variable names
 * Remove documentation from Screen.cpp file
 * Create Screen.dox documentation file



Modified: haiku/trunk/docs/user/Doxyfile
===================================================================
--- haiku/trunk/docs/user/Doxyfile      2011-10-29 21:30:22 UTC (rev 42983)
+++ haiku/trunk/docs/user/Doxyfile      2011-10-29 21:51:43 UTC (rev 42984)
@@ -488,6 +488,7 @@
                                                 
../../headers/os/interface/Layout.h \
                                                 
../../headers/os/interface/LayoutBuilder.h \
                                                 
../../headers/os/interface/LayoutItem.h \
+                                                
../../headers/os/interface/Screen.h \
                                                 
../../headers/os/interface/TwoDimensionalLayout.h \
                          ../../headers/os/locale \
                          ../../headers/os/midi2 \

Added: haiku/trunk/docs/user/interface/Screen.dox
===================================================================
--- haiku/trunk/docs/user/interface/Screen.dox                          (rev 0)
+++ haiku/trunk/docs/user/interface/Screen.dox  2011-10-29 21:51:43 UTC (rev 
42984)
@@ -0,0 +1,640 @@
+/*
+ * Copyright 2011, Haiku inc.
+ * Distributed under the terms of the MIT Licence.
+ *
+ * Documentation by:
+ *             Stefano Ceccherini, burton666@xxxxxxxxx
+ *             Axel Dörfler, axeld@xxxxxxxxxxxxxxxx
+ *             John Scipione, jscipione@xxxxxxxxx
+ * Corresponds to:
+ *             /trunk/headers/os/interface/Screen.h     rev 42759
+ *             /trunk/src/kits/interface/Screen.cpp     rev 42759
+ */
+
+
+/*!
+       \file Screen.h
+       \brief Defines the BScreen class and support structures.
+*/
+
+
+/*!
+       \class BScreen
+       \ingroup interface
+       \brief The BScreen class provides methods to retrieve and change display
+               settings.
+
+       Each BScreen object describes one display connected to the computer.
+       Multiple BScreen objects can represent the same physical display.
+
+       \attention Haiku currently supports only a single display. The main
+       screen with id \c B_MAIN_SCREEN_ID contains the origin in its top left
+       corner. Additional displays, when they become supported, will extend
+       the coordinates of the main screen.
+
+       Some utility methods provided by this class are ColorSpace() to get the
+       color space of the screen, Frame() to get the frame rectangle, and ID()
+       to get the identifier of the screen.
+
+       Methods to convert between 8-bit and 32-bit colors are provided by
+       IndexForColor() and ColorForIndex().
+
+       You can also use this class to take a screenshot of the entire screen or
+       a particular portion of it. To take a screenshot use either the 
GetBitmap()
+       or ReadBitmap() method.
+
+       Furthermore, you can use this class get and set the background color of 
a
+       workspace. To get the background color call DesktopColor() or to set the
+       background color use SetDesktopColor().
+
+       This class provides methods to get and set the resolution, pixel depth,
+       and color map of a display. To get a list of the display modes supported
+       by the graphics card use the GetModeList() method. You can get and set
+       the screen resolution by calling the GetMode() and SetMode() methods.
+       The color map of the display can be retrieved by calling the ColorMap()
+       method.
+
+       You can use this class to get information about the graphics card and
+       monitor connected to the computer by calling the GetDeviceInfo() and
+       GetMonitorInfo() methods.
+
+       VESA Display Power Management Signaling support allow you to put the
+       monitor into a low-power mode. Call DPMSCapabilites() to check what
+       modes are supported by your monitor. DPMSState() tells you what state
+       your monitor is currently in and SetDPMS() allows you to change it.
+*/
+
+
+/*!
+       \fn BScreen::BScreen(screen_id id)
+       \brief Creates a BScreen object which represents the display
+               connected to the computer with the given screen_id.
+
+       In the current implementation, there is only one display
+       (\c B_MAIN_SCREEN_ID). To be sure that the object was constructed
+       correctly, call IsValid().
+
+       \param id The screen_id of the screen to create a BScreen object from.
+*/
+
+
+/*!
+       \fn BScreen::BScreen(BWindow* window)
+       \brief Creates a BScreen object which represents the display that
+               contains \a window.
+
+       In the current implementation, there is only one display
+       (\c B_MAIN_SCREEN_ID). To be sure that the object was constructed
+       correctly, call IsValid().
+
+       \param window A BWindow object.
+*/
+
+
+/*!
+       \fn BScreen::~BScreen()
+       \brief Frees the resources used by the BScreen object and unlocks the
+               screen.
+
+       \note The main screen object will never go away, even if you disconnect
+               all monitors.
+*/
+
+
+/*!
+       \name Utility Methods
+*/
+
+
+//! @{
+
+
+/*! 
+       \fn bool BScreen::IsValid()
+       \brief Checks that the BScreen object represents a real display that is
+               connected to the computer.
+
+       \return \c true if the BScreen object is valid, \c false otherwise.
+*/
+
+
+/*!
+       \fn status_t BScreen::SetToNext()
+       \brief Sets the BScreen object to the next display in the screen list.
+
+       \return \c B_OK if successful, otherwise \c B_ERROR.
+*/
+
+
+/*!    \fn color_space BScreen::ColorSpace()
+       \brief Gets the color_space of the display.
+
+       \return \c B_CMAP8, \c B_RGB15, \c B_RGB32, or \c B_NO_COLOR_SPACE
+               if the BScreen object is invalid.
+*/
+
+
+/*!
+       \fn BRect BScreen::Frame()
+       \brief Gets the frame of the screen in the screen's coordinate system.
+
+       For example if the BScreen object points to the main screen with a
+       resolution of 1,366x768 then this method returns
+       BRect(0.0, 0.0, 1365.0, 767.0). If the BScreen object is invalid then
+       this method returns an empty rectangle i.e. BRect(0.0, 0.0, 0.0, 0.0)
+
+       You can set the frame programmatically by calling the SetMode() method.
+
+       \return a BRect frame of the screen in the screen's coordinate system.
+*/
+
+
+/*!
+       \fn screen_id BScreen::ID()
+       \brief Gets the identifier of the display.
+
+       In the current implementation this method returns \c B_MAIN_SCREEN_ID
+       even if the object is invalid.
+
+       \return A screen_id that identifies the screen.
+*/
+
+
+/*!
+       \fn status_t BScreen::WaitForRetrace()
+       \brief Blocks until the monitor has finished its current vertical 
retrace.
+
+       \return \c B_OK or \c B_ERROR if the screen object is invalid.
+*/
+
+
+/*!
+       \fn status_t BScreen::WaitForRetrace(bigtime_t timeout)
+       \brief Blocks until the monitor has finished its current vertical 
retrace
+               or until \a timeout has expired.
+
+       \param timeout The amount of time to wait before returning.
+
+       \return \c B_OK if the monitor has retraced in the given \a timeout
+               duration, \c B_ERROR otherwise.
+*/
+
+
+//! @}
+
+
+/*!
+       \name Color Methods
+*/
+
+
+//! @{
+
+
+/*!
+       \fn inline uint8 BScreen::IndexForColor(rgb_color color)
+       \brief Gets the 8-bit color index that most closely matches a
+               32-bit \a color.
+
+       \param color The 32-bit \a color to get the 8-bit index of.
+
+       \return An 8-bit color index in the screen's color_map.
+*/
+
+
+/*!
+       \fn uint8 BScreen::IndexForColor(uint8 red, uint8 green, uint8 blue,
+                                                                        uint8 
alpha)
+       \brief Gets the 8-bit color index that most closely matches a set of
+               \a red, \a green, \a blue, and \a alpha values.
+
+       \param red The \a red value.
+       \param green The \a green value.
+       \param blue The \a blue value.
+       \param alpha The \a alpha value.
+
+       \return An 8-bit color index in the screen's color_map.
+*/
+
+
+/*!
+       \fn rgb_color BScreen::ColorForIndex(const uint8 index)
+       \brief Gets the 32-bit color representation of an 8-bit color \a index.
+
+       \param index The 8-bit color \a index to convert to a 32-bit color.
+
+       \return A 32-bit rgb_color structure.
+*/
+
+
+/*!
+       \fn uint8 BScreen::InvertIndex(uint8 index)
+       \brief Gets the "Inversion" of an 8-bit color \a index.
+
+       Inverted colors are useful for highlighting.
+
+       \param index The 8-bit color \a index.
+
+       \return An 8-bit color \a index that represents the "Inversion" of the
+               given color in the screen's color_map.
+*/
+
+
+/*!
+       \fn const color_map* BScreen::ColorMap()
+       \brief Gets the color_map of the BScreen.
+
+       \return A pointer to the BScreen object's color_map.
+*/
+
+
+//! @}
+
+
+/*!
+       \name Bitmap Methods
+*/
+
+
+//! @{
+
+
+/*!
+       \fn status_t BScreen::GetBitmap(BBitmap** _bitmap, bool drawCursor,
+                                                                       BRect* 
bounds)
+       \brief Allocates a BBitmap and copies the contents of the screen into 
it.
+
+       \note GetBitmap() will allocate a BBitmap object for you while
+               ReadBitmap() requires you to pre-allocate a BBitmap object 
first.
+
+       \note The caller is responsible for freeing the BBitmap object.
+
+       \param _bitmap A pointer to a BBitmap pointer where this method will
+               store the contents of the display.
+       \param drawCursor Specifies whether or not to draw the cursor.
+       \param bounds Specifies the screen area that you want copied. If
+               \a bounds is \c NULL then the entire screen is copied.
+
+       \return \c B_OK if the operation was successful, \c B_ERROR otherwise.
+*/
+
+
+/*!
+       \fn status_t BScreen::ReadBitmap(BBitmap* bitmap, bool drawCursor,
+                                                                        BRect* 
bounds)
+       \brief Copies the contents of the screen into a BBitmap.
+
+       \note ReadBitmap() requires you to pre-allocate a BBitmap object first,
+               while GetBitmap() will allocate a BBitmap object for you.
+
+       \param bitmap A pointer to a pre-allocated BBitmap where this
+               method will store the contents of the display.
+       \param drawCursor Specifies whether or not to draw the cursor.
+       \param bounds Specifies the screen area that you want copied. If
+               \a bounds is \c NULL then the entire screen is copied.
+
+       \return \c B_OK if the operation was successful, \c B_ERROR otherwise.
+*/
+
+
+//! @}
+
+
+/*!
+       \name Desktop Color Methods
+*/
+
+
+//! @{
+
+
+/*!
+       \fn rgb_color BScreen::DesktopColor()
+       \brief Gets the background color of the current workspace.
+
+       \return A 32-bit rgb_color structure containing the background color
+               of the current workspace.
+*/
+
+
+/*!
+       \fn rgb_color BScreen::DesktopColor(uint32 workspace)
+       \brief Gets the background color of the specified \a workspace.
+
+       \param workspace The \a workspace index to get the desktop background
+               color of.
+
+       \return An 32-bit rgb_color structure containing the background color
+               of the specified \a workspace.
+*/
+
+
+/*!
+       \fn void BScreen::SetDesktopColor(rgb_color color, bool stick)
+       \brief Set the background \a color of the current workspace.
+
+       \param color The 32-bit \a color to paint the desktop background.
+       \param stick Whether or not the \a color will stay after a reboot.
+*/
+
+
+/*!
+       \fn void BScreen::SetDesktopColor(rgb_color color, uint32 workspace,
+                                                                         bool 
stick)
+       \brief Set the background \a color of the specified \a workspace.
+
+       \param color The 32-bit \a color to paint the desktop background.
+       \param workspace The \a workspace index to update.
+       \param stick Whether or not the \a color will stay after a reboot.
+*/
+
+
+//! @}
+
+
+/*!
+       \name Display Mode Methods
+
+       The following methods retrieve and alter the display_mode structure
+       of a screen. The display_mode structure contains screen size,
+       pixel depth, and display timings settings.
+*/
+
+
+//! @{
+
+
+/*!
+       \fn status_t BScreen::ProposeMode(display_mode* target,
+                                                                         const 
display_mode* low,
+                                                                         const 
display_mode* high)
+       \brief Adjust the \a target mode to make it a supported mode.
+
+       The list of supported modes for the graphics card is supplied by
+       the GetModeList() method.
+
+       \param target The mode you want adjust.
+       \param low The lower display mode limit.
+       \param high The higher display mode limit.
+
+       \retval B_OK if \a target is supported and falls within the
+               \a low and \a high limits.
+       \retval B_BAD_VALUE if \a target is supported but does not
+               fall within the \a low and \a high limits.
+       \retval B_ERROR if the target mode isn't supported.
+*/
+
+
+/*!
+       \fn status_t BScreen::GetModeList(display_mode** _modeList, uint32* 
_count)
+       \brief Allocates and returns a list of the display modes supported by 
the
+               graphics card into \a _modeList.
+
+       \warning The monitor may not be able to display all of the modes that
+               GetModeList() retrieves.
+
+       \note The caller is responsible for freeing the display_mode object.
+
+       \param _modeList A pointer to a display_mode pointer, where the function
+               will allocate an array of display_mode structures.
+       \param _count A pointer to an integer used to store the count of
+               available display modes.
+
+       \retval B_OK if the operation was successful.
+       \retval B_ERROR if \a modeList or \a count is invalid.
+       \retval B_ERROR for all other errors.
+*/
+
+
+/*!
+       \fn status_t BScreen::GetMode(display_mode* mode)
+       \brief Fills out the display_mode struct from the current workspace.
+
+       \param mode A pointer to a display_mode struct to copy into.
+
+       \retval B_OK if the operation was successful.
+       \retval B_BAD_VALUE if \a mode is invalid.
+       \retval B_ERROR for all other errors.
+*/
+
+
+/*!
+       \fn status_t BScreen::GetMode(uint32 workspace, display_mode* mode)
+       \brief Fills out the display_mode struct from the specified
+               \a workspace.
+
+       \param workspace The index of the \a workspace to query.
+       \param mode A pointer to a display_mode structure to copy into.
+
+       \retval B_OK if the operation was successful
+       \retval B_BAD_VALUE if \a mode is invalid.
+       \retval B_ERROR for all other errors.
+*/
+
+
+/*!
+       \fn status_t BScreen::SetMode(display_mode* mode, bool makeDefault)
+       \brief Sets the screen in the current workspace to the given \a mode.
+
+       \param mode A pointer to a display_mode struct.
+       \param makeDefault Whether or not \a mode is set as the default.
+
+       \return \c B_OK if the operation was successful, \c B_ERROR otherwise.
+*/
+
+
+/*!
+       \fn status_t BScreen::SetMode(uint32 workspace, display_mode* mode,
+                                                                 bool 
makeDefault)
+       \brief Set the screen in the specified \a workspace to the given \a 
mode.
+
+       \param workspace The index of the workspace to set the \a mode of.
+       \param mode A pointer to a display_mode struct.
+       \param makeDefault Whether or not the \a mode is set as the default
+               for the specified \a workspace.
+
+       \return \c B_OK if the operation was successful, \c B_ERROR otherwise.
+*/
+
+
+//! @}
+
+
+/*!
+       \name Display and Graphics Card Info Methods
+*/
+
+
+//! @{
+
+
+/*!
+       \fn status_t BScreen::GetDeviceInfo(accelerant_device_info* info)
+       \brief Fills out the \a info struct with information about a graphics 
card.
+
+       \param info An accelerant_device_info struct to store the device
+               \a info.
+
+       \retval B_OK if the operation was successful.
+       \retval B_BAD_VALUE if \a info is invalid.
+       \retval B_ERROR for all other errors.
+*/
+
+
+/*!
+       \fn status_t BScreen::GetMonitorInfo(monitor_info* info)
+       \brief Fills out the \a info struct with information about a monitor.
+
+       \param info A monitor_info struct to store the monitor \a info.
+
+       \retval B_OK if the operation was successful.
+       \retval B_BAD_VALUE if \a info is invalid.
+       \retval B_ERROR for all other errors.
+*/
+
+
+/*!
+       \fn status_t BScreen::GetPixelClockLimits(display_mode* mode,
+                                                                               
          uint32* _low, uint32* _high)
+       \brief Gets the minimum and maximum pixel clock rates that are possible
+               for the specified \a mode.
+
+       \param mode A pointer to a display_mode structure.
+       \param _low A pointer to a uint32 where the method stores the lowest
+               available pixel clock.
+       \param _high A pointer to a uint32 where the method stores the highest
+               available pixel clock.
+
+       \retval B_OK if the operation was successful.
+       \retval B_BAD_VALUE if \a mode, \a low, or \a high is invalid.
+       \retval B_ERROR for all other errors.
+*/
+
+
+/*!
+       \fn status_t BScreen::GetTimingConstraints(display_timing_constraints*
+                                                                               
           constraints)
+       \brief Fills out the \a constraints structure with the timing 
constraints
+               of the current display mode.
+
+       \param constraints A pointer to a display_timing_constraints structure
+               to store the timing constraints.
+
+       \retval B_OK if the operation was successful.
+       \retval B_BAD_VALUE if \a constraints is invalid.
+       \retval B_ERROR for all other errors.
+*/
+
+
+//! @}
+
+
+/*!
+       \name VESA Display Power Management Signaling Settings
+
+       VESA Display Power Management Signaling (or DPMS) is a standard from the
+       VESA consortium for managing the power usage of displays through the
+       graphics card. DPMS allows you to shut off the display after the 
computer
+       has been unused for some time to save power.
+
+       DPMS states include:
+               - \c B_DPMS_ON Normal display operation.
+               - \c B_DPMS_STAND_BY Image not visible normal operation and 
returns to
+                       normal after ~1 second.
+               - \c B_DPMS_SUSPEND Image not visible, returns to normal after 
~5
+                       seconds.
+               - \c B_DPMS_OFF Image not visible, display is off except for 
power to
+                       monitoring circuitry. Returns to normal after ~8-20 
seconds.
+
+       Power usage in each of the above states depends on the monitor used. CRT
+       monitors typically receive larger power savings than LCD monitors in
+       low-power states.
+*/
+
+
+//! @{
+
+
+/*!
+       \fn status_t BScreen::SetDPMS(uint32 dpmsState)
+       \brief Sets the VESA Display Power Management Signaling (DPMS) state for
+               the display.
+
+       \param dpmsState The DPMS state to set.
+               valid values are:
+               - \c B_DPMS_ON
+               - \c B_DPMS_STAND_BY
+               - \c B_DPMS_SUSPEND
+               - \c B_DPMS_OFF
+
+       \return \c B_OK if the operation was successful, otherwise an error 
code.
+*/
+
+
+/*!
+       \fn uint32 BScreen::DPMSState()
+       \brief Gets the current VESA Display Power Management Signaling (DPMS)
+               state of the screen.
+
+       \return The current VESA Display Power Management Signaling (DPMS) state
+               of the display or 0 in the case of an error.
+*/
+
+
+
+/*!
+       \fn uint32 BScreen::DPMSCapabilites()
+       \brief Gets the VESA Display Power Management Signaling (DPMS)
+               modes that the display supports as a bit mask.
+
+       - \c B_DPMS_ON is worth 1
+       - \c B_DPMS_STAND_BY is worth 2
+       - \c B_DPMS_SUSPEND is worth 4
+       - \c B_DPMS_OFF is worth 8
+
+       \return A bit mask of the VESA Display Power Management Signaling (DPMS)
+               modes that the display supports or 0 in the case of an error.
+*/
+
+
+//! @}
+
+
+/*!
+       \name Deprecated methods
+*/
+
+
+//! @{
+
+
+/*!
+       \fn BPrivate::BPrivateScreen* BScreen::private_screen()
+       \brief Returns the BPrivateScreen used by the BScreen object.
+
+       \return A pointer to the BPrivateScreen class internally used by the 
BScreen
+               object.
+*/
+
+
+/*!
+       \fn status_t BScreen::ProposeDisplayMode(display_mode* target,
+                                                                               
         const display_mode* low,
+                                                                               
         const display_mode* high)
+       \brief Deprecated, use ProposeMode() instead.
+*/
+
+
+/*!
+       \fn void* BScreen::BaseAddress()
+       \brief Returns the base address of the frame buffer.
+*/
+
+
+/*!
+       \fn uint32 BScreen::BytesPerRow()
+       \brief Returns the bytes per row of the frame buffer.
+*/
+
+
+//! @}

Modified: haiku/trunk/headers/os/interface/Screen.h
===================================================================
--- haiku/trunk/headers/os/interface/Screen.h   2011-10-29 21:30:22 UTC (rev 
42983)
+++ haiku/trunk/headers/os/interface/Screen.h   2011-10-29 21:51:43 UTC (rev 
42984)
@@ -52,20 +52,20 @@
                                                                        BRect* 
frame = NULL);
 
                        rgb_color                       DesktopColor();
-                       rgb_color                       DesktopColor(uint32 
index);
+                       rgb_color                       DesktopColor(uint32 
workspace);
                        void                            
SetDesktopColor(rgb_color color,
-                                                                       bool 
makeDefault = true);
+                                                                       bool 
stick = true);
                        void                            
SetDesktopColor(rgb_color color,
-                                                                       uint32 
index, bool makeDefault = true);
+                                                                       uint32 
workspace, bool stick = true);
 
                        status_t                        
ProposeMode(display_mode* target,
                                                                        const 
display_mode* low,
                                                                        const 
display_mode* high);
                        status_t                        
GetModeList(display_mode** _modeList,
                                                                        uint32* 
_count);
-                       status_t                        GetMode(display_mode* 
_mode);
+                       status_t                        GetMode(display_mode* 
mode);
                        status_t                        GetMode(uint32 
workspace,
-                                                                       
display_mode* _mode);
+                                                                       
display_mode* mode);
                        status_t                        SetMode(display_mode* 
mode,
                                                                        bool 
makeDefault = false);
                        status_t                        SetMode(uint32 
workspace,
@@ -74,7 +74,7 @@
                        status_t                        
GetDeviceInfo(accelerant_device_info* info);
                        status_t                        
GetMonitorInfo(monitor_info* info);
                        status_t                        
GetPixelClockLimits(display_mode* mode,
-                                                                       uint32* 
low, uint32* high);
+                                                                       uint32* 
_low, uint32* _high);
                        status_t                        GetTimingConstraints(
                                                                        
display_timing_constraints*
                                                                                
timingConstraints);

Modified: haiku/trunk/src/kits/interface/Screen.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Screen.cpp   2011-10-29 21:30:22 UTC (rev 
42983)
+++ haiku/trunk/src/kits/interface/Screen.cpp   2011-10-29 21:51:43 UTC (rev 
42984)
@@ -8,9 +8,6 @@
  */
 
 
-/*!    BScreen lets you retrieve and change the display settings. */
-
-
 #include <Screen.h>
 
 #include <Window.h>
@@ -21,41 +18,24 @@
 using namespace BPrivate;
 
 
-/*!    \brief Creates a BScreen object which represents the display with the 
given
-               screen_id
-       \param id The screen_id of the screen to get.
-
-       In the current implementation, there is only one display 
(B_MAIN_SCREEN_ID).
-       To be sure that the object was correctly constructed, call IsValid().
-*/
 BScreen::BScreen(screen_id id)
 {
        fScreen = BPrivateScreen::Get(id.id);
 }
 
 
-/*!    \brief Creates a BScreen object which represents the display which 
contains
-       the given BWindow.
-       \param window A BWindow.
-*/
 BScreen::BScreen(BWindow* window)
 {
        fScreen = BPrivateScreen::Get(window);
 }
 
 
-/*!    \brief Releases the resources allocated by the constructor.
-*/
 BScreen::~BScreen()
 {
        BPrivateScreen::Put(fScreen);
 }
 
 
-/*! \brief Checks if the BScreen object represents a real screen connected to
-               the computer.
-       \return \c true if the BScreen object is valid, \c false if not.
-*/
 bool
 BScreen::IsValid()
 {
@@ -63,9 +43,6 @@
 }
 
 
-/*!    \brief In the current implementation, this function always returns 
B_ERROR.
-       \return Always \c B_ERROR.
-*/
 status_t
 BScreen::SetToNext()
 {
@@ -80,38 +57,26 @@
 }
 
 
-/*!    \brief Returns the color space of the screen display.
-       \return \c B_CMAP8, \c B_RGB15, or \c B_RGB32, or \c B_NO_COLOR_SPACE
-               if the screen object is invalid.
-*/
 color_space
 BScreen::ColorSpace()
 {
        if (fScreen != NULL)
                return fScreen->ColorSpace();
+
        return B_NO_COLOR_SPACE;
 }
 
 
-/*!    \brief Returns the rectangle that locates the screen in the screen
-               coordinate system.
-       \return a BRect that locates the screen in the screen coordinate system.
-*/
 BRect
 BScreen::Frame()
 {
        if (fScreen != NULL)
                return fScreen->Frame();
+
        return BRect(0, 0, 0, 0);
 }
 
 
-/*!    \brief Returns the identifier for the screen.
-       \return A screen_id struct that identifies the screen.
-
-       In the current implementation, this function always returns
-       \c B_MAIN_SCREEN_ID, even if the object is invalid.
-*/
 screen_id
 BScreen::ID()
 {
@@ -124,9 +89,6 @@
 }
 
 
-/*!    \brief Blocks until the monitor has finished the current vertical 
retrace.
-       \return \c B_OK, or \c B_ERROR if the screen object is invalid.
-*/
 status_t
 BScreen::WaitForRetrace()
 {
@@ -134,119 +96,76 @@
 }
 
 
-/*!    \brief Blocks until the monitor has finished the current vertical 
retrace,
-       or until the given timeout has passed.
-       \param timeout A bigtime_t which indicates the time to wait before
-               returning.
-       \return \c B_OK if the monitor has retraced in the given amount of time,
-               \c B_ERROR otherwise.
-*/
 status_t
 BScreen::WaitForRetrace(bigtime_t timeout)
 {
        if (fScreen != NULL)
                return fScreen->WaitForRetrace(timeout);
+
        return B_ERROR;
 }
 
 
-/*!    \brief Returns the index of the 8-bit color that,
-               most closely matches the given 32-bit color.
-       \param r The red value for a 32-bit color.
-       \param g The green value for a 32-bit color.
-       \param b The blue value for a 32-bit color.
-       \param a The alpha value for a 32-bit color.
-       \return An index for a 8-bit color in the screen's color map.
-*/
 uint8
-BScreen::IndexForColor(uint8 r, uint8 g, uint8 b, uint8 a)
+BScreen::IndexForColor(uint8 red, uint8 green, uint8 blue, uint8 alpha)
 {
        if (fScreen != NULL)
-               return fScreen->IndexForColor(r, g, b, a);
+               return fScreen->IndexForColor(red, green, blue, alpha);
+
        return 0;
 }
 
 
-/*!    \brief Returns the 32-bit color representation of a given 8-bit color 
index.
-       \param index The 8-bit color index to convert.
-       \return A rgb_color struct which represents the given 8-bit color index.
-*/
 rgb_color
 BScreen::ColorForIndex(const uint8 index)
 {
        if (fScreen != NULL)
                return fScreen->ColorForIndex(index);
+
        return rgb_color();
 }
 
 
-/*!    \brief Returns the "inversion" of the given 8-bit color.
-       \param index An 8-bit color index.
-       \return An 8-bit color index that represents the "inversion" of the 
given
-               color.
-*/
 uint8
 BScreen::InvertIndex(uint8 index)
 {
        if (fScreen != NULL)
                return fScreen->InvertIndex(index);
+
        return 0;
 }
 
 
-/*!    \brief Returns the color map of the current display.
-       \return A pointer to the object's color_map.
-*/
 const color_map*
 BScreen::ColorMap()
 {
        if (fScreen != NULL)
                return fScreen->ColorMap();
+
        return NULL;
 }
 
 
-/*!    \brief Copies the screen's contents into the first argument BBitmap.
-       \param screen_shot A pointer to a BBitmap pointer, where the function 
will
-               allocate a BBitmap for you.
-       \param draw_cursor Specifies if you want the cursor to be drawn.
-       \param bound Let you specify the area you want copied. If it's NULL, the
-               entire screen is copied.
-       \return \c B_OK if the operation was succesful, \c B_ERROR on failure.
-*/
 status_t
 BScreen::GetBitmap(BBitmap** _bitmap, bool drawCursor, BRect* bounds)
 {
        if (fScreen != NULL)
                return fScreen->GetBitmap(_bitmap, drawCursor, bounds);
+
        return B_ERROR;
 }
 
 
-/*!    \brief Copies the screen's contents into the first argument BBitmap.
-       \param screen_shot A pointer to an allocated BBitmap, where the function
-               will store the screen's content.
-       \param draw_cursor Specifies if you want the cursor to be drawn.
-       \param bound Let you specify the area you want copied. If it's NULL, the
-               entire screen is copied.
-       \return \c B_OK if the operation was succesful, \c B_ERROR on failure.
-
-       The only difference between this method and GetBitmap() is that 
ReadBitmap
-       requires you to allocate a BBitmap, while the latter will allocate a 
BBitmap
-       for you.
-*/
 status_t
-BScreen::ReadBitmap(BBitmap* buffer, bool drawCursor, BRect* bounds)
+BScreen::ReadBitmap(BBitmap* bitmap, bool drawCursor, BRect* bounds)
 {
        if (fScreen != NULL)
-               return fScreen->ReadBitmap(buffer, drawCursor, bounds);
+               return fScreen->ReadBitmap(bitmap, drawCursor, bounds);
+
        return B_ERROR;
 }
 
 
-/*!    \brief Returns the color of the desktop.
-       \return An rgb_color structure which is the color of the desktop.
-*/
 rgb_color
 BScreen::DesktopColor()
 {
@@ -257,11 +176,6 @@
 }
 
 
-/*!    \brief Returns the color of the desktop in the given workspace.
-       \param workspace The workspace of which you want to have the color.
-       \return An rgb_color structure which is the color of the desktop in the
-               given workspace.
-*/
 rgb_color
 BScreen::DesktopColor(uint32 workspace)
 {
@@ -272,139 +186,89 @@
 }
 
 
-/*!    \brief Set the color of the desktop.
-       \param rgb The color you want to paint the desktop background.
-       \param stick If you pass \c true here, the color will be maintained 
across
-               boots.
-*/
 void
-BScreen::SetDesktopColor(rgb_color rgb, bool stick)
+BScreen::SetDesktopColor(rgb_color color, bool stick)
 {
        if (fScreen != NULL)
-               fScreen->SetDesktopColor(rgb, B_CURRENT_WORKSPACE_INDEX, stick);
+               fScreen->SetDesktopColor(color, B_CURRENT_WORKSPACE_INDEX, 
stick);
 }
 
 
-/*!    \brief Set the color of the desktop in the given workspace.
-       \param rgb The color you want to paint the desktop background.
-       \param index The workspace you want to change the color.
-       \param stick If you pass \c true here, the color will be maintained 
across
-               boots.
-*/
 void
-BScreen::SetDesktopColor(rgb_color rgb, uint32 index, bool stick)
+BScreen::SetDesktopColor(rgb_color color, uint32 workspace, bool stick)
 {
        if (fScreen != NULL)
-               fScreen->SetDesktopColor(rgb, index, stick);
+               fScreen->SetDesktopColor(color, workspace, stick);
 }
 
 
-/*!    \brief Attempts to adjust the supplied mode so that it's a supported 
mode.
-       \param target The mode you want to be adjusted.
-       \param low The lower limit you want target to be adjusted.
-       \param high The higher limit you want target to be adjusted.
-       \return
-               - \c B_OK if target (as returned) is supported and falls into 
the

[... truncated: 244 lines follow ...]

Other related posts:

  • » [haiku-commits] r42984 - in haiku/trunk: docs/user docs/user/interface headers/os/interface src/kits/interface - niels . reedijk