From 070eeb2adb75cb730545e0673435e97fba755dd7 Mon Sep 17 00:00:00 2001 From: Antti Harri Date: Sun, 10 Jul 2011 16:24:44 +0300 Subject: [PATCH 01/11] Fix previous FLAC pkg-config commit that had some typos. While there, restructure and remove duplicate code. --- config.d/compression.m4 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/config.d/compression.m4 b/config.d/compression.m4 index 293c996ce..8c4fcd210 100644 --- a/config.d/compression.m4 +++ b/config.d/compression.m4 @@ -4,15 +4,12 @@ AC_ARG_ENABLE(flac, HAVE_FLAC=no if test "x$enable_flac" != "xno"; then if test "x$PKG_CONFIG" != "x"; then - PKG_CHECK_MODULES([FLAC], [flac], HAVE_FLAC=yes, HAVE_JACK=no) - if test "x$HAVE_FLAC" = "xyes"; then - AC_DEFINE(HAVE_JACK, 1, [Define if you have libFLAC]) - fi + PKG_CHECK_MODULES([LIBFLAC], [flac], HAVE_FLAC=yes, HAVE_FLAC=no) else AM_PATH_LIBFLAC(HAVE_FLAC=yes, HAVE_FLAC=no) - if test "x$HAVE_FLAC" = xyes; then - AC_DEFINE(HAVE_FLAC, 1, [define this if you have flac libs]) - fi + fi + if test "x$HAVE_FLAC" = xyes; then + AC_DEFINE(HAVE_FLAC, 1, [define this if you have flac libs]) fi fi AM_CONDITIONAL(HAVE_FLAC, test "x$HAVE_FLAC" = "xyes") From a46f8e333cf0d482143fc4a865ffc1efa6c46a9c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 10 Jul 2011 08:56:04 +0900 Subject: [PATCH 02/11] Convert prototypes to C-style for doxygen. --- ruamoko/cl_menu/controls_o.h | 4 +-- ruamoko/cl_menu/menu.h | 45 +++++++++++++++++----------------- ruamoko/cl_menu/options.h | 4 +-- ruamoko/cl_menu/options_util.h | 10 ++++---- ruamoko/cl_menu/servlist.h | 2 +- 5 files changed, 32 insertions(+), 33 deletions(-) diff --git a/ruamoko/cl_menu/controls_o.h b/ruamoko/cl_menu/controls_o.h index b4dac59f6..3e8c340b1 100644 --- a/ruamoko/cl_menu/controls_o.h +++ b/ruamoko/cl_menu/controls_o.h @@ -1,7 +1,7 @@ #ifndef __controls_o_h #define __controls_o_h -@extern void () MENU_control_binding; -@extern void () load_keybindings; +@extern void MENU_control_binding (void); +@extern void load_keybindings (void); #endif//__controls_o_h diff --git a/ruamoko/cl_menu/menu.h b/ruamoko/cl_menu/menu.h index e5d2326e2..5c8d48df3 100644 --- a/ruamoko/cl_menu/menu.h +++ b/ruamoko/cl_menu/menu.h @@ -1,28 +1,27 @@ #ifndef __menu_h #define __menu_h -@extern void (int x, int y, string text) Menu_Begin; -@extern void (int val) Menu_FadeScreen; -@extern void (int (int x, int y) func) Menu_Draw; -@extern void (void () func) Menu_EnterHook; -@extern void (void () func) Menu_LeaveHook; -@extern void (int x, int y, string name) Menu_Pic; -@extern void (int x, int y, string name, int srcx, int srcy, - int width, int height) Menu_SubPic; -@extern void (int x, int y, string name) Menu_CenterPic; -@extern void (int x, int y, string name, int srcx, int srcy, - int width, int height) Menu_CenterSubPic; -@extern void (int x, int y, string text, - int (string text, int key) func, - int allkeys) Menu_Item; -@extern void (void (int x, int y) func) Menu_Cursor; -@extern void (int (int key, int unicode, int down) - func) Menu_KeyEvent; -@extern void () Menu_End; -@extern void (string name) Menu_TopMenu; -@extern void (string name) Menu_SelectMenu; -@extern void (int () func) Menu_SetQuit; -@extern void () Menu_Quit; -@extern int () Menu_GetIndex; +@extern void Menu_Begin (int x, int y, string text); +@extern void Menu_FadeScreen (int val); +@extern void Menu_Draw (int (func)(int x, int y)); +@extern void Menu_EnterHook (void (func)(void)); +@extern void Menu_LeaveHook (void (func)(void)); +@extern void Menu_Pic (int x, int y, string name); +@extern void Menu_SubPic (int x, int y, string name, int srcx, int srcy, + int width, int height); +@extern void Menu_CenterPic (int x, int y, string name); +@extern void Menu_CenterSubPic (int x, int y, string name, int srcx, int srcy, + int width, int height); +@extern void Menu_Item (int x, int y, string text, + int (func)(string text, int key), + int allkeys); +@extern void Menu_Cursor (void (func)(int x, int y)); +@extern void Menu_KeyEvent (int (func)(int key, int unicode, int down)); +@extern void Menu_End (void); +@extern void Menu_TopMenu (string name); +@extern void Menu_SelectMenu (string name); +@extern void Menu_SetQuit (int (func)(void)); +@extern void Menu_Quit (void); +@extern int Menu_GetIndex (void); #endif//__menu_h; diff --git a/ruamoko/cl_menu/options.h b/ruamoko/cl_menu/options.h index 451c685de..bb4971d95 100644 --- a/ruamoko/cl_menu/options.h +++ b/ruamoko/cl_menu/options.h @@ -1,7 +1,7 @@ #ifndef __options_h #define __options_h -@extern void () MENU_options; -@extern void (int x, int y, int spacing, string label, string valstr) draw_val_item; +@extern void MENU_options (void); +@extern void draw_val_item (int x, int y, int spacing, string label, string valstr); #endif//__options_r diff --git a/ruamoko/cl_menu/options_util.h b/ruamoko/cl_menu/options_util.h index 79d4aed47..18db97003 100644 --- a/ruamoko/cl_menu/options_util.h +++ b/ruamoko/cl_menu/options_util.h @@ -1,10 +1,10 @@ #ifndef __options_util_h #define __options_util_h -@extern void (int x, int y) opt_cursor; -@extern void (int x, int y, int spacing, string spacechar, string label, string valstr) draw_item; -@extern void (int x, int y, int spacing, string label, string valstr) draw_val_item; -@extern int (float min, float max, float val) to_percentage; -@extern float (float min, float max, float step, float val, int cntflag) min_max_cnt; +@extern void opt_cursor (int x, int y); +@extern void draw_item (int x, int y, int spacing, string spacechar, string label, string valstr); +@extern void draw_val_item (int x, int y, int spacing, string label, string valstr); +@extern int to_percentage (float min, float max, float val); +@extern float min_max_cnt (float min, float max, float step, float val, int cntflag); #endif//__options_util_h diff --git a/ruamoko/cl_menu/servlist.h b/ruamoko/cl_menu/servlist.h index 14aef4172..e49667e7f 100644 --- a/ruamoko/cl_menu/servlist.h +++ b/ruamoko/cl_menu/servlist.h @@ -1,6 +1,6 @@ #ifndef __servlist_h #define __servlist_h -@extern void () server_list_menu; +@extern void server_list_menu (void); #endif//__servlist_h From 9be02354b042a3cc736cdf39cf35da4623a9dd8c Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Sat, 9 Jul 2011 23:16:34 -0400 Subject: [PATCH 03/11] Add stuff from doxygen 1.7.4 New doxygen makes our docs all ugly, let's give 'em a face lift. --- doc/doxygen.css | 313 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 260 insertions(+), 53 deletions(-) diff --git a/doc/doxygen.css b/doc/doxygen.css index f1c0445cb..af984b6b5 100644 --- a/doc/doxygen.css +++ b/doc/doxygen.css @@ -11,6 +11,12 @@ h1 { font-size: 150%; } +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + h2 { font-size: 120%; } @@ -53,13 +59,13 @@ caption { } span.legend { - font-size: 70%; - text-align: center; + font-size: 70%; + text-align: center; } h3.version { - font-size: 90%; - text-align: center; + font-size: 90%; + text-align: center; } div.qindex, div.navtab{ @@ -119,17 +125,17 @@ a.elRef { a.code { color: #4444cc; - font-weight: bold; +/* font-weight: bold;*/ } a.code:visited { color: #444488; - font-weight: bold; +/* font-weight: bold;*/ } a.codeRef { color: #6666ff; - font-weight: bold; +/* font-weight: bold;*/ } /* @end */ @@ -166,6 +172,7 @@ div.ah { border-radius: 0.5em; -webkit-border-radius: .5em; -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; -webkit-box-shadow: 2px 2px 3px #999; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); @@ -197,10 +204,10 @@ div.contents { } /* inline MSC graphs? */ -.contents div img { +/*.contents div img { border: 2px solid #737b9c; } - +*/ td.indexkey { background-color: #262833; font-weight: bold; @@ -234,9 +241,9 @@ img.formulaInl { div.center { text-align: center; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; } div.center img { @@ -378,12 +385,16 @@ table.memberdecls { } .memItemLeft, .memTemplItemLeft { - white-space: nowrap; + white-space: nowrap; +} + +.memItemRight { + width: 100%; } .memTemplParams { color: #465079; - white-space: nowrap; + white-space: nowrap; } /* @end */ @@ -408,6 +419,10 @@ table.memberdecls { padding: 2px; } +.mempage { + width: 100%; +} + .memitem { padding: 0; margin-bottom: 10px; @@ -423,44 +438,50 @@ table.memberdecls { } .memproto { - border-top: 1px solid #A0A8C7; - border-left: 1px solid #A0A8C7; - border-right: 1px solid #A0A8C7; - padding: 6px 0px 6px 0px; - color: #ffffff; - font-weight: bold; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 8px; - -moz-border-radius-topleft: 8px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 8px; - -webkit-border-top-left-radius: 8px; -/* background-image:url('nav_f.png');*/ - background-repeat:repeat-x; - background-color: #737b9c; + border-top: 1px solid #A0A8C7; + border-left: 1px solid #A0A8C7; + border-right: 1px solid #A0A8C7; + padding: 6px 0px 6px 0px; + color: #ffffff; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; +/* background-image:url('nav_f.png');*/ + background-repeat:repeat-x; + background-color: #737b9c; } .memdoc { - border-bottom: 1px solid #737b9c; - border-left: 1px solid #737b9c; - border-right: 1px solid #737b9c; - padding: 2px 5px; - background-color: #262833; - border-top-width: 0; - /* firefox specific markup */ - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F6F6F9 95%, #ECEDF3); - /* webkit specific markup */ - -webkit-border-bottom-left-radius: 8px; - -webkit-border-bottom-right-radius: 8px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F6F6F9), to(#ECEDF3)); + border-bottom: 1px solid #737b9c; + border-left: 1px solid #737b9c; + border-right: 1px solid #737b9c; + padding: 2px 5px; + background-color: #262833; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); } .paramkey { @@ -476,13 +497,35 @@ table.memberdecls { .paramname { color: #406; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); white-space: nowrap; } .paramname em { /* font-style: normal;*/ } +/* NEW doxygen 1.7.4 */ +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "Courier New", Courier, monospace; + vertical-align: top; +} + + + /* @end */ /* @group Directory (tree) */ @@ -619,12 +662,13 @@ table.doxtable th { .navpath ul { font-size: 11px; - background-image:url('tab_b.png'); +/* background-image:url('tab_b.png');*/ + background-color: #737b9c; background-repeat:repeat-x; height:30px; line-height:30px; color:#808BB5; - border:solid 1px #bdcaff; + border-top:solid 2px #bec3d9; overflow:hidden; margin:0px; padding:0px; @@ -642,6 +686,7 @@ table.doxtable th { color:#4b5166 } +/* OLD .navpath a { height:32px; @@ -655,6 +700,39 @@ table.doxtable th { color:#4b5166 } +.navpath li.footer +{ + display: none; +} + +/* NEW doxygen 1.7.4 */ +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:white; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#4b5166; + font-size: 8pt; +} +/* end NEW */ + div.summary { float: right; @@ -669,10 +747,25 @@ div.summary a white-space: nowrap; } +/* NEW doxygen 1.7.4 */ +div.ingroups +{ + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} +/* end NEW */ + div.header { -/* background-image:url('nav_h.png'); - background-repeat:repeat-x;*/ +/* background-image:url('nav_h.png'); + background-repeat:repeat-x;*/ background-color: #737b9c; margin: 0px; border-bottom: 2px solid #bdcaff; @@ -683,3 +776,117 @@ div.headertitle padding: 5px 5px 5px 10px; } +/* NEW doxygen 1.7.4 */ +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + display:none; + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 2px solid #bec3d9; /*#9BA3C4;#bec3d9;*/ + background-color: #737b9c; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} +/* end NEW */ + +#nav-tree { + background: black; +} From c1dc4f774877672f7e088e90c43d71e58e3e9547 Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Sat, 9 Jul 2011 23:24:38 -0400 Subject: [PATCH 04/11] Fix parameter names in documentation bodies In \param sections within function/etc. docs, argument names were being displayed with the same formatting they are in the prototype...very ugly on the background they're on. Make 'em white. --- doc/doxygen.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/doxygen.css b/doc/doxygen.css index af984b6b5..f03f5179c 100644 --- a/doc/doxygen.css +++ b/doc/doxygen.css @@ -496,10 +496,14 @@ table.memberdecls { } .paramname { - color: #406; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + color: white; white-space: nowrap; } +.memproto .paramname { + color: #406; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +} + .paramname em { /* font-style: normal;*/ } From efbedf6ce131621c15e73d5e2698e44a39c81652 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 10 Jul 2011 17:33:43 +0900 Subject: [PATCH 05/11] Make a start on documenting the gui stuff. --- ruamoko/include/gui/Group.h | 33 ++++- ruamoko/include/gui/InputLine.h | 236 +++++++++++++++++++++++++++++--- ruamoko/include/gui/Pic.h | 5 + ruamoko/include/gui/Point.h | 5 + ruamoko/include/gui/Rect.h | 5 + ruamoko/include/gui/Size.h | 5 + ruamoko/include/gui/Slider.h | 5 + ruamoko/include/gui/Text.h | 5 + ruamoko/include/gui/View.h | 8 ++ 9 files changed, 285 insertions(+), 22 deletions(-) diff --git a/ruamoko/include/gui/Group.h b/ruamoko/include/gui/Group.h index d5b8eb903..b9ea99386 100644 --- a/ruamoko/include/gui/Group.h +++ b/ruamoko/include/gui/Group.h @@ -3,17 +3,44 @@ #include "View.h" +/** \addtogroup gui */ +//@{ + @class Array; +/** A group of logically realted views. + + The sub-views are all positioned relative to the group's origin. + Sub-views may be other groups. + + The order in which views are added determines the draw and event handling + order. + + \todo Events are not handled. +*/ @interface Group : View { Array *views; } -- (void) dealloc; + +/** Add a view to the group. + + \param aView The view to be added. + \return The added view. +*/ - (View*) addView: (View*)aView; + +/** Add an array of views to the group. + + The views will be appened to any already existing sub-views, maintaining + the order of the views in the array. + + \param viewlist The array of views to be added. + \return self +*/ - (id) addViews: (Array*)viewlist; -- (void) moveTo: (int)x y:(int)y; -- (void) draw; @end +//@} + #endif//__ruamoko_gui_Group_h diff --git a/ruamoko/include/gui/InputLine.h b/ruamoko/include/gui/InputLine.h index a6b2e48ea..1aafb6302 100644 --- a/ruamoko/include/gui/InputLine.h +++ b/ruamoko/include/gui/InputLine.h @@ -3,38 +3,187 @@ #include "View.h" -struct _inputline_t {}; // opaque type :) +/** \defgroup inputline Low level intputline interface. + \ingroup gui + + Interface functions to the engine implementation. +*/ +//@{ + +/** Opaque handle to an inputline. + + \warning Not a real pointer. Dereferencing leads to nasal-dragon + infested lands. +*/ typedef struct _inputline_t *inputline_t; -@extern inputline_t (int lines, int size, int prompt) InputLine_Create; -@extern void InputLine_SetPos (inputline_t il, int x, int y); -@extern void InputLine_SetCursor (inputline_t il, int cursorr); -@extern @overload void InputLine_SetEnter (inputline_t il, void (f)(string, void*), void *data); -@extern @overload void InputLine_SetEnter (inputline_t il, IMP imp, id obj, SEL sel); -@extern void (inputline_t il, int width) InputLine_SetWidth; -@extern void (inputline_t il) InputLine_Destroy; -@extern void (inputline_t il, int save) InputLine_Clear; -@extern void (inputline_t il, int ch) InputLine_Process; -@extern void (inputline_t il) InputLine_Draw; -@extern void (inputline_t il, string str) InputLine_SetText; -@extern string (inputline_t il) InputLine_GetText; +/** Create a new inputline. + The inputline will be positioned at 0,0 with the cursor enabled. + + \param lines The number of lines of input history. + \param size The maximum length of the input string. + \param prompt The prompt to display. + \return The inputline handle. +*/ +@extern inputline_t InputLine_Create (int lines, int size, int prompt); + +/** Set the visual location of the input line. + + The coordinates are defined by the display system (pixels for clients, + character cells for servers). + + \param il The inputline handle. + \param x The X coordinate of the upper-left corner of the inputline. + \param y The Y coordinate of the upper-left corner of the inputline. +*/ +@extern void InputLine_SetPos (inputline_t il, int x, int y); + +/** Turn the inputline's cursor on or off. + + \param il The inputline handle. + \param cursor 0 turns off the cursor, non-0 turns it on. +*/ +@extern void InputLine_SetCursor (inputline_t il, int cursor); + +/** Set the callback function for when the enter key is pressed. + + \param il The inputline handle. + \param f The callback function. The first parameter is the text + of the input line and the second is \a data. + \param data Pointer to a data block to be passed to the callback + function. +*/ +@extern @overload void InputLine_SetEnter (inputline_t il, void (f)(string, void*), void *data); + +/** Set the callback method for when the enter key is pressed. + + The method will be called with a single string parameter representing the + text of the inputline. eg: + + -enter: (string) text; + + \param il The inputline handle. + \param imp The implementation of the method. + \param obj The object receiving the message. + \param sel The selector representing the message. +*/ +@extern @overload void InputLine_SetEnter (inputline_t il, IMP imp, id obj, SEL sel); + +/** Set the visible width of the inputline. + + \param il The inputline handle. + \param width The width of the inputline in character cells. +*/ +@extern void InputLine_SetWidth (inputline_t il, int width); + +/** Destroy an inputline, freeing its resources. + + \param il The inputline handle. +*/ +@extern void InputLine_Destroy (inputline_t il); + +/** Clear the inputline's text. + + \param il The inputline handle. + \param save If true, the current text will be saved to the history. +*/ +@extern void InputLine_Clear (inputline_t il, int save); + +/** Process a keystroke. + + \param il The inputline handle. + \param key The Quake key code for the key press. +*/ +@extern void InputLine_Process (inputline_t il, int key); + +/** Draw the inputline to the screen. + + Drawing is handled by the engine. + \param il The inputline handle. +*/ +@extern void InputLine_Draw (inputline_t il); + +/** Set the text of the inputline + + \param il The inputline handle. + \param str The text to which the inputline will be set. +*/ +@extern void InputLine_SetText (inputline_t il, string str); + +/** Retrieve the text of the inputline. + + \param il The inputline handle. + \return The current text of the intputline. +*/ +@extern string InputLine_GetText (inputline_t il); +//@} + +/** \addtogroup gui */ +//@{ + +/** Class representation of the low-level inputline objects. +*/ @interface InputLine: View { - inputline_t il; + inputline_t il; ///< The inputline handle. } +/** Initialize. + + \note The size of the bounds parameter is interpreted differently to + usual. The width is in character cells and the hight is used + for the number of lines of history. + \param aRect The bounds of the inputline. + \param char The prompt character. + \todo the size thing is stupid and broken. +*/ - (id) initWithBounds: (Rect)aRect promptCharacter: (int)char; -- (void) setBasePosFromView: (View *) view; -- (void) setWidth: (int)width; -- (void) setEnter: obj message:(SEL) msg; -- (void) cursor: (BOOL)cursor; -- (void) draw; +/** Set the visible width of the inputline. + \param width The visible width of the inputline. + \todo the size thing is stupid and broken. +*/ +- (void) setWidth: (int)width; + +/** Set up the XXX for when the enter key is pressed. + + The method will be called with a single string parameter representing the + text of the inputline. eg: + + -enter: (string) text; + + \param obj The object receiving the message. + \param sel The selector representing the message. + + \todo -(void) set[X]Action: (SEL)aSelector; + \todo -(void) setTarget: (id)ahnObject; +*/ +- (void) setEnter: obj message:(SEL) msg; + +/** Turn the inputline's cursor on or off. + + \param cursor 0 turns off the cursor, non-0 turns it on. +*/ +- (void) cursor: (BOOL)cursor; + +/** Process a keystroke. + + \param key The Quake key code for the key press. +*/ - (void) processInput: (int)key; +/** Set the text of the inputline + + \param text The text to which the inputline will be set. +*/ - (id) setText: (string)text; + +/** Retrieve the text of the inputline. + + \return The current text of the intputline. +*/ - (string) text; @end @@ -43,16 +192,65 @@ typedef struct _inputline_t *inputline_t; { InputLine *input_line; } + +/** Initialize. + + \note The size of the bounds parameter is interpreted differently to + usual. The width is in character cells and the hight is used + for the number of lines of history. + \param aRect The bounds of the inputline. + \param char The prompt character. + \todo the size thing is stupid and broken. +*/ - (id) initWithBounds: (Rect)aRect promptCharacter: (int)char; +/** Set the visible width of the inputline. + + \param width The visible width of the inputline. + \todo the size thing is stupid and broken. +*/ - (void) setWidth: (int)width; + +/** Set up the target/action for when the enter key is pressed. + + The method will be called with a single string parameter representing the + text of the inputline. eg: + + -enter: (string) text; + + \param obj The object receiving the message. + \param sel The selector representing the message. + + \todo -(void) set[X]Action: (SEL)aSelector; + \todo -(void) setTarget: (id)ahnObject; +*/ - (void) setEnter: obj message:(SEL) msg; + +/** Turn the inputline's cursor on or off. + + \param cursor 0 turns off the cursor, non-0 turns it on. +*/ - (void) cursor: (BOOL)cursor; +/** Process a keystroke. + + \param key The Quake key code for the key press. +*/ - (void) processInput: (int)key; +/** Set the text of the inputline + + \param text The text to which the inputline will be set. +*/ - (id) setText: (string)text; + +/** Retrieve the text of the inputline. + + \return The current text of the intputline. +*/ - (string) text; @end +//@} + #endif //__ruamoko_gui_InputLine_h diff --git a/ruamoko/include/gui/Pic.h b/ruamoko/include/gui/Pic.h index d50aed866..f19e8b6e4 100644 --- a/ruamoko/include/gui/Pic.h +++ b/ruamoko/include/gui/Pic.h @@ -3,6 +3,9 @@ #include "gui/View.h" +/** \addtogroup gui */ +//@{ + @interface Pic : View { string pic_name; @@ -15,4 +18,6 @@ -(void)draw; @end +//@} + #endif//__ruamoko_gui_Pic_h diff --git a/ruamoko/include/gui/Point.h b/ruamoko/include/gui/Point.h index 845aafda9..4ac36391a 100644 --- a/ruamoko/include/gui/Point.h +++ b/ruamoko/include/gui/Point.h @@ -1,6 +1,9 @@ #ifndef __ruamoko_gui_Point_h #define __ruamoko_gui_Point_h +/** \addtogroup gui */ +//@{ + struct Point { int x; int y; @@ -12,4 +15,6 @@ typedef struct Point Point; @extern Point addPoint (Point a, Point b); @extern Point subtractPoint (Point a, Point b); +//@} + #endif //__ruamoko_gui_Point_h diff --git a/ruamoko/include/gui/Rect.h b/ruamoko/include/gui/Rect.h index 70d5c4c80..145815d66 100644 --- a/ruamoko/include/gui/Rect.h +++ b/ruamoko/include/gui/Rect.h @@ -4,6 +4,9 @@ #include "gui/Point.h" #include "gui/Size.h" +/** \addtogroup gui */ +//@{ + struct Rect { Point origin; Size size; @@ -27,4 +30,6 @@ typedef struct Rect Rect; - (Rect) offsetBySize: (Size)aSize; #endif +//@} + #endif //__ruamoko_gui_Rect_h diff --git a/ruamoko/include/gui/Size.h b/ruamoko/include/gui/Size.h index 344ee7c4d..0f6b387a3 100644 --- a/ruamoko/include/gui/Size.h +++ b/ruamoko/include/gui/Size.h @@ -1,6 +1,9 @@ #ifndef __ruamoko_gui_Size_h #define __ruamoko_gui_Size_h +/** \addtogroup gui */ +//@{ + struct Size { int width; int height; @@ -12,4 +15,6 @@ typedef struct Size Size; @extern Size addSize (Size a, Size b); @extern Size subtractSize (Size a, Size b); +//@} + #endif //__ruamoko_gui_Size_h diff --git a/ruamoko/include/gui/Slider.h b/ruamoko/include/gui/Slider.h index f077ceda9..13a68f492 100644 --- a/ruamoko/include/gui/Slider.h +++ b/ruamoko/include/gui/Slider.h @@ -3,6 +3,9 @@ #include "View.h" +/** \addtogroup gui */ +//@{ + @interface Slider: View { int index; @@ -16,4 +19,6 @@ @end +//@} + #endif //__ruamoko_gui_Slider_h diff --git a/ruamoko/include/gui/Text.h b/ruamoko/include/gui/Text.h index 8b4051976..d9c6a1311 100644 --- a/ruamoko/include/gui/Text.h +++ b/ruamoko/include/gui/Text.h @@ -3,6 +3,9 @@ #include "View.h" +/** \addtogroup gui */ +//@{ + @interface Text: View { @public @@ -15,4 +18,6 @@ - (void) draw; @end +//@} + #endif //__ruamoko_gui_Text_h diff --git a/ruamoko/include/gui/View.h b/ruamoko/include/gui/View.h index 6b598534b..a84f05e06 100644 --- a/ruamoko/include/gui/View.h +++ b/ruamoko/include/gui/View.h @@ -4,6 +4,12 @@ #include "Object.h" #include "gui/Rect.h" +/** \defgroup gui GUI goo for gooey chewing +*/ + +/** \addtogroup gui */ +//@{ + /** The View class. */ @interface View: Object @@ -28,4 +34,6 @@ - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down; @end +//@} + #endif //__ruamoko_gui_View_h From 2d34b89f3f087b966d4a698564a7c21070811964 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 10 Jul 2011 18:57:24 +0900 Subject: [PATCH 06/11] Some changes I missed from the previous commit. --- ruamoko/gui/Group.r | 5 ----- ruamoko/gui/InputLine.r | 16 ++++++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ruamoko/gui/Group.r b/ruamoko/gui/Group.r index 5411562aa..4bcccadf1 100644 --- a/ruamoko/gui/Group.r +++ b/ruamoko/gui/Group.r @@ -32,11 +32,6 @@ return self; } -- (void) moveTo: (int)x y:(int)y -{ - [self setBasePos: x y:y]; -} - - (void) setBasePos: (int) x y: (int) y { [super setBasePos: x y:y]; diff --git a/ruamoko/gui/InputLine.r b/ruamoko/gui/InputLine.r index 09017ebe5..781e56b78 100644 --- a/ruamoko/gui/InputLine.r +++ b/ruamoko/gui/InputLine.r @@ -2,18 +2,18 @@ #include "gui/InputLine.h" #include "gui/Rect.h" -inputline_t (int lines, int size, int prompt) InputLine_Create = #0; +inputline_t InputLine_Create (int lines, int size, int prompt) = #0; void InputLine_SetPos (inputline_t il, int x, int y) = #0; void InputLine_SetCursor (inputline_t il, int cursorr) = #0; @overload void InputLine_SetEnter (inputline_t il, void (f)(string, void*), void *data) = #0; @overload void InputLine_SetEnter (inputline_t il, IMP imp, id obj, SEL sel) = #0; -void (inputline_t il, int width) InputLine_SetWidth = #0; -void (inputline_t il) InputLine_Destroy = #0; -void (inputline_t il, int size) InputLine_Clear = #0; -void (inputline_t il, int ch) InputLine_Process = #0; -void (inputline_t il) InputLine_Draw = #0; -void (inputline_t il, string str) InputLine_SetText = #0; -string (inputline_t il) InputLine_GetText = #0; +void InputLine_SetWidth (inputline_t il, int width) = #0; +void InputLine_Destroy (inputline_t il) = #0; +void InputLine_Clear (inputline_t il, int size) = #0; +void InputLine_Process (inputline_t il, int ch) = #0; +void InputLine_Draw (inputline_t il) = #0; +void InputLine_SetText (inputline_t il, string str) = #0; +string InputLine_GetText (inputline_t il) = #0; @implementation InputLine From b250879817a653fc97d0f7955c60e5ddcf8dfbee Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 10 Jul 2011 18:58:16 +0900 Subject: [PATCH 07/11] Docs for MenuGroup --- ruamoko/cl_menu/MenuGroup.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ruamoko/cl_menu/MenuGroup.h b/ruamoko/cl_menu/MenuGroup.h index 108106f34..3b4bf473f 100644 --- a/ruamoko/cl_menu/MenuGroup.h +++ b/ruamoko/cl_menu/MenuGroup.h @@ -3,13 +3,33 @@ #include "gui/Group.h" +/** A group of views for use as a menu. + + A menu may consist of decorations and actual menu items. For correct + results, the decoration views must be added before the menu item views. +*/ @interface MenuGroup : Group { - int base; - int current; + int base; ///< The index of the first menu item. + int current; ///< The currently selected menu item. } --(void)setBase:(int)b; + +/** Set the index of the first menu item. + + \param b The index of the first menu item. +*/ +-(void) setBase: (int) b; + +/** Select the next menu item. + + Wraps back to the base menu item if the current menu item is the last. +*/ -(void) next; + +/** Select the previous menu item. + + Wraps to the last menu item if the current menu item is the base item. +*/ -(void) prev; @end From 01eb29fd9f0df3f9733c4daa592cb2c701310960 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 10 Jul 2011 18:58:50 +0900 Subject: [PATCH 08/11] Fix the bindings menus. That was a lot easier than I expected. --- ruamoko/cl_menu/Makefile.am | 4 ++-- ruamoko/cl_menu/SubMenu.h | 14 +++++++++++++ ruamoko/cl_menu/SubMenu.r | 39 +++++++++++++++++++++++++++++++++++++ ruamoko/cl_menu/menu.plist | 14 ++++++++++--- ruamoko/cl_menu/options.qc | 4 ++-- 5 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 ruamoko/cl_menu/SubMenu.h create mode 100644 ruamoko/cl_menu/SubMenu.r diff --git a/ruamoko/cl_menu/Makefile.am b/ruamoko/cl_menu/Makefile.am index 25da215fe..e3cc7e793 100644 --- a/ruamoko/cl_menu/Makefile.am +++ b/ruamoko/cl_menu/Makefile.am @@ -33,7 +33,7 @@ menu_src= \ CrosshairCvar.r CrosshairView.r CvarColor.r CvarColorView.r \ CvarObject.r CvarRange.r CvarRangeView.r CvarString.r CvarStringView.r \ CvarToggle.r CvarToggleView.r \ - MenuGroup.r MouseToggle.r ProxyView.r RunToggle.r + MenuGroup.r MouseToggle.r ProxyView.r RunToggle.r SubMenu.r %.qfo: %.r $(QFCC) $(QCFLAGS) $(QCPPFLAGS) -c -o $@ $< @@ -52,7 +52,7 @@ EXTRA_DIST= $(menu_src) \ CrosshairCvar.h CrosshairView.h CvarColor.h CvarColorView.h CvarObject.h \ CvarRange.h CvarRangeView.h CvarString.h CvarStringView.h \ CvarToggle.h CvarToggleView.h Frame.h HUD.h \ - MenuGroup.h MouseToggle.h ProxyView.h RunToggle.h client_menu.h \ + MenuGroup.h MouseToggle.h ProxyView.h RunToggle.h SubMenu.h client_menu.h \ controls_o.h menu.h options.h options_util.h plistmenu.h servlist.h \ menu.plist CLEANFILES= *.dat *.sym *.gz *.qfo diff --git a/ruamoko/cl_menu/SubMenu.h b/ruamoko/cl_menu/SubMenu.h new file mode 100644 index 000000000..864703844 --- /dev/null +++ b/ruamoko/cl_menu/SubMenu.h @@ -0,0 +1,14 @@ +#ifndef __SubMenu_h +#define __SubMenu_h + +#include "gui/View.h" + +@interface SubMenu : View +{ + View *title; + string menu_name; +} +-(id)initWithBounds:(Rect)aRect title:(View*)aTitle menu:(string)name; +@end + +#endif//__SubMenu_h diff --git a/ruamoko/cl_menu/SubMenu.r b/ruamoko/cl_menu/SubMenu.r new file mode 100644 index 000000000..c4aa188d7 --- /dev/null +++ b/ruamoko/cl_menu/SubMenu.r @@ -0,0 +1,39 @@ +#include "key.h" + +#include "menu.h" +#include "SubMenu.h" + +@implementation SubMenu + +-(id)initWithBounds:(Rect)aRect title:(View *)aTitle menu:(string)name +{ + self = [super initWithBounds:aRect]; + if (!self) + return self; + + title = aTitle; + menu_name = name; + return self; +} + +- (int) keyEvent:(int)key unicode:(int)unicode down:(int)down +{ + if (key == QFK_RETURN) { + Menu_SelectMenu (menu_name); + return 1; + } + return 0; +} + +- (void) draw +{ + [title draw]; +} + +- (void) setBasePosFromView: (View *) aview +{ + [super setBasePosFromView:aview]; + [title setBasePosFromView:self]; +} + +@end diff --git a/ruamoko/cl_menu/menu.plist b/ruamoko/cl_menu/menu.plist index 254f87fb2..bec17b43f 100644 --- a/ruamoko/cl_menu/menu.plist +++ b/ruamoko/cl_menu/menu.plist @@ -41,12 +41,20 @@ rect = "[54, 50, 64, 8]"; }, { - Class = Text; + Class = SubMenu; Messages = ( - (initWithBounds:, $rect), - (setText:, "\"Bindings\"") + (initWithBounds:title:menu:, $rect, $title, + "\"Bindings\""), ); rect = "[70, 60, 64, 8]"; + title = { + Class = Text; + Messages = ( + (initWithBounds:, $rect), + (setText:, "\"Bindings\"") + ); + rect = "[0, 0, 64, 8]"; + }; }, { Class = CvarToggleView; diff --git a/ruamoko/cl_menu/options.qc b/ruamoko/cl_menu/options.qc index a8096b336..e0529c23e 100644 --- a/ruamoko/cl_menu/options.qc +++ b/ruamoko/cl_menu/options.qc @@ -199,7 +199,7 @@ DRAW_control_options = [control_options setBasePos:x y:y]; [control_options draw]; - return 1; + return 0; }; int (int key, int unicode, int down) @@ -227,8 +227,8 @@ MENU_control_options (PLItem *plist) control_options = ret.pointer_val; } + MENU_control_binding (); //FIXME how to hook in the bindings menu? Menu_End (); - //MENU_control_binding (); FIXME how to hook in the bindings menu? }; /*********************************************** From 6a026aebf5704aea79347b64d346fbbcce38b14b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 10 Jul 2011 19:12:07 +0900 Subject: [PATCH 09/11] Clean up some doxygen warnings. --- doc/qw-download-spec.txt | 2 +- tools/qfcc/include/expr.h | 2 +- tools/qfcc/source/linker.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/qw-download-spec.txt b/doc/qw-download-spec.txt index 9c0f145d2..140e71e55 100644 --- a/doc/qw-download-spec.txt +++ b/doc/qw-download-spec.txt @@ -32,7 +32,7 @@ size is the number of data bytes in the message (if >= 0) or a special flag: be the empty string (""), otherwise it contains the new name of the file. See -2. -QF #defines for the above values: +QF \#defines for the above values: \verbatim #define DL_NOFILE -1 #define DL_RENAME -2 diff --git a/tools/qfcc/include/expr.h b/tools/qfcc/include/expr.h index 54a1d5e81..b50747898 100644 --- a/tools/qfcc/include/expr.h +++ b/tools/qfcc/include/expr.h @@ -425,7 +425,7 @@ int expr_integer (expr_t *e); /** Create a new integer constant expression node. - \param integer_val The integer constant being represented. + \param uinteger_val The integer constant being represented. \return The new integer constant expression node (expr_t::e::integer_val). */ diff --git a/tools/qfcc/source/linker.c b/tools/qfcc/source/linker.c index 2cfeace14..3d184225f 100644 --- a/tools/qfcc/source/linker.c +++ b/tools/qfcc/source/linker.c @@ -427,6 +427,7 @@ add_code (qfo_mspace_t *code) /** Add the data in a data space to the working qfo. + \param space The space to which the data will be added. \param data A data space of the qfo being linked. */ static void From 4dca5004defdae35cf3dab7c5a34efbf0648e83e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 10 Jul 2011 21:29:10 +0900 Subject: [PATCH 10/11] Mintor improvment to the QWE newstr(). --- qw/source/sv_pr_qwe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qw/source/sv_pr_qwe.c b/qw/source/sv_pr_qwe.c index f52d797cb..5f2a07a16 100644 --- a/qw/source/sv_pr_qwe.c +++ b/qw/source/sv_pr_qwe.c @@ -256,8 +256,10 @@ PF_newstr (progs_t *pr) dstring_copystr (dstr, s); if (pr->pr_argc > 1 && P_FLOAT (pr, 1) > dstr->size) { - dstr->size = P_FLOAT (pr, 1); + int s = dstr->size; + dstr->size = P_FLOAT (pr, 1) + 1; dstring_adjust (dstr); + memset (dstr->str + s, dstr->size - s, 0); } R_STRING (pr) = i; From cc937828b844f74885056ef32a62cd769a06de46 Mon Sep 17 00:00:00 2001 From: Antti Harri Date: Sat, 10 Dec 2011 13:33:20 +0200 Subject: [PATCH 11/11] Propagate flags set in pthread.m4 to nq and qw sources. Removes the need to have -pthread in CFLAGS on OpenBSD. --- nq/source/Makefile.am | 3 ++- qw/source/Makefile.am | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nq/source/Makefile.am b/nq/source/Makefile.am index d304f6271..544e44a5c 100644 --- a/nq/source/Makefile.am +++ b/nq/source/Makefile.am @@ -32,6 +32,7 @@ AUTOMAKE_OPTIONS= foreign # INCLUDES= -I$(top_srcdir)/include -I$(top_srcdir)/nq/include SDL_LIBS = @SDL_LIBS@ +AM_CFLAGS= @PTHREAD_CFLAGS@ bin_PROGRAMS= @NQ_TARGETS@ @@ -45,7 +46,7 @@ libnq_common_a_SOURCES=game.c world.c libnq_sdl_a_SOURCES= sys_sdl.c libnq_sdl_a_CFLAGS= $(SDL_CFLAGS) -common_ldflags= -export-dynamic +common_ldflags= -export-dynamic @PTHREAD_LDFLAGS@ cl_plugin_LIBS= \ $(SERVER_PLUGIN_STATIC_LIBS) \ diff --git a/qw/source/Makefile.am b/qw/source/Makefile.am index 15e4e7155..74131dc82 100644 --- a/qw/source/Makefile.am +++ b/qw/source/Makefile.am @@ -32,6 +32,7 @@ AUTOMAKE_OPTIONS= foreign # Stuff that is common to both client and server INCLUDES= -I$(top_srcdir)/include -I$(top_srcdir)/qw/include @LIBCURL_CPPFLAGS@ SDL_LIBS = @SDL_LIBS@ +AM_CFLAGS= @PTHREAD_CFLAGS@ bin_PROGRAMS= @QW_TARGETS@ @@ -48,7 +49,7 @@ libqw_common_a_SOURCES=\ libqw_sdl_a_SOURCES=cl_sys_sdl.c libqw_sdl_a_CFLAGS=$(SDL_CFLAGS) -common_ldflags= -export-dynamic +common_ldflags= -export-dynamic @PTHREAD_LDFLAGS@ # Server builds #