diff options
author | raveit65 (via Travis CI) <[email protected]> | 2023-07-21 03:09:56 +0000 |
---|---|---|
committer | raveit65 (via Travis CI) <[email protected]> | 2023-07-21 03:09:56 +0000 |
commit | 8f6ca4c787210df90e5e371a3cafe54400785252 (patch) | |
tree | 8cb65e74f0bdb34bfe5f925978496ea1548c0de7 /2022-10-29-134752-5499-1@cd263b7986ec_master | |
download | mate-netbook-8f6ca4c787210df90e5e371a3cafe54400785252.tar.bz2 mate-netbook-8f6ca4c787210df90e5e371a3cafe54400785252.tar.xz |
Deploy mate-desktop/mate-netbook to github.com/mate-desktop/mate-netbook.git:gh-pagesgh-pages
Diffstat (limited to '2022-10-29-134752-5499-1@cd263b7986ec_master')
18 files changed, 20356 insertions, 0 deletions
diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/index.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/index.html new file mode 100644 index 0000000..321de6a --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/index.html @@ -0,0 +1,140 @@ +<html> +<head> +<title>rootdir - scan-build results</title> +<link type="text/css" rel="stylesheet" href="scanview.css"/> +<script src="sorttable.js"></script> +<script language='javascript' type="text/javascript"> +function SetDisplay(RowClass, DisplayVal) +{ + var Rows = document.getElementsByTagName("tr"); + for ( var i = 0 ; i < Rows.length; ++i ) { + if (Rows[i].className == RowClass) { + Rows[i].style.display = DisplayVal; + } + } +} + +function CopyCheckedStateToCheckButtons(SummaryCheckButton) { + var Inputs = document.getElementsByTagName("input"); + for ( var i = 0 ; i < Inputs.length; ++i ) { + if (Inputs[i].type == "checkbox") { + if(Inputs[i] != SummaryCheckButton) { + Inputs[i].checked = SummaryCheckButton.checked; + Inputs[i].onclick(); + } + } + } +} + +function returnObjById( id ) { + if (document.getElementById) + var returnVar = document.getElementById(id); + else if (document.all) + var returnVar = document.all[id]; + else if (document.layers) + var returnVar = document.layers[id]; + return returnVar; +} + +var NumUnchecked = 0; + +function ToggleDisplay(CheckButton, ClassName) { + if (CheckButton.checked) { + SetDisplay(ClassName, ""); + if (--NumUnchecked == 0) { + returnObjById("AllBugsCheck").checked = true; + } + } + else { + SetDisplay(ClassName, "none"); + NumUnchecked++; + returnObjById("AllBugsCheck").checked = false; + } +} +</script> +<!-- SUMMARYENDHEAD --> +</head> +<body> +<h1>rootdir - scan-build results</h1> + +<table> +<tr><th>User:</th><td>root@94ed60b4c71d</td></tr> +<tr><th>Working Directory:</th><td>/rootdir</td></tr> +<tr><th>Command Line:</th><td>make -j 2</td></tr> +<tr><th>Clang Version:</th><td>clang version 14.0.5 (Fedora 14.0.5-1.fc36) +</td></tr> +<tr><th>Date:</th><td>Sat Oct 29 13:47:52 2022</td></tr> +</table> +<h2>Bug Summary</h2><table> +<thead><tr><td>Bug Type</td><td>Quantity</td><td class="sorttable_nosort">Display?</td></tr></thead> +<tr style="font-weight:bold"><td class="SUMM_DESC">All Bugs</td><td class="Q">15</td><td><center><input type="checkbox" id="AllBugsCheck" onClick="CopyCheckedStateToCheckButtons(this);" checked/></center></td></tr> +<tr><th>Logic error</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Cast from non-struct type to struct type</td><td class="Q">2</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_logic_error_cast_from_non-struct_type_to_struct_type');" checked/></center></td></tr> +<tr><th>Security</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td class="Q">12</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_');" checked/></center></td></tr> +<tr><th>Unused code</th><th colspan=2></th></tr> +<tr><td class="SUMM_DESC">Dead nested assignment</td><td class="Q">1</td><td><center><input type="checkbox" onClick="ToggleDisplay(this,'bt_unused_code_dead_nested_assignment');" checked/></center></td></tr> +</table> +<h2>Reports</h2> + +<table class="sortable" style="table-layout:automatic"> +<thead><tr> + <td>Bug Group</td> + <td class="sorttable_sorted">Bug Type<span id="sorttable_sortfwdind"> ▾</span></td> + <td>File</td> + <td>Function/Method</td> + <td class="Q">Line</td> + <td class="Q">Path Length</td> + <td class="sorttable_nosort"></td> + <!-- REPORTBUGCOL --> +</tr></thead> +<tbody> +<tr class="bt_logic_error_cast_from_non-struct_type_to_struct_type"><td class="DESC">Logic error</td><td class="DESC">Cast from non-struct type to struct type</td><td>maximus-app.c</td><td class="DESC">wnck_window_is_decorated</td><td class="Q">120</td><td class="Q">1</td><td><a href="report-1f618a.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-1f618a.html" --> +</tr> +<tr class="bt_logic_error_cast_from_non-struct_type_to_struct_type"><td class="DESC">Logic error</td><td class="DESC">Cast from non-struct type to struct type</td><td>maximus-app.c</td><td class="DESC">gdk_window_set_mwm_hints</td><td class="Q">162</td><td class="Q">1</td><td><a href="report-e9ff85.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-e9ff85.html" --> +</tr> +<tr class="bt_unused_code_dead_nested_assignment"><td class="DESC">Unused code</td><td class="DESC">Dead nested assignment</td><td>maximus-bind.c</td><td class="DESC">maximus_bind_init</td><td class="Q">464</td><td class="Q">1</td><td><a href="report-90bf5a.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-90bf5a.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">408</td><td class="Q">1</td><td><a href="report-05d832.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-05d832.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">453</td><td class="Q">1</td><td><a href="report-37b917.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-37b917.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">423</td><td class="Q">1</td><td><a href="report-4bda9e.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-4bda9e.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">443</td><td class="Q">1</td><td><a href="report-678a90.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-678a90.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">403</td><td class="Q">1</td><td><a href="report-6fb882.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-6fb882.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">418</td><td class="Q">1</td><td><a href="report-7534c9.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-7534c9.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">448</td><td class="Q">1</td><td><a href="report-85a3e8.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-85a3e8.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">413</td><td class="Q">1</td><td><a href="report-aa2062.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-aa2062.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">433</td><td class="Q">1</td><td><a href="report-b10f27.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-b10f27.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">438</td><td class="Q">1</td><td><a href="report-c2cf20.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-c2cf20.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">457</td><td class="Q">1</td><td><a href="report-e3bdb1.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-e3bdb1.html" --> +</tr> +<tr class="bt_security_potential_insecure_memory_buffer_bounds_restriction_in_call_strcpy_"><td class="DESC">Security</td><td class="DESC">Potential insecure memory buffer bounds restriction in call 'strcpy'</td><td>eggaccelerators.c</td><td class="DESC">egg_virtual_accelerator_name</td><td class="Q">428</td><td class="Q">1</td><td><a href="report-faab40.html#EndPath">View Report</a></td> +<!-- REPORTBUG id="report-faab40.html" --> +</tr> +</tbody> +</table> + +</body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-05d832.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-05d832.html new file mode 100644 index 0000000..685d182 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-05d832.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 05d83240fce8174fd1332b22fbc124bf --> + +<!-- BUGLINE 408 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 408, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"408": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_shift);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-1f618a.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-1f618a.html new file mode 100644 index 0000000..bdffb48 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-1f618a.html @@ -0,0 +1,1228 @@ +<!doctype html> +<html> +<head> +<title>maximus-app.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption --> + +<!-- BUGTYPE Cast from non-struct type to struct type --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/maximus/maximus-app.c --> + +<!-- FILENAME maximus-app.c --> + +<!-- FUNCTIONNAME wnck_window_is_decorated --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 1f618a149edf71b462da33dfca10809b --> + +<!-- BUGLINE 120 --> + +<!-- BUGCOLUMN 11 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>maximus-app.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 120, column 11</a><br />Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name maximus-app.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c maximus-app.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"120": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Canonical Ltd</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* This program is free software: you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License version 3 as</span> </td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* published by the Free Software Foundation.</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* along with this program. If not, see <http://www.gnu.org/licenses/>.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* Authored by Neil Jagdish Patel <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <gio/gio.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include "maximus-app.h"</span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include "maximus-bind.h"</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include "xutils.h"</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='comment'>/* GSettings schemas and keys */</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>APP_SCHEMA<span class='macro_popup'>"org.mate.maximus"</span></span> "org.mate.maximus"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>APP_EXCLUDE_CLASS<span class='macro_popup'>"exclude-class"</span></span> "exclude-class"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>APP_UNDECORATE<span class='macro_popup'>"undecorate"</span></span> "undecorate"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#define <span class='macro'>APP_NO_MAXIMIZE<span class='macro_popup'>"no-maximize"</span></span> "no-maximize"</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='comment'>/* A set of default exceptions */</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='keyword'>static</span> gchar *default_exclude_classes[] = </td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='string_literal'>"Apport-gtk"</span>,</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> <span class='string_literal'>"Bluetooth-properties"</span>,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='string_literal'>"Bluetooth-wizard"</span>,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='string_literal'>"Download"</span>, <span class='comment'>/* Firefox Download Window */</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> <span class='string_literal'>"Ekiga"</span>,</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='string_literal'>"Extension"</span>, <span class='comment'>/* Firefox Add-Ons/Extension Window */</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> <span class='string_literal'>"Gcalctool"</span>,</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='string_literal'>"Gimp"</span>,</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> <span class='string_literal'>"Global"</span>, <span class='comment'>/* Firefox Error Console Window */</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='string_literal'>"Mate-dictionary"</span>,</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> <span class='string_literal'>"Mate-language-selector"</span>,</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='string_literal'>"Mate-nettool"</span>,</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='string_literal'>"Mate-volume-control"</span>,</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> <span class='string_literal'>"Kiten"</span>,</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='string_literal'>"Kmplot"</span>,</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> <span class='string_literal'>"Nm-editor"</span>,</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='string_literal'>"Pidgin"</span>,</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='string_literal'>"Polkit-mate-authorization"</span>,</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='string_literal'>"Update-manager"</span>,</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='string_literal'>"Skype"</span>,</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> <span class='string_literal'>"Toplevel"</span>, <span class='comment'>/* Firefox "Clear Private Data" Window */</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='string_literal'>"Transmission"</span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>struct</span> _MaximusAppPrivate</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> MaximusBind *bind;</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> WnckScreen *screen;</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> gchar **exclude_class_list;</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> gboolean undecorate;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> gboolean no_maximize;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='keyword'>static</span> GQuark was_decorated = 0;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='comment'>/* <TAKEN FROM GDK> */</span></td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> flags;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> functions;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> decorations;</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>long</span> input_mode;</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> status;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line">} MotifWmHints, MwmHints;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"><span class='directive'>#define <span class='macro'>MWM_HINTS_FUNCTIONS<span class='macro_popup'>(1L << 0)</span></span> (1L << 0)</span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"><span class='directive'>#define <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span> (1L << 1)</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"><span class='directive'>#define <span class='macro'>_XA_MOTIF_WM_HINTS<span class='macro_popup'>"_MOTIF_WM_HINTS"</span></span> "_MOTIF_WM_HINTS"</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (MaximusApp, maximus_app, G_TYPE_OBJECT)<span class='macro_popup'>static void maximus_app_init (MaximusApp *self); static void maximus_app_class_init<br> (MaximusAppClass *klass); static GType maximus_app_get_type_once<br> (void); static gpointer maximus_app_parent_class = ((void*)0<br>); static gint MaximusApp_private_offset; static void maximus_app_class_intern_init<br> (gpointer klass) { maximus_app_parent_class = g_type_class_peek_parent<br> (klass); if (MaximusApp_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &MaximusApp_private_offset); maximus_app_class_init<br> ((MaximusAppClass*) klass); } __attribute__ ((__unused__)) static<br> inline gpointer maximus_app_get_instance_private (MaximusApp<br> *self) { return (((gpointer) ((guint8*) (self) + (glong) (MaximusApp_private_offset<br>)))); } GType maximus_app_get_type (void) { static gsize static_g_define_type_id<br> = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); (void<br>) (0 ? (gpointer) *(&static_g_define_type_id) : ((void*)0<br>)); (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter (&static_g_define_type_id<br>)); }))) { GType g_define_type_id = maximus_app_get_type_once<br> (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); 0 ?<br> (void) (*(&static_g_define_type_id) = (g_define_type_id)<br>) : (void) 0; g_once_init_leave ((&static_g_define_type_id<br>), (gsize) (g_define_type_id)); })); } return static_g_define_type_id<br>; } __attribute__ ((__noinline__)) static GType maximus_app_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> (((GType) ((20) << (2))), g_intern_static_string ("MaximusApp"<br>), sizeof (MaximusAppClass), (GClassInitFunc)(void (*)(void))<br> maximus_app_class_intern_init, sizeof (MaximusApp), (GInstanceInitFunc<br>)(void (*)(void)) maximus_app_init, (GTypeFlags) 0); { {{ MaximusApp_private_offset<br> = g_type_add_instance_private (g_define_type_id, sizeof (MaximusAppPrivate<br>)); };} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line">wnck_window_is_decorated (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> GdkDisplay *display = gdk_display_get_default();</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> Atom hints_atom = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> guchar *data = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> MotifWmHints *hints = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> Atom type = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> gint format;</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> gulong nitems;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> gulong bytes_after;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> gboolean retval;</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> hints_atom = gdk_x11_get_xatom_by_name_for_display (display, </td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> <span class='macro'>_XA_MOTIF_WM_HINTS<span class='macro_popup'>"_MOTIF_WM_HINTS"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> XGetWindowProperty (<span class='macro'>GDK_DISPLAY_XDISPLAY (display)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (display))</span></span>, </td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> wnck_window_get_xid (window),</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> hints_atom, 0, <span class='keyword'>sizeof</span> (MotifWmHints)/<span class='keyword'>sizeof</span> (<span class='keyword'>long</span>),</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='macro'>False<span class='macro_popup'>0</span></span>, <span class='macro'>AnyPropertyType<span class='macro_popup'>0L</span></span>, &type, &format, &nitems,</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> &bytes_after, &data);</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>if</span> (type == <span class='macro'>None<span class='macro_popup'>0L</span></span> || !data) <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> hints = <span class="mrange"><span class="mrange">(MotifWmHints *)data</span></span>; </td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:11ex; max-width:31em">Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</div></td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> retval = hints->decorations;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (data)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> XFree (data);</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='keyword'>return</span> retval;</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">gdk_window_set_mwm_hints (WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> MotifWmHints *new_hints)</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> GdkDisplay *display = gdk_display_get_default();</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> Atom hints_atom = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> guchar *data = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> MotifWmHints *hints = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> Atom type = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> gint format;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> gulong nitems;</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> gulong bytes_after;</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_DISPLAY (display))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((display)); GType __t = ((gdk_display_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_DISPLAY (display)"); return; } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> hints_atom = gdk_x11_get_xatom_by_name_for_display (display, </td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='macro'>_XA_MOTIF_WM_HINTS<span class='macro_popup'>"_MOTIF_WM_HINTS"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> gdk_x11_display_error_trap_push (display);</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> XGetWindowProperty (<span class='macro'>GDK_DISPLAY_XDISPLAY (display)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (display))</span></span>, </td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> wnck_window_get_xid (window),</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> hints_atom, 0, <span class='keyword'>sizeof</span> (MotifWmHints)/<span class='keyword'>sizeof</span> (<span class='keyword'>long</span>),</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>False<span class='macro_popup'>0</span></span>, <span class='macro'>AnyPropertyType<span class='macro_popup'>0L</span></span>, &type, &format, &nitems,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &bytes_after, &data);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>if</span> (gdk_x11_display_error_trap_pop (display))</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>if</span> (type != hints_atom || !data)</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> hints = new_hints;</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> hints = (MotifWmHints *)data;</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (new_hints->flags & <span class='macro'>MWM_HINTS_FUNCTIONS<span class='macro_popup'>(1L << 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> hints->flags |= <span class='macro'>MWM_HINTS_FUNCTIONS<span class='macro_popup'>(1L << 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> hints->functions = new_hints->functions; </td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>if</span> (new_hints->flags & <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> hints->flags |= <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> hints->decorations = new_hints->decorations;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> _wnck_error_trap_push ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> XChangeProperty (<span class='macro'>GDK_DISPLAY_XDISPLAY (display)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (display))</span></span>, </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> wnck_window_get_xid (window),</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> hints_atom, hints_atom, 32, <span class='macro'>PropModeReplace<span class='macro_popup'>0</span></span>,</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> (guchar *)hints, <span class='keyword'>sizeof</span> (MotifWmHints)/<span class='keyword'>sizeof</span> (<span class='keyword'>long</span>));</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> gdk_display_flush (display);</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> _wnck_error_trap_pop ();</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>if</span> (data)</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> XFree (data);</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line">_window_set_decorations (WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> GdkWMDecoration decorations)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> MotifWmHints *hints;</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>/* initialize to zero to avoid writing uninitialized data to socket */</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> hints = <span class='macro'>g_slice_new0 (MotifWmHints)<span class='macro_popup'>(MotifWmHints *) (__extension__ ({ gsize __s = sizeof (MotifWmHints<br>); gpointer __p; __p = g_slice_alloc (__s); memset (__p, 0, __s<br>); __p; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> hints->flags = <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> hints->decorations = decorations;</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> gdk_window_set_mwm_hints (window, hints);</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='macro'>g_slice_free (MotifWmHints, hints)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MotifWmHints), (hints)); else<br> (void) ((MotifWmHints*) 0 == (hints)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"><span class='comment'>/* </TAKEN FROM GDK> */</span></td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line">window_is_too_large_for_screen (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>static</span> GdkScreen *screen = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> gint x=0, y=0, w=0, h=0;</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>if</span> (screen == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> screen = gdk_screen_get_default ();</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> wnck_window_get_geometry (window, &x, &y, &w, &h);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='comment'>/* some wiggle room */</span></td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> <span class='keyword'>return</span> (screen && </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> (w > (<span class='macro'>WidthOfScreen (gdk_x11_screen_get_xscreen (screen))<span class='macro_popup'>((gdk_x11_screen_get_xscreen (screen))->width)</span></span> + 20) ||</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> h > (<span class='macro'>HeightOfScreen (gdk_x11_screen_get_xscreen (screen))<span class='macro_popup'>((gdk_x11_screen_get_xscreen (screen))->height)</span></span> + 20)));</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line">on_window_maximised_changed (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (window_is_too_large_for_screen (window))</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> _window_set_decorations (window, 1);</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> wnck_window_unmaximize (window);</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> _window_set_decorations (window, 0);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line">enable_window_decorations (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> _window_set_decorations (window, 1);</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line">on_window_state_changed (WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> WnckWindowState change_mask,</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> WnckWindowState new_state,</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), <span class='string_literal'>"exclude"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((window)), (((GType) ((20) << (2)))<br>))))), "exclude")))</span></span>==1)</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='keyword'>if</span> (change_mask & WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> || change_mask & WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY)</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_maximized (window) && app->priv->undecorate)</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> g_idle_add ((GSourceFunc)on_window_maximised_changed, window);</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> g_idle_add ((GSourceFunc)enable_window_decorations, window);</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line">is_excluded (MaximusApp *app, WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> WnckWindowType type;</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> WnckWindowActions actions;</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> gchar *res_name;</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> gchar *class_name;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> <span class='macro'>g_return_val_if_fail (MAXIMUS_IS_APP (app), TRUE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return ((!(0))); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), TRUE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((!(0))); }<br> } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> type = wnck_window_get_window_type (window);</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>if</span> (type != WNCK_WINDOW_NORMAL)</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), <span class='string_literal'>"exclude"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((window)), (((GType) ((20) << (2)))<br>))))), "exclude")))</span></span>==1)</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='comment'>/* Ignore if the window is already fullscreen */</span></td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_fullscreen (window))</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> g_debug (<span class='string_literal'>"Excluding (is fullscreen): %s\n"</span>,wnck_window_get_name (window));</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='comment'>/* Make sure the window supports maximising */</span></td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> actions = wnck_window_get_actions (window);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> <span class='keyword'>if</span> (actions & WNCK_WINDOW_ACTION_RESIZE</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> && actions & WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> && actions & WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> && actions & WNCK_WINDOW_ACTION_MAXIMIZE)</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> ; <span class='comment'>/* Is good to maximise */</span></td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> _wnck_get_wmclass (wnck_window_get_xid (window), &res_name, &class_name);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> g_debug (<span class='string_literal'>"Window opened: res_name=%s -- class_name=%s"</span>, res_name, class_name);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> <span class='comment'>/* Check internal list of class_ids */</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < <span class='macro'>G_N_ELEMENTS (default_exclude_classes)<span class='macro_popup'>(sizeof (default_exclude_classes) / sizeof ((default_exclude_classes<br>)[0]))</span></span>; i++)</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> <span class='keyword'>if</span> ((class_name && default_exclude_classes[i] </td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> && strstr (class_name, default_exclude_classes[i]))</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> || (res_name && default_exclude_classes[i] && strstr (res_name, </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> default_exclude_classes[i])))</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> g_debug (<span class='string_literal'>"Excluding: %s\n"</span>, wnck_window_get_name (window));</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> } </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> <span class='comment'>/* Check user list */</span></td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>for</span> (i = 0; priv->exclude_class_list[i] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++)</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>if</span> ((class_name && strstr (class_name, priv->exclude_class_list[i]))</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> || (res_name && strstr (res_name, priv->exclude_class_list[i]) ))</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> g_debug (<span class='string_literal'>"Excluding: %s\n"</span>, wnck_window_get_name (window));</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> g_free (res_name);</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> g_free (class_name);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"><span class='keyword'>extern</span> gboolean no_maximize;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line">on_window_opened (WnckScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line">{ </td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> WnckWindowType type;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> gint exclude = 0;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> GdkDisplay *gdk_display = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> type = wnck_window_get_window_type (window);</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> <span class='keyword'>if</span> (type != WNCK_WINDOW_NORMAL)</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='comment'>/* Ignore undecorated windows */</span></td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> gdk_x11_display_error_trap_push (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> exclude = wnck_window_is_decorated (window) ? 0 : 1;</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> <span class='keyword'>if</span> (gdk_x11_display_error_trap_pop (gdk_display))</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_maximized (window))</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> exclude = 0;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> g_object_set_data (<span class='macro'>G_OBJECT (window)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((window)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"exclude"</span>, <span class='macro'>GINT_TO_POINTER (exclude)<span class='macro_popup'>((gpointer) (glong) (exclude))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (is_excluded (app, window))</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='macro'>g_signal_connect (window, <span class='string_literal'>"state-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_state_changed), app)<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>if</span> (no_maximize || priv->no_maximize)</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_maximized(window) && priv->undecorate)</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> _window_set_decorations (window, 0);</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> gdk_display_flush (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='macro'>g_signal_connect (window, <span class='string_literal'>"state-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_state_changed), app)<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>if</span> (priv->undecorate)</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='comment'>/* Only undecorate right now if the window is smaller than the screen */</span></td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (!window_is_too_large_for_screen (window))</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> _window_set_decorations (window, 0);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> gdk_display_flush (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> wnck_window_maximize (window);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='macro'>g_signal_connect (window, <span class='string_literal'>"state-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_state_changed), app)<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"><span class='comment'>/* GSettings Callbacks */</span></td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line">on_app_no_maximize_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> priv->no_maximize = g_settings_get_boolean (settings, key);</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line">on_exclude_class_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> <span class='keyword'>if</span> (priv->exclude_class_list)</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> g_strfreev (priv->exclude_class_list);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> priv->exclude_class_list= g_settings_get_strv (settings, </td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='macro'>APP_EXCLUDE_CLASS<span class='macro_popup'>"exclude-class"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line">show_desktop (WnckScreen *screen)</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_SCREEN (screen), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((screen)); GType __t = ((wnck_screen_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_SCREEN (screen)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> wnck_screen_toggle_showing_desktop (screen, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line">on_app_undecorate_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> GList *windows, *w;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_SCREEN (priv->screen))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((priv->screen)); GType __t = ((wnck_screen_get_type ()<br>)); gboolean __r; if (!__inst) __r = (0); else if (__inst-><br>g_class && __inst->g_class->g_type == __t) __r =<br> (!(0)); else __r = g_type_check_instance_is_a (__inst, __t);<br> __r; }))))) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_<br>; }), 1))) { } else { g_return_if_fail_warning (((gchar*) 0),<br> ((const char*) (__func__)), "WNCK_IS_SCREEN (priv->screen)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> priv->undecorate = g_settings_get_boolean (settings, <span class='macro'>APP_UNDECORATE<span class='macro_popup'>"undecorate"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> g_debug (<span class='string_literal'>"%s\n"</span>, priv->undecorate ? <span class='string_literal'>"Undecorating"</span> : <span class='string_literal'>"Decorating"</span>);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> windows = wnck_screen_get_windows (priv->screen);</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>for</span> (w = windows; w; w = w->next)</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> WnckWindow *window = w->data;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>if</span> (!<span class='macro'>WNCK_IS_WINDOW (window)<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(window)); GType __t = ((wnck_window_get_type ())); gboolean __r<br>; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='keyword'>if</span> (no_maximize || priv->no_maximize)</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> <span class='keyword'>if</span> (!wnck_window_is_maximized(window))</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (!is_excluded (app, window))</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> GdkDisplay *gdk_display = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> gdk_x11_display_error_trap_push (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> _window_set_decorations (window, priv->undecorate ? 0 : 1);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> wnck_window_unmaximize (window);</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> wnck_window_maximize (window);</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> gdk_display_flush (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> gdk_x11_display_error_trap_pop_ignored (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> sleep (1);</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='comment'>/* We want the user to be left on the launcher/desktop after switching modes*/</span></td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> g_timeout_add_seconds (1, (GSourceFunc)show_desktop, priv->screen);</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"><span class='comment'>/* GObject stuff */</span></td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line">maximus_app_class_init (MaximusAppClass *klass)</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line">maximus_app_init (MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> WnckScreen *screen;</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> priv = app->priv = maximus_app_get_instance_private (app);</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> priv->bind = maximus_bind_get_default ();</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> was_decorated = g_quark_from_static_string (<span class='string_literal'>"was-decorated"</span>);</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> priv->settings = g_settings_new (<span class='macro'>APP_SCHEMA<span class='macro_popup'>"org.mate.maximus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings, <span class='string_literal'>"changed::"</span> APP_EXCLUDE_CLASS,<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "exclude-class"<br>), (((GCallback) (on_exclude_class_changed))), (app), ((void*<br>)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='macro'>G_CALLBACK (on_exclude_class_changed), app)<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "exclude-class"<br>), (((GCallback) (on_exclude_class_changed))), (app), ((void*<br>)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings, <span class='string_literal'>"changed::"</span> APP_UNDECORATE,<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "undecorate"<br>), (((GCallback) (on_app_undecorate_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='macro'>G_CALLBACK (on_app_undecorate_changed), app)<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "undecorate"<br>), (((GCallback) (on_app_undecorate_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings, <span class='string_literal'>"changed::"</span> APP_NO_MAXIMIZE,<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "no-maximize"<br>), (((GCallback) (on_app_no_maximize_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span class='macro'>G_CALLBACK (on_app_no_maximize_changed), app)<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "no-maximize"<br>), (((GCallback) (on_app_no_maximize_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> priv->exclude_class_list = g_settings_get_strv (priv->settings, <span class='macro'>APP_EXCLUDE_CLASS<span class='macro_popup'>"exclude-class"</span></span>); </td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> priv->undecorate = g_settings_get_boolean (priv->settings, <span class='macro'>APP_UNDECORATE<span class='macro_popup'>"undecorate"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> priv->no_maximize = g_settings_get_boolean (priv->settings, <span class='macro'>APP_NO_MAXIMIZE<span class='macro_popup'>"no-maximize"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> g_print (<span class='string_literal'>"no maximize: %s\n"</span>, priv->no_maximize ? <span class='string_literal'>"true"</span> : <span class='string_literal'>"false"</span>);</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> priv->screen = screen = wnck_screen_get_default ();</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='macro'>g_signal_connect (screen, <span class='string_literal'>"window-opened"</span>,<span class='macro_popup'>g_signal_connect_data ((screen), ("window-opened"), (((GCallback<br>) (on_window_opened))), (app), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_opened), app)<span class='macro_popup'>g_signal_connect_data ((screen), ("window-opened"), (((GCallback<br>) (on_window_opened))), (app), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">MaximusApp *</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line">maximus_app_get_default (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> <span class='keyword'>static</span> MaximusApp *app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> <span class='keyword'>if</span> (!app)</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> app = g_object_new (<span class='macro'>MAXIMUS_TYPE_APP<span class='macro_popup'>(maximus_app_get_type ())</span></span>, </td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='keyword'>return</span> app;</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-37b917.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-37b917.html new file mode 100644 index 0000000..4d6bb25 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-37b917.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 37b917a9e5f613021b48161ade459f5b --> + +<!-- BUGLINE 453 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 453, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"453": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_super);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-4bda9e.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-4bda9e.html new file mode 100644 index 0000000..952b207 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-4bda9e.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 4bda9e58b4bf33c997175cdcfa25449b --> + +<!-- BUGLINE 423 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 423, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"423": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_mod2);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-678a90.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-678a90.html new file mode 100644 index 0000000..40be66b --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-678a90.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 678a90e674052b84eddaedb1c8d2d6ec --> + +<!-- BUGLINE 443 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 443, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"443": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_meta);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-6fb882.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-6fb882.html new file mode 100644 index 0000000..abce720 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-6fb882.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 6fb88298e195f4d3b6a489624de6bb0d --> + +<!-- BUGLINE 403 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 403, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"403": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_release);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-7534c9.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-7534c9.html new file mode 100644 index 0000000..9e3a502 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-7534c9.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 7534c982fb6cb42150c3b19819d76000 --> + +<!-- BUGLINE 418 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 418, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"418": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_mod1);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-85a3e8.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-85a3e8.html new file mode 100644 index 0000000..8d5dc7e --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-85a3e8.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 85a3e8642ffe959f277bcaa67d6dd996 --> + +<!-- BUGLINE 448 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 448, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"448": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_hyper);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-90bf5a.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-90bf5a.html new file mode 100644 index 0000000..2b5fee8 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-90bf5a.html @@ -0,0 +1,1174 @@ +<!doctype html> +<html> +<head> +<title>maximus-bind.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Although the value stored to 'screen' is used in the enclosing expression, the value is never actually read from 'screen' --> + +<!-- BUGTYPE Dead nested assignment --> + +<!-- BUGCATEGORY Unused code --> + +<!-- BUGFILE /rootdir/maximus/maximus-bind.c --> + +<!-- FILENAME maximus-bind.c --> + +<!-- FUNCTIONNAME maximus_bind_init --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT 90bf5a9f693a0235d76532ff85f7cdf2 --> + +<!-- BUGLINE 464 --> + +<!-- BUGCOLUMN 18 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>maximus-bind.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 464, column 18</a><br />Although the value stored to 'screen' is used in the enclosing expression, the value is never actually read from 'screen'</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name maximus-bind.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c maximus-bind.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"464": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Canonical Ltd</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* This program is free software: you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License version 3 as</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* published by the Free Software Foundation.</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* along with this program. If not, see <http://www.gnu.org/licenses/>.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* Authored by Neil Jagdish Patel <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include <gio/gio.h></span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#define WNCK_I_KNOW_THIS_IS_UNSTABLE</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"><span class='directive'>#include <libwnck/libwnck.h></span></td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#include <X11/Xlib.h></span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#include <X11/Xresource.h></span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#include <X11/Xutil.h></span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#include <X11/extensions/XTest.h></span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"><span class='directive'>#include <X11/keysymdef.h></span></td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <X11/keysym.h></span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#include <fakekey/fakekey.h></span></td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#include "maximus-bind.h"</span></td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#include "tomboykeybinder.h"</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#define <span class='macro'>KEY_RELEASE_TIMEOUT<span class='macro_popup'>300</span></span> 300</span></td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#define <span class='macro'>STATE_CHANGED_SLEEP<span class='macro_popup'>0.5</span></span> 0.5</span></td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"><span class='comment'>/* GSettings schemas and keys */</span></td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"><span class='directive'>#define <span class='macro'>BIND_SCHEMA<span class='macro_popup'>"org.mate.maximus"</span></span> "org.mate.maximus"</span></td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"><span class='directive'>#define <span class='macro'>BIND_EXCLUDE_CLASS<span class='macro_popup'>"binding"</span></span> "binding"</span></td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"><span class='directive'>#define <span class='macro'>SYSRULESDIR<span class='macro_popup'>"/usr/local/etc""/maximus"</span></span> <span class='macro'>SYSCONFDIR<span class='macro_popup'>"/usr/local/etc"</span></span>"/maximus"</span></td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"><span class='directive'>#ifdef <span class='macro'>__GNUC__<span class='macro_popup'>4</span></span></span></td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> __attribute__ ((unused))</span></td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#else</span></td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='directive'>#define <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span></span></td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"><span class='directive'>#endif</span></td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"><span class='keyword'>struct</span> _MaximusBindPrivate</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> FakeKey *fk;</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> WnckScreen *screen;</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> gchar *binding;</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> GList *rules;</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> gchar *wm_class;</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> gchar *fullscreen;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> gchar *unfullscreen;</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">} MaximusRule;</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (MaximusBind, maximus_bind, G_TYPE_OBJECT)<span class='macro_popup'>static void maximus_bind_init (MaximusBind *self); static void<br> maximus_bind_class_init (MaximusBindClass *klass); static GType<br> maximus_bind_get_type_once (void); static gpointer maximus_bind_parent_class<br> = ((void*)0); static gint MaximusBind_private_offset; static<br> void maximus_bind_class_intern_init (gpointer klass) { maximus_bind_parent_class<br> = g_type_class_peek_parent (klass); if (MaximusBind_private_offset<br> != 0) g_type_class_adjust_private_offset (klass, &MaximusBind_private_offset<br>); maximus_bind_class_init ((MaximusBindClass*) klass); } __attribute__<br> ((__unused__)) static inline gpointer maximus_bind_get_instance_private<br> (MaximusBind *self) { return (((gpointer) ((guint8*) (self) +<br> (glong) (MaximusBind_private_offset)))); } GType maximus_bind_get_type<br> (void) { static gsize static_g_define_type_id = 0; if ((__extension__<br> ({ _Static_assert (sizeof *(&static_g_define_type_id) ==<br> sizeof (gpointer), "Expression evaluates to false"); (void) (<br>0 ? (gpointer) *(&static_g_define_type_id) : ((void*)0));<br> (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter (&static_g_define_type_id<br>)); }))) { GType g_define_type_id = maximus_bind_get_type_once<br> (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); 0 ?<br> (void) (*(&static_g_define_type_id) = (g_define_type_id)<br>) : (void) 0; g_once_init_leave ((&static_g_define_type_id<br>), (gsize) (g_define_type_id)); })); } return static_g_define_type_id<br>; } __attribute__ ((__noinline__)) static GType maximus_bind_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> (((GType) ((20) << (2))), g_intern_static_string ("MaximusBind"<br>), sizeof (MaximusBindClass), (GClassInitFunc)(void (*)(void)<br>) maximus_bind_class_intern_init, sizeof (MaximusBind), (GInstanceInitFunc<br>)(void (*)(void)) maximus_bind_init, (GTypeFlags) 0); { {{ MaximusBind_private_offset<br> = g_type_add_instance_private (g_define_type_id, sizeof (MaximusBindPrivate<br>)); };} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line">get_fullscreen_keystroke (GList *rules, WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> WnckClassGroup *group;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> <span class='keyword'>const</span> gchar *class_name;</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> GList *r;</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"> group = wnck_window_get_class_group (window);</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> class_name = wnck_class_group_get_name (group);</td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> g_debug (<span class='string_literal'>"Searching rules for %s:\n"</span>, wnck_window_get_name (window));</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>for</span> (r = rules; r; r = r->next)</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> MaximusRule *rule = r->data;</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> g_debug (<span class='string_literal'>"\t%s ?= %s"</span>, class_name, rule->wm_class);</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> <span class='keyword'>if</span> (class_name && rule->wm_class && strstr (class_name, rule->wm_class))</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> g_debug (<span class='string_literal'>"\tYES!\n"</span>);</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> <span class='keyword'>return</span> rule->fullscreen;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> g_debug (<span class='string_literal'>"\tNO!\n"</span>);</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>const</span> gchar *</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">get_unfullscreen_keystroke (GList *rules, WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> WnckClassGroup *group;</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> <span class='keyword'>const</span> gchar *class_name;</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> GList *r;</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> group = wnck_window_get_class_group (window);</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> class_name = wnck_class_group_get_name (group);</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> <span class='keyword'>for</span> (r = rules; r; r = r->next)</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> MaximusRule *rule = r->data;</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> <span class='keyword'>if</span> (class_name && rule->wm_class && strstr (class_name, rule->wm_class))</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> <span class='keyword'>return</span> rule->unfullscreen;</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line">real_fullscreen (MaximusBind *bind)</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> MaximusBindPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> GdkDisplay <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> *display;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> WnckWindow *active;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> <span class='keyword'>const</span> gchar *keystroke;</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> display = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> active = wnck_screen_get_active_window (priv->screen);</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='keyword'>if</span> (!<span class='macro'>WNCK_IS_WINDOW (active)<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(active)); GType __t = ((wnck_window_get_type ())); gboolean __r<br>; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))</span></span></td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> || wnck_window_get_window_type (active) != WNCK_WINDOW_NORMAL)</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> keystroke = get_fullscreen_keystroke (priv->rules, active);</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='keyword'>if</span> (keystroke)</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> guint keysym = 0;</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> EggVirtualModifierType modifiers = 0;</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>if</span> (egg_accelerator_parse_virtual (keystroke, &keysym, &modifiers))</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> guint mods = 0;</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> mods |= FAKEKEYMOD_SHIFT;</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> mods |= FAKEKEYMOD_CONTROL;</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> mods |= FAKEKEYMOD_ALT;</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> mods |= FAKEKEYMOD_META;</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> g_debug (<span class='string_literal'>"Sending fullscreen special event: %s = %d %d"</span>,</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> keystroke, keysym, mods);</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> fakekey_press_keysym (priv->fk, keysym, mods);</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> fakekey_release (priv->fk);</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>if</span> (!wnck_window_is_fullscreen (active))</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> g_debug (<span class='string_literal'>"Sending fullscreen F11 event"</span>);</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> fakekey_press_keysym (priv->fk, <span class='macro'>XK_F11<span class='macro_popup'>0xffc8</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> fakekey_release (priv->fk);</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> sleep (<span class='macro'>STATE_CHANGED_SLEEP<span class='macro_popup'>0.5</span></span>);</td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='keyword'>if</span> (!wnck_window_is_fullscreen (active))</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> g_debug (<span class='string_literal'>"Forcing fullscreen wnck event"</span>);</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> wnck_window_set_fullscreen (active, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line">fullscreen (MaximusBind *bind, WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> MaximusBindPrivate <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> *priv;</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> g_timeout_add (<span class='macro'>KEY_RELEASE_TIMEOUT<span class='macro_popup'>300</span></span>, (GSourceFunc)real_fullscreen, bind);</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line">real_unfullscreen (MaximusBind *bind)</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> MaximusBindPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> GdkDisplay <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> *display;</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> WnckWindow *active;</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>const</span> gchar *keystroke;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> display = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> active = wnck_screen_get_active_window (priv->screen);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>if</span> (!<span class='macro'>WNCK_IS_WINDOW (active)<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(active)); GType __t = ((wnck_window_get_type ())); gboolean __r<br>; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))</span></span></td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> || wnck_window_get_window_type (active) != WNCK_WINDOW_NORMAL)</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> keystroke = get_unfullscreen_keystroke (priv->rules, active);</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (keystroke)</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> guint keysym = 0;</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> EggVirtualModifierType modifiers = 0;</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (egg_accelerator_parse_virtual (keystroke, &keysym, &modifiers))</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> guint mods = 0;</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> mods |= FAKEKEYMOD_SHIFT;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= FAKEKEYMOD_CONTROL;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> mods |= FAKEKEYMOD_ALT;</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (modifiers & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> mods |= FAKEKEYMOD_META;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> g_debug (<span class='string_literal'>"Sending fullscreen special event: %s = %d %d"</span>,</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> keystroke, keysym, mods);</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> fakekey_press_keysym (priv->fk, keysym, mods);</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> fakekey_release (priv->fk);</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_fullscreen (active))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> g_debug (<span class='string_literal'>"Sending un-fullscreen F11 event"</span>);</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> fakekey_press_keysym (priv->fk, <span class='macro'>XK_F11<span class='macro_popup'>0xffc8</span></span>, 0);</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> fakekey_release (priv->fk);</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> sleep (<span class='macro'>STATE_CHANGED_SLEEP<span class='macro_popup'>0.5</span></span>);</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_fullscreen (active))</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> g_debug (<span class='string_literal'>"Forcing un-fullscreen wnck event"</span>);</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> wnck_window_set_fullscreen (active, <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line">unfullscreen (MaximusBind *bind, WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> MaximusBindPrivate <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> *priv;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> g_timeout_add (<span class='macro'>KEY_RELEASE_TIMEOUT<span class='macro_popup'>300</span></span>, (GSourceFunc)real_unfullscreen, bind);</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line">on_binding_activated (gchar *keystring, MaximusBind *bind)</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> MaximusBindPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> WnckWindow *active;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_BIND (bind))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((bind)); GType __t = ((maximus_bind_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_BIND (bind)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> active = wnck_screen_get_active_window (priv->screen);</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> <span class='keyword'>if</span> (wnck_window_get_window_type (active) != WNCK_WINDOW_NORMAL)</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_fullscreen (active))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> unfullscreen (bind, active);</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> fullscreen (bind, active);</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"><span class='comment'>/* Callbacks */</span></td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line">binding_is_valid (<span class='keyword'>const</span> gchar *binding)</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> gboolean retval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> <span class='keyword'>if</span> (!binding || strlen (binding) < 1 || strcmp (binding, <span class='string_literal'>"disabled"</span>) == 0)</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> retval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>return</span> retval;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line">on_binding_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> MaximusBind *bind)</td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> MaximusBindPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_BIND (bind))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((bind)); GType __t = ((maximus_bind_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_BIND (bind)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> <span class='keyword'>if</span> (binding_is_valid (priv->binding))</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> tomboy_keybinder_unbind (priv->binding,</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> (TomboyBindkeyHandler)on_binding_changed);</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> g_free (priv->binding);</td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> priv->binding = g_settings_get_string (settings, <span class='macro'>BIND_EXCLUDE_CLASS<span class='macro_popup'>"binding"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>if</span> (binding_is_valid (priv->binding))</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> tomboy_keybinder_bind (priv->binding,</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> (TomboyBindkeyHandler)on_binding_activated,</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> bind);</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> g_print (<span class='string_literal'>"Binding changed: %s\n"</span>, priv->binding);</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"><span class='comment'>/* GObject stuff */</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line">create_rule (MaximusBind *bind, <span class='keyword'>const</span> gchar *filename)</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"><span class='directive'>#define <span class='macro'>RULE_GROUP<span class='macro_popup'>"Fullscreening"</span></span> "Fullscreening"</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line"><span class='directive'>#define <span class='macro'>RULE_WMCLASS<span class='macro_popup'>"WMClass"</span></span> "WMClass"</span></td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"><span class='directive'>#define <span class='macro'>RULE_FULLSCREEN<span class='macro_popup'>"Fullscreen"</span></span> "Fullscreen"</span></td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"><span class='directive'>#define <span class='macro'>RULE_UNFULLSCREEN<span class='macro_popup'>"Unfullscreen"</span></span> "Unfullscreen"</span></td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> MaximusBindPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> GKeyFile *file;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> GError *error = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> MaximusRule *rule;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> file = g_key_file_new ();</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> g_key_file_load_from_file (file, filename, 0, &error);</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>if</span> (error)</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> g_warning (<span class='string_literal'>"Unable to load %s: %s\n"</span>, filename, error->message);</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> g_error_free (error);</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> g_key_file_free (file);</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> rule = <span class='macro'>g_slice_new0 (MaximusRule)<span class='macro_popup'>(MaximusRule *) (__extension__ ({ gsize __s = sizeof (MaximusRule<br>); gpointer __p; __p = g_slice_alloc (__s); memset (__p, 0, __s<br>); __p; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> rule->wm_class = g_key_file_get_string (file,</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> <span class='macro'>RULE_GROUP<span class='macro_popup'>"Fullscreening"</span></span>, <span class='macro'>RULE_WMCLASS<span class='macro_popup'>"WMClass"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> rule->fullscreen = g_key_file_get_string (file,</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='macro'>RULE_GROUP<span class='macro_popup'>"Fullscreening"</span></span>, <span class='macro'>RULE_FULLSCREEN<span class='macro_popup'>"Fullscreen"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> rule->unfullscreen = g_key_file_get_string (file,</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> <span class='macro'>RULE_GROUP<span class='macro_popup'>"Fullscreening"</span></span>, <span class='macro'>RULE_UNFULLSCREEN<span class='macro_popup'>"Unfullscreen"</span></span>,</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> <span class='keyword'>if</span> (!rule->wm_class || !rule->fullscreen || !rule->unfullscreen)</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> g_free (rule->wm_class);</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> g_free (rule->fullscreen);</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> g_free (rule->unfullscreen);</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='macro'>g_slice_free (MaximusRule, rule)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MaximusRule), (rule)); else<br> (void) ((MaximusRule*) 0 == (rule)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> g_warning (<span class='string_literal'>"Unable to load %s, missing strings"</span>, filename);</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> priv->rules = g_list_append (priv->rules, rule);</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> g_key_file_free (file);</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line">load_rules (MaximusBind *bind, <span class='keyword'>const</span> gchar *path)</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> MaximusBindPrivate <span class='macro'>UNUSED_VARIABLE<span class='macro_popup'>__attribute__ ((unused))</span></span> *priv;</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> GDir *dir;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>const</span> gchar *name;</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> dir = g_dir_open (path, 0, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> <span class='keyword'>if</span> (!dir)</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> <span class='keyword'>while</span> ((name = g_dir_read_name (dir)))</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> gchar *filename;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> filename= g_build_filename (path, name, <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> create_rule (bind, filename);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> g_free (filename);</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> g_dir_close (dir);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line">maximus_bind_finalize (GObject *obj)</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> MaximusBind *bind = <span class='macro'>MAXIMUS_BIND (obj)<span class='macro_popup'>((((MaximusBind*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((obj)), ((maximus_bind_get_type ()))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> MaximusBindPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> GList *r;</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_BIND (bind))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((bind)); GType __t = ((maximus_bind_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_BIND (bind)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> priv = bind->priv;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>for</span> (r = priv->rules; r; r = r->next)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> MaximusRule *rule = r->data;</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> g_free (rule->wm_class);</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> g_free (rule->fullscreen);</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> g_free (rule->unfullscreen);</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> <span class='macro'>g_slice_free (MaximusRule, rule)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MaximusRule), (rule)); else<br> (void) ((MaximusRule*) 0 == (rule)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> g_free (priv->binding);</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> <span class='macro'>G_OBJECT_CLASS (maximus_bind_parent_class)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((maximus_bind_parent_class)), (((GType) ((20) << (2<br>))))))))</span></span>->finalize (obj);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line">maximus_bind_class_init (MaximusBindClass *klass)</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> GObjectClass *obj_class = <span class='macro'>G_OBJECT_CLASS (klass)<span class='macro_popup'>((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass<br>*) ((klass)), (((GType) ((20) << (2))))))))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> obj_class->finalize = maximus_bind_finalize;</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line">maximus_bind_init (MaximusBind *bind)</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> MaximusBindPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> GdkDisplay *display = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> WnckScreen *screen;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> priv = bind->priv = maximus_bind_get_instance_private (bind);</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> priv->fk = fakekey_init (<span class='macro'>GDK_DISPLAY_XDISPLAY (display)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (display))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> priv->screen = screen = <span class="mrange">wnck_screen_get_default ()</span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:18ex; max-width:30em">Although the value stored to 'screen' is used in the enclosing expression, the value is never actually read from 'screen'</div></td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> priv->rules = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> priv->settings = g_settings_new (<span class='macro'>BIND_SCHEMA<span class='macro_popup'>"org.mate.maximus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> tomboy_keybinder_init ();</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings, <span class='string_literal'>"changed::"</span> BIND_EXCLUDE_CLASS,<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "binding"<br>), (((GCallback) (on_binding_changed))), (bind), ((void*)0), (<br>GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>G_CALLBACK (on_binding_changed), bind)<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "binding"<br>), (((GCallback) (on_binding_changed))), (bind), ((void*)0), (<br>GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> priv->binding = g_settings_get_string (priv->settings, <span class='macro'>BIND_EXCLUDE_CLASS<span class='macro_popup'>"binding"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> <span class='keyword'>if</span> (binding_is_valid (priv->binding))</td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> tomboy_keybinder_bind (priv->binding,</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> (TomboyBindkeyHandler)on_binding_activated,</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> bind);</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> load_rules (bind, <span class='macro'>SYSRULESDIR<span class='macro_popup'>"/usr/local/etc""/maximus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line">MaximusBind *</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line">maximus_bind_get_default (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> <span class='keyword'>static</span> MaximusBind *bind = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> <span class='keyword'>if</span> (!bind)</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> bind = g_object_new (<span class='macro'>MAXIMUS_TYPE_BIND<span class='macro_popup'>(maximus_bind_get_type ())</span></span>,</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> <span class='keyword'>return</span> bind;</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-aa2062.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-aa2062.html new file mode 100644 index 0000000..339cb3a --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-aa2062.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT aa206295a9614dd1e1bfd3b5061f70d2 --> + +<!-- BUGLINE 413 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 413, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"413": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_control);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-b10f27.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-b10f27.html new file mode 100644 index 0000000..18421ba --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-b10f27.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT b10f27d4b3991b4db41cc962f3169aa6 --> + +<!-- BUGLINE 433 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 433, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"433": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_mod4);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-c2cf20.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-c2cf20.html new file mode 100644 index 0000000..60ceb5a --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-c2cf20.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT c2cf20e5b4011f390175268d8f118e89 --> + +<!-- BUGLINE 438 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 438, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"438": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_mod5);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-e3bdb1.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-e3bdb1.html new file mode 100644 index 0000000..4d9f83a --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-e3bdb1.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT e3bdb12cf9a5782838a727e511318ee1 --> + +<!-- BUGLINE 457 --> + +<!-- BUGCOLUMN 3 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 457, column 3</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"457": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> strcpy (accelerator + l, text_mod3);</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, keyval_name);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:3ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-e9ff85.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-e9ff85.html new file mode 100644 index 0000000..2def2f8 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-e9ff85.html @@ -0,0 +1,1228 @@ +<!doctype html> +<html> +<head> +<title>maximus-app.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption --> + +<!-- BUGTYPE Cast from non-struct type to struct type --> + +<!-- BUGCATEGORY Logic error --> + +<!-- BUGFILE /rootdir/maximus/maximus-app.c --> + +<!-- FILENAME maximus-app.c --> + +<!-- FUNCTIONNAME gdk_window_set_mwm_hints --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT e9ff85e59bd5500d29b8228afbff6e91 --> + +<!-- BUGLINE 162 --> + +<!-- BUGCOLUMN 13 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>maximus-app.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 162, column 13</a><br />Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name maximus-app.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c maximus-app.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"162": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2008 Canonical Ltd</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* This program is free software: you can redistribute it and/or modify</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* it under the terms of the GNU General Public License version 3 as</span> </td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* published by the Free Software Foundation.</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* This program is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* GNU General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU General Public License</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>* along with this program. If not, see <http://www.gnu.org/licenses/>.</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* Authored by Neil Jagdish Patel <[email protected]></span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include <stdio.h></span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <unistd.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gtk/gtk.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include <gio/gio.h></span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#include "maximus-app.h"</span></td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#include "maximus-bind.h"</span></td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#include "xutils.h"</span></td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"><span class='comment'>/* GSettings schemas and keys */</span></td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"><span class='directive'>#define <span class='macro'>APP_SCHEMA<span class='macro_popup'>"org.mate.maximus"</span></span> "org.mate.maximus"</span></td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"><span class='directive'>#define <span class='macro'>APP_EXCLUDE_CLASS<span class='macro_popup'>"exclude-class"</span></span> "exclude-class"</span></td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>APP_UNDECORATE<span class='macro_popup'>"undecorate"</span></span> "undecorate"</span></td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"><span class='directive'>#define <span class='macro'>APP_NO_MAXIMIZE<span class='macro_popup'>"no-maximize"</span></span> "no-maximize"</span></td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"><span class='comment'>/* A set of default exceptions */</span></td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='keyword'>static</span> gchar *default_exclude_classes[] = </td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"> <span class='string_literal'>"Apport-gtk"</span>,</td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line"> <span class='string_literal'>"Bluetooth-properties"</span>,</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> <span class='string_literal'>"Bluetooth-wizard"</span>,</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> <span class='string_literal'>"Download"</span>, <span class='comment'>/* Firefox Download Window */</span></td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line"> <span class='string_literal'>"Ekiga"</span>,</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> <span class='string_literal'>"Extension"</span>, <span class='comment'>/* Firefox Add-Ons/Extension Window */</span></td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"> <span class='string_literal'>"Gcalctool"</span>,</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> <span class='string_literal'>"Gimp"</span>,</td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"> <span class='string_literal'>"Global"</span>, <span class='comment'>/* Firefox Error Console Window */</span></td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line"> <span class='string_literal'>"Mate-dictionary"</span>,</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line"> <span class='string_literal'>"Mate-language-selector"</span>,</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='string_literal'>"Mate-nettool"</span>,</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> <span class='string_literal'>"Mate-volume-control"</span>,</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> <span class='string_literal'>"Kiten"</span>,</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> <span class='string_literal'>"Kmplot"</span>,</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> <span class='string_literal'>"Nm-editor"</span>,</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line"> <span class='string_literal'>"Pidgin"</span>,</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> <span class='string_literal'>"Polkit-mate-authorization"</span>,</td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"> <span class='string_literal'>"Update-manager"</span>,</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line"> <span class='string_literal'>"Skype"</span>,</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line"> <span class='string_literal'>"Toplevel"</span>, <span class='comment'>/* Firefox "Clear Private Data" Window */</span></td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='string_literal'>"Transmission"</span></td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"><span class='keyword'>struct</span> _MaximusAppPrivate</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line"> MaximusBind *bind;</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> WnckScreen *screen;</td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"> GSettings *settings;</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line"> gchar **exclude_class_list;</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> gboolean undecorate;</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> gboolean no_maximize;</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"><span class='keyword'>static</span> GQuark was_decorated = 0;</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line"><span class='comment'>/* <TAKEN FROM GDK> */</span></td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span> {</td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> flags;</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> functions;</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> decorations;</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>long</span> input_mode;</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> <span class='keyword'>unsigned</span> <span class='keyword'>long</span> status;</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line">} MotifWmHints, MwmHints;</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"><span class='directive'>#define <span class='macro'>MWM_HINTS_FUNCTIONS<span class='macro_popup'>(1L << 0)</span></span> (1L << 0)</span></td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"><span class='directive'>#define <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span> (1L << 1)</span></td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line"><span class='directive'>#define <span class='macro'>_XA_MOTIF_WM_HINTS<span class='macro_popup'>"_MOTIF_WM_HINTS"</span></span> "_MOTIF_WM_HINTS"</span></td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='macro'>G_DEFINE_TYPE_WITH_PRIVATE (MaximusApp, maximus_app, G_TYPE_OBJECT)<span class='macro_popup'>static void maximus_app_init (MaximusApp *self); static void maximus_app_class_init<br> (MaximusAppClass *klass); static GType maximus_app_get_type_once<br> (void); static gpointer maximus_app_parent_class = ((void*)0<br>); static gint MaximusApp_private_offset; static void maximus_app_class_intern_init<br> (gpointer klass) { maximus_app_parent_class = g_type_class_peek_parent<br> (klass); if (MaximusApp_private_offset != 0) g_type_class_adjust_private_offset<br> (klass, &MaximusApp_private_offset); maximus_app_class_init<br> ((MaximusAppClass*) klass); } __attribute__ ((__unused__)) static<br> inline gpointer maximus_app_get_instance_private (MaximusApp<br> *self) { return (((gpointer) ((guint8*) (self) + (glong) (MaximusApp_private_offset<br>)))); } GType maximus_app_get_type (void) { static gsize static_g_define_type_id<br> = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); (void<br>) (0 ? (gpointer) *(&static_g_define_type_id) : ((void*)0<br>)); (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); __typeof__<br> (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__<br> ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id<br>); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)<br>; gapg_temp_newval; })) && g_once_init_enter (&static_g_define_type_id<br>)); }))) { GType g_define_type_id = maximus_app_get_type_once<br> (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id<br>) == sizeof (gpointer), "Expression evaluates to false"); 0 ?<br> (void) (*(&static_g_define_type_id) = (g_define_type_id)<br>) : (void) 0; g_once_init_leave ((&static_g_define_type_id<br>), (gsize) (g_define_type_id)); })); } return static_g_define_type_id<br>; } __attribute__ ((__noinline__)) static GType maximus_app_get_type_once<br> (void) { GType g_define_type_id = g_type_register_static_simple<br> (((GType) ((20) << (2))), g_intern_static_string ("MaximusApp"<br>), sizeof (MaximusAppClass), (GClassInitFunc)(void (*)(void))<br> maximus_app_class_intern_init, sizeof (MaximusApp), (GInstanceInitFunc<br>)(void (*)(void)) maximus_app_init, (GTypeFlags) 0); { {{ MaximusApp_private_offset<br> = g_type_add_instance_private (g_define_type_id, sizeof (MaximusAppPrivate<br>)); };} } return g_define_type_id; }</span></span>;</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line">wnck_window_is_decorated (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> GdkDisplay *display = gdk_display_get_default();</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> Atom hints_atom = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> guchar *data = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> MotifWmHints *hints = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line"> Atom type = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> gint format;</td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"> gulong nitems;</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line"> gulong bytes_after;</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line"> gboolean retval;</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> hints_atom = gdk_x11_get_xatom_by_name_for_display (display, </td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> <span class='macro'>_XA_MOTIF_WM_HINTS<span class='macro_popup'>"_MOTIF_WM_HINTS"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> XGetWindowProperty (<span class='macro'>GDK_DISPLAY_XDISPLAY (display)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (display))</span></span>, </td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line"> wnck_window_get_xid (window),</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> hints_atom, 0, <span class='keyword'>sizeof</span> (MotifWmHints)/<span class='keyword'>sizeof</span> (<span class='keyword'>long</span>),</td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"> <span class='macro'>False<span class='macro_popup'>0</span></span>, <span class='macro'>AnyPropertyType<span class='macro_popup'>0L</span></span>, &type, &format, &nitems,</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line"> &bytes_after, &data);</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>if</span> (type == <span class='macro'>None<span class='macro_popup'>0L</span></span> || !data) <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> hints = (MotifWmHints *)data; </td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> retval = hints->decorations;</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (data)</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> XFree (data);</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line"> <span class='keyword'>return</span> retval;</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">gdk_window_set_mwm_hints (WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> MotifWmHints *new_hints)</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> GdkDisplay *display = gdk_display_get_default();</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> Atom hints_atom = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> guchar *data = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> MotifWmHints *hints = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> Atom type = <span class='macro'>None<span class='macro_popup'>0L</span></span>;</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> gint format;</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> gulong nitems;</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line"> gulong bytes_after;</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_DISPLAY (display))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((display)); GType __t = ((gdk_display_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_DISPLAY (display)"); return; } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> hints_atom = gdk_x11_get_xatom_by_name_for_display (display, </td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> <span class='macro'>_XA_MOTIF_WM_HINTS<span class='macro_popup'>"_MOTIF_WM_HINTS"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> gdk_x11_display_error_trap_push (display);</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> XGetWindowProperty (<span class='macro'>GDK_DISPLAY_XDISPLAY (display)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (display))</span></span>, </td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> wnck_window_get_xid (window),</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line"> hints_atom, 0, <span class='keyword'>sizeof</span> (MotifWmHints)/<span class='keyword'>sizeof</span> (<span class='keyword'>long</span>),</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> <span class='macro'>False<span class='macro_popup'>0</span></span>, <span class='macro'>AnyPropertyType<span class='macro_popup'>0L</span></span>, &type, &format, &nitems,</td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"> &bytes_after, &data);</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>if</span> (gdk_x11_display_error_trap_pop (display))</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>if</span> (type != hints_atom || !data)</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> hints = new_hints;</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> hints = <span class="mrange"><span class="mrange">(MotifWmHints *)data</span></span>;</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:13ex; max-width:31em">Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption</div></td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line"> <span class='keyword'>if</span> (new_hints->flags & <span class='macro'>MWM_HINTS_FUNCTIONS<span class='macro_popup'>(1L << 0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"> hints->flags |= <span class='macro'>MWM_HINTS_FUNCTIONS<span class='macro_popup'>(1L << 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line"> hints->functions = new_hints->functions; </td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>if</span> (new_hints->flags & <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> hints->flags |= <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> hints->decorations = new_hints->decorations;</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line"> _wnck_error_trap_push ();</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> XChangeProperty (<span class='macro'>GDK_DISPLAY_XDISPLAY (display)<span class='macro_popup'>(gdk_x11_display_get_xdisplay (display))</span></span>, </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"> wnck_window_get_xid (window),</td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> hints_atom, hints_atom, 32, <span class='macro'>PropModeReplace<span class='macro_popup'>0</span></span>,</td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> (guchar *)hints, <span class='keyword'>sizeof</span> (MotifWmHints)/<span class='keyword'>sizeof</span> (<span class='keyword'>long</span>));</td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> gdk_display_flush (display);</td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> _wnck_error_trap_pop ();</td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>if</span> (data)</td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> XFree (data);</td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line">_window_set_decorations (WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> GdkWMDecoration decorations)</td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> MotifWmHints *hints;</td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>/* initialize to zero to avoid writing uninitialized data to socket */</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> hints = <span class='macro'>g_slice_new0 (MotifWmHints)<span class='macro_popup'>(MotifWmHints *) (__extension__ ({ gsize __s = sizeof (MotifWmHints<br>); gpointer __p; __p = g_slice_alloc (__s); memset (__p, 0, __s<br>); __p; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> hints->flags = <span class='macro'>MWM_HINTS_DECORATIONS<span class='macro_popup'>(1L << 1)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> hints->decorations = decorations;</td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> gdk_window_set_mwm_hints (window, hints);</td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line"> <span class='macro'>g_slice_free (MotifWmHints, hints)<span class='macro_popup'>do { if (1) g_slice_free1 (sizeof (MotifWmHints), (hints)); else<br> (void) ((MotifWmHints*) 0 == (hints)); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"><span class='comment'>/* </TAKEN FROM GDK> */</span></td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line">window_is_too_large_for_screen (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>static</span> GdkScreen *screen = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> gint x=0, y=0, w=0, h=0;</td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> <span class='keyword'>if</span> (screen == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> screen = gdk_screen_get_default ();</td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> wnck_window_get_geometry (window, &x, &y, &w, &h);</td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> <span class='comment'>/* some wiggle room */</span></td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> <span class='keyword'>return</span> (screen && </td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> (w > (<span class='macro'>WidthOfScreen (gdk_x11_screen_get_xscreen (screen))<span class='macro_popup'>((gdk_x11_screen_get_xscreen (screen))->width)</span></span> + 20) ||</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> h > (<span class='macro'>HeightOfScreen (gdk_x11_screen_get_xscreen (screen))<span class='macro_popup'>((gdk_x11_screen_get_xscreen (screen))->height)</span></span> + 20)));</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line">on_window_maximised_changed (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> <span class='keyword'>if</span> (window_is_too_large_for_screen (window))</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> _window_set_decorations (window, 1);</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> wnck_window_unmaximize (window);</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> _window_set_decorations (window, 0);</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line">enable_window_decorations (WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> _window_set_decorations (window, 1);</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line">on_window_state_changed (WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> WnckWindowState change_mask,</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> WnckWindowState new_state,</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), <span class='string_literal'>"exclude"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((window)), (((GType) ((20) << (2)))<br>))))), "exclude")))</span></span>==1)</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> <span class='keyword'>if</span> (change_mask & WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> || change_mask & WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY)</td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_maximized (window) && app->priv->undecorate)</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> g_idle_add ((GSourceFunc)on_window_maximised_changed, window);</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> g_idle_add ((GSourceFunc)enable_window_decorations, window);</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line">is_excluded (MaximusApp *app, WnckWindow *window)</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> WnckWindowType type;</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> WnckWindowActions actions;</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> gchar *res_name;</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> gchar *class_name;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> gint i;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> <span class='macro'>g_return_val_if_fail (MAXIMUS_IS_APP (app), TRUE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return ((!(0))); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_WINDOW (window), TRUE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return ((!(0))); }<br> } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> type = wnck_window_get_window_type (window);</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> <span class='keyword'>if</span> (type != WNCK_WINDOW_NORMAL)</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> <span class='keyword'>if</span> (<span class='macro'>GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), <span class='string_literal'>"exclude"</span>))<span class='macro_popup'>((gint) (glong) (g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast<br> ((GTypeInstance*) ((window)), (((GType) ((20) << (2)))<br>))))), "exclude")))</span></span>==1)</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> <span class='comment'>/* Ignore if the window is already fullscreen */</span></td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_fullscreen (window))</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> g_debug (<span class='string_literal'>"Excluding (is fullscreen): %s\n"</span>,wnck_window_get_name (window));</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='comment'>/* Make sure the window supports maximising */</span></td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> actions = wnck_window_get_actions (window);</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> <span class='keyword'>if</span> (actions & WNCK_WINDOW_ACTION_RESIZE</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> && actions & WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> && actions & WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> && actions & WNCK_WINDOW_ACTION_MAXIMIZE)</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> ; <span class='comment'>/* Is good to maximise */</span></td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> _wnck_get_wmclass (wnck_window_get_xid (window), &res_name, &class_name);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> g_debug (<span class='string_literal'>"Window opened: res_name=%s -- class_name=%s"</span>, res_name, class_name);</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> <span class='comment'>/* Check internal list of class_ids */</span></td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> <span class='keyword'>for</span> (i = 0; i < <span class='macro'>G_N_ELEMENTS (default_exclude_classes)<span class='macro_popup'>(sizeof (default_exclude_classes) / sizeof ((default_exclude_classes<br>)[0]))</span></span>; i++)</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> <span class='keyword'>if</span> ((class_name && default_exclude_classes[i] </td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> && strstr (class_name, default_exclude_classes[i]))</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> || (res_name && default_exclude_classes[i] && strstr (res_name, </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> default_exclude_classes[i])))</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> g_debug (<span class='string_literal'>"Excluding: %s\n"</span>, wnck_window_get_name (window));</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> } </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> <span class='comment'>/* Check user list */</span></td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"> <span class='keyword'>for</span> (i = 0; priv->exclude_class_list[i] != <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>; i++)</td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='keyword'>if</span> ((class_name && strstr (class_name, priv->exclude_class_list[i]))</td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> || (res_name && strstr (res_name, priv->exclude_class_list[i]) ))</td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> g_debug (<span class='string_literal'>"Excluding: %s\n"</span>, wnck_window_get_name (window));</td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> g_free (res_name);</td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> g_free (class_name);</td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"><span class='keyword'>extern</span> gboolean no_maximize;</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line">on_window_opened (WnckScreen *screen,</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> WnckWindow *window,</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line">{ </td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> WnckWindowType type;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> gint exclude = 0;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> GdkDisplay *gdk_display = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_WINDOW (window))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((window)); GType __t = ((wnck_window_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_WINDOW (window)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> type = wnck_window_get_window_type (window);</td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> <span class='keyword'>if</span> (type != WNCK_WINDOW_NORMAL)</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='comment'>/* Ignore undecorated windows */</span></td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> gdk_x11_display_error_trap_push (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> exclude = wnck_window_is_decorated (window) ? 0 : 1;</td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> <span class='keyword'>if</span> (gdk_x11_display_error_trap_pop (gdk_display))</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_maximized (window))</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> exclude = 0;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> g_object_set_data (<span class='macro'>G_OBJECT (window)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((window)), (((GType) ((20) << (2))))))))</span></span>, <span class='string_literal'>"exclude"</span>, <span class='macro'>GINT_TO_POINTER (exclude)<span class='macro_popup'>((gpointer) (glong) (exclude))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (is_excluded (app, window))</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='macro'>g_signal_connect (window, <span class='string_literal'>"state-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_state_changed), app)<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> <span class='keyword'>if</span> (no_maximize || priv->no_maximize)</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>if</span> (wnck_window_is_maximized(window) && priv->undecorate)</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> _window_set_decorations (window, 0);</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> gdk_display_flush (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='macro'>g_signal_connect (window, <span class='string_literal'>"state-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_state_changed), app)<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> <span class='keyword'>return</span>;</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> <span class='keyword'>if</span> (priv->undecorate)</td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> <span class='comment'>/* Only undecorate right now if the window is smaller than the screen */</span></td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (!window_is_too_large_for_screen (window))</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> _window_set_decorations (window, 0);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> gdk_display_flush (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> wnck_window_maximize (window);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> <span class='macro'>g_signal_connect (window, <span class='string_literal'>"state-changed"</span>,<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_state_changed), app)<span class='macro_popup'>g_signal_connect_data ((window), ("state-changed"), (((GCallback<br>) (on_window_state_changed))), (app), ((void*)0), (GConnectFlags<br>) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"><span class='comment'>/* GSettings Callbacks */</span></td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line">on_app_no_maximize_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> priv->no_maximize = g_settings_get_boolean (settings, key);</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line">on_exclude_class_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> <span class='keyword'>if</span> (priv->exclude_class_list)</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> g_strfreev (priv->exclude_class_list);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> priv->exclude_class_list= g_settings_get_strv (settings, </td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='macro'>APP_EXCLUDE_CLASS<span class='macro_popup'>"exclude-class"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"><span class='keyword'>static</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line">show_desktop (WnckScreen *screen)</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> <span class='macro'>g_return_val_if_fail (WNCK_IS_SCREEN (screen), FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((screen)); GType __t = ((wnck_screen_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "WNCK_IS_SCREEN (screen)"); return ((0)); } } while<br> (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> wnck_screen_toggle_showing_desktop (screen, <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>);</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line">on_app_undecorate_changed (GSettings *settings,</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> gchar *key,</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> GList *windows, *w;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> <span class='macro'>g_return_if_fail (MAXIMUS_IS_APP (app))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((app)); GType __t = ((maximus_app_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "MAXIMUS_IS_APP (app)"); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"> priv = app->priv;</td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line"> <span class='macro'>g_return_if_fail (WNCK_IS_SCREEN (priv->screen))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((priv->screen)); GType __t = ((wnck_screen_get_type ()<br>)); gboolean __r; if (!__inst) __r = (0); else if (__inst-><br>g_class && __inst->g_class->g_type == __t) __r =<br> (!(0)); else __r = g_type_check_instance_is_a (__inst, __t);<br> __r; }))))) _g_boolean_var_ = 1; else _g_boolean_var_ = 0; _g_boolean_var_<br>; }), 1))) { } else { g_return_if_fail_warning (((gchar*) 0),<br> ((const char*) (__func__)), "WNCK_IS_SCREEN (priv->screen)"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> priv->undecorate = g_settings_get_boolean (settings, <span class='macro'>APP_UNDECORATE<span class='macro_popup'>"undecorate"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line"> g_debug (<span class='string_literal'>"%s\n"</span>, priv->undecorate ? <span class='string_literal'>"Undecorating"</span> : <span class='string_literal'>"Decorating"</span>);</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> windows = wnck_screen_get_windows (priv->screen);</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>for</span> (w = windows; w; w = w->next)</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> WnckWindow *window = w->data;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> <span class='keyword'>if</span> (!<span class='macro'>WNCK_IS_WINDOW (window)<span class='macro_popup'>(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (<br>(window)); GType __t = ((wnck_window_get_type ())); gboolean __r<br>; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))</span></span>)</td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='keyword'>if</span> (no_maximize || priv->no_maximize)</td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> <span class='keyword'>if</span> (!wnck_window_is_maximized(window))</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> <span class='keyword'>continue</span>;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (!is_excluded (app, window))</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> GdkDisplay *gdk_display = gdk_display_get_default ();</td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> gdk_x11_display_error_trap_push (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> _window_set_decorations (window, priv->undecorate ? 0 : 1);</td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> wnck_window_unmaximize (window);</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line"> wnck_window_maximize (window);</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> gdk_display_flush (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"> gdk_x11_display_error_trap_pop_ignored (gdk_display);</td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> sleep (1);</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> <span class='comment'>/* We want the user to be left on the launcher/desktop after switching modes*/</span></td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> g_timeout_add_seconds (1, (GSourceFunc)show_desktop, priv->screen);</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"><span class='comment'>/* GObject stuff */</span></td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line">maximus_app_class_init (MaximusAppClass *klass)</td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line">maximus_app_init (MaximusApp *app)</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> MaximusAppPrivate *priv;</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> WnckScreen *screen;</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> priv = app->priv = maximus_app_get_instance_private (app);</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> priv->bind = maximus_bind_get_default ();</td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> was_decorated = g_quark_from_static_string (<span class='string_literal'>"was-decorated"</span>);</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> priv->settings = g_settings_new (<span class='macro'>APP_SCHEMA<span class='macro_popup'>"org.mate.maximus"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings, <span class='string_literal'>"changed::"</span> APP_EXCLUDE_CLASS,<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "exclude-class"<br>), (((GCallback) (on_exclude_class_changed))), (app), ((void*<br>)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> <span class='macro'>G_CALLBACK (on_exclude_class_changed), app)<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "exclude-class"<br>), (((GCallback) (on_exclude_class_changed))), (app), ((void*<br>)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings, <span class='string_literal'>"changed::"</span> APP_UNDECORATE,<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "undecorate"<br>), (((GCallback) (on_app_undecorate_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> <span class='macro'>G_CALLBACK (on_app_undecorate_changed), app)<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "undecorate"<br>), (((GCallback) (on_app_undecorate_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='macro'>g_signal_connect (priv->settings, <span class='string_literal'>"changed::"</span> APP_NO_MAXIMIZE,<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "no-maximize"<br>), (((GCallback) (on_app_no_maximize_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> <span class='macro'>G_CALLBACK (on_app_no_maximize_changed), app)<span class='macro_popup'>g_signal_connect_data ((priv->settings), ("changed::" "no-maximize"<br>), (((GCallback) (on_app_no_maximize_changed))), (app), ((void<br>*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> priv->exclude_class_list = g_settings_get_strv (priv->settings, <span class='macro'>APP_EXCLUDE_CLASS<span class='macro_popup'>"exclude-class"</span></span>); </td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> priv->undecorate = g_settings_get_boolean (priv->settings, <span class='macro'>APP_UNDECORATE<span class='macro_popup'>"undecorate"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> priv->no_maximize = g_settings_get_boolean (priv->settings, <span class='macro'>APP_NO_MAXIMIZE<span class='macro_popup'>"no-maximize"</span></span>);</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> g_print (<span class='string_literal'>"no maximize: %s\n"</span>, priv->no_maximize ? <span class='string_literal'>"true"</span> : <span class='string_literal'>"false"</span>);</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> priv->screen = screen = wnck_screen_get_default ();</td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> <span class='macro'>g_signal_connect (screen, <span class='string_literal'>"window-opened"</span>,<span class='macro_popup'>g_signal_connect_data ((screen), ("window-opened"), (((GCallback<br>) (on_window_opened))), (app), ((void*)0), (GConnectFlags) 0)</span></span></td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> <span class='macro'>G_CALLBACK (on_window_opened), app)<span class='macro_popup'>g_signal_connect_data ((screen), ("window-opened"), (((GCallback<br>) (on_window_opened))), (app), ((void*)0), (GConnectFlags) 0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">MaximusApp *</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line">maximus_app_get_default (<span class='keyword'>void</span>)</td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> <span class='keyword'>static</span> MaximusApp *app = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> <span class='keyword'>if</span> (!app)</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> app = g_object_new (<span class='macro'>MAXIMUS_TYPE_APP<span class='macro_popup'>(maximus_app_get_type ())</span></span>, </td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>);</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='keyword'>return</span> app;</td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/report-faab40.html b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-faab40.html new file mode 100644 index 0000000..e4680a9 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/report-faab40.html @@ -0,0 +1,1336 @@ +<!doctype html> +<html> +<head> +<title>eggaccelerators.c</title> + +<style type="text/css"> +body { color:#000000; background-color:#ffffff } +body { font-family:Helvetica, sans-serif; font-size:10pt } +h1 { font-size:14pt } +.FileName { margin-top: 5px; margin-bottom: 5px; display: inline; } +.FileNav { margin-left: 5px; margin-right: 5px; display: inline; } +.FileNav a { text-decoration:none; font-size: larger; } +.divider { margin-top: 30px; margin-bottom: 30px; height: 15px; } +.divider { background-color: gray; } +.code { border-collapse:collapse; width:100%; } +.code { font-family: "Monospace", monospace; font-size:10pt } +.code { line-height: 1.2em } +.comment { color: green; font-style: oblique } +.keyword { color: blue } +.string_literal { color: red } +.directive { color: darkmagenta } + +/* Macros and variables could have pop-up notes hidden by default. + - Macro pop-up: expansion of the macro + - Variable pop-up: value (table) of the variable */ +.macro_popup, .variable_popup { display: none; } + +/* Pop-up appears on mouse-hover event. */ +.macro:hover .macro_popup, .variable:hover .variable_popup { + display: block; + padding: 2px; + -webkit-border-radius:5px; + -webkit-box-shadow:1px 1px 7px #000; + border-radius:5px; + box-shadow:1px 1px 7px #000; + position: absolute; + top: -1em; + left:10em; + z-index: 1 +} + +.macro_popup { + border: 2px solid red; + background-color:#FFF0F0; + font-weight: normal; +} + +.variable_popup { + border: 2px solid blue; + background-color:#F0F0FF; + font-weight: bold; + font-family: Helvetica, sans-serif; + font-size: 9pt; +} + +/* Pop-up notes needs a relative position as a base where they pops up. */ +.macro, .variable { + background-color: PaleGoldenRod; + position: relative; +} +.macro { color: DarkMagenta; } + +#tooltiphint { + position: fixed; + width: 50em; + margin-left: -25em; + left: 50%; + padding: 10px; + border: 1px solid #b0b0b0; + border-radius: 2px; + box-shadow: 1px 1px 7px black; + background-color: #c0c0c0; + z-index: 2; +} + +.num { width:2.5em; padding-right:2ex; background-color:#eeeeee } +.num { text-align:right; font-size:8pt } +.num { color:#444444 } +.line { padding-left: 1ex; border-left: 3px solid #ccc } +.line { white-space: pre } +.msg { -webkit-box-shadow:1px 1px 7px #000 } +.msg { box-shadow:1px 1px 7px #000 } +.msg { -webkit-border-radius:5px } +.msg { border-radius:5px } +.msg { font-family:Helvetica, sans-serif; font-size:8pt } +.msg { float:left } +.msg { position:relative } +.msg { padding:0.25em 1ex 0.25em 1ex } +.msg { margin-top:10px; margin-bottom:10px } +.msg { font-weight:bold } +.msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap } +.msgT { padding:0x; spacing:0x } +.msgEvent { background-color:#fff8b4; color:#000000 } +.msgControl { background-color:#bbbbbb; color:#000000 } +.msgNote { background-color:#ddeeff; color:#000000 } +.mrange { background-color:#dfddf3 } +.mrange { border-bottom:1px solid #6F9DBE } +.PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; } +.PathIndex { -webkit-border-radius:8px } +.PathIndex { border-radius:8px } +.PathIndexEvent { background-color:#bfba87 } +.PathIndexControl { background-color:#8c8c8c } +.PathIndexPopUp { background-color: #879abc; } +.PathNav a { text-decoration:none; font-size: larger } +.CodeInsertionHint { font-weight: bold; background-color: #10dd10 } +.CodeRemovalHint { background-color:#de1010 } +.CodeRemovalHint { border-bottom:1px solid #6F9DBE } +.msg.selected{ background-color:orange !important; } + +table.simpletable { + padding: 5px; + font-size:12pt; + margin:20px; + border-collapse: collapse; border-spacing: 0px; +} +td.rowname { + text-align: right; + vertical-align: top; + font-weight: bold; + color:#444444; + padding-right:2ex; +} + +/* Hidden text. */ +input.spoilerhider + label { + cursor: pointer; + text-decoration: underline; + display: block; +} +input.spoilerhider { + display: none; +} +input.spoilerhider ~ .spoiler { + overflow: hidden; + margin: 10px auto 0; + height: 0; + opacity: 0; +} +input.spoilerhider:checked + label + .spoiler{ + height: auto; + opacity: 1; +} +</style> +</head> +<body> +<!-- BUGDESC Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 --> + +<!-- BUGTYPE Potential insecure memory buffer bounds restriction in call 'strcpy' --> + +<!-- BUGCATEGORY Security --> + +<!-- BUGFILE /rootdir/maximus/eggaccelerators.c --> + +<!-- FILENAME eggaccelerators.c --> + +<!-- FUNCTIONNAME egg_virtual_accelerator_name --> + +<!-- ISSUEHASHCONTENTOFLINEINCONTEXT faab40761d92f680f6fa644d39c1d389 --> + +<!-- BUGLINE 428 --> + +<!-- BUGCOLUMN 7 --> + +<!-- BUGPATHLENGTH 1 --> + +<!-- BUGMETAEND --> +<!-- REPORTHEADER --> +<h3>Bug Summary</h3> +<table class="simpletable"> +<tr><td class="rowname">File:</td><td>eggaccelerators.c</td></tr> +<tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 428, column 7</a><br />Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</td></tr> + +</table> +<!-- REPORTSUMMARYEXTRA --> +<h3>Annotated Source Code</h3> +<p>Press <a href="#" onclick="toggleHelp(); return false;">'?'</a> + to see keyboard shortcuts</p> +<input type="checkbox" class="spoilerhider" id="showinvocation" /> +<label for="showinvocation" >Show analyzer invocation</label> +<div class="spoiler">clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name eggaccelerators.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/maximus -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -I /usr/include/libwnck-3.0 -I /usr/include/startup-notification-1.0 -I .. -I .. -I ../tidy -D _GNU_SOURCE -D PKGDATADIR="/usr/local/share/mate-maximus" -D DATADIR="/usr/local/share" -D SYSCONFDIR="/usr/local/etc" -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/maximus -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-134752-5499-1 -x c eggaccelerators.c +</div> +<div id='tooltiphint' hidden="true"> + <p>Keyboard shortcuts: </p> + <ul> + <li>Use 'j/k' keys for keyboard navigation</li> + <li>Use 'Shift+S' to show/hide relevant lines</li> + <li>Use '?' to toggle this window</li> + </ul> + <a href="#" onclick="toggleHelp(); return false;">Close</a> +</div> +<script type='text/javascript'> +var relevant_lines = {"1": {"428": 1}}; + +var filterCounterexample = function (hide) { + var tables = document.getElementsByClassName("code"); + for (var t=0; t<tables.length; t++) { + var table = tables[t]; + var file_id = table.getAttribute("data-fileid"); + var lines_in_fid = relevant_lines[file_id]; + if (!lines_in_fid) { + lines_in_fid = {}; + } + var lines = table.getElementsByClassName("codeline"); + for (var i=0; i<lines.length; i++) { + var el = lines[i]; + var lineNo = el.getAttribute("data-linenumber"); + if (!lines_in_fid[lineNo]) { + if (hide) { + el.setAttribute("hidden", ""); + } else { + el.removeAttribute("hidden"); + } + } + } + } +} + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // SHIFT + S + if (event.shiftKey && event.keyCode == 83) { + var checked = document.getElementsByName("showCounterexample")[0].checked; + filterCounterexample(!checked); + document.getElementsByName("showCounterexample")[0].click(); + } else { + return; + } + event.preventDefault(); +}, true); + +document.addEventListener("DOMContentLoaded", function() { + document.querySelector('input[name="showCounterexample"]').onchange= + function (event) { + filterCounterexample(this.checked); + }; +}); +</script> + +<form> + <input type="checkbox" name="showCounterexample" id="showCounterexample" /> + <label for="showCounterexample"> + Show only relevant lines + </label> + <input type="checkbox" name="showArrows" + id="showArrows" style="margin-left: 10px" /> + <label for="showArrows"> + Show control flow arrows + </label> +</form> + +<script type='text/javascript'> +// Return range of numbers from a range [lower, upper). +function range(lower, upper) { + var array = []; + for (var i = lower; i <= upper; ++i) { + array.push(i); + } + return array; +} + +var getRelatedArrowIndices = function(pathId) { + // HTML numeration of events is a bit different than it is in the path. + // Everything is rotated one step to the right, so the last element + // (error diagnostic) has index 0. + if (pathId == 0) { + // arrowIndices has at least 2 elements + pathId = arrowIndices.length - 1; + } + + return range(arrowIndices[pathId], arrowIndices[pathId - 1]); +} + +var highlightArrowsForSelectedEvent = function() { + const selectedNum = findNum(); + const arrowIndicesToHighlight = getRelatedArrowIndices(selectedNum); + arrowIndicesToHighlight.forEach((index) => { + var arrow = document.querySelector("#arrow" + index); + if(arrow) { + classListAdd(arrow, "selected") + } + }); +} + +var getAbsoluteBoundingRect = function(element) { + const relative = element.getBoundingClientRect(); + return { + left: relative.left + window.pageXOffset, + right: relative.right + window.pageXOffset, + top: relative.top + window.pageYOffset, + bottom: relative.bottom + window.pageYOffset, + height: relative.height, + width: relative.width + }; +} + +var drawArrow = function(index) { + // This function is based on the great answer from SO: + // https://stackoverflow.com/a/39575674/11582326 + var start = document.querySelector("#start" + index); + var end = document.querySelector("#end" + index); + var arrow = document.querySelector("#arrow" + index); + + var startRect = getAbsoluteBoundingRect(start); + var endRect = getAbsoluteBoundingRect(end); + + // It is an arrow from a token to itself, no need to visualize it. + if (startRect.top == endRect.top && + startRect.left == endRect.left) + return; + + // Each arrow is a very simple Bézier curve, with two nodes and + // two handles. So, we need to calculate four points in the window: + // * start node + var posStart = { x: 0, y: 0 }; + // * end node + var posEnd = { x: 0, y: 0 }; + // * handle for the start node + var startHandle = { x: 0, y: 0 }; + // * handle for the end node + var endHandle = { x: 0, y: 0 }; + // One can visualize it as follows: + // + // start handle + // / + // X"""_.-""""X + // .' \ + // / start node + // | + // | + // | end node + // \ / + // `->X + // X-' + // \ + // end handle + // + // NOTE: (0, 0) is the top left corner of the window. + + // We have 3 similar, but still different scenarios to cover: + // + // 1. Two tokens on different lines. + // -xxx + // / + // \ + // -> xxx + // In this situation, we draw arrow on the left curving to the left. + // 2. Two tokens on the same line, and the destination is on the right. + // ____ + // / \ + // / V + // xxx xxx + // In this situation, we draw arrow above curving upwards. + // 3. Two tokens on the same line, and the destination is on the left. + // xxx xxx + // ^ / + // \____/ + // In this situation, we draw arrow below curving downwards. + const onDifferentLines = startRect.top <= endRect.top - 5 || + startRect.top >= endRect.top + 5; + const leftToRight = startRect.left < endRect.left; + + // NOTE: various magic constants are chosen empirically for + // better positioning and look + if (onDifferentLines) { + // Case #1 + const topToBottom = startRect.top < endRect.top; + posStart.x = startRect.left - 1; + // We don't want to start it at the top left corner of the token, + // it doesn't feel like this is where the arrow comes from. + // For this reason, we start it in the middle of the left side + // of the token. + posStart.y = startRect.top + startRect.height / 2; + + // End node has arrow head and we give it a bit more space. + posEnd.x = endRect.left - 4; + posEnd.y = endRect.top; + + // Utility object with x and y offsets for handles. + var curvature = { + // We want bottom-to-top arrow to curve a bit more, so it doesn't + // overlap much with top-to-bottom curves (much more frequent). + x: topToBottom ? 15 : 25, + y: Math.min((posEnd.y - posStart.y) / 3, 10) + } + + // When destination is on the different line, we can make a + // curvier arrow because we have space for it. + // So, instead of using + // + // startHandle.x = posStart.x - curvature.x + // endHandle.x = posEnd.x - curvature.x + // + // We use the leftmost of these two values for both handles. + startHandle.x = Math.min(posStart.x, posEnd.x) - curvature.x; + endHandle.x = startHandle.x; + + // Curving downwards from the start node... + startHandle.y = posStart.y + curvature.y; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else if (leftToRight) { + // Case #2 + // Starting from the top right corner... + posStart.x = startRect.right - 1; + posStart.y = startRect.top; + + // ...and ending at the top left corner of the end token. + posEnd.x = endRect.left + 1; + posEnd.y = endRect.top - 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posEnd.x - posStart.x) / 3, 15), + y: 5 + } + + // Curving to the right... + startHandle.x = posStart.x + curvature.x; + // ... and upwards from the start node. + startHandle.y = posStart.y - curvature.y; + + // And to the left... + endHandle.x = posEnd.x - curvature.x; + // ... and upwards from the end node. + endHandle.y = posEnd.y - curvature.y; + + } else { + // Case #3 + // Starting from the bottom right corner... + posStart.x = startRect.right; + posStart.y = startRect.bottom; + + // ...and ending also at the bottom right corner, but of the end token. + posEnd.x = endRect.right - 1; + posEnd.y = endRect.bottom + 1; + + // Utility object with x and y offsets for handles. + var curvature = { + x: Math.min((posStart.x - posEnd.x) / 3, 15), + y: 5 + } + + // Curving to the left... + startHandle.x = posStart.x - curvature.x; + // ... and downwards from the start node. + startHandle.y = posStart.y + curvature.y; + + // And to the right... + endHandle.x = posEnd.x + curvature.x; + // ... and downwards from the end node. + endHandle.y = posEnd.y + curvature.y; + } + + // Put it all together into a path. + // More information on the format: + // https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths + var pathStr = "M" + posStart.x + "," + posStart.y + " " + + "C" + startHandle.x + "," + startHandle.y + " " + + endHandle.x + "," + endHandle.y + " " + + posEnd.x + "," + posEnd.y; + + arrow.setAttribute("d", pathStr); +}; + +var drawArrows = function() { + const numOfArrows = document.querySelectorAll("path[id^=arrow]").length; + for (var i = 0; i < numOfArrows; ++i) { + drawArrow(i); + } +} + +var toggleArrows = function(event) { + const arrows = document.querySelector("#arrows"); + if (event.target.checked) { + arrows.setAttribute("visibility", "visible"); + } else { + arrows.setAttribute("visibility", "hidden"); + } +} + +window.addEventListener("resize", drawArrows); +document.addEventListener("DOMContentLoaded", function() { + // Whenever we show invocation, locations change, i.e. we + // need to redraw arrows. + document + .querySelector('input[id="showinvocation"]') + .addEventListener("click", drawArrows); + // Hiding irrelevant lines also should cause arrow rerender. + document + .querySelector('input[name="showCounterexample"]') + .addEventListener("change", drawArrows); + document + .querySelector('input[name="showArrows"]') + .addEventListener("change", toggleArrows); + drawArrows(); + // Default highlighting for the last event. + highlightArrowsForSelectedEvent(); +}); +</script> + +<script type='text/javascript'> +var digitMatcher = new RegExp("[0-9]+"); + +var querySelectorAllArray = function(selector) { + return Array.prototype.slice.call( + document.querySelectorAll(selector)); +} + +document.addEventListener("DOMContentLoaded", function() { + querySelectorAllArray(".PathNav > a").forEach( + function(currentValue, currentIndex) { + var hrefValue = currentValue.getAttribute("href"); + currentValue.onclick = function() { + scrollTo(document.querySelector(hrefValue)); + return false; + }; + }); +}); + +var findNum = function() { + var s = document.querySelector(".msg.selected"); + if (!s || s.id == "EndPath") { + return 0; + } + var out = parseInt(digitMatcher.exec(s.id)[0]); + return out; +}; + +var classListAdd = function(el, theClass) { + if(!el.className.baseVal) + el.className += " " + theClass; + else + el.className.baseVal += " " + theClass; +}; + +var classListRemove = function(el, theClass) { + var className = (!el.className.baseVal) ? + el.className : el.className.baseVal; + className = className.replace(" " + theClass, ""); + if(!el.className.baseVal) + el.className = className; + else + el.className.baseVal = className; +}; + +var scrollTo = function(el) { + querySelectorAllArray(".selected").forEach(function(s) { + classListRemove(s, "selected"); + }); + classListAdd(el, "selected"); + window.scrollBy(0, el.getBoundingClientRect().top - + (window.innerHeight / 2)); + highlightArrowsForSelectedEvent(); +}; + +var move = function(num, up, numItems) { + if (num == 1 && up || num == numItems - 1 && !up) { + return 0; + } else if (num == 0 && up) { + return numItems - 1; + } else if (num == 0 && !up) { + return 1 % numItems; + } + return up ? num - 1 : num + 1; +} + +var numToId = function(num) { + if (num == 0) { + return document.getElementById("EndPath") + } + return document.getElementById("Path" + num); +}; + +var navigateTo = function(up) { + var numItems = document.querySelectorAll( + ".line > .msgEvent, .line > .msgControl").length; + var currentSelected = findNum(); + var newSelected = move(currentSelected, up, numItems); + var newEl = numToId(newSelected, numItems); + + // Scroll element into center. + scrollTo(newEl); +}; + +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + // key 'j' + if (event.keyCode == 74) { + navigateTo(/*up=*/false); + // key 'k' + } else if (event.keyCode == 75) { + navigateTo(/*up=*/true); + } else { + return; + } + event.preventDefault(); +}, true); +</script> + +<script type='text/javascript'> + +var toggleHelp = function() { + var hint = document.querySelector("#tooltiphint"); + var attributeName = "hidden"; + if (hint.hasAttribute(attributeName)) { + hint.removeAttribute(attributeName); + } else { + hint.setAttribute("hidden", "true"); + } +}; +window.addEventListener("keydown", function (event) { + if (event.defaultPrevented) { + return; + } + if (event.key == "?") { + toggleHelp(); + } else { + return; + } + event.preventDefault(); +}); +</script> + +<style type="text/css"> + svg { + position:absolute; + top:0; + left:0; + height:100%; + width:100%; + pointer-events: none; + overflow: visible + } + .arrow { + stroke-opacity: 0.2; + stroke-width: 1; + marker-end: url(#arrowhead); + } + + .arrow.selected { + stroke-opacity: 0.6; + stroke-width: 2; + marker-end: url(#arrowheadSelected); + } + + .arrowhead { + orient: auto; + stroke: none; + opacity: 0.6; + fill: blue; + } +</style> +<svg xmlns="http://www.w3.org/2000/svg"> + <defs> + <marker id="arrowheadSelected" class="arrowhead" opacity="0.6" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + <marker id="arrowhead" class="arrowhead" opacity="0.2" + viewBox="0 0 10 10" refX="3" refY="5" + markerWidth="4" markerHeight="4"> + <path d="M 0 0 L 10 5 L 0 10 z" /> + </marker> + </defs> + <g id="arrows" fill="none" stroke="blue" visibility="hidden"> + + </g> +</svg> +<script type='text/javascript'> +const arrowIndices = [ 0,0 ] +</script> +<table class="code" data-fileid="1"> +<tr class="codeline" data-linenumber="1"><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/* eggaccelerators.c</span></td></tr> +<tr class="codeline" data-linenumber="2"><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="3"><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Copyright (C) 2012-2021 MATE Developers</span></td></tr> +<tr class="codeline" data-linenumber="4"><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>* Developed by Havoc Pennington, Tim Janik</span></td></tr> +<tr class="codeline" data-linenumber="5"><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="6"><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* This library is free software; you can redistribute it and/or</span></td></tr> +<tr class="codeline" data-linenumber="7"><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>* modify it under the terms of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="8"><td class="num" id="LN8">8</td><td class="line"> <span class='comment'>* License as published by the Free Software Foundation; either</span></td></tr> +<tr class="codeline" data-linenumber="9"><td class="num" id="LN9">9</td><td class="line"> <span class='comment'>* version 2 of the License, or (at your option) any later version.</span></td></tr> +<tr class="codeline" data-linenumber="10"><td class="num" id="LN10">10</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="11"><td class="num" id="LN11">11</td><td class="line"> <span class='comment'>* This library is distributed in the hope that it will be useful,</span></td></tr> +<tr class="codeline" data-linenumber="12"><td class="num" id="LN12">12</td><td class="line"> <span class='comment'>* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></td></tr> +<tr class="codeline" data-linenumber="13"><td class="num" id="LN13">13</td><td class="line"> <span class='comment'>* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></td></tr> +<tr class="codeline" data-linenumber="14"><td class="num" id="LN14">14</td><td class="line"> <span class='comment'>* Library General Public License for more details.</span></td></tr> +<tr class="codeline" data-linenumber="15"><td class="num" id="LN15">15</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="16"><td class="num" id="LN16">16</td><td class="line"> <span class='comment'>* You should have received a copy of the GNU Library General Public</span></td></tr> +<tr class="codeline" data-linenumber="17"><td class="num" id="LN17">17</td><td class="line"> <span class='comment'>* License along with this library; if not, write to the</span></td></tr> +<tr class="codeline" data-linenumber="18"><td class="num" id="LN18">18</td><td class="line"> <span class='comment'>* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA</span> </td></tr> +<tr class="codeline" data-linenumber="19"><td class="num" id="LN19">19</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="20"><td class="num" id="LN20">20</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="21"><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "eggaccelerators.h"</span></td></tr> +<tr class="codeline" data-linenumber="22"><td class="num" id="LN22">22</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="23"><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include <string.h></span></td></tr> +<tr class="codeline" data-linenumber="24"><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include <gdk/gdkx.h></span></td></tr> +<tr class="codeline" data-linenumber="25"><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include <gdk/gdkkeysyms.h></span></td></tr> +<tr class="codeline" data-linenumber="26"><td class="num" id="LN26">26</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="27"><td class="num" id="LN27">27</td><td class="line"><span class='keyword'>enum</span></td></tr> +<tr class="codeline" data-linenumber="28"><td class="num" id="LN28">28</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="29"><td class="num" id="LN29">29</td><td class="line"> EGG_MODMAP_ENTRY_SHIFT = 0,</td></tr> +<tr class="codeline" data-linenumber="30"><td class="num" id="LN30">30</td><td class="line"> EGG_MODMAP_ENTRY_LOCK = 1,</td></tr> +<tr class="codeline" data-linenumber="31"><td class="num" id="LN31">31</td><td class="line"> EGG_MODMAP_ENTRY_CONTROL = 2,</td></tr> +<tr class="codeline" data-linenumber="32"><td class="num" id="LN32">32</td><td class="line"> EGG_MODMAP_ENTRY_MOD1 = 3,</td></tr> +<tr class="codeline" data-linenumber="33"><td class="num" id="LN33">33</td><td class="line"> EGG_MODMAP_ENTRY_MOD2 = 4,</td></tr> +<tr class="codeline" data-linenumber="34"><td class="num" id="LN34">34</td><td class="line"> EGG_MODMAP_ENTRY_MOD3 = 5,</td></tr> +<tr class="codeline" data-linenumber="35"><td class="num" id="LN35">35</td><td class="line"> EGG_MODMAP_ENTRY_MOD4 = 6,</td></tr> +<tr class="codeline" data-linenumber="36"><td class="num" id="LN36">36</td><td class="line"> EGG_MODMAP_ENTRY_MOD5 = 7,</td></tr> +<tr class="codeline" data-linenumber="37"><td class="num" id="LN37">37</td><td class="line"> EGG_MODMAP_ENTRY_LAST = 8</td></tr> +<tr class="codeline" data-linenumber="38"><td class="num" id="LN38">38</td><td class="line">};</td></tr> +<tr class="codeline" data-linenumber="39"><td class="num" id="LN39">39</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="40"><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#define <span class='macro'>MODMAP_ENTRY_TO_MODIFIER(x)<span class='macro_popup'>(1 << (x))</span></span> (1 << (x))</span></td></tr> +<tr class="codeline" data-linenumber="41"><td class="num" id="LN41">41</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="42"><td class="num" id="LN42">42</td><td class="line"><span class='keyword'>typedef</span> <span class='keyword'>struct</span></td></tr> +<tr class="codeline" data-linenumber="43"><td class="num" id="LN43">43</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="44"><td class="num" id="LN44">44</td><td class="line"> EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];</td></tr> +<tr class="codeline" data-linenumber="45"><td class="num" id="LN45">45</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="46"><td class="num" id="LN46">46</td><td class="line">} EggModmap;</td></tr> +<tr class="codeline" data-linenumber="47"><td class="num" id="LN47">47</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="48"><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>const</span> EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);</td></tr> +<tr class="codeline" data-linenumber="49"><td class="num" id="LN49">49</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="50"><td class="num" id="LN50">50</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="51"><td class="num" id="LN51">51</td><td class="line">is_alt (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="52"><td class="num" id="LN52">52</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="53"><td class="num" id="LN53">53</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="54"><td class="num" id="LN54">54</td><td class="line"> (string[1] == 'a' || string[1] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="55"><td class="num" id="LN55">55</td><td class="line"> (string[2] == 'l' || string[2] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="56"><td class="num" id="LN56">56</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="57"><td class="num" id="LN57">57</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="58"><td class="num" id="LN58">58</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="59"><td class="num" id="LN59">59</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="60"><td class="num" id="LN60">60</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="61"><td class="num" id="LN61">61</td><td class="line">is_ctl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="62"><td class="num" id="LN62">62</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="63"><td class="num" id="LN63">63</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="64"><td class="num" id="LN64">64</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="65"><td class="num" id="LN65">65</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="66"><td class="num" id="LN66">66</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="67"><td class="num" id="LN67">67</td><td class="line"> (string[4] == '>'));</td></tr> +<tr class="codeline" data-linenumber="68"><td class="num" id="LN68">68</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="69"><td class="num" id="LN69">69</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="70"><td class="num" id="LN70">70</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="71"><td class="num" id="LN71">71</td><td class="line">is_modx (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="72"><td class="num" id="LN72">72</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="73"><td class="num" id="LN73">73</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="74"><td class="num" id="LN74">74</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="75"><td class="num" id="LN75">75</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="76"><td class="num" id="LN76">76</td><td class="line"> (string[3] == 'd' || string[3] == 'D') &&</td></tr> +<tr class="codeline" data-linenumber="77"><td class="num" id="LN77">77</td><td class="line"> (string[4] >= '1' && string[4] <= '5') &&</td></tr> +<tr class="codeline" data-linenumber="78"><td class="num" id="LN78">78</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="79"><td class="num" id="LN79">79</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="80"><td class="num" id="LN80">80</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="81"><td class="num" id="LN81">81</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="82"><td class="num" id="LN82">82</td><td class="line">is_ctrl (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="83"><td class="num" id="LN83">83</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="84"><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="85"><td class="num" id="LN85">85</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="86"><td class="num" id="LN86">86</td><td class="line"> (string[2] == 't' || string[2] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="87"><td class="num" id="LN87">87</td><td class="line"> (string[3] == 'r' || string[3] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="88"><td class="num" id="LN88">88</td><td class="line"> (string[4] == 'l' || string[4] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="89"><td class="num" id="LN89">89</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="90"><td class="num" id="LN90">90</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="91"><td class="num" id="LN91">91</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="92"><td class="num" id="LN92">92</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="93"><td class="num" id="LN93">93</td><td class="line">is_shft (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="94"><td class="num" id="LN94">94</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="95"><td class="num" id="LN95">95</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="96"><td class="num" id="LN96">96</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="97"><td class="num" id="LN97">97</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="98"><td class="num" id="LN98">98</td><td class="line"> (string[3] == 'f' || string[3] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="99"><td class="num" id="LN99">99</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="100"><td class="num" id="LN100">100</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="101"><td class="num" id="LN101">101</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="102"><td class="num" id="LN102">102</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="103"><td class="num" id="LN103">103</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="104"><td class="num" id="LN104">104</td><td class="line">is_shift (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="105"><td class="num" id="LN105">105</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="106"><td class="num" id="LN106">106</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="107"><td class="num" id="LN107">107</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="108"><td class="num" id="LN108">108</td><td class="line"> (string[2] == 'h' || string[2] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="109"><td class="num" id="LN109">109</td><td class="line"> (string[3] == 'i' || string[3] == 'I') &&</td></tr> +<tr class="codeline" data-linenumber="110"><td class="num" id="LN110">110</td><td class="line"> (string[4] == 'f' || string[4] == 'F') &&</td></tr> +<tr class="codeline" data-linenumber="111"><td class="num" id="LN111">111</td><td class="line"> (string[5] == 't' || string[5] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="112"><td class="num" id="LN112">112</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="113"><td class="num" id="LN113">113</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="114"><td class="num" id="LN114">114</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="115"><td class="num" id="LN115">115</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="116"><td class="num" id="LN116">116</td><td class="line">is_control (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="117"><td class="num" id="LN117">117</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="118"><td class="num" id="LN118">118</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="119"><td class="num" id="LN119">119</td><td class="line"> (string[1] == 'c' || string[1] == 'C') &&</td></tr> +<tr class="codeline" data-linenumber="120"><td class="num" id="LN120">120</td><td class="line"> (string[2] == 'o' || string[2] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="121"><td class="num" id="LN121">121</td><td class="line"> (string[3] == 'n' || string[3] == 'N') &&</td></tr> +<tr class="codeline" data-linenumber="122"><td class="num" id="LN122">122</td><td class="line"> (string[4] == 't' || string[4] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="123"><td class="num" id="LN123">123</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="124"><td class="num" id="LN124">124</td><td class="line"> (string[6] == 'o' || string[6] == 'O') &&</td></tr> +<tr class="codeline" data-linenumber="125"><td class="num" id="LN125">125</td><td class="line"> (string[7] == 'l' || string[7] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="126"><td class="num" id="LN126">126</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="127"><td class="num" id="LN127">127</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="128"><td class="num" id="LN128">128</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="129"><td class="num" id="LN129">129</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="130"><td class="num" id="LN130">130</td><td class="line">is_release (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="131"><td class="num" id="LN131">131</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="132"><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="133"><td class="num" id="LN133">133</td><td class="line"> (string[1] == 'r' || string[1] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="134"><td class="num" id="LN134">134</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="135"><td class="num" id="LN135">135</td><td class="line"> (string[3] == 'l' || string[3] == 'L') &&</td></tr> +<tr class="codeline" data-linenumber="136"><td class="num" id="LN136">136</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="137"><td class="num" id="LN137">137</td><td class="line"> (string[5] == 'a' || string[5] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="138"><td class="num" id="LN138">138</td><td class="line"> (string[6] == 's' || string[6] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="139"><td class="num" id="LN139">139</td><td class="line"> (string[7] == 'e' || string[7] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="140"><td class="num" id="LN140">140</td><td class="line"> (string[8] == '>'));</td></tr> +<tr class="codeline" data-linenumber="141"><td class="num" id="LN141">141</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="142"><td class="num" id="LN142">142</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="143"><td class="num" id="LN143">143</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="144"><td class="num" id="LN144">144</td><td class="line">is_meta (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="145"><td class="num" id="LN145">145</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="146"><td class="num" id="LN146">146</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="147"><td class="num" id="LN147">147</td><td class="line"> (string[1] == 'm' || string[1] == 'M') &&</td></tr> +<tr class="codeline" data-linenumber="148"><td class="num" id="LN148">148</td><td class="line"> (string[2] == 'e' || string[2] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="149"><td class="num" id="LN149">149</td><td class="line"> (string[3] == 't' || string[3] == 'T') &&</td></tr> +<tr class="codeline" data-linenumber="150"><td class="num" id="LN150">150</td><td class="line"> (string[4] == 'a' || string[4] == 'A') &&</td></tr> +<tr class="codeline" data-linenumber="151"><td class="num" id="LN151">151</td><td class="line"> (string[5] == '>'));</td></tr> +<tr class="codeline" data-linenumber="152"><td class="num" id="LN152">152</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="153"><td class="num" id="LN153">153</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="154"><td class="num" id="LN154">154</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="155"><td class="num" id="LN155">155</td><td class="line">is_super (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="156"><td class="num" id="LN156">156</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="157"><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="158"><td class="num" id="LN158">158</td><td class="line"> (string[1] == 's' || string[1] == 'S') &&</td></tr> +<tr class="codeline" data-linenumber="159"><td class="num" id="LN159">159</td><td class="line"> (string[2] == 'u' || string[2] == 'U') &&</td></tr> +<tr class="codeline" data-linenumber="160"><td class="num" id="LN160">160</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="161"><td class="num" id="LN161">161</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="162"><td class="num" id="LN162">162</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="163"><td class="num" id="LN163">163</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="164"><td class="num" id="LN164">164</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="165"><td class="num" id="LN165">165</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="166"><td class="num" id="LN166">166</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>inline</span> gboolean</td></tr> +<tr class="codeline" data-linenumber="167"><td class="num" id="LN167">167</td><td class="line">is_hyper (<span class='keyword'>const</span> gchar *string)</td></tr> +<tr class="codeline" data-linenumber="168"><td class="num" id="LN168">168</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="169"><td class="num" id="LN169">169</td><td class="line"> <span class='keyword'>return</span> ((string[0] == '<') &&</td></tr> +<tr class="codeline" data-linenumber="170"><td class="num" id="LN170">170</td><td class="line"> (string[1] == 'h' || string[1] == 'H') &&</td></tr> +<tr class="codeline" data-linenumber="171"><td class="num" id="LN171">171</td><td class="line"> (string[2] == 'y' || string[2] == 'Y') &&</td></tr> +<tr class="codeline" data-linenumber="172"><td class="num" id="LN172">172</td><td class="line"> (string[3] == 'p' || string[3] == 'P') &&</td></tr> +<tr class="codeline" data-linenumber="173"><td class="num" id="LN173">173</td><td class="line"> (string[4] == 'e' || string[4] == 'E') &&</td></tr> +<tr class="codeline" data-linenumber="174"><td class="num" id="LN174">174</td><td class="line"> (string[5] == 'r' || string[5] == 'R') &&</td></tr> +<tr class="codeline" data-linenumber="175"><td class="num" id="LN175">175</td><td class="line"> (string[6] == '>'));</td></tr> +<tr class="codeline" data-linenumber="176"><td class="num" id="LN176">176</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="177"><td class="num" id="LN177">177</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="178"><td class="num" id="LN178">178</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="179"><td class="num" id="LN179">179</td><td class="line"> <span class='comment'>* egg_accelerator_parse_virtual:</span></td></tr> +<tr class="codeline" data-linenumber="180"><td class="num" id="LN180">180</td><td class="line"> <span class='comment'>* @accelerator: string representing an accelerator</span></td></tr> +<tr class="codeline" data-linenumber="181"><td class="num" id="LN181">181</td><td class="line"> <span class='comment'>* @accelerator_key: return location for accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="182"><td class="num" id="LN182">182</td><td class="line"> <span class='comment'>* @accelerator_mods: return location for accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="183"><td class="num" id="LN183">183</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="184"><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>* Parses a string representing a virtual accelerator. The format</span></td></tr> +<tr class="codeline" data-linenumber="185"><td class="num" id="LN185">185</td><td class="line"> <span class='comment'>* looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or</span></td></tr> +<tr class="codeline" data-linenumber="186"><td class="num" id="LN186">186</td><td class="line"> <span class='comment'>* "&lt;Release&gt;z" (the last one is for key release). The parser</span></td></tr> +<tr class="codeline" data-linenumber="187"><td class="num" id="LN187">187</td><td class="line"> <span class='comment'>* is fairly liberal and allows lower or upper case, and also</span></td></tr> +<tr class="codeline" data-linenumber="188"><td class="num" id="LN188">188</td><td class="line"> <span class='comment'>* abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".</span></td></tr> +<tr class="codeline" data-linenumber="189"><td class="num" id="LN189">189</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="190"><td class="num" id="LN190">190</td><td class="line"> <span class='comment'>* If the parse fails, @accelerator_key and @accelerator_mods will</span></td></tr> +<tr class="codeline" data-linenumber="191"><td class="num" id="LN191">191</td><td class="line"> <span class='comment'>* be set to 0 (zero) and %FALSE will be returned. If the string contains</span></td></tr> +<tr class="codeline" data-linenumber="192"><td class="num" id="LN192">192</td><td class="line"> <span class='comment'>* only modifiers, @accelerator_key will be set to 0 but %TRUE will be</span></td></tr> +<tr class="codeline" data-linenumber="193"><td class="num" id="LN193">193</td><td class="line"> <span class='comment'>* returned.</span></td></tr> +<tr class="codeline" data-linenumber="194"><td class="num" id="LN194">194</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="195"><td class="num" id="LN195">195</td><td class="line"> <span class='comment'>* The virtual vs. concrete accelerator distinction is a relic of</span></td></tr> +<tr class="codeline" data-linenumber="196"><td class="num" id="LN196">196</td><td class="line"> <span class='comment'>* how the X Window System works; there are modifiers Mod2-Mod5 that</span></td></tr> +<tr class="codeline" data-linenumber="197"><td class="num" id="LN197">197</td><td class="line"> <span class='comment'>* can represent various keyboard keys (numlock, meta, hyper, etc.),</span></td></tr> +<tr class="codeline" data-linenumber="198"><td class="num" id="LN198">198</td><td class="line"> <span class='comment'>* the virtual modifier represents the keyboard key, the concrete</span></td></tr> +<tr class="codeline" data-linenumber="199"><td class="num" id="LN199">199</td><td class="line"> <span class='comment'>* modifier the actual Mod2-Mod5 bits in the key press event.</span></td></tr> +<tr class="codeline" data-linenumber="200"><td class="num" id="LN200">200</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="201"><td class="num" id="LN201">201</td><td class="line"> <span class='comment'>* Returns: %TRUE on success.</span></td></tr> +<tr class="codeline" data-linenumber="202"><td class="num" id="LN202">202</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="203"><td class="num" id="LN203">203</td><td class="line">gboolean</td></tr> +<tr class="codeline" data-linenumber="204"><td class="num" id="LN204">204</td><td class="line">egg_accelerator_parse_virtual (<span class='keyword'>const</span> gchar *accelerator,</td></tr> +<tr class="codeline" data-linenumber="205"><td class="num" id="LN205">205</td><td class="line"> guint *accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="206"><td class="num" id="LN206">206</td><td class="line"> EggVirtualModifierType *accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="207"><td class="num" id="LN207">207</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="208"><td class="num" id="LN208">208</td><td class="line"> guint keyval;</td></tr> +<tr class="codeline" data-linenumber="209"><td class="num" id="LN209">209</td><td class="line"> GdkModifierType mods;</td></tr> +<tr class="codeline" data-linenumber="210"><td class="num" id="LN210">210</td><td class="line"> gint len;</td></tr> +<tr class="codeline" data-linenumber="211"><td class="num" id="LN211">211</td><td class="line"> gboolean bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="212"><td class="num" id="LN212">212</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="213"><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="214"><td class="num" id="LN214">214</td><td class="line"> *accelerator_key = 0;</td></tr> +<tr class="codeline" data-linenumber="215"><td class="num" id="LN215">215</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="216"><td class="num" id="LN216">216</td><td class="line"> *accelerator_mods = 0;</td></tr> +<tr class="codeline" data-linenumber="217"><td class="num" id="LN217">217</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="218"><td class="num" id="LN218">218</td><td class="line"> <span class='macro'>g_return_val_if_fail (accelerator != NULL, FALSE)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (accelerator != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "accelerator != NULL"<br>); return ((0)); } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="219"><td class="num" id="LN219">219</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="220"><td class="num" id="LN220">220</td><td class="line"> bad_keyval = <span class='macro'>FALSE<span class='macro_popup'>(0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="221"><td class="num" id="LN221">221</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="222"><td class="num" id="LN222">222</td><td class="line"> keyval = 0;</td></tr> +<tr class="codeline" data-linenumber="223"><td class="num" id="LN223">223</td><td class="line"> mods = 0;</td></tr> +<tr class="codeline" data-linenumber="224"><td class="num" id="LN224">224</td><td class="line"> len = strlen (accelerator);</td></tr> +<tr class="codeline" data-linenumber="225"><td class="num" id="LN225">225</td><td class="line"> <span class='keyword'>while</span> (len)</td></tr> +<tr class="codeline" data-linenumber="226"><td class="num" id="LN226">226</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="227"><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (*accelerator == '<')</td></tr> +<tr class="codeline" data-linenumber="228"><td class="num" id="LN228">228</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="229"><td class="num" id="LN229">229</td><td class="line"> <span class='keyword'>if</span> (len >= 9 && is_release (accelerator))</td></tr> +<tr class="codeline" data-linenumber="230"><td class="num" id="LN230">230</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="231"><td class="num" id="LN231">231</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="232"><td class="num" id="LN232">232</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="233"><td class="num" id="LN233">233</td><td class="line"> mods |= EGG_VIRTUAL_RELEASE_MASK;</td></tr> +<tr class="codeline" data-linenumber="234"><td class="num" id="LN234">234</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="235"><td class="num" id="LN235">235</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 9 && is_control (accelerator))</td></tr> +<tr class="codeline" data-linenumber="236"><td class="num" id="LN236">236</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="237"><td class="num" id="LN237">237</td><td class="line"> accelerator += 9;</td></tr> +<tr class="codeline" data-linenumber="238"><td class="num" id="LN238">238</td><td class="line"> len -= 9;</td></tr> +<tr class="codeline" data-linenumber="239"><td class="num" id="LN239">239</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="240"><td class="num" id="LN240">240</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="241"><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_shift (accelerator))</td></tr> +<tr class="codeline" data-linenumber="242"><td class="num" id="LN242">242</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="243"><td class="num" id="LN243">243</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="244"><td class="num" id="LN244">244</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="245"><td class="num" id="LN245">245</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="246"><td class="num" id="LN246">246</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="247"><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_shft (accelerator))</td></tr> +<tr class="codeline" data-linenumber="248"><td class="num" id="LN248">248</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="249"><td class="num" id="LN249">249</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="250"><td class="num" id="LN250">250</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="251"><td class="num" id="LN251">251</td><td class="line"> mods |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="252"><td class="num" id="LN252">252</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="253"><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_ctrl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="254"><td class="num" id="LN254">254</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="255"><td class="num" id="LN255">255</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="256"><td class="num" id="LN256">256</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="257"><td class="num" id="LN257">257</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="258"><td class="num" id="LN258">258</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="259"><td class="num" id="LN259">259</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_modx (accelerator))</td></tr> +<tr class="codeline" data-linenumber="260"><td class="num" id="LN260">260</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="261"><td class="num" id="LN261">261</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> guint mod_vals[] = {</td></tr> +<tr class="codeline" data-linenumber="262"><td class="num" id="LN262">262</td><td class="line"> EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,</td></tr> +<tr class="codeline" data-linenumber="263"><td class="num" id="LN263">263</td><td class="line"> EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK</td></tr> +<tr class="codeline" data-linenumber="264"><td class="num" id="LN264">264</td><td class="line"> };</td></tr> +<tr class="codeline" data-linenumber="265"><td class="num" id="LN265">265</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="266"><td class="num" id="LN266">266</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="267"><td class="num" id="LN267">267</td><td class="line"> accelerator += 4;</td></tr> +<tr class="codeline" data-linenumber="268"><td class="num" id="LN268">268</td><td class="line"> mods |= mod_vals[*accelerator - '1'];</td></tr> +<tr class="codeline" data-linenumber="269"><td class="num" id="LN269">269</td><td class="line"> accelerator += 2;</td></tr> +<tr class="codeline" data-linenumber="270"><td class="num" id="LN270">270</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="271"><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_ctl (accelerator))</td></tr> +<tr class="codeline" data-linenumber="272"><td class="num" id="LN272">272</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="273"><td class="num" id="LN273">273</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="274"><td class="num" id="LN274">274</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="275"><td class="num" id="LN275">275</td><td class="line"> mods |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="276"><td class="num" id="LN276">276</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="277"><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 5 && is_alt (accelerator))</td></tr> +<tr class="codeline" data-linenumber="278"><td class="num" id="LN278">278</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="279"><td class="num" id="LN279">279</td><td class="line"> accelerator += 5;</td></tr> +<tr class="codeline" data-linenumber="280"><td class="num" id="LN280">280</td><td class="line"> len -= 5;</td></tr> +<tr class="codeline" data-linenumber="281"><td class="num" id="LN281">281</td><td class="line"> mods |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="282"><td class="num" id="LN282">282</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="283"><td class="num" id="LN283">283</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 6 && is_meta (accelerator))</td></tr> +<tr class="codeline" data-linenumber="284"><td class="num" id="LN284">284</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="285"><td class="num" id="LN285">285</td><td class="line"> accelerator += 6;</td></tr> +<tr class="codeline" data-linenumber="286"><td class="num" id="LN286">286</td><td class="line"> len -= 6;</td></tr> +<tr class="codeline" data-linenumber="287"><td class="num" id="LN287">287</td><td class="line"> mods |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="288"><td class="num" id="LN288">288</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="289"><td class="num" id="LN289">289</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_hyper (accelerator))</td></tr> +<tr class="codeline" data-linenumber="290"><td class="num" id="LN290">290</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="291"><td class="num" id="LN291">291</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="292"><td class="num" id="LN292">292</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="293"><td class="num" id="LN293">293</td><td class="line"> mods |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="294"><td class="num" id="LN294">294</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="295"><td class="num" id="LN295">295</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (len >= 7 && is_super (accelerator))</td></tr> +<tr class="codeline" data-linenumber="296"><td class="num" id="LN296">296</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="297"><td class="num" id="LN297">297</td><td class="line"> accelerator += 7;</td></tr> +<tr class="codeline" data-linenumber="298"><td class="num" id="LN298">298</td><td class="line"> len -= 7;</td></tr> +<tr class="codeline" data-linenumber="299"><td class="num" id="LN299">299</td><td class="line"> mods |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="300"><td class="num" id="LN300">300</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="301"><td class="num" id="LN301">301</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="302"><td class="num" id="LN302">302</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="303"><td class="num" id="LN303">303</td><td class="line"> gchar last_ch;</td></tr> +<tr class="codeline" data-linenumber="304"><td class="num" id="LN304">304</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="305"><td class="num" id="LN305">305</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="306"><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>while</span> (last_ch && last_ch != '>')</td></tr> +<tr class="codeline" data-linenumber="307"><td class="num" id="LN307">307</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="308"><td class="num" id="LN308">308</td><td class="line"> last_ch = *accelerator;</td></tr> +<tr class="codeline" data-linenumber="309"><td class="num" id="LN309">309</td><td class="line"> accelerator += 1;</td></tr> +<tr class="codeline" data-linenumber="310"><td class="num" id="LN310">310</td><td class="line"> len -= 1;</td></tr> +<tr class="codeline" data-linenumber="311"><td class="num" id="LN311">311</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="312"><td class="num" id="LN312">312</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="313"><td class="num" id="LN313">313</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="314"><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="315"><td class="num" id="LN315">315</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="316"><td class="num" id="LN316">316</td><td class="line"> keyval = gdk_keyval_from_name (accelerator);</td></tr> +<tr class="codeline" data-linenumber="317"><td class="num" id="LN317">317</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="318"><td class="num" id="LN318">318</td><td class="line"> <span class='keyword'>if</span> (keyval == 0)</td></tr> +<tr class="codeline" data-linenumber="319"><td class="num" id="LN319">319</td><td class="line"> bad_keyval = <span class='macro'>TRUE<span class='macro_popup'>(!(0))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="320"><td class="num" id="LN320">320</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="321"><td class="num" id="LN321">321</td><td class="line"> accelerator += len;</td></tr> +<tr class="codeline" data-linenumber="322"><td class="num" id="LN322">322</td><td class="line"> len -= len; </td></tr> +<tr class="codeline" data-linenumber="323"><td class="num" id="LN323">323</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="324"><td class="num" id="LN324">324</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="325"><td class="num" id="LN325">325</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="326"><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (accelerator_key)</td></tr> +<tr class="codeline" data-linenumber="327"><td class="num" id="LN327">327</td><td class="line"> *accelerator_key = gdk_keyval_to_lower (keyval);</td></tr> +<tr class="codeline" data-linenumber="328"><td class="num" id="LN328">328</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="329"><td class="num" id="LN329">329</td><td class="line"> *accelerator_mods = mods;</td></tr> +<tr class="codeline" data-linenumber="330"><td class="num" id="LN330">330</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="331"><td class="num" id="LN331">331</td><td class="line"> <span class='keyword'>return</span> !bad_keyval;</td></tr> +<tr class="codeline" data-linenumber="332"><td class="num" id="LN332">332</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="333"><td class="num" id="LN333">333</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="334"><td class="num" id="LN334">334</td><td class="line"><span class='comment'>/**</span></td></tr> +<tr class="codeline" data-linenumber="335"><td class="num" id="LN335">335</td><td class="line"> <span class='comment'>* egg_virtual_accelerator_name:</span></td></tr> +<tr class="codeline" data-linenumber="336"><td class="num" id="LN336">336</td><td class="line"> <span class='comment'>* @accelerator_key: accelerator keyval</span></td></tr> +<tr class="codeline" data-linenumber="337"><td class="num" id="LN337">337</td><td class="line"> <span class='comment'>* @accelerator_mods: accelerator modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="338"><td class="num" id="LN338">338</td><td class="line"> <span class='comment'>* @returns: a newly-allocated accelerator name</span></td></tr> +<tr class="codeline" data-linenumber="339"><td class="num" id="LN339">339</td><td class="line"> <span class='comment'>*</span> </td></tr> +<tr class="codeline" data-linenumber="340"><td class="num" id="LN340">340</td><td class="line"> <span class='comment'>* Converts an accelerator keyval and modifier mask</span></td></tr> +<tr class="codeline" data-linenumber="341"><td class="num" id="LN341">341</td><td class="line"> <span class='comment'>* into a string parseable by egg_accelerator_parse_virtual().</span></td></tr> +<tr class="codeline" data-linenumber="342"><td class="num" id="LN342">342</td><td class="line"> <span class='comment'>* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,</span></td></tr> +<tr class="codeline" data-linenumber="343"><td class="num" id="LN343">343</td><td class="line"> <span class='comment'>* this function returns "&lt;Control&gt;q".</span></td></tr> +<tr class="codeline" data-linenumber="344"><td class="num" id="LN344">344</td><td class="line"> <span class='comment'>*</span></td></tr> +<tr class="codeline" data-linenumber="345"><td class="num" id="LN345">345</td><td class="line"> <span class='comment'>* The caller of this function must free the returned string.</span></td></tr> +<tr class="codeline" data-linenumber="346"><td class="num" id="LN346">346</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="347"><td class="num" id="LN347">347</td><td class="line">gchar*</td></tr> +<tr class="codeline" data-linenumber="348"><td class="num" id="LN348">348</td><td class="line">egg_virtual_accelerator_name (guint accelerator_key,</td></tr> +<tr class="codeline" data-linenumber="349"><td class="num" id="LN349">349</td><td class="line"> EggVirtualModifierType accelerator_mods)</td></tr> +<tr class="codeline" data-linenumber="350"><td class="num" id="LN350">350</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="351"><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_release[] = <span class='string_literal'>"<Release>"</span>;</td></tr> +<tr class="codeline" data-linenumber="352"><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_shift[] = <span class='string_literal'>"<Shift>"</span>;</td></tr> +<tr class="codeline" data-linenumber="353"><td class="num" id="LN353">353</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_control[] = <span class='string_literal'>"<Control>"</span>;</td></tr> +<tr class="codeline" data-linenumber="354"><td class="num" id="LN354">354</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod1[] = <span class='string_literal'>"<Alt>"</span>;</td></tr> +<tr class="codeline" data-linenumber="355"><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod2[] = <span class='string_literal'>"<Mod2>"</span>;</td></tr> +<tr class="codeline" data-linenumber="356"><td class="num" id="LN356">356</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod3[] = <span class='string_literal'>"<Mod3>"</span>;</td></tr> +<tr class="codeline" data-linenumber="357"><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod4[] = <span class='string_literal'>"<Mod4>"</span>;</td></tr> +<tr class="codeline" data-linenumber="358"><td class="num" id="LN358">358</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_mod5[] = <span class='string_literal'>"<Mod5>"</span>;</td></tr> +<tr class="codeline" data-linenumber="359"><td class="num" id="LN359">359</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_meta[] = <span class='string_literal'>"<Meta>"</span>;</td></tr> +<tr class="codeline" data-linenumber="360"><td class="num" id="LN360">360</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_super[] = <span class='string_literal'>"<Super>"</span>;</td></tr> +<tr class="codeline" data-linenumber="361"><td class="num" id="LN361">361</td><td class="line"> <span class='keyword'>static</span> <span class='keyword'>const</span> gchar text_hyper[] = <span class='string_literal'>"<Hyper>"</span>;</td></tr> +<tr class="codeline" data-linenumber="362"><td class="num" id="LN362">362</td><td class="line"> guint l;</td></tr> +<tr class="codeline" data-linenumber="363"><td class="num" id="LN363">363</td><td class="line"> gchar *keyval_name;</td></tr> +<tr class="codeline" data-linenumber="364"><td class="num" id="LN364">364</td><td class="line"> gchar *accelerator;</td></tr> +<tr class="codeline" data-linenumber="365"><td class="num" id="LN365">365</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="366"><td class="num" id="LN366">366</td><td class="line"> accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;</td></tr> +<tr class="codeline" data-linenumber="367"><td class="num" id="LN367">367</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="368"><td class="num" id="LN368">368</td><td class="line"> keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));</td></tr> +<tr class="codeline" data-linenumber="369"><td class="num" id="LN369">369</td><td class="line"> <span class='keyword'>if</span> (!keyval_name)</td></tr> +<tr class="codeline" data-linenumber="370"><td class="num" id="LN370">370</td><td class="line"> keyval_name = <span class='string_literal'>""</span>;</td></tr> +<tr class="codeline" data-linenumber="371"><td class="num" id="LN371">371</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="372"><td class="num" id="LN372">372</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="373"><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="374"><td class="num" id="LN374">374</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="375"><td class="num" id="LN375">375</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="376"><td class="num" id="LN376">376</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="377"><td class="num" id="LN377">377</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="378"><td class="num" id="LN378">378</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="379"><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="380"><td class="num" id="LN380">380</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="381"><td class="num" id="LN381">381</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="382"><td class="num" id="LN382">382</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="383"><td class="num" id="LN383">383</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="384"><td class="num" id="LN384">384</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="385"><td class="num" id="LN385">385</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="386"><td class="num" id="LN386">386</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="387"><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="388"><td class="num" id="LN388">388</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="389"><td class="num" id="LN389">389</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="390"><td class="num" id="LN390">390</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="391"><td class="num" id="LN391">391</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="392"><td class="num" id="LN392">392</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="393"><td class="num" id="LN393">393</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="394"><td class="num" id="LN394">394</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="395"><td class="num" id="LN395">395</td><td class="line"> l += strlen (keyval_name);</td></tr> +<tr class="codeline" data-linenumber="396"><td class="num" id="LN396">396</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="397"><td class="num" id="LN397">397</td><td class="line"> accelerator = <span class='macro'>g_new (gchar, l + 1)<span class='macro_popup'>(gchar *) (__extension__ ({ gsize __n = (gsize) (l + 1); gsize<br> __s = sizeof (gchar); gpointer __p; if (__s == 1) __p = g_malloc<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc (__n * __s); else __p = g_malloc_n (__n, __s); __p;<br> }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="398"><td class="num" id="LN398">398</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="399"><td class="num" id="LN399">399</td><td class="line"> l = 0;</td></tr> +<tr class="codeline" data-linenumber="400"><td class="num" id="LN400">400</td><td class="line"> accelerator[l] = 0;</td></tr> +<tr class="codeline" data-linenumber="401"><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)</td></tr> +<tr class="codeline" data-linenumber="402"><td class="num" id="LN402">402</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="403"><td class="num" id="LN403">403</td><td class="line"> strcpy (accelerator + l, text_release);</td></tr> +<tr class="codeline" data-linenumber="404"><td class="num" id="LN404">404</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_release) - 1;</td></tr> +<tr class="codeline" data-linenumber="405"><td class="num" id="LN405">405</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="406"><td class="num" id="LN406">406</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)</td></tr> +<tr class="codeline" data-linenumber="407"><td class="num" id="LN407">407</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="408"><td class="num" id="LN408">408</td><td class="line"> strcpy (accelerator + l, text_shift);</td></tr> +<tr class="codeline" data-linenumber="409"><td class="num" id="LN409">409</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_shift) - 1;</td></tr> +<tr class="codeline" data-linenumber="410"><td class="num" id="LN410">410</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="411"><td class="num" id="LN411">411</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)</td></tr> +<tr class="codeline" data-linenumber="412"><td class="num" id="LN412">412</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="413"><td class="num" id="LN413">413</td><td class="line"> strcpy (accelerator + l, text_control);</td></tr> +<tr class="codeline" data-linenumber="414"><td class="num" id="LN414">414</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_control) - 1;</td></tr> +<tr class="codeline" data-linenumber="415"><td class="num" id="LN415">415</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="416"><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_ALT_MASK)</td></tr> +<tr class="codeline" data-linenumber="417"><td class="num" id="LN417">417</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="418"><td class="num" id="LN418">418</td><td class="line"> strcpy (accelerator + l, text_mod1);</td></tr> +<tr class="codeline" data-linenumber="419"><td class="num" id="LN419">419</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod1) - 1;</td></tr> +<tr class="codeline" data-linenumber="420"><td class="num" id="LN420">420</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="421"><td class="num" id="LN421">421</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)</td></tr> +<tr class="codeline" data-linenumber="422"><td class="num" id="LN422">422</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="423"><td class="num" id="LN423">423</td><td class="line"> strcpy (accelerator + l, text_mod2);</td></tr> +<tr class="codeline" data-linenumber="424"><td class="num" id="LN424">424</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod2) - 1;</td></tr> +<tr class="codeline" data-linenumber="425"><td class="num" id="LN425">425</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="426"><td class="num" id="LN426">426</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)</td></tr> +<tr class="codeline" data-linenumber="427"><td class="num" id="LN427">427</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="428"><td class="num" id="LN428">428</td><td class="line"> <span class="mrange">strcpy</span> (accelerator + l, text_mod3);</td></tr> +<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:7ex; max-width:52em">Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119</div></td></tr> +<tr class="codeline" data-linenumber="429"><td class="num" id="LN429">429</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod3) - 1;</td></tr> +<tr class="codeline" data-linenumber="430"><td class="num" id="LN430">430</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="431"><td class="num" id="LN431">431</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)</td></tr> +<tr class="codeline" data-linenumber="432"><td class="num" id="LN432">432</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="433"><td class="num" id="LN433">433</td><td class="line"> strcpy (accelerator + l, text_mod4);</td></tr> +<tr class="codeline" data-linenumber="434"><td class="num" id="LN434">434</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod4) - 1;</td></tr> +<tr class="codeline" data-linenumber="435"><td class="num" id="LN435">435</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="436"><td class="num" id="LN436">436</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)</td></tr> +<tr class="codeline" data-linenumber="437"><td class="num" id="LN437">437</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="438"><td class="num" id="LN438">438</td><td class="line"> strcpy (accelerator + l, text_mod5);</td></tr> +<tr class="codeline" data-linenumber="439"><td class="num" id="LN439">439</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_mod5) - 1;</td></tr> +<tr class="codeline" data-linenumber="440"><td class="num" id="LN440">440</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="441"><td class="num" id="LN441">441</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_META_MASK)</td></tr> +<tr class="codeline" data-linenumber="442"><td class="num" id="LN442">442</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="443"><td class="num" id="LN443">443</td><td class="line"> strcpy (accelerator + l, text_meta);</td></tr> +<tr class="codeline" data-linenumber="444"><td class="num" id="LN444">444</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_meta) - 1;</td></tr> +<tr class="codeline" data-linenumber="445"><td class="num" id="LN445">445</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="446"><td class="num" id="LN446">446</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="447"><td class="num" id="LN447">447</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="448"><td class="num" id="LN448">448</td><td class="line"> strcpy (accelerator + l, text_hyper);</td></tr> +<tr class="codeline" data-linenumber="449"><td class="num" id="LN449">449</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_hyper) - 1;</td></tr> +<tr class="codeline" data-linenumber="450"><td class="num" id="LN450">450</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="451"><td class="num" id="LN451">451</td><td class="line"> <span class='keyword'>if</span> (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)</td></tr> +<tr class="codeline" data-linenumber="452"><td class="num" id="LN452">452</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="453"><td class="num" id="LN453">453</td><td class="line"> strcpy (accelerator + l, text_super);</td></tr> +<tr class="codeline" data-linenumber="454"><td class="num" id="LN454">454</td><td class="line"> l += <span class='keyword'>sizeof</span> (text_super) - 1;</td></tr> +<tr class="codeline" data-linenumber="455"><td class="num" id="LN455">455</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="456"><td class="num" id="LN456">456</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="457"><td class="num" id="LN457">457</td><td class="line"> strcpy (accelerator + l, keyval_name);</td></tr> +<tr class="codeline" data-linenumber="458"><td class="num" id="LN458">458</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="459"><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>return</span> accelerator;</td></tr> +<tr class="codeline" data-linenumber="460"><td class="num" id="LN460">460</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="461"><td class="num" id="LN461">461</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="462"><td class="num" id="LN462">462</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="463"><td class="num" id="LN463">463</td><td class="line">egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="464"><td class="num" id="LN464">464</td><td class="line"> EggVirtualModifierType virtual_mods,</td></tr> +<tr class="codeline" data-linenumber="465"><td class="num" id="LN465">465</td><td class="line"> GdkModifierType *concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="466"><td class="num" id="LN466">466</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="467"><td class="num" id="LN467">467</td><td class="line"> GdkModifierType concrete;</td></tr> +<tr class="codeline" data-linenumber="468"><td class="num" id="LN468">468</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="469"><td class="num" id="LN469">469</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="470"><td class="num" id="LN470">470</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="471"><td class="num" id="LN471">471</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="472"><td class="num" id="LN472">472</td><td class="line"> <span class='macro'>g_return_if_fail (concrete_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (concrete_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "concrete_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="473"><td class="num" id="LN473">473</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="474"><td class="num" id="LN474">474</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="475"><td class="num" id="LN475">475</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="476"><td class="num" id="LN476">476</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="477"><td class="num" id="LN477">477</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="478"><td class="num" id="LN478">478</td><td class="line"> concrete = 0;</td></tr> +<tr class="codeline" data-linenumber="479"><td class="num" id="LN479">479</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="480"><td class="num" id="LN480">480</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="481"><td class="num" id="LN481">481</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="482"><td class="num" id="LN482">482</td><td class="line"> <span class='keyword'>if</span> (modmap->mapping[i] & virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="483"><td class="num" id="LN483">483</td><td class="line"> concrete |= (1 << i);</td></tr> +<tr class="codeline" data-linenumber="484"><td class="num" id="LN484">484</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="485"><td class="num" id="LN485">485</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="486"><td class="num" id="LN486">486</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="487"><td class="num" id="LN487">487</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="488"><td class="num" id="LN488">488</td><td class="line"> *concrete_mods = concrete;</td></tr> +<tr class="codeline" data-linenumber="489"><td class="num" id="LN489">489</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="490"><td class="num" id="LN490">490</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="491"><td class="num" id="LN491">491</td><td class="line"><span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="492"><td class="num" id="LN492">492</td><td class="line">egg_keymap_virtualize_modifiers (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="493"><td class="num" id="LN493">493</td><td class="line"> GdkModifierType concrete_mods,</td></tr> +<tr class="codeline" data-linenumber="494"><td class="num" id="LN494">494</td><td class="line"> EggVirtualModifierType *virtual_mods)</td></tr> +<tr class="codeline" data-linenumber="495"><td class="num" id="LN495">495</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="496"><td class="num" id="LN496">496</td><td class="line"> GdkModifierType virtual;</td></tr> +<tr class="codeline" data-linenumber="497"><td class="num" id="LN497">497</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="498"><td class="num" id="LN498">498</td><td class="line"> <span class='keyword'>const</span> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="499"><td class="num" id="LN499">499</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="500"><td class="num" id="LN500">500</td><td class="line"> <span class='macro'>g_return_if_fail (GDK_IS_KEYMAP (keymap))<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance<br>*) ((keymap)); GType __t = ((gdk_keymap_get_type ())); gboolean<br> __r; if (!__inst) __r = (0); else if (__inst->g_class &&<br> __inst->g_class->g_type == __t) __r = (!(0)); else __r<br> = g_type_check_instance_is_a (__inst, __t); __r; }))))) _g_boolean_var_<br> = 1; else _g_boolean_var_ = 0; _g_boolean_var_; }), 1))) { }<br> else { g_return_if_fail_warning (((gchar*) 0), ((const char*<br>) (__func__)), "GDK_IS_KEYMAP (keymap)"); return; } } while (<br>0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="501"><td class="num" id="LN501">501</td><td class="line"> <span class='macro'>g_return_if_fail (virtual_mods != NULL)<span class='macro_popup'>do { if ((__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (virtual_mods != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1))) { } else { g_return_if_fail_warning<br> (((gchar*) 0), ((const char*) (__func__)), "virtual_mods != NULL"<br>); return; } } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="502"><td class="num" id="LN502">502</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="503"><td class="num" id="LN503">503</td><td class="line"> modmap = egg_keymap_get_modmap (keymap);</td></tr> +<tr class="codeline" data-linenumber="504"><td class="num" id="LN504">504</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="505"><td class="num" id="LN505">505</td><td class="line"> <span class='comment'>/* Not so sure about this algorithm. */</span></td></tr> +<tr class="codeline" data-linenumber="506"><td class="num" id="LN506">506</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="507"><td class="num" id="LN507">507</td><td class="line"> virtual = 0;</td></tr> +<tr class="codeline" data-linenumber="508"><td class="num" id="LN508">508</td><td class="line"> i = 0;</td></tr> +<tr class="codeline" data-linenumber="509"><td class="num" id="LN509">509</td><td class="line"> <span class='keyword'>while</span> (i < EGG_MODMAP_ENTRY_LAST)</td></tr> +<tr class="codeline" data-linenumber="510"><td class="num" id="LN510">510</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="511"><td class="num" id="LN511">511</td><td class="line"> <span class='keyword'>if</span> ((1 << i) & concrete_mods)</td></tr> +<tr class="codeline" data-linenumber="512"><td class="num" id="LN512">512</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="513"><td class="num" id="LN513">513</td><td class="line"> EggVirtualModifierType cleaned;</td></tr> +<tr class="codeline" data-linenumber="514"><td class="num" id="LN514">514</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="515"><td class="num" id="LN515">515</td><td class="line"> cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |</td></tr> +<tr class="codeline" data-linenumber="516"><td class="num" id="LN516">516</td><td class="line"> EGG_VIRTUAL_MOD3_MASK |</td></tr> +<tr class="codeline" data-linenumber="517"><td class="num" id="LN517">517</td><td class="line"> EGG_VIRTUAL_MOD4_MASK |</td></tr> +<tr class="codeline" data-linenumber="518"><td class="num" id="LN518">518</td><td class="line"> EGG_VIRTUAL_MOD5_MASK);</td></tr> +<tr class="codeline" data-linenumber="519"><td class="num" id="LN519">519</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="520"><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>if</span> (cleaned != 0)</td></tr> +<tr class="codeline" data-linenumber="521"><td class="num" id="LN521">521</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="522"><td class="num" id="LN522">522</td><td class="line"> virtual |= cleaned;</td></tr> +<tr class="codeline" data-linenumber="523"><td class="num" id="LN523">523</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="524"><td class="num" id="LN524">524</td><td class="line"> <span class='keyword'>else</span></td></tr> +<tr class="codeline" data-linenumber="525"><td class="num" id="LN525">525</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="526"><td class="num" id="LN526">526</td><td class="line"> <span class='comment'>/* Rather than dropping mod2->mod5 if not bound,</span></td></tr> +<tr class="codeline" data-linenumber="527"><td class="num" id="LN527">527</td><td class="line"> <span class='comment'>* go ahead and use the concrete names</span></td></tr> +<tr class="codeline" data-linenumber="528"><td class="num" id="LN528">528</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="529"><td class="num" id="LN529">529</td><td class="line"> virtual |= modmap->mapping[i];</td></tr> +<tr class="codeline" data-linenumber="530"><td class="num" id="LN530">530</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="531"><td class="num" id="LN531">531</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="532"><td class="num" id="LN532">532</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="533"><td class="num" id="LN533">533</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="534"><td class="num" id="LN534">534</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="535"><td class="num" id="LN535">535</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="536"><td class="num" id="LN536">536</td><td class="line"> *virtual_mods = virtual;</td></tr> +<tr class="codeline" data-linenumber="537"><td class="num" id="LN537">537</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="538"><td class="num" id="LN538">538</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="539"><td class="num" id="LN539">539</td><td class="line"><span class='keyword'>static</span> <span class='keyword'>void</span></td></tr> +<tr class="codeline" data-linenumber="540"><td class="num" id="LN540">540</td><td class="line">reload_modmap (GdkKeymap *keymap,</td></tr> +<tr class="codeline" data-linenumber="541"><td class="num" id="LN541">541</td><td class="line"> EggModmap *modmap)</td></tr> +<tr class="codeline" data-linenumber="542"><td class="num" id="LN542">542</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="543"><td class="num" id="LN543">543</td><td class="line"> XModifierKeymap *xmodmap;</td></tr> +<tr class="codeline" data-linenumber="544"><td class="num" id="LN544">544</td><td class="line"> <span class='keyword'>int</span> map_size;</td></tr> +<tr class="codeline" data-linenumber="545"><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>int</span> i;</td></tr> +<tr class="codeline" data-linenumber="546"><td class="num" id="LN546">546</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="547"><td class="num" id="LN547">547</td><td class="line"> <span class='comment'>/* FIXME multihead */</span></td></tr> +<tr class="codeline" data-linenumber="548"><td class="num" id="LN548">548</td><td class="line"> xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());</td></tr> +<tr class="codeline" data-linenumber="549"><td class="num" id="LN549">549</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="550"><td class="num" id="LN550">550</td><td class="line"> memset (modmap->mapping, 0, <span class='keyword'>sizeof</span> (modmap->mapping));</td></tr> +<tr class="codeline" data-linenumber="551"><td class="num" id="LN551">551</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="552"><td class="num" id="LN552">552</td><td class="line"> <span class='comment'>/* there are 8 modifiers, and the first 3 are shift, shift lock,</span></td></tr> +<tr class="codeline" data-linenumber="553"><td class="num" id="LN553">553</td><td class="line"> <span class='comment'>* and control</span></td></tr> +<tr class="codeline" data-linenumber="554"><td class="num" id="LN554">554</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="555"><td class="num" id="LN555">555</td><td class="line"> map_size = 8 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="556"><td class="num" id="LN556">556</td><td class="line"> i = 3 * xmodmap->max_keypermod;</td></tr> +<tr class="codeline" data-linenumber="557"><td class="num" id="LN557">557</td><td class="line"> <span class='keyword'>while</span> (i < map_size)</td></tr> +<tr class="codeline" data-linenumber="558"><td class="num" id="LN558">558</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="559"><td class="num" id="LN559">559</td><td class="line"> <span class='comment'>/* get the key code at this point in the map,</span></td></tr> +<tr class="codeline" data-linenumber="560"><td class="num" id="LN560">560</td><td class="line"> <span class='comment'>* see if its keysym is one we're interested in</span></td></tr> +<tr class="codeline" data-linenumber="561"><td class="num" id="LN561">561</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="562"><td class="num" id="LN562">562</td><td class="line"> <span class='keyword'>int</span> keycode = xmodmap->modifiermap[i];</td></tr> +<tr class="codeline" data-linenumber="563"><td class="num" id="LN563">563</td><td class="line"> GdkKeymapKey *keys;</td></tr> +<tr class="codeline" data-linenumber="564"><td class="num" id="LN564">564</td><td class="line"> guint *keyvals;</td></tr> +<tr class="codeline" data-linenumber="565"><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>int</span> n_entries;</td></tr> +<tr class="codeline" data-linenumber="566"><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>int</span> j;</td></tr> +<tr class="codeline" data-linenumber="567"><td class="num" id="LN567">567</td><td class="line"> EggVirtualModifierType mask;</td></tr> +<tr class="codeline" data-linenumber="568"><td class="num" id="LN568">568</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="569"><td class="num" id="LN569">569</td><td class="line"> keys = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="570"><td class="num" id="LN570">570</td><td class="line"> keyvals = <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="571"><td class="num" id="LN571">571</td><td class="line"> n_entries = 0;</td></tr> +<tr class="codeline" data-linenumber="572"><td class="num" id="LN572">572</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="573"><td class="num" id="LN573">573</td><td class="line"> gdk_keymap_get_entries_for_keycode (keymap,</td></tr> +<tr class="codeline" data-linenumber="574"><td class="num" id="LN574">574</td><td class="line"> keycode,</td></tr> +<tr class="codeline" data-linenumber="575"><td class="num" id="LN575">575</td><td class="line"> &keys, &keyvals, &n_entries);</td></tr> +<tr class="codeline" data-linenumber="576"><td class="num" id="LN576">576</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="577"><td class="num" id="LN577">577</td><td class="line"> mask = 0;</td></tr> +<tr class="codeline" data-linenumber="578"><td class="num" id="LN578">578</td><td class="line"> j = 0;</td></tr> +<tr class="codeline" data-linenumber="579"><td class="num" id="LN579">579</td><td class="line"> <span class='keyword'>while</span> (j < n_entries)</td></tr> +<tr class="codeline" data-linenumber="580"><td class="num" id="LN580">580</td><td class="line"> { </td></tr> +<tr class="codeline" data-linenumber="581"><td class="num" id="LN581">581</td><td class="line"> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Num_Lock<span class='macro_popup'>0xff7f</span></span>)</td></tr> +<tr class="codeline" data-linenumber="582"><td class="num" id="LN582">582</td><td class="line"> mask |= EGG_VIRTUAL_NUM_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="583"><td class="num" id="LN583">583</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Scroll_Lock<span class='macro_popup'>0xff14</span></span>)</td></tr> +<tr class="codeline" data-linenumber="584"><td class="num" id="LN584">584</td><td class="line"> mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="585"><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Meta_L<span class='macro_popup'>0xffe7</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="586"><td class="num" id="LN586">586</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Meta_R<span class='macro_popup'>0xffe8</span></span>)</td></tr> +<tr class="codeline" data-linenumber="587"><td class="num" id="LN587">587</td><td class="line"> mask |= EGG_VIRTUAL_META_MASK;</td></tr> +<tr class="codeline" data-linenumber="588"><td class="num" id="LN588">588</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Hyper_L<span class='macro_popup'>0xffed</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="589"><td class="num" id="LN589">589</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Hyper_R<span class='macro_popup'>0xffee</span></span>)</td></tr> +<tr class="codeline" data-linenumber="590"><td class="num" id="LN590">590</td><td class="line"> mask |= EGG_VIRTUAL_HYPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="591"><td class="num" id="LN591">591</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Super_L<span class='macro_popup'>0xffeb</span></span> ||</td></tr> +<tr class="codeline" data-linenumber="592"><td class="num" id="LN592">592</td><td class="line"> keyvals[j] == <span class='macro'>GDK_KEY_Super_R<span class='macro_popup'>0xffec</span></span>)</td></tr> +<tr class="codeline" data-linenumber="593"><td class="num" id="LN593">593</td><td class="line"> mask |= EGG_VIRTUAL_SUPER_MASK;</td></tr> +<tr class="codeline" data-linenumber="594"><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (keyvals[j] == <span class='macro'>GDK_KEY_Mode_switch<span class='macro_popup'>0xff7e</span></span>)</td></tr> +<tr class="codeline" data-linenumber="595"><td class="num" id="LN595">595</td><td class="line"> mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;</td></tr> +<tr class="codeline" data-linenumber="596"><td class="num" id="LN596">596</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="597"><td class="num" id="LN597">597</td><td class="line"> ++j;</td></tr> +<tr class="codeline" data-linenumber="598"><td class="num" id="LN598">598</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="599"><td class="num" id="LN599">599</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="600"><td class="num" id="LN600">600</td><td class="line"> <span class='comment'>/* Mod1Mask is 1 << 3 for example, i.e. the</span></td></tr> +<tr class="codeline" data-linenumber="601"><td class="num" id="LN601">601</td><td class="line"> <span class='comment'>* fourth modifier, i / keyspermod is the modifier</span></td></tr> +<tr class="codeline" data-linenumber="602"><td class="num" id="LN602">602</td><td class="line"> <span class='comment'>* index</span></td></tr> +<tr class="codeline" data-linenumber="603"><td class="num" id="LN603">603</td><td class="line"> <span class='comment'>*/</span> </td></tr> +<tr class="codeline" data-linenumber="604"><td class="num" id="LN604">604</td><td class="line"> modmap->mapping[i/xmodmap->max_keypermod] |= mask;</td></tr> +<tr class="codeline" data-linenumber="605"><td class="num" id="LN605">605</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="606"><td class="num" id="LN606">606</td><td class="line"> g_free (keyvals);</td></tr> +<tr class="codeline" data-linenumber="607"><td class="num" id="LN607">607</td><td class="line"> g_free (keys); </td></tr> +<tr class="codeline" data-linenumber="608"><td class="num" id="LN608">608</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="609"><td class="num" id="LN609">609</td><td class="line"> ++i;</td></tr> +<tr class="codeline" data-linenumber="610"><td class="num" id="LN610">610</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="611"><td class="num" id="LN611">611</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="612"><td class="num" id="LN612">612</td><td class="line"> <span class='comment'>/* Add in the not-really-virtual fixed entries */</span></td></tr> +<tr class="codeline" data-linenumber="613"><td class="num" id="LN613">613</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;</td></tr> +<tr class="codeline" data-linenumber="614"><td class="num" id="LN614">614</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;</td></tr> +<tr class="codeline" data-linenumber="615"><td class="num" id="LN615">615</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;</td></tr> +<tr class="codeline" data-linenumber="616"><td class="num" id="LN616">616</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;</td></tr> +<tr class="codeline" data-linenumber="617"><td class="num" id="LN617">617</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;</td></tr> +<tr class="codeline" data-linenumber="618"><td class="num" id="LN618">618</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;</td></tr> +<tr class="codeline" data-linenumber="619"><td class="num" id="LN619">619</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;</td></tr> +<tr class="codeline" data-linenumber="620"><td class="num" id="LN620">620</td><td class="line"> modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;</td></tr> +<tr class="codeline" data-linenumber="621"><td class="num" id="LN621">621</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="622"><td class="num" id="LN622">622</td><td class="line"> XFreeModifiermap (xmodmap);</td></tr> +<tr class="codeline" data-linenumber="623"><td class="num" id="LN623">623</td><td class="line">}</td></tr> +<tr class="codeline" data-linenumber="624"><td class="num" id="LN624">624</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="625"><td class="num" id="LN625">625</td><td class="line"><span class='keyword'>const</span> EggModmap*</td></tr> +<tr class="codeline" data-linenumber="626"><td class="num" id="LN626">626</td><td class="line">egg_keymap_get_modmap (GdkKeymap *keymap)</td></tr> +<tr class="codeline" data-linenumber="627"><td class="num" id="LN627">627</td><td class="line">{</td></tr> +<tr class="codeline" data-linenumber="628"><td class="num" id="LN628">628</td><td class="line"> EggModmap *modmap;</td></tr> +<tr class="codeline" data-linenumber="629"><td class="num" id="LN629">629</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="630"><td class="num" id="LN630">630</td><td class="line"> <span class='comment'>/* This is all a hack, much simpler when we can just</span></td></tr> +<tr class="codeline" data-linenumber="631"><td class="num" id="LN631">631</td><td class="line"> <span class='comment'>* modify GDK directly.</span></td></tr> +<tr class="codeline" data-linenumber="632"><td class="num" id="LN632">632</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="633"><td class="num" id="LN633">633</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="634"><td class="num" id="LN634">634</td><td class="line"> modmap = g_object_get_data (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="635"><td class="num" id="LN635">635</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>);</td></tr> +<tr class="codeline" data-linenumber="636"><td class="num" id="LN636">636</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="637"><td class="num" id="LN637">637</td><td class="line"> <span class='keyword'>if</span> (modmap == <span class='macro'>NULL<span class='macro_popup'>((void*)0)</span></span>)</td></tr> +<tr class="codeline" data-linenumber="638"><td class="num" id="LN638">638</td><td class="line"> {</td></tr> +<tr class="codeline" data-linenumber="639"><td class="num" id="LN639">639</td><td class="line"> modmap = <span class='macro'>g_new0 (EggModmap, 1)<span class='macro_popup'>(EggModmap *) (__extension__ ({ gsize __n = (gsize) (1); gsize<br> __s = sizeof (EggModmap); gpointer __p; if (__s == 1) __p = g_malloc0<br> (__n); else if (__builtin_constant_p (__n) && (__s ==<br> 0 || __n <= (9223372036854775807L *2UL+1UL) / __s)) __p =<br> g_malloc0 (__n * __s); else __p = g_malloc0_n (__n, __s); __p<br>; }))</span></span>;</td></tr> +<tr class="codeline" data-linenumber="640"><td class="num" id="LN640">640</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="641"><td class="num" id="LN641">641</td><td class="line"> <span class='comment'>/* FIXME modify keymap change events with an event filter</span></td></tr> +<tr class="codeline" data-linenumber="642"><td class="num" id="LN642">642</td><td class="line"> <span class='comment'>* and force a reload if we get one</span></td></tr> +<tr class="codeline" data-linenumber="643"><td class="num" id="LN643">643</td><td class="line"> <span class='comment'>*/</span></td></tr> +<tr class="codeline" data-linenumber="644"><td class="num" id="LN644">644</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="645"><td class="num" id="LN645">645</td><td class="line"> reload_modmap (keymap, modmap);</td></tr> +<tr class="codeline" data-linenumber="646"><td class="num" id="LN646">646</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="647"><td class="num" id="LN647">647</td><td class="line"> g_object_set_data_full (<span class='macro'>G_OBJECT (keymap)<span class='macro_popup'>((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance<br>*) ((keymap)), (((GType) ((20) << (2))))))))</span></span>,</td></tr> +<tr class="codeline" data-linenumber="648"><td class="num" id="LN648">648</td><td class="line"> <span class='string_literal'>"egg-modmap"</span>,</td></tr> +<tr class="codeline" data-linenumber="649"><td class="num" id="LN649">649</td><td class="line"> modmap,</td></tr> +<tr class="codeline" data-linenumber="650"><td class="num" id="LN650">650</td><td class="line"> g_free);</td></tr> +<tr class="codeline" data-linenumber="651"><td class="num" id="LN651">651</td><td class="line"> }</td></tr> +<tr class="codeline" data-linenumber="652"><td class="num" id="LN652">652</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="653"><td class="num" id="LN653">653</td><td class="line"> <span class='macro'>g_assert (modmap != NULL)<span class='macro_popup'>do { if (__builtin_expect (__extension__ ({ int _g_boolean_var_<br>; if (modmap != ((void*)0)) _g_boolean_var_ = 1; else _g_boolean_var_<br> = 0; _g_boolean_var_; }), 1)) ; else g_assertion_message_expr<br> (((gchar*) 0), "eggaccelerators.c", 653, ((const char*) (__func__<br>)), "modmap != NULL"); } while (0)</span></span>;</td></tr> +<tr class="codeline" data-linenumber="654"><td class="num" id="LN654">654</td><td class="line"> </td></tr> +<tr class="codeline" data-linenumber="655"><td class="num" id="LN655">655</td><td class="line"> <span class='keyword'>return</span> modmap;</td></tr> +<tr class="codeline" data-linenumber="656"><td class="num" id="LN656">656</td><td class="line">}</td></tr> +</table></body></html> diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/scanview.css b/2022-10-29-134752-5499-1@cd263b7986ec_master/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-10-29-134752-5499-1@cd263b7986ec_master/sorttable.js b/2022-10-29-134752-5499-1@cd263b7986ec_master/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-10-29-134752-5499-1@cd263b7986ec_master/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add <script src="sorttable.js"></script> to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i<table.rows.length; i++) { + if (table.rows[i].className.search(/\bsortbottom\b/) != -1) { + sortbottomrows[sortbottomrows.length] = table.rows[i]; + } + } + if (sortbottomrows) { + if (table.tFoot == null) { + // table doesn't have a tfoot. Create one. + tfo = document.createElement('tfoot'); + table.appendChild(tfo); + } + for (var i=0; i<sortbottomrows.length; i++) { + tfo.appendChild(sortbottomrows[i]); + } + delete sortbottomrows; + } + + // work through each column and calculate its type + headrow = table.tHead.rows[0].cells; + for (var i=0; i<headrow.length; i++) { + // manually override the type with a sorttable_type attribute + if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col + mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/); + if (mtch) { override = mtch[1]; } + if (mtch && typeof sorttable["sort_"+override] == 'function') { + headrow[i].sorttable_sortfunction = sorttable["sort_"+override]; + } else { + headrow[i].sorttable_sortfunction = sorttable.guessType(table,i); + } + // make it clickable to sort + headrow[i].sorttable_columnindex = i; + headrow[i].sorttable_tbody = table.tBodies[0]; + dean_addEvent(headrow[i],"click", function(e) { + + if (this.className.search(/\bsorttable_sorted\b/) != -1) { + // if we're already sorted by this column, just + // reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted', + 'sorttable_sorted_reverse'); + this.removeChild(document.getElementById('sorttable_sortfwdind')); + sortrevind = document.createElement('span'); + sortrevind.id = "sorttable_sortrevind"; + sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j<rows.length; j++) { + row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]]; + } + /* If you want a stable sort, uncomment the following line */ + sorttable.shaker_sort(row_array, this.sorttable_sortfunction); + /* and comment out this one */ + //row_array.sort(this.sorttable_sortfunction); + + tb = this.sorttable_tbody; + for (var j=0; j<row_array.length; j++) { + tb.appendChild(row_array[j][1]); + } + + delete row_array; + }); + } + } + }, + + guessType: function(table, column) { + // guess the type of a column based on its first non-blank row + sortfn = sorttable.sort_alpha; + for (var i=0; i<table.tBodies[0].rows.length; i++) { + text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]); + if (text != '') { + if (text.match(/^-?[�$�]?[\d,.]+%?$/)) { + return sorttable.sort_numeric; + } + // check for a date: dd/mm/yyyy or dd/mm/yy + // can have / or . or - as separator + // can be mm/dd as well + possdate = text.match(sorttable.DATE_RE) + if (possdate) { + // looks like a date + first = parseInt(possdate[1]); + second = parseInt(possdate[2]); + if (first > 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for <input> fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i<tbody.rows.length; i++) { + newrows[newrows.length] = tbody.rows[i]; + } + for (var i=newrows.length-1; i>=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0]<b[0]) return -1; + return 1; + }, + sort_ddmm: function(a,b) { + mtch = a[0].match(sorttable.DATE_RE); + y = mtch[3]; m = mtch[2]; d = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt1 = y+m+d; + mtch = b[0].match(sorttable.DATE_RE); + y = mtch[3]; m = mtch[2]; d = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt2 = y+m+d; + if (dt1==dt2) return 0; + if (dt1<dt2) return -1; + return 1; + }, + sort_mmdd: function(a,b) { + mtch = a[0].match(sorttable.DATE_RE); + y = mtch[3]; d = mtch[2]; m = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt1 = y+m+d; + mtch = b[0].match(sorttable.DATE_RE); + y = mtch[3]; d = mtch[2]; m = mtch[1]; + if (m.length == 1) m = '0'+m; + if (d.length == 1) d = '0'+d; + dt2 = y+m+d; + if (dt1==dt2) return 0; + if (dt1<dt2) return -1; + return 1; + }, + + shaker_sort: function(list, comp_func) { + // A stable sort function to allow multi-level sorting of data + // see: http://en.wikipedia.org/wiki/Cocktail_sort + // thanks to Joseph Nahmias + var b = 0; + var t = list.length - 1; + var swap = true; + + while(swap) { + swap = false; + for(var i = b; i < t; ++i) { + if ( comp_func(list[i], list[i+1]) > 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>"); + var script = document.getElementById("__ie_onload"); + script.onreadystatechange = function() { + if (this.readyState == "complete") { + sorttable.init(); // call the onload handler + } + }; +/*@end @*/ + +/* for Safari */ +if (/WebKit/i.test(navigator.userAgent)) { // sniff + var _timer = setInterval(function() { + if (/loaded|complete/.test(document.readyState)) { + sorttable.init(); // call the onload handler + } + }, 10); +} + +/* for other browsers */ +window.onload = sorttable.init; + +// written by Dean Edwards, 2005 +// with input from Tino Zijdel, Matthias Miller, Diego Perini + +// http://dean.edwards.name/weblog/2005/10/add-event/ + +function dean_addEvent(element, type, handler) { + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else { + // assign each event handler a unique ID + if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++; + // create a hash table of event types for the element + if (!element.events) element.events = {}; + // create a hash table of event handlers for each element/event pair + var handlers = element.events[type]; + if (!handlers) { + handlers = element.events[type] = {}; + // store the existing event handler (if there is one) + if (element["on" + type]) { + handlers[0] = element["on" + type]; + } + } + // store the event handler in the hash table + handlers[handler.$$guid] = handler; + // assign a global event handler to do all the work + element["on" + type] = handleEvent; + } +}; +// a counter used to create unique IDs +dean_addEvent.guid = 1; + +function removeEvent(element, type, handler) { + if (element.removeEventListener) { + element.removeEventListener(type, handler, false); + } else { + // delete the event handler from the hash table + if (element.events && element.events[type]) { + delete element.events[type][handler.$$guid]; + } + } +}; + +function handleEvent(event) { + var returnValue = true; + // grab the event object (IE uses a global event object) + event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); + // get a reference to the hash table of event handlers + var handlers = this.events[event.type]; + // execute each event handler + for (var i in handlers) { + this.$$handleEvent = handlers[i]; + if (this.$$handleEvent(event) === false) { + returnValue = false; + } + } + return returnValue; +}; + +function fixEvent(event) { + // add W3C standard event methods + event.preventDefault = fixEvent.preventDefault; + event.stopPropagation = fixEvent.stopPropagation; + return event; +}; +fixEvent.preventDefault = function() { + this.returnValue = false; +}; +fixEvent.stopPropagation = function() { + this.cancelBubble = true; +} + +// Dean's forEach: http://dean.edwards.name/base/forEach.js +/* + forEach, version 1.0 + Copyright 2006, Dean Edwards + License: http://www.opensource.org/licenses/mit-license.php +*/ + +// array-like enumeration +if (!Array.forEach) { // mozilla already supports this + Array.forEach = function(array, block, context) { + for (var i = 0; i < array.length; i++) { + block.call(context, array[i], i, array); + } + }; +} + +// generic enumeration +Function.prototype.forEach = function(object, block, context) { + for (var key in object) { + if (typeof this.prototype[key] == "undefined") { + block.call(context, object[key], key, object); + } + } +}; + +// character enumeration +String.forEach = function(string, block, context) { + Array.forEach(string.split(""), function(chr, index) { + block.call(context, chr, index, string); + }); +}; + +// globally resolve forEach enumeration +var forEach = function(object, block, context) { + if (object) { + var resolve = Object; // default + if (object instanceof Function) { + // functions have a "length" property + resolve = Function; + } else if (object.forEach instanceof Function) { + // the object implements a custom forEach method so use that + object.forEach(block, context); + return; + } else if (typeof object == "string") { + // the object is a string + resolve = String; + } else if (typeof object.length == "number") { + // the object is array-like + resolve = Array; + } + resolve.forEach(object, block, context); + } +}; |