From a3498b25f414a888aa01ffd1cf9b2e44f6c54764 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Wed, 2 Apr 2014 21:43:53 +0300 Subject: Quote cmake variables --- doxygen/Doxyfile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doxygen') diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 292260d..399b400 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = @BEMENU_NAME@ +PROJECT_NAME = "@BEMENU_NAME@" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = @BEMENU_DESCRIPTION@ +PROJECT_BRIEF = "@BEMENU_DESCRIPTION@" # With the PROJECT_LOGO tag one can specify an logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels @@ -743,7 +743,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../lib @CMAKE_CURRENT_SOURCE_DIR@/../client +INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/../lib" "@CMAKE_CURRENT_SOURCE_DIR@/../client" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -- cgit v1.2.3-70-g09d2 From 4a931c5ed4aaa0637bd9d41f7e45e9f22d9513ce Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 10 Apr 2014 15:48:55 +0300 Subject: Nicer doxygen output --- CMakeLists.txt | 1 + doxygen/CMakeLists.txt | 2 + doxygen/Doxyfile.in | 16 +- doxygen/Mainpage.dox | 19 + doxygen/doxygen-qmi-style/README.md | 41 + doxygen/doxygen-qmi-style/footer.html | 20 + doxygen/doxygen-qmi-style/header.html | 55 ++ .../doxygen-qmi-style/navtree/ftv2mlastnode.png | Bin 0 -> 285 bytes doxygen/doxygen-qmi-style/navtree/ftv2mnode.png | Bin 0 -> 285 bytes .../doxygen-qmi-style/navtree/ftv2plastnode.png | Bin 0 -> 277 bytes doxygen/doxygen-qmi-style/navtree/ftv2pnode.png | Bin 0 -> 282 bytes doxygen/doxygen-qmi-style/navtree/navtree.css | 117 +++ doxygen/doxygen-qmi-style/qmi.css | 1033 ++++++++++++++++++++ doxygen/doxygen-qmi-style/search/search.css | 238 +++++ 14 files changed, 1535 insertions(+), 7 deletions(-) create mode 100644 doxygen/Mainpage.dox create mode 100644 doxygen/doxygen-qmi-style/README.md create mode 100644 doxygen/doxygen-qmi-style/footer.html create mode 100644 doxygen/doxygen-qmi-style/header.html create mode 100644 doxygen/doxygen-qmi-style/navtree/ftv2mlastnode.png create mode 100644 doxygen/doxygen-qmi-style/navtree/ftv2mnode.png create mode 100644 doxygen/doxygen-qmi-style/navtree/ftv2plastnode.png create mode 100644 doxygen/doxygen-qmi-style/navtree/ftv2pnode.png create mode 100644 doxygen/doxygen-qmi-style/navtree/navtree.css create mode 100644 doxygen/doxygen-qmi-style/qmi.css create mode 100644 doxygen/doxygen-qmi-style/search/search.css (limited to 'doxygen') diff --git a/CMakeLists.txt b/CMakeLists.txt index 65e2b3b..ac22069 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ PROJECT(bemenu) INCLUDE(CTest) SET(BEMENU_NAME "bemenu") SET(BEMENU_DESCRIPTION "Dynamic menu library and client program inspired by dmenu") +SET(BEMENU_VERSION "1.0.0") SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${chck_SOURCE_DIR}/CMake/modules) # Compile library diff --git a/doxygen/CMakeLists.txt b/doxygen/CMakeLists.txt index e1a364b..0d2c406 100644 --- a/doxygen/CMakeLists.txt +++ b/doxygen/CMakeLists.txt @@ -4,6 +4,8 @@ IF (DOXYGEN_FOUND) CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY) ADD_CUSTOM_TARGET(doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/doxygen-qmi-style/navtree ${CMAKE_CURRENT_BINARY_DIR}/html + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/doxygen-qmi-style/search ${CMAKE_CURRENT_BINARY_DIR}/html/search WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating bemenu documentation with Doxygen" VERBATIM) MESSAGE("-!- Use 'make doxygen' to generate documentation") diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 399b400..fcd3604 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = "@BEMENU_NAME@" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = "@BEMENU_VERSION@" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -90,7 +90,7 @@ OUTPUT_LANGUAGE = English # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. -BRIEF_MEMBER_DESC = YES +BRIEF_MEMBER_DESC = NO # If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief # description of a member or function before the detailed description @@ -743,7 +743,9 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/../lib" "@CMAKE_CURRENT_SOURCE_DIR@/../client" +INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/Mainpage.dox" \ + "@CMAKE_CURRENT_SOURCE_DIR@/../lib" \ + "@CMAKE_CURRENT_SOURCE_DIR@/../client" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1035,7 +1037,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = "@CMAKE_CURRENT_SOURCE_DIR@/doxygen-qmi-style/header.html" # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1045,7 +1047,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = "@CMAKE_CURRENT_SOURCE_DIR@/doxygen-qmi-style/footer.html" # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1057,7 +1059,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = "@CMAKE_CURRENT_SOURCE_DIR@/doxygen-qmi-style/qmi.css" # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets @@ -1352,7 +1354,7 @@ DISABLE_INDEX = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. diff --git a/doxygen/Mainpage.dox b/doxygen/Mainpage.dox new file mode 100644 index 0000000..8da4792 --- /dev/null +++ b/doxygen/Mainpage.dox @@ -0,0 +1,19 @@ +/** +@mainpage Main Page + +bemenu is a dynamic menu library and client program inspired by dmenu. +You can create flexible menu oriented programs using the library interface in your favorite language that has bemenu bindings avaialable. + +Unlike old dmenu approach, with library you don't have to feed unneccessary metadata into client program and parse the result. +Instead your program will be aware of the items and possible metadata inside the menu. +It's also possible to use multiple menus or dynamically remove/insert items. + +Features: + - Multiple layouts + - Different filtering algorithms: + - Vanilla dmenu filtering + - Rendering backends (UI toolkits are loaded dynamically, not depended): + - Curses + +bemenu also provides 'bemenu' executable that is compatible with dmenu interface. +*/ diff --git a/doxygen/doxygen-qmi-style/README.md b/doxygen/doxygen-qmi-style/README.md new file mode 100644 index 0000000..7fb3e13 --- /dev/null +++ b/doxygen/doxygen-qmi-style/README.md @@ -0,0 +1,41 @@ +Qmi is a "**Q**t **Mi**nimal" theme for the Doxygen HTML documentation. +It based on official Qt4 documentation's style. + +# How to setup + +To use `qmi` style make the following changes in your Doxyfile: + + # Project section + BRIEF_MEMBER_DESC = NO + + # HTML section + HTML_HEADER = ${path_to_qmi}/header.html + HTML_FOOTER = ${path_to_qmi}/footer.html + HTML_STYLESHEET = ${path_to_qmi}/qmi.css + +**NOTE**: + +* If you use **_tree navigation panel_** then copy contents of the `navtree` dir to the documentation html dir. +* If you use **_search_** feature then copy contents of the `search` dir to the `html/search`. + +# Examples + +If you want to see `qmi` style in action then use the following links with examples: + +* [Qwt docs](http://skozlovf.github.com/doxygen-qmi-style/qwt) +* [libxml++ docs](http://skozlovf.github.com/doxygen-qmi-style/libxmlpp) (with tree navigation and search) + + +## Screenshots + +* **Main page**: + + ![](http://skozlovf.github.com/doxygen-qmi-style/shot1.png) + +* **Index page**: + + ![](http://skozlovf.github.com/doxygen-qmi-style/shot2.png) + +* **Member description**: + + ![](http://skozlovf.github.com/doxygen-qmi-style/shot3.png) diff --git a/doxygen/doxygen-qmi-style/footer.html b/doxygen/doxygen-qmi-style/footer.html new file mode 100644 index 0000000..14115b4 --- /dev/null +++ b/doxygen/doxygen-qmi-style/footer.html @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/doxygen/doxygen-qmi-style/header.html b/doxygen/doxygen-qmi-style/header.html new file mode 100644 index 0000000..0b634ee --- /dev/null +++ b/doxygen/doxygen-qmi-style/header.html @@ -0,0 +1,55 @@ + + + + + + + +$projectname: $title +$title + + + +$treeview +$search +$mathjax + +$extrastylesheet + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
$projectname + $projectnumber +
+
$projectbrief
+
+
$projectbrief
+
$searchbox
+
+ diff --git a/doxygen/doxygen-qmi-style/navtree/ftv2mlastnode.png b/doxygen/doxygen-qmi-style/navtree/ftv2mlastnode.png new file mode 100644 index 0000000..6dfeb5d Binary files /dev/null and b/doxygen/doxygen-qmi-style/navtree/ftv2mlastnode.png differ diff --git a/doxygen/doxygen-qmi-style/navtree/ftv2mnode.png b/doxygen/doxygen-qmi-style/navtree/ftv2mnode.png new file mode 100644 index 0000000..48e70f0 Binary files /dev/null and b/doxygen/doxygen-qmi-style/navtree/ftv2mnode.png differ diff --git a/doxygen/doxygen-qmi-style/navtree/ftv2plastnode.png b/doxygen/doxygen-qmi-style/navtree/ftv2plastnode.png new file mode 100644 index 0000000..2b99c65 Binary files /dev/null and b/doxygen/doxygen-qmi-style/navtree/ftv2plastnode.png differ diff --git a/doxygen/doxygen-qmi-style/navtree/ftv2pnode.png b/doxygen/doxygen-qmi-style/navtree/ftv2pnode.png new file mode 100644 index 0000000..02f42f7 Binary files /dev/null and b/doxygen/doxygen-qmi-style/navtree/ftv2pnode.png differ diff --git a/doxygen/doxygen-qmi-style/navtree/navtree.css b/doxygen/doxygen-qmi-style/navtree/navtree.css new file mode 100644 index 0000000..64fa6b5 --- /dev/null +++ b/doxygen/doxygen-qmi-style/navtree/navtree.css @@ -0,0 +1,117 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: none; + background-color: #B0B0B0; + color: #fff; +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; + outline:none; +} + +#nav-tree .label { + margin:0px; + padding:0px; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + padding:2px; + margin:0px; + color:#fff; +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + background-image:none; + background-color: #F6F6F6; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; +} + +#side-nav { + padding:0 4px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: 300px; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background: none; + background-color: #EBEBEB; + cursor:e-resize; + height:100%; + right:0; + top:0; + width:4px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + + diff --git a/doxygen/doxygen-qmi-style/qmi.css b/doxygen/doxygen-qmi-style/qmi.css new file mode 100644 index 0000000..4f1a70b --- /dev/null +++ b/doxygen/doxygen-qmi-style/qmi.css @@ -0,0 +1,1033 @@ +/******************************************************************************* + * Qmi style css for the doxygen. + * Based on tabs.css + doxygen.css and Qt4 documentation look&feel. + * Sergey Kozlov. + ******************************************************************************/ + + +/*********************************************************** + * Globals. + **********************************************************/ +body +{ + background-color: white; + color: black; + margin: 0; +} + +body, table, div, p, dl +{ + font: normal 13px/1.2 Verdana; + color: #363534; +} + +/* Treeview. */ + +#nav-sync +{ + display:none; +} + +/* Header. */ + +#titlearea +{ + padding: 0 0 0 8px; + margin: 0px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font-size: 24px; + font-weight: bold; +} + +#projectbrief +{ + color: #575757; + font-size: 0.9em; + margin: 0 0 10px 0; + padding: 0px; +} + +#projectnumber +{ + font-size: 0.5em; + margin: 0px; + padding: 0px; +} + +/* Footer. */ + +/* Bottom left label. */ +.qmi +{ + float:left; + text-align: left; + font-style: normal; + margin-left:10px; + padding-bottom: 6px; + color: #C2C2C2; +} + +.qmi a { color: #5E5E5E; } + +address { font-style: normal; } +address.footer +{ + text-align: right; + padding-right: 12px; + padding-bottom: 6px; +} + +hr.footer +{ + height: 1px; +} + + +/* Not used. */ +/* +img.footer +{ + border: 0px; + vertical-align: middle; +} +*/ + + +h1 { font-size: 150%; } +h2 { font-size: 120%; } +h3 { font-size: 100%; } +dt { font-weight: bold; } +dl { padding: 0 0 0 10px; } +dl.el { margin-left: -1cm; } + +hr +{ + height: 0px; + border: none; + border-top: 1px solid #C4C4C4; +} + +div.center +{ + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { border: 0px; } + +/* Link to reference (classes etc). */ +a.el { font-weight: bold; } + +/** Use normal font on the index page. */ +.qindex + table a.el { font-weight: normal; } +/* a.elRef {} */ + +/* Links in code section. */ +a.code { font-weight: bold; } +a.codeRef { color: #4665A2; } + + +/* Code section */ +.fragment +{ + font-family: monospace, fixed; + font-size: 11px; +} + +pre.fragment +{ + padding: 4px 6px; + margin: 4px 20px 4px 10px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + + background-color: #F6F6F6; + border-color: #E6E6E6; + border-width: 1px; + border-style: solid; + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; +} + + +/*********************************************************** + * Top navigation tabs. + * General info: + * navrow1 - div id of the first tab row. + * tabs, tabs2, tabs3 - are divs of of each tab row. + * tablist - list of tabs in a row. + * tablist li - tab contents. + **********************************************************/ + +#navrow1 { background-color: #EBEBEB; } + +.tabs, .tabs2, .tabs3 +{ + width: 100%; + z-index: 101; + font-size: 13px; +} + +.tabs2 +{ + font-size: 10px; +} + +.tabs3 { font-size: 9px; } + +.tablist +{ + margin: 0; + padding: 0; + display: table; + width: 100%; +} + +.tablist li +{ + float: left; + display: table-cell; + line-height: 24px; + list-style: none; +} + +.tablist a +{ + color: #00732F; + display: block; + padding: 0 20px 0 10px; +} + +.tabs3 .tablist a { padding: 0 10px; } + +/* Not used. */ +/* .tablist a:hover{} */ + +/** Currently selected tab. */ +.tablist li.current a { font-weight: bold; } + + + +/*********************************************************** + * Unsorted stuff. + **********************************************************/ + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +/* +h3.version { + font-size: 90%; + text-align: center; +} +*/ + +div.qindex, div.navtab{ + /*background-color: #EBEFF6; + border: 1px solid #A3B4D7;*/ + text-align: center; + background-color: #F6F6F6; + border-color: #E6E6E6; + border-width: 1px; + border-style: solid; + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; + font-size: 16px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #00732F; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #005C26; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #F6F6F6; + color: #ffffff; + border: 1px double #E6E6E6; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + + +/* @end */ + +/* Letter in the Class Index page */ +div.ah +{ + font-weight: bold; + width: 100%; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +div.contents { + margin-top: 10px; + margin-left: 8px; + margin-right: 8px; +} + +td.indexkey { + background-color: #F6F6F6; + font-weight: bold; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #F6F6F6; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #F6F6F6; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + + + +/* @group Code Colorization */ + +span.keyword { + color: #840000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #E6E6E6; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F6F6F6; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} +/* +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} +*/ +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #F6F6F6; + border: 1px solid #E6E6E6; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 35px; + margin-right: 5px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto, dl.reflist dt { + /*border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9;*/ + padding: 6px 0px 6px 0px; + /*color: #253555;*/ + font-weight: bold; + /*text-shadow: 0px 1px 1px rgba(255, 255, 255, 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: #F6F6F6; + border-color: #E6E6E6; + border-width: 1px; + border-style: solid; + -moz-border-radius: 7px 7px 7px 7px; + -webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; +} + +.memdoc, dl.reflist dd { + /*border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9;*/ + padding: 0 5px; + /*background-color: #FBFCFD;*/ + 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; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);*/ + /* 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,#F7F8FB), to(#EEF1F7));*/ +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.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) */ + +/* for the tree view */ + +.ftvtree { + /*font-family: sans-serif;*/ + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +table.fieldtable { + width: 100%; + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + height:30px; + line-height:30px; + border-top: 1px solid #C4C4C4; + overflow:hidden; + margin:0px; + padding:0px; +} + +/** TODO: use image as marker. */ +.navpath li +{ + list-style-type:disc; + float:left; + padding-left:5px; + padding-right:5px; + margin-right: 25px; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + text-decoration: underline; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-bottom: 6px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + margin-left: 5px; + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + /*background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC;*/ + margin-top: 10px; + /*border-bottom: 1px solid #C4CFE5;*/ +} + +div.headertitle +{ + padding: 5px 5px 5px 7px; +} + + +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; +} + +.title +{ + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #E6E6E6; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } + pre.fragment + { + overflow: visible; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + } +} + diff --git a/doxygen/doxygen-qmi-style/search/search.css b/doxygen/doxygen-qmi-style/search/search.css new file mode 100644 index 0000000..e5d5064 --- /dev/null +++ b/doxygen/doxygen-qmi-style/search/search.css @@ -0,0 +1,238 @@ +/*---------------- Search Box */ + +#FSearchBox { + float: left; +} + +#MSearchBox { + white-space : nowrap; + position: absolute; + float: none; + display: inline; + margin-top: 3px; + right: 0px; + width: 170px; + z-index: 102; +} + +#MSearchBox .left +{ + display:block; + position:absolute; + left:10px; + width:20px; + height:19px; + background:url('search_l.png') no-repeat; + background-position:right; +} + +#MSearchSelect { + display:block; + position:absolute; + width:20px; + height:19px; +} + +.left #MSearchSelect { + left:4px; +} + +.right #MSearchSelect { + right:5px; +} + +#MSearchField { + display:block; + position:absolute; + padding:0; + margin:0; + height:19px; + background:url('search_m.png') repeat-x; + border:none; + width:116px; + margin-left:20px; + padding-left:4px; + color:#909090; + outline:none; + font:9pt Arial, Verdana, sans-serif; +} + +#FSearchBox #MSearchField { + margin-left:15px; +} + +#MSearchBox .right { + display:block; + position:absolute; + right:10px; + width:20px; + height:19px; + background:url('search_r.png') no-repeat; + background-position:left; +} + +#MSearchClose { + display: none; + position: absolute; + top: 4px; + background : none; + border: none; + margin: 0px 4px 0px 0px; + padding: 0px 0px; + outline: none; +} + +.left #MSearchClose { + left: 6px; +} + +.right #MSearchClose { + right: 2px; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #E6E6E6; + background-color: #F6F6F6; + z-index: 1; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #B0B0B0; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #8A8A8A; + background-color: #F6F6F6; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #00732F; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #00732F; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; +} + +.SRResult { + display: none; +} + +DIV.searchresults { + margin-left: 10px; + margin-right: 10px; +} -- cgit v1.2.3-70-g09d2 From 8631506d9d1522f1a24e528f75682201b4f3cc7b Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 10 Apr 2014 17:26:42 +0300 Subject: Update documentation, include only public API in doxygen output. --- client/client.c | 16 ------- doxygen/Doxyfile.in | 6 +-- doxygen/Mainpage.dox | 2 + lib/bemenu.h | 119 ++++++++++++++++++++++++++++++++++++++++----------- lib/filter.c | 28 ++++++------ lib/internal.h | 13 +++--- lib/item.c | 8 ++-- lib/menu.c | 46 ++++++++++++-------- lib/util.c | 46 ++++++++++---------- 9 files changed, 172 insertions(+), 112 deletions(-) (limited to 'doxygen') diff --git a/client/client.c b/client/client.c index 973e57a..4419967 100644 --- a/client/client.c +++ b/client/client.c @@ -1,10 +1,3 @@ -/** - * @file client.c - * - * Sample client using the libbemenu. - * Also usable as dmenu replacement. - */ - #include #include #include @@ -86,15 +79,6 @@ static void readItemsToMenuFromStdin(bmMenu *menu) free(line); } -/** - * Main method - * - * This function gives and takes the life of our program. - * - * @param argc Number of arguments from command line - * @param argv Pointer to array of the arguments - * @return exit status of the program - */ int main(int argc, char **argv) { (void)argc, (void)argv; diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index fcd3604..3b80187 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -90,7 +90,7 @@ OUTPUT_LANGUAGE = English # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. -BRIEF_MEMBER_DESC = NO +BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief # description of a member or function before the detailed description @@ -765,7 +765,7 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = +FILE_PATTERNS = *.h *.dox # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -796,7 +796,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = internal.h # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/doxygen/Mainpage.dox b/doxygen/Mainpage.dox index 8da4792..869071c 100644 --- a/doxygen/Mainpage.dox +++ b/doxygen/Mainpage.dox @@ -16,4 +16,6 @@ Features: - Curses bemenu also provides 'bemenu' executable that is compatible with dmenu interface. + +Get started on the Modules page. */ diff --git a/lib/bemenu.h b/lib/bemenu.h index d8e604b..f2f0372 100644 --- a/lib/bemenu.h +++ b/lib/bemenu.h @@ -1,13 +1,34 @@ /** * @file bemenu.h * - * Public header + * Public API header. */ +typedef struct _bmMenu bmMenu; +typedef struct _bmItem bmItem; + +/** + * @defgroup Menu + * @brief Menu container. + * + * Holds all the items, runs logic and gets rendered. + */ + +/** + * @defgroup Item + * @brief Item container. + * + * Contains properties for visual representation of item. + */ + +/** + * @addtogroup Menu + * @{ */ + /** * Draw mode constants for bmMenu instance draw mode. * - * BM_DRAW_MODE_LAST is provided for enumerating draw modes. + * @link ::bmDrawMode BM_DRAW_MODE_LAST @endlink is provided for enumerating draw modes. * Instancing with it however provides exactly same functionality as BM_DRAW_MODE_NONE. */ typedef enum bmDrawMode { @@ -19,7 +40,7 @@ typedef enum bmDrawMode { /** * Filter mode constants for bmMenu instance filter mode. * - * BM_FILTER_MODE_LAST is provided for enumerating filter modes. + * @link ::bmFilterMode BM_FILTER_MODE_LAST @endlink is provided for enumerating filter modes. * Using it as filter mode however provides exactly same functionality as BM_FILTER_MODE_DMENU. */ typedef enum bmFilterMode { @@ -31,9 +52,9 @@ typedef enum bmFilterMode { /** * Result constants from bmMenuRunWithKey function. * - * BM_RUN_RESULT_RUNNING means that menu is running and thus should be still renderer && ran. - * BM_RUN_RESULT_SELECTED means that menu was closed and items were selected. - * BM_RUN_RESULT_CANCEL means that menu was closed and selection was canceled. + * - @link ::bmRunResult BM_RUN_RESULT_RUNNING @endlink means that menu is running and thus should be still renderer && ran. + * - @link ::bmRunResult BM_RUN_RESULT_SELECTED @endlink means that menu was closed and items were selected. + * - @link ::bmRunResult BM_RUN_RESULT_CANCEL @endlink means that menu was closed and selection was canceled. */ typedef enum bmRunResult { BM_RUN_RESULT_RUNNING, @@ -44,7 +65,7 @@ typedef enum bmRunResult { /** * Key constants. * - * BM_KEY_LAST is provided for enumerating keys. + * @link ::bmKey BM_KEY_LAST @endlink is provided for enumerating keys. */ typedef enum bmKey { BM_KEY_NONE, @@ -68,14 +89,15 @@ typedef enum bmKey { BM_KEY_LAST } bmKey; -typedef struct _bmMenu bmMenu; -typedef struct _bmItem bmItem; +/** + * @name Menu Memory + * @{ */ /** * Create new bmMenu instance. * * @param drawMode Render method to be used for this menu instance. - * @return bmMenu for new menu instance, NULL if creation failed. + * @return bmMenu for new menu instance, **NULL** if creation failed. */ bmMenu* bmMenuNew(bmDrawMode drawMode); @@ -93,6 +115,12 @@ void bmMenuFree(bmMenu *menu); */ void bmMenuFreeItems(bmMenu *menu); +/** @} Menu Memory */ + +/** + * @name Menu Properties + * @{ */ + /** * Set active filter mode to bmMenu instance. * @@ -113,7 +141,7 @@ bmFilterMode bmMenuGetFilterMode(const bmMenu *menu); * Set title to bmMenu instance. * * @param menu bmMenu instance where to set title. - * @param title C "string" to set as title, can be NULL for empty title. + * @param title C "string" to set as title, can be **NULL** for empty title. */ int bmMenuSetTitle(bmMenu *menu, const char *title); @@ -121,10 +149,16 @@ int bmMenuSetTitle(bmMenu *menu, const char *title); * Get title from bmMenu instance. * * @param menu bmMenu instance where to get title from. - * @return Pointer to null terminated C "string", can be NULL for empty title. + * @return Pointer to null terminated C "string", can be **NULL** for empty title. */ const char* bmMenuGetTitle(const bmMenu *menu); +/** @} Properties */ + +/** + * @name Menu Items + * @{ */ + /** * Add item to bmMenu instance at specific index. * @@ -147,6 +181,8 @@ int bmMenuAddItem(bmMenu *menu, bmItem *item); /** * Remove item from bmMenu instance at specific index. * + * @warning The item won't be freed, use bmItemFree to do that. + * * @param menu bmMenu instance from where item will be removed. * @param index Index of item to remove. * @return 1 on successful add, 0 on failure. @@ -155,7 +191,8 @@ int bmMenuRemoveItemAt(bmMenu *menu, unsigned int index); /** * Remove item from bmMenu instance. - * The item won't be freed, use bmItemFree to do that. + * + * @warning The item won't be freed, use bmItemFree to do that. * * @param menu bmMenu instance from where item will be removed. * @param item bmItem instance to remove. @@ -167,18 +204,20 @@ int bmMenuRemoveItem(bmMenu *menu, bmItem *item); * Get selected item from bmMenu instance. * * @param menu bmMenu instance from where to get selected item. - * @return Selected bmItem instance, NULL if none selected. + * @return Selected bmItem instance, **NULL** if none selected. */ bmItem* bmMenuGetSelectedItem(const bmMenu *menu); /** * Get items from bmMenu instance. * + * @warning The pointer returned by this function may be invalid after removing or adding new items. + * * @param menu bmMenu instance from where to get items. - * @param nmemb Reference to unsigned int where total count of returned items will be stored. + * @param outNmemb Reference to unsigned int where total count of returned items will be stored. * @return Pointer to array of bmItem pointers. */ -bmItem** bmMenuGetItems(const bmMenu *menu, unsigned int *nmemb); +bmItem** bmMenuGetItems(const bmMenu *menu, unsigned int *outNmemb); /** * Get filtered (displayed) items from bmMenu instance. @@ -187,16 +226,16 @@ bmItem** bmMenuGetItems(const bmMenu *menu, unsigned int *nmemb); * Do not store this pointer. * * @param menu bmMenu instance from where to get filtered items. - * @param nmemb Reference to unsigned int where total count of returned items will be stored. + * @param outNmemb Reference to unsigned int where total count of returned items will be stored. * @return Pointer to array of bmItem pointers. */ -bmItem** bmMenuGetFilteredItems(const bmMenu *menu, unsigned int *nmemb); +bmItem** bmMenuGetFilteredItems(const bmMenu *menu, unsigned int *outNmemb); /** * Set items to bmMenu instance. * Will replace all the old items on bmMenu instance. * - * If items is NULL, or nmemb is zero, all items will be freed from the menu. + * If items is **NULL**, or nmemb is zero, all items will be freed from the menu. * * @param menu bmMenu instance where items will be set. * @param items Array of bmItem pointers to set. @@ -205,6 +244,12 @@ bmItem** bmMenuGetFilteredItems(const bmMenu *menu, unsigned int *nmemb); */ int bmMenuSetItems(bmMenu *menu, const bmItem **items, unsigned int nmemb); +/** @} Menu Items */ + +/** + * @name Menu Logic + * @{ */ + /** * Render bmMenu instance using chosen draw method. * @@ -215,13 +260,13 @@ void bmMenuRender(const bmMenu *menu); /** * Poll key and unicode from underlying UI toolkit. * - * This function will block on CURSES draw mode. + * This function will block on @link ::bmDrawMode BM_DRAW_MODE_CURSES @endlink draw mode. * * @param menu bmMenu instance from which to poll. - * @param unicode Reference to unsigned int. + * @param outUnicode Reference to unsigned int. * @return bmKey for polled key. */ -bmKey bmMenuGetKey(bmMenu *menu, unsigned int *unicode); +bmKey bmMenuGetKey(bmMenu *menu, unsigned int *outUnicode); /** * Advances menu logic with key and unicode as input. @@ -233,11 +278,23 @@ bmKey bmMenuGetKey(bmMenu *menu, unsigned int *unicode); */ bmRunResult bmMenuRunWithKey(bmMenu *menu, bmKey key, unsigned int unicode); +/** @} Menu Logic */ + +/** @} Menu */ + +/** + * @addtogroup Item + * @{ */ + +/** + * @name Item Memory + * @{ */ + /** * Allocate a new item. * - * @param text Pointer to null terminated C "string", can be NULL for empty text. - * @return bmItem for new item instance, NULL if creation failed. + * @param text Pointer to null terminated C "string", can be **NULL** for empty text. + * @return bmItem for new item instance, **NULL** if creation failed. */ bmItem* bmItemNew(const char *text); @@ -248,11 +305,17 @@ bmItem* bmItemNew(const char *text); */ void bmItemFree(bmItem *item); +/** @} Item Memory */ + +/** + * @name Item Properties + * @{ */ + /** * Set text to bmItem instance. * * @param item bmItem instance where to set text. - * @param text C "string" to set as text, can be NULL for empty text. + * @param text C "string" to set as text, can be **NULL** for empty text. */ int bmItemSetText(bmItem *item, const char *text); @@ -260,8 +323,12 @@ int bmItemSetText(bmItem *item, const char *text); * Get text from bmItem instance. * * @param item bmItem instance where to get text from. - * @return Pointer to null terminated C "string", can be NULL for empty text. + * @return Pointer to null terminated C "string", can be **NULL** for empty text. */ const char* bmItemGetText(const bmItem *item); +/** @} Item Properties */ + +/** @} Item */ + /* vim: set ts=8 sw=4 tw=0 :*/ diff --git a/lib/filter.c b/lib/filter.c index 92e5683..33126c0 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -7,16 +7,16 @@ * Filter that mimics the vanilla dmenu filtering. * * @param menu bmMenu instance to filter. - * @param count unsigned int reference to filtered items count. - * @param selected unsigned int reference to new selected item index. + * @param outNmemb unsigned int reference to filtered items outNmemb. + * @param outSelected unsigned int reference to new outSelected item index. * @return Pointer to array of bmItem pointers. */ -bmItem** _bmFilterDmenu(bmMenu *menu, unsigned int *count, unsigned int *selected) +bmItem** _bmFilterDmenu(bmMenu *menu, unsigned int *outNmemb, unsigned int *outSelected) { assert(menu); - assert(count); - assert(selected); - *count = *selected = 0; + assert(outNmemb); + assert(outSelected); + *outNmemb = *outSelected = 0; /* FIXME: not real dmenu like filtering at all */ @@ -29,28 +29,28 @@ bmItem** _bmFilterDmenu(bmMenu *menu, unsigned int *count, unsigned int *selecte bmItem *item = menu->items[i]; if (item->text && strstr(item->text, menu->filter)) { if (f == 0 || item == bmMenuGetSelectedItem(menu)) - *selected = f; + *outSelected = f; filtered[f++] = item; } } - return _bmShrinkItemList(&filtered, menu->itemsCount, (*count = f)); + return _bmShrinkItemList(&filtered, menu->itemsCount, (*outNmemb = f)); } /** * Filter that mimics the vanilla case-insensitive dmenu filtering. * * @param menu bmMenu instance to filter. - * @param count unsigned int reference to filtered items count. - * @param selected unsigned int reference to new selected item index. + * @param outNmemb unsigned int reference to filtered items outNmemb. + * @param outSelected unsigned int reference to new outSelected item index. * @return Pointer to array of bmItem pointers. */ -bmItem** _bmFilterDmenuCaseInsensitive(bmMenu *menu, unsigned int *count, unsigned int *selected) +bmItem** _bmFilterDmenuCaseInsensitive(bmMenu *menu, unsigned int *outNmemb, unsigned int *outSelected) { assert(menu); - assert(count); - assert(selected); - *count = *selected = 0; + assert(outNmemb); + assert(outSelected); + *outNmemb = *outSelected = 0; /* FIXME: stub */ diff --git a/lib/internal.h b/lib/internal.h index 41fb926..66eabbc 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -64,7 +64,6 @@ struct _bmMenu { /** * Text used to filter matches. - * * XXX: Change this to a pointer? */ char filter[1024]; @@ -115,18 +114,18 @@ struct _bmMenu { int _bmDrawCursesInit(struct _bmRenderApi *api); /* filter.c */ -bmItem** _bmFilterDmenu(bmMenu *menu, unsigned int *count, unsigned int *selected); -bmItem** _bmFilterDmenuCaseInsensitive(bmMenu *menu, unsigned int *count, unsigned int *selected); +bmItem** _bmFilterDmenu(bmMenu *menu, unsigned int *outNmemb, unsigned int *outSelected); +bmItem** _bmFilterDmenuCaseInsensitive(bmMenu *menu, unsigned int *outNmemb, unsigned int *outSelected); /* util.c */ char* _bmStrdup(const char *s); -bmItem** _bmShrinkItemList(bmItem ***list, size_t osize, size_t nsize); +bmItem** _bmShrinkItemList(bmItem ***inOutList, size_t osize, size_t nsize); int _bmUtf8StringScreenWidth(const char *string); size_t _bmUtf8RuneNext(const char *string, size_t start); size_t _bmUtf8RunePrev(const char *string, size_t start); size_t _bmUtf8RuneWidth(const char *rune, unsigned int u8len); -size_t _bmUtf8RuneRemove(char *string, size_t start, size_t *runeWidth); -size_t _bmUtf8RuneInsert(char *string, size_t bufSize, size_t start, const char *rune, unsigned int u8len, size_t *runeWidth); -size_t _bmUnicodeInsert(char *string, size_t bufSize, size_t start, unsigned int unicode, size_t *runeWidth); +size_t _bmUtf8RuneRemove(char *string, size_t start, size_t *outRuneWidth); +size_t _bmUtf8RuneInsert(char *string, size_t bufSize, size_t start, const char *rune, unsigned int u8len, size_t *outRuneWidth); +size_t _bmUnicodeInsert(char *string, size_t bufSize, size_t start, unsigned int unicode, size_t *outRuneWidth); /* vim: set ts=8 sw=4 tw=0 :*/ diff --git a/lib/item.c b/lib/item.c index 8320b9b..e6ccc7a 100644 --- a/lib/item.c +++ b/lib/item.c @@ -6,8 +6,8 @@ /** * Allocate a new item. * - * @param text Pointer to null terminated C "string", can be NULL for empty text. - * @return bmItem instance. + * @param text Pointer to null terminated C "string", can be **NULL** for empty text. + * @return bmItem for new item instance, **NULL** if creation failed. */ bmItem* bmItemNew(const char *text) { @@ -39,7 +39,7 @@ void bmItemFree(bmItem *item) * Set text to bmItem instance. * * @param item bmItem instance where to set text. - * @param text C "string" to set as text, can be NULL for empty text. + * @param text C "string" to set as text, can be **NULL** for empty text. */ int bmItemSetText(bmItem *item, const char *text) { @@ -60,7 +60,7 @@ int bmItemSetText(bmItem *item, const char *text) * Get text from bmItem instance. * * @param item bmItem instance where to get text from. - * @return Pointer to null terminated C "string", can be NULL for empty text. + * @return Pointer to null terminated C "string", can be **NULL** for empty text. */ const char* bmItemGetText(const bmItem *item) { diff --git a/lib/menu.c b/lib/menu.c index c8c6a26..3d41121 100644 --- a/lib/menu.c +++ b/lib/menu.c @@ -7,7 +7,7 @@ /** * Filter function map. */ -static bmItem** (*filterFunc[BM_FILTER_MODE_LAST])(bmMenu *menu, unsigned int *count, unsigned int *selected) = { +static bmItem** (*filterFunc[BM_FILTER_MODE_LAST])(bmMenu *menu, unsigned int *outNmemb, unsigned int *outSelected) = { _bmFilterDmenu, /* BM_FILTER_DMENU */ _bmFilterDmenuCaseInsensitive /* BM_FILTER_DMENU_CASE_INSENSITIVE */ }; @@ -53,7 +53,7 @@ static int _bmMenuGrowItems(bmMenu *menu) * Create new bmMenu instance. * * @param drawMode Render method to be used for this menu instance. - * @return bmMenu for new menu instance, NULL if creation failed. + * @return bmMenu for new menu instance, **NULL** if creation failed. */ bmMenu* bmMenuNew(bmDrawMode drawMode) { @@ -155,7 +155,7 @@ bmFilterMode bmMenuGetFilterMode(const bmMenu *menu) * Set title to bmMenu instance. * * @param menu bmMenu instance where to set title. - * @param title C "string" to set as title, can be NULL for empty title. + * @param title C "string" to set as title, can be **NULL** for empty title. */ int bmMenuSetTitle(bmMenu *menu, const char *title) { @@ -176,7 +176,7 @@ int bmMenuSetTitle(bmMenu *menu, const char *title) * Get title from bmMenu instance. * * @param menu bmMenu instance where to get title from. - * @return Pointer to null terminated C "string", can be NULL for empty title. + * @return Pointer to null terminated C "string", can be **NULL** for empty title. */ const char* bmMenuGetTitle(const bmMenu *menu) { @@ -225,6 +225,8 @@ int bmMenuAddItem(bmMenu *menu, bmItem *item) /** * Remove item from bmMenu instance at specific index. * + * @warning The item won't be freed, use bmItemFree to do that. + * * @param menu bmMenu instance from where item will be removed. * @param index Index of item to remove. * @return 1 on successful add, 0 on failure. @@ -244,6 +246,8 @@ int bmMenuRemoveItemAt(bmMenu *menu, unsigned int index) /** * Remove item from bmMenu instance. * + * @warning The item won't be freed, use bmItemFree to do that. + * * @param menu bmMenu instance from where item will be removed. * @param item bmItem instance to remove. * @return 1 on successful add, 0 on failure. @@ -262,7 +266,7 @@ int bmMenuRemoveItem(bmMenu *menu, bmItem *item) * Get selected item from bmMenu instance. * * @param menu bmMenu instance from where to get selected item. - * @return Selected bmItem instance, NULL if none selected. + * @return Selected bmItem instance, **NULL** if none selected. */ bmItem* bmMenuGetSelectedItem(const bmMenu *menu) { @@ -280,16 +284,18 @@ bmItem* bmMenuGetSelectedItem(const bmMenu *menu) /** * Get items from bmMenu instance. * + * @warning The pointer returned by this function may be invalid after removing or adding new items. + * * @param menu bmMenu instance from where to get items. - * @param nmemb Reference to unsigned int where total count of returned items will be stored. + * @param outNmemb Reference to unsigned int where total count of returned items will be stored. * @return Pointer to array of bmItem pointers. */ -bmItem** bmMenuGetItems(const bmMenu *menu, unsigned int *nmemb) +bmItem** bmMenuGetItems(const bmMenu *menu, unsigned int *outNmemb) { assert(menu); - if (nmemb) - *nmemb = menu->itemsCount; + if (outNmemb) + *outNmemb = menu->itemsCount; return menu->items; } @@ -301,15 +307,15 @@ bmItem** bmMenuGetItems(const bmMenu *menu, unsigned int *nmemb) * Do not store this pointer. * * @param menu bmMenu instance from where to get filtered items. - * @param nmemb Reference to unsigned int where total count of returned items will be stored. + * @param outNmemb Reference to unsigned int where total count of returned items will be stored. * @return Pointer to array of bmItem pointers. */ -bmItem** bmMenuGetFilteredItems(const bmMenu *menu, unsigned int *nmemb) +bmItem** bmMenuGetFilteredItems(const bmMenu *menu, unsigned int *outNmemb) { assert(menu); - if (nmemb) - *nmemb = (menu->filteredItems ? menu->filteredCount : menu->itemsCount); + if (outNmemb) + *outNmemb = (menu->filteredItems ? menu->filteredCount : menu->itemsCount); return (menu->filteredItems ? menu->filteredItems : menu->items); } @@ -318,6 +324,8 @@ bmItem** bmMenuGetFilteredItems(const bmMenu *menu, unsigned int *nmemb) * Set items to bmMenu instance. * Will replace all the old items on bmMenu instance. * + * If items is **NULL**, or nmemb is zero, all items will be freed from the menu. + * * @param menu bmMenu instance where items will be set. * @param items Array of bmItem pointers to set. * @param nmemb Total count of items in array. @@ -360,22 +368,22 @@ void bmMenuRender(const bmMenu *menu) /** * Poll key and unicode from underlying UI toolkit. * - * This function will block on CURSES draw mode. + * This function will block on @link ::bmDrawMode BM_DRAW_MODE_CURSES @endlink draw mode. * * @param menu bmMenu instance from which to poll. - * @param unicode Reference to unsigned int. + * @param outUnicode Reference to unsigned int. * @return bmKey for polled key. */ -bmKey bmMenuGetKey(bmMenu *menu, unsigned int *unicode) +bmKey bmMenuGetKey(bmMenu *menu, unsigned int *outUnicode) { assert(menu); - assert(unicode); + assert(outUnicode); - *unicode = 0; + *outUnicode = 0; bmKey key = BM_KEY_NONE; if (menu->renderApi.getKey) - key = menu->renderApi.getKey(unicode); + key = menu->renderApi.getKey(outUnicode); return key; } diff --git a/lib/util.c b/lib/util.c index ae230c8..5eb980d 100644 --- a/lib/util.c +++ b/lib/util.c @@ -37,21 +37,21 @@ char* _bmStrdup(const char *string) * @param nsize New size the list will be shrinked to. * @return Pointer to list of bmItem pointers. */ -bmItem** _bmShrinkItemList(bmItem ***list, size_t osize, size_t nsize) +bmItem** _bmShrinkItemList(bmItem ***inOutList, size_t osize, size_t nsize) { - assert(list); + assert(inOutList); if (nsize >= osize) - return *list; + return *inOutList; void *tmp = malloc(sizeof(bmItem*) * nsize); if (!tmp) - return *list; + return *inOutList; - memcpy(tmp, *list, sizeof(bmItem*) * nsize); - free(*list); - *list = tmp; - return *list; + memcpy(tmp, *inOutList, sizeof(bmItem*) * nsize); + free(*inOutList); + *inOutList = tmp; + return *inOutList; } /** @@ -135,15 +135,15 @@ size_t _bmUtf8RuneWidth(const char *rune, unsigned int u8len) * * @param string Null terminated C "string". * @param start Start offset where to delete from. (cursor) - * @param runeWidth Reference to size_t, return number of columns for removed rune, or -1 on failure. + * @param outRuneWidth Reference to size_t, return number of columns for removed rune, or -1 on failure. * @return Number of bytes removed from buffer. */ -size_t _bmUtf8RuneRemove(char *string, size_t start, size_t *runeWidth) +size_t _bmUtf8RuneRemove(char *string, size_t start, size_t *outRuneWidth) { assert(string); - if (runeWidth) - *runeWidth = 0; + if (outRuneWidth) + *outRuneWidth = 0; size_t len = strlen(string), oldStart = start; if (len == 0 || len < start || !*string) @@ -151,8 +151,8 @@ size_t _bmUtf8RuneRemove(char *string, size_t start, size_t *runeWidth) start -= _bmUtf8RunePrev(string, start); - if (runeWidth) - *runeWidth = _bmUtf8RuneWidth(string + start, oldStart - start); + if (outRuneWidth) + *outRuneWidth = _bmUtf8RuneWidth(string + start, oldStart - start); memmove(string + start, string + oldStart, len - oldStart); string[len - (oldStart - start)] = 0; @@ -167,15 +167,15 @@ size_t _bmUtf8RuneRemove(char *string, size_t start, size_t *runeWidth) * @param start Start offset where to insert to. (cursor) * @param rune Buffer to insert to string. * @param u8len Byte length of the rune. - * @param runeWidth Reference to size_t, return number of columns for inserted rune, or -1 on failure. + * @param outRuneWidth Reference to size_t, return number of columns for inserted rune, or -1 on failure. * @return Number of bytes inserted to buffer. */ -size_t _bmUtf8RuneInsert(char *string, size_t bufSize, size_t start, const char *rune, unsigned int u8len, size_t *runeWidth) +size_t _bmUtf8RuneInsert(char *string, size_t bufSize, size_t start, const char *rune, unsigned int u8len, size_t *outRuneWidth) { assert(string); - if (runeWidth) - *runeWidth = 0; + if (outRuneWidth) + *outRuneWidth = 0; size_t len = strlen(string); if (len + u8len >= bufSize) @@ -188,8 +188,8 @@ size_t _bmUtf8RuneInsert(char *string, size_t bufSize, size_t start, const char memmove(str + u8len, str, len - start); memcpy(str, rune, u8len); - if (runeWidth) - *runeWidth = _bmUtf8RuneWidth(rune, u8len); + if (outRuneWidth) + *outRuneWidth = _bmUtf8RuneWidth(rune, u8len); return u8len; } @@ -200,10 +200,10 @@ size_t _bmUtf8RuneInsert(char *string, size_t bufSize, size_t start, const char * @param bufSize Size of the buffer. * @param start Start offset where to insert to. (cursor) * @param unicode Unicode character to insert. - * @param runeWidth Reference to size_t, return number of columns for inserted rune, or -1 on failure. + * @param outRuneWidth Reference to size_t, return number of columns for inserted rune, or -1 on failure. * @return Number of bytes inserted to buffer. */ -size_t _bmUnicodeInsert(char *string, size_t bufSize, size_t start, unsigned int unicode, size_t *runeWidth) +size_t _bmUnicodeInsert(char *string, size_t bufSize, size_t start, unsigned int unicode, size_t *outRuneWidth) { assert(string); @@ -219,7 +219,7 @@ size_t _bmUnicodeInsert(char *string, size_t bufSize, size_t start, unsigned int mb[0] |= (unicode >> (i * 6 - 6)); } - return _bmUtf8RuneInsert(string, bufSize, start, mb, u8len, runeWidth); + return _bmUtf8RuneInsert(string, bufSize, start, mb, u8len, outRuneWidth); } /* vim: set ts=8 sw=4 tw=0 :*/ -- cgit v1.2.3-70-g09d2 From 1f51a67589213a93ddd80843a909b92c2670ddc8 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 10 Apr 2014 20:15:25 +0300 Subject: Don't sort documentation members. --- doxygen/Doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doxygen') diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 3b80187..b65debf 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -526,7 +526,7 @@ INLINE_INFO = YES # name. If set to NO the members will appear in declaration order. # The default value is: YES. -SORT_MEMBER_DOCS = YES +SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -- cgit v1.2.3-70-g09d2 From 8e1ff89f9cedab9a5f5b5f6a702f76feda514182 Mon Sep 17 00:00:00 2001 From: Martin Langasek Date: Sat, 12 Apr 2014 23:05:12 +0200 Subject: Fix typo in Mainpage.dox --- doxygen/Mainpage.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doxygen') diff --git a/doxygen/Mainpage.dox b/doxygen/Mainpage.dox index 869071c..1b91ebf 100644 --- a/doxygen/Mainpage.dox +++ b/doxygen/Mainpage.dox @@ -2,7 +2,7 @@ @mainpage Main Page bemenu is a dynamic menu library and client program inspired by dmenu. -You can create flexible menu oriented programs using the library interface in your favorite language that has bemenu bindings avaialable. +You can create flexible menu oriented programs using the library interface in your favorite language that has bemenu bindings available. Unlike old dmenu approach, with library you don't have to feed unneccessary metadata into client program and parse the result. Instead your program will be aware of the items and possible metadata inside the menu. -- cgit v1.2.3-70-g09d2