aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx/menubar.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/gfx/menubar.h')
-rw-r--r--engines/sci/gfx/menubar.h80
1 files changed, 44 insertions, 36 deletions
diff --git a/engines/sci/gfx/menubar.h b/engines/sci/gfx/menubar.h
index 02d99332d9..44ecd8f1bb 100644
--- a/engines/sci/gfx/menubar.h
+++ b/engines/sci/gfx/menubar.h
@@ -50,9 +50,7 @@ struct EngineState;
/* The number of pixels added to the left of the first menu */
#define MENU_BOX_CENTER_PADDING 10
-/* Number of pixels to leave in between the left and the right centered text content in boxes
-** that use right centered content
-*/
+/* Number of pixels to leave in between the left and the right centered text content in boxes that use right centered content */
#define MENU_BOX_LEFT_PADDING 0
/* Number of pixels to pad to the left */
@@ -88,16 +86,16 @@ enum MenuType {
class MenuItem : public Common::Serializable {
public:
- MenuType _type; /* Normal or hbar */
- Common::String _keytext; /* right-centered part of the text (the key) */
+ MenuType _type; /**< Normal or hbar */
+ Common::String _keytext; /**< right-centered part of the text (the key) */
int _flags;
- byte _said[MENU_SAID_SPEC_SIZE]; /* Said spec for this item */
+ byte _said[MENU_SAID_SPEC_SIZE]; /**< Said spec for this item */
reg_t _saidPos;
Common::String _text;
reg_t _textPos;
- int _modifiers; /* Hotkey for this item */
- int _key; /* Hotkey for this item */
+ int _modifiers; /**< Hotkey for this item */
+ int _key; /**< Hotkey for this item */
int _enabled;
int _tag;
@@ -108,9 +106,10 @@ public:
/**
* Determines whether a message/modifiers key pair matches a menu item's key parameters.
- * @param message The message to match
- * @param modifiers The modifier flags to match
- * @return true on match, false otherwise
+ *
+ * @param[in] message The message to match
+ * @param[in] modifiers The modifier flags to match
+ * @return true on match, false otherwise
*/
bool matchKey(int message, int modifiers);
};
@@ -156,59 +155,68 @@ public:
/**
* Adds a menu to the menubar.
- * Parameters: (GfxState *) state: The state the fonts are stored in
- * (char *) title: The menu title
- * (char *) entries: A string of menu entries
- * (int) font: The font which is to be used for drawing
- * (reg_t) entries_base: Segmented VM address of the entries string
- * Returns : (void)
+ *
* The menu entries use the following special characters:
* '`' : Right justify the following part
* ':' : End of this entry
* '#' : Function key (replaced by 'F')
* '^' : Control key (replaced by \002, which looks like "CTRL")
* '=' : Initial tag value
- * and the special string "--!", which represents a horizontal bar in the menu.
+ * and the special string "--!", which represents a horizontal bar in the
+ * menu.
+ *
+ * @param[in] state The state the fonts are stored in
+ * @param[in] title The menu title
+ * @param[in] entries A string of menu entries
+ * @param[in] font The font which is to be used for drawing
+ * @param[in] entries_base Segmented VM address of the entries string
*/
void addMenu(GfxState *state, const char *title, const char *entries, int font, reg_t entries_base);
/**
- * Sets the (currently unidentified) foo and bar values.
- * Parameters: (state_t *) s: The current state
- * (int) menu: The menu number to edit
- * (int) item: The menu item to change
- * (int) attribute: The attribute to modify
- * (int) value: The value the attribute should be set to
- * Returns : (int) 0 on success, 1 if either menu or item were invalid
+ * Sets the attributes for a menu item.
+ *
+ * @param[in] s The current state
+ * @param[in] menu The menu number to edit
+ * @param[in] item The menu item to change
+ * @param[in] attribute The attribute to modify
+ * @param[in] value The value the attribute should be set to
+ * @return 0 on success, 1 if either menu or item were invalid
*/
int setAttribute(EngineState *s, int menu, int item, int attribute, reg_t value);
/**
- * Sets the (currently unidentified) foo and bar values.
- * Parameters: (int) menu: The menu number
- * (int) item: The menu item to read
- * (int) attribute: The attribute to read from
- * Returns : (int) The attribute value, or -1 on error
+ * Gets an attribute for a menuitem.
+ *
+ * @param[in] menu The menu number
+ * @param[in] item The menu item to read
+ * @param[in] attribute The attribute to read from
+ * @return The attribute value, or -1 on error
*/
reg_t getAttribute(int menu, int item, int attribute) const;
/**
* Determines whether the specified menu entry may be activated.
- * @return true if the menu item may be selected, false otherwise
+ *
+ * @return true if the menu item may be selected, false otherwise
*/
bool itemValid(int menu, int item) const;
/**
* Maps the pointer position to a (menu,item) tuple.
- * @param pointerPos the current pointer position
- * @param menu_nr the current menu (updated by this function if necessary)
- * @param item_nr the current menu item (updated by this function if necessary)
- * @param port the port of the currently active menu (if any)
- * @return true if the pointer is outside a valid port, false otherwise.
+ *
+ * @param[in] pointerPos the current pointer position
+ * @param[in] menu_nr the current menu (updated by this function if
+ * necessary)
+ * @param[in] item_nr the current menu item (updated by this function
+ * if necessary)
+ * @param[in] port the port of the currently active menu (if any)
+ * @return true if the pointer is outside a valid port,
+ * false otherwise.
*/
bool mapPointer(const Common::Point &pointerPos, int &menu_nr, int &item_nr, GfxPort *port) const;