.tabs-container {
  overflow: hidden;
}
.tabs-header {
  border-width: 1px;
  border-style: solid;
  border-bottom-width: 0;
  position: relative;
  padding: 0;
  padding-top: 2px;
  overflow: hidden;
}
.tabs-scroller-left,
.tabs-scroller-right {
  position: absolute;
  top: auto;
  bottom: 0;
  width: 18px;
  font-size: 1px;
  display: none;
  cursor: pointer;
  border-width: 1px;
  border-style: solid;
}
.tabs-scroller-left {
  left: 0;
}
.tabs-scroller-right {
  right: 0;
}
.tabs-tool {
  position: absolute;
  bottom: 0;
  padding: 1px;
  overflow: hidden;
  border-width: 1px;
  border-style: solid;
}
.tabs-header-plain .tabs-tool {
  padding: 0 1px;
}
.tabs-wrap {
  position: relative;
  left: 0;
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}
.tabs-scrolling {
  margin-left: 18px;
  margin-right: 18px;
}
.tabs-disabled {
  opacity: 0.3;
  filter: alpha(opacity=30);
}
.tabs {
  list-style-type: none;
  height: 26px;
  margin: 0px;
  padding: 0px;
  padding-left: 4px;
  width: 50000px;
  border-style: solid;
  border-width: 0 0 1px 0;
}
.tabs li {
  float: left;
  display: inline-block;
  margin: 0 4px -1px 0;
  padding: 0;
  position: relative;
  border: 0;
}
.tabs li a.tabs-inner {
  display: inline-block;
  text-decoration: none;
  margin: 0;
  padding: 0 10px;
  height: 25px;
  line-height: 25px;
  text-align: center;
  white-space: nowrap;
  border-width: 1px;
  border-style: solid;
  -moz-border-radius: 5px 5px 0 0;
  -webkit-border-radius: 5px 5px 0 0;
  border-radius: 5px 5px 0 0;
}
.tabs li.tabs-selected a.tabs-inner {
  font-weight: bold;
  outline: none;
}
.tabs li.tabs-selected a:hover.tabs-inner {
  cursor: default;
  pointer: default;
}
.tabs li a.tabs-close,
.tabs-p-tool {
  position: absolute;
  font-size: 1px;
  display: block;
  height: 12px;
  padding: 0;
  top: 50%;
  margin-top: -6px;
  overflow: hidden;
}
.tabs li a.tabs-close {
  width: 12px;
  right: 5px;
  opacity: 0.6;
  filter: alpha(opacity=60);
}
.tabs-p-tool {
  right: 16px;
}
.tabs-p-tool a {
  display: inline-block;
  font-size: 1px;
  width: 12px;
  height: 12px;
  margin: 0;
  opacity: 0.6;
  filter: alpha(opacity=60);
}
.tabs li a:hover.tabs-close,
.tabs-p-tool a:hover {
  opacity: 1;
  filter: alpha(opacity=100);
  cursor: hand;
  cursor: pointer;
}
.tabs-with-icon {
  padding-left: 18px;
}
.tabs-icon {
  position: absolute;
  width: 16px;
  height: 16px;
  left: 10px;
  top: 50%;
  margin-top: -8px;
}
.tabs-title {
  font-size: 12px;
}
.tabs-closable {
  padding-right: 8px;
}
.tabs-panels {
  margin: 0px;
  padding: 0px;
  border-width: 1px;
  border-style: solid;
  border-top-width: 0;
  overflow: hidden;
}
.tabs-header-bottom {
  border-width: 0 1px 1px 1px;
  padding: 0 0 2px 0;
}
.tabs-header-bottom .tabs {
  border-width: 1px 0 0 0;
}
.tabs-header-bottom .tabs li {
  margin: -1px 4px 0 0;
}
.tabs-header-bottom .tabs li a.tabs-inner {
  -moz-border-radius: 0 0 5px 5px;
  -webkit-border-radius: 0 0 5px 5px;
  border-radius: 0 0 5px 5px;
}
.tabs-header-bottom .tabs-tool {
  top: 0;
}
.tabs-header-bottom .tabs-scroller-left,
.tabs-header-bottom .tabs-scroller-right {
  top: 0;
  bottom: auto;
}
.tabs-panels-top {
  border-width: 1px 1px 0 1px;
}
.tabs-header-left {
  float: left;
  border-width: 1px 0 1px 1px;
  padding: 0;
}
.tabs-header-right {
  float: right;
  border-width: 1px 1px 1px 0;
  padding: 0;
}
.tabs-header-left .tabs-wrap,
.tabs-header-right .tabs-wrap {
  height: 100%;
}
.tabs-header-left .tabs {
  height: 100%;
  padding: 4px 0 0 2px;
  border-width: 0 1px 0 0;
}
.tabs-header-right .tabs {
  height: 100%;
  padding: 4px 2px 0 0;
  border-width: 0 0 0 1px;
}
.tabs-header-left .tabs li,
.tabs-header-right .tabs li {
  display: block;
  width: 100%;
  position: relative;
}
.tabs-header-left .tabs li {
  left: auto;
  right: 0;
  margin: 0 -1px 4px 0;
  float: right;
}
.tabs-header-right .tabs li {
  left: 0;
  right: auto;
  margin: 0 0 4px -1px;
  float: left;
}
.tabs-justified li a.tabs-inner {
  padding-left: 0;
  padding-right: 0;
}
.tabs-header-left .tabs li a.tabs-inner {
  display: block;
  text-align: left;
  padding-left: 10px;
  padding-right: 10px;
  -moz-border-radius: 5px 0 0 5px;
  -webkit-border-radius: 5px 0 0 5px;
  border-radius: 5px 0 0 5px;
}
.tabs-header-right .tabs li a.tabs-inner {
  display: block;
  text-align: left;
  padding-left: 10px;
  padding-right: 10px;
  -moz-border-radius: 0 5px 5px 0;
  -webkit-border-radius: 0 5px 5px 0;
  border-radius: 0 5px 5px 0;
}
.tabs-panels-right {
  float: right;
  border-width: 1px 1px 1px 0;
}
.tabs-panels-left {
  float: left;
  border-width: 1px 0 1px 1px;
}
.tabs-header-noborder,
.tabs-panels-noborder {
  border: 0px;
}
.tabs-header-plain {
  border: 0px;
  background: transparent;
}
.tabs-pill {
  padding-bottom: 3px;
}
.tabs-header-bottom .tabs-pill {
  padding-top: 3px;
  padding-bottom: 0;
}
.tabs-header-left .tabs-pill {
  padding-right: 3px;
}
.tabs-header-right .tabs-pill {
  padding-left: 3px;
}
.tabs-header .tabs-pill li a.tabs-inner {
  -moz-border-radius: 5px 5px 5px 5px;
  -webkit-border-radius: 5px 5px 5px 5px;
  border-radius: 5px 5px 5px 5px;
}
.tabs-header-narrow,
.tabs-header-narrow .tabs-narrow {
  padding: 0;
}
.tabs-narrow li,
.tabs-header-bottom .tabs-narrow li {
  margin-left: 0;
  margin-right: -1px;
}
.tabs-narrow li.tabs-last,
.tabs-header-bottom .tabs-narrow li.tabs-last {
  margin-right: 0;
}
.tabs-header-left .tabs-narrow,
.tabs-header-right .tabs-narrow {
  padding-top: 0;
}
.tabs-header-left .tabs-narrow li {
  margin-bottom: -1px;
  margin-right: -1px;
}
.tabs-header-left .tabs-narrow li.tabs-last,
.tabs-header-right .tabs-narrow li.tabs-last {
  margin-bottom: 0;
}
.tabs-header-right .tabs-narrow li {
  margin-bottom: -1px;
  margin-left: -1px;
}
.tabs-scroller-left {
  background: #E0ECFF url('images/tabs_icons.png') no-repeat 1px center;
}
.tabs-scroller-right {
  background: #E0ECFF url('images/tabs_icons.png') no-repeat -15px center;
}
.tabs li a.tabs-close {
  background: url('images/tabs_icons.png') no-repeat -34px center;
}
.tabs li a.tabs-inner:hover {
  background: #eaf2ff;
  color: #000000;
  filter: none;
}
.tabs li.tabs-selected a.tabs-inner {
  background-color: #ffffff;
  color: #0E2D5F;
  background: -webkit-linear-gradient(top,#EFF5FF 0,#ffffff 100%);
  background: -moz-linear-gradient(top,#EFF5FF 0,#ffffff 100%);
  background: -o-linear-gradient(top,#EFF5FF 0,#ffffff 100%);
  background: linear-gradient(to bottom,#EFF5FF 0,#ffffff 100%);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#ffffff,GradientType=0);
}
.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner {
  background: -webkit-linear-gradient(top,#ffffff 0,#EFF5FF 100%);
  background: -moz-linear-gradient(top,#ffffff 0,#EFF5FF 100%);
  background: -o-linear-gradient(top,#ffffff 0,#EFF5FF 100%);
  background: linear-gradient(to bottom,#ffffff 0,#EFF5FF 100%);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#EFF5FF,GradientType=0);
}
.tabs-header-left .tabs li.tabs-selected a.tabs-inner {
  background: -webkit-linear-gradient(left,#EFF5FF 0,#ffffff 100%);
  background: -moz-linear-gradient(left,#EFF5FF 0,#ffffff 100%);
  background: -o-linear-gradient(left,#EFF5FF 0,#ffffff 100%);
  background: linear-gradient(to right,#EFF5FF 0,#ffffff 100%);
  background-repeat: repeat-y;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#ffffff,GradientType=1);
}
.tabs-header-right .tabs li.tabs-selected a.tabs-inner {
  background: -webkit-linear-gradient(left,#ffffff 0,#EFF5FF 100%);
  background: -moz-linear-gradient(left,#ffffff 0,#EFF5FF 100%);
  background: -o-linear-gradient(left,#ffffff 0,#EFF5FF 100%);
  background: linear-gradient(to right,#ffffff 0,#EFF5FF 100%);
  background-repeat: repeat-y;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#EFF5FF,GradientType=1);
}
.tabs li a.tabs-inner {
  color: #0E2D5F;
  background-color: #E0ECFF;
  background: -webkit-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%);
  background: -moz-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%);
  background: -o-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%);
  background: linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 100%);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#E0ECFF,GradientType=0);
}
.tabs-header,
.tabs-tool {
  background-color: #E0ECFF;
}
.tabs-header-plain {
  background: transparent;
}
.tabs-header,
.tabs-scroller-left,
.tabs-scroller-right,
.tabs-tool,
.tabs,
.tabs-panels,
.tabs li a.tabs-inner,
.tabs li.tabs-selected a.tabs-inner,
.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner,
.tabs-header-left .tabs li.tabs-selected a.tabs-inner,
.tabs-header-right .tabs li.tabs-selected a.tabs-inner {
  border-color: #95B8E7;
}
.tabs-p-tool a:hover,
.tabs li a:hover.tabs-close,
.tabs-scroller-over {
  background-color: #eaf2ff;
}
.tabs li.tabs-selected a.tabs-inner {
  border-bottom: 1px solid #ffffff;
}
.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner {
  border-top: 1px solid #ffffff;
}
.tabs-header-left .tabs li.tabs-selected a.tabs-inner {
  border-right: 1px solid #ffffff;
}
.tabs-header-right .tabs li.tabs-selected a.tabs-inner {
  border-left: 1px solid #ffffff;
}
.tabs-header .tabs-pill li.tabs-selected a.tabs-inner {
  background: #ffe48d;
  color: #000000;
  filter: none;
  border-color: #95B8E7;
}


<!doctype html>

  <meta charset="utf-8">
  <title>Video Watcher</title>

  <link rel="stylesheet" type="text/css" href="../../common/css/bootstrap.min.css">

Best Videos Ever ❤


//testing single line comment

/*+ testing multiple lines comment.
	+ testing return constant.
	+ testing spaces.*/

int main(){/*comment 2*/return 0x4321;};


<?xml version='1.0' ?>
<m:oMathPara>
  <m:oMathParaPr>
    <m:jc m:val="center" />
  </m:oMathParaPr>
  <m:oMath>
    <m:r>
      <m:t>f</m:t>
    </m:r>
    <m:r>
      <m:t></m:t>
    </m:r>
    <m:d>
      <m:dPr>
        <m:begChr m:val="(" />
        <m:endChr m:val=")" />
        <m:grow />
      </m:dPr>
      <m:e>
        <m:r>
          <m:t>x</m:t>
        </m:r>
      </m:e>
    </m:d>
  </m:oMath>
</m:oMathPara>


///////////////////////////////////////////////////////////////////////////////////
// FreeFrame.cpp
//
// FreeFrame Open Video Plugin Prototype
// C Version
//
// Implementation of a plugin interface for the FreeFrame API
//
// www.freeframe.org
// marcus@freeframe.org

/*

Copyright (c) 2002, Marcus Clements www.freeframe.org
All rights reserved.

FreeFrame 1.0 upgrade by Russell Blakeborough
email: boblists@brightonart.org

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

   * Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.
   * Neither the name of FreeFrame nor the names of its
     contributors may be used to endorse or promote products derived
     from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/

/*
includes:
freeframe 1.0 extended. see: http://vvvv.org/tiki-index.php?page=FreeFrameExtendedSpecification
*/

///////////////////////////////////////////////////////////////////////////////////////////
//
// includes
//

#include "FreeFrame.h"
#include "TemplateExtOpenCV.h"  // replace this with your plugins header

///////////////////////////////////////////////////////////////////////////////////////////
// Windows DLL Entry point
//
// notes: we may want to capture hModule as the instance of the host...

//#ifdef WIN32
BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
    return TRUE;
}
//#endif

///////////////////////////////////////////////////////////////////////////////////////
// plugMain - The one and only exposed function
// parameters:
//	functionCode - tells the plugin which function is being called
//  pParam - 32-bit parameter or 32-bit pointer to parameter structure
//
// PLUGIN DEVELOPERS:  you shouldn't need to change this function
//
// All parameters are cast as 32-bit untyped pointers and cast to appropriate
// types here
//
// All return values are cast to 32-bit untyped pointers here before return to
// the host
//

#ifdef WIN32
extern "C"  __declspec(dllexport) __stdcall plugMainUnion plugMain(DWORD functionCode, LPVOID pParam, LPVOID instanceID)
#elif LINUX
extern "C" {
   plugMainUnion plugMain( DWORD functionCode, LPVOID pParam, LPVOID instanceID)
#endif
{
	plugMainUnion retval;

	// declare pPlugObj - pointer to this instance
	plugClass *pPlugObj;

	// typecast LPVOID into pointer to a plugClass
	pPlugObj = (plugClass*) instanceID;

	switch(functionCode) {

	case FF_GETINFO:
		retval.PISvalue = getInfo();
		break;
	case FF_INITIALISE:
		retval.ivalue = initialise();
		break;
	case FF_DEINITIALISE:
		retval.ivalue = deInitialise();			// todo: pass on instance IDs etc
		break;
	case FF_GETNUMPARAMETERS:
		retval.ivalue = getNumParameters();
		break;
	case FF_GETPARAMETERNAME:
		retval.svalue =  getParameterName( (DWORD) pParam );
		break;
	case FF_GETPARAMETERDEFAULT:
		retval.fvalue =  getParameterDefault( (DWORD) pParam );
		break;
	case FF_GETPARAMETERDISPLAY:
		retval.svalue =  pPlugObj->getParameterDisplay( (DWORD) pParam );
		break;
	// parameters are passed in here as a packed struct of two DWORDS:
	// index and value
	case FF_SETPARAMETER:
		retval.ivalue=  pPlugObj->setParameter( (SetParameterStruct*) pParam );
		break;
	case FF_PROCESSFRAME:
		retval.ivalue = pPlugObj->processFrame(pParam);
		break;
	case FF_GETPARAMETER:
		retval.fvalue =  pPlugObj->getParameter((DWORD) pParam);
		break;
	case FF_GETPLUGINCAPS:
		retval.ivalue = getPluginCaps( (DWORD) pParam);
		break;

// Russell - FF 1.0 upgrade in progress ...

	case FF_INSTANTIATE:
		retval.ivalue = (DWORD) instantiate( (VideoInfoStruct*) pParam);
		break;
	case FF_DEINSTANTIATE:
		retval.ivalue = deInstantiate(pPlugObj);
		break;
	case FF_GETEXTENDEDINFO:
		retval.ivalue = (DWORD) getExtendedInfo();
		break;
	case FF_PROCESSFRAMECOPY:
		retval.ivalue = pPlugObj->processFrameCopy((ProcessFrameCopyStruct*)pParam);
		break;
	case FF_GETPARAMETERTYPE:
		retval.ivalue = getParameterType( (DWORD) pParam );
		break;

//freeframe 1.0 extended. see: http://vvvv.org/tiki-index.php?page=FreeFrameExtendedSpecification
//outputs
	case FF_GETNUMOUTPUTS:
		retval.ivalue = getNumOutputs();
		break;
	case FF_GETOUTPUTNAME:
		retval.svalue = getOutputName((DWORD) pParam);
		break;
	case FF_GETOUTPUTTYPE:
		retval.ivalue = getOutputType((DWORD) pParam);
		break;
	case FF_GETOUTPUTSLICECOUNT:
		retval.ivalue = pPlugObj->getOutputSliceCount((DWORD) pParam);
		break;
	case FF_GETOUTPUT:
		retval.svalue = (char*)pPlugObj->getOutput((DWORD) pParam);
		break;
	case FF_SETTHREADLOCK:
         retval.ivalue = pPlugObj->setThreadLock((DWORD) pParam);
         break;

//spreaded inputs
    case FF_SETINPUT:
        retval.ivalue =  pPlugObj->setInput( (InputStruct*) pParam );
        break;

// ....................................

	default:
		retval.ivalue = FF_FAIL;
		break;
	}
	return retval;
}
#ifdef linux

} /* extern "C" */
#endif

// }


using System;
using System.Collections;
using System.Collections.Generic;
using FormFactory.Attributes;
using System.Linq;
using System.Reflection;
using System.Text;

using FormFactory.AspMvc.Wrappers;
using FormFactory.UnobtrusiveValidation;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;

namespace FormFactory
{
    public static class AspMvcValidationHelper
    {

        public static IHtmlContent AllValidationMessages(this IHtmlHelper helper, string modelName)
        {
            if (HasErrors(helper, modelName))
            {
                var message = string.Join(", ", helper.ViewData.ModelState[modelName].Errors.Select(e => e.ErrorMessage));
                return new HtmlString(message);
            }
            return new HtmlString("");
        }

        public static bool HasErrors(this IHtmlHelper helper, string modelName)
        {
            return helper.ViewData.ModelState.ContainsKey(modelName) &&
                   helper.ViewData.ModelState[modelName].Errors.Count > 0;
        }

        public static List<UnobtrusiveValidationRule> UnobtrusiveValidationRules = new List<UnobtrusiveValidationRule>()
        {
            GetRulesFromAttributes
        };

        private static IEnumerable<ModelClientValidationRule> GetRulesFromAttributes(PropertyVm property)
        {
            return property.GetCustomAttributes()
                .SelectMany(attribute => UnobtrusiveValidationAttributeRules,
                            (attribute, rule) => rule(property, attribute))
                .Where(r => r != null);
        }

        public static List<UnobtrusiveValidationAttributeRule> UnobtrusiveValidationAttributeRules = new List
          <UnobtrusiveValidationAttributeRule>()
        {
            RangeAttribteRule,
            RequiredAttributeRule,
            StringLengthAttributeRule,
            RegexAttributeRule
        };

        private static ModelClientValidationRule RangeAttribteRule(PropertyVm propertyVm, object attribute)
        {
            var a = attribute as RangeAttribute;
            return (a == null) ? null : new ModelClientValidationRangeRule(a.FormatErrorMessage(propertyVm.DisplayName), a.Minimum, a.Maximum);
        }

        private static ModelClientValidationRule RequiredAttributeRule(PropertyVm propertyVm, object attribute)
        {
            var a = attribute as RequiredAttribute ;
            return (a == null) ? null : new ModelClientValidationRequiredRule(a.FormatErrorMessage(propertyVm.DisplayName));
        }

        private static ModelClientValidationRule StringLengthAttributeRule(PropertyVm propertyVm, object attribute)
        {
            var a = attribute as StringLengthAttribute;
            return (a == null) ? null : new ModelClientValidationStringLengthRule(a.FormatErrorMessage(propertyVm.DisplayName), a.MinimumLength, a.MaximumLength);
        }
        private static ModelClientValidationRule RegexAttributeRule(PropertyVm propertyVm, object attribute)
        {
            var a = attribute as RegularExpressionAttribute;
            return (a == null) ? null : new ModelClientValidationRegexRule(a.FormatErrorMessage(propertyVm.DisplayName), a.Pattern);
        }

        public delegate IEnumerable<ModelClientValidationRule> UnobtrusiveValidationRule(PropertyVm property);
        public delegate ModelClientValidationRule UnobtrusiveValidationAttributeRule(PropertyVm property, object attribute);

        public static IHtmlContent UnobtrusiveValidation(this IHtmlHelper helper, PropertyVm property)
        {
            var unobtrusiveValidation = ValidationHelper.UnobtrusiveValidation(new FormFactoryHtmlHelper(helper), property);

            return new HtmlString(unobtrusiveValidation);
        }
    }

}


c++DBUG    = -ggdb3 -DFULLDEBUG
c++OPT      = -O0 -fdefault-inline


<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>default_expr</string> </key>
            <value>
              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
            </value>
        </item>
        <item>
            <key> <string>default_value</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>description</string> </key>
            <value> <string>Comments about the last transition</string> </value>
        </item>
        <item>
            <key> <string>for_catalog</string> </key>
            <value> <int>0</int> </value>
        </item>
        <item>
            <key> <string>for_status</string> </key>
            <value> <int>1</int> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>comment</string> </value>
        </item>
        <item>
            <key> <string>info_guard</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>update_always</string> </key>
            <value> <int>1</int> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
  <record id="2" aka="AAAAAAAAAAI=">
    <pickle>
      <tuple>
        <tuple>
          <string>Products.CMFCore.Expression</string>
          <string>Expression</string>
        </tuple>
        <none/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>text</string> </key>
            <value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>


@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*"


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>GLFW: Globals</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra.css" rel="stylesheet" type="text/css"/>

		GLFW

Documentation

Download

Media

Community

Main Page

Related Pages

Modules

Data Structures

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

Globals

All

Functions

Typedefs

Macros

a

b

c

d

f

g

h

i

j

k

l

m

n

o

p

r

s

v

 All Data Structures Files Functions Variables Typedefs Macros Modules Pages

- i -

GLFW_IBEAM_CURSOR
: glfw3.h

GLFW_ICONIFIED
: glfw3.h

GLFW_INVALID_ENUM
: glfw3.h

GLFW_INVALID_VALUE
: glfw3.h

<address class="footer">

Last update on Mon Oct 12 2015 for GLFW 3.1.2

</address>


// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build plan9

package plan9_test

import (
	"testing"

	"golang.org/x/sys/plan9"
)

func testSetGetenv(t *testing.T, key, value string) {
	err := plan9.Setenv(key, value)
	if err != nil {
		t.Fatalf("Setenv failed to set %q: %v", value, err)
	}
	newvalue, found := plan9.Getenv(key)
	if !found {
		t.Fatalf("Getenv failed to find %v variable (want value %q)", key, value)
	}
	if newvalue != value {
		t.Fatalf("Getenv(%v) = %q; want %q", key, newvalue, value)
	}
}

func TestEnv(t *testing.T) {
	testSetGetenv(t, "TESTENV", "AVALUE")
	// make sure TESTENV gets set to "", not deleted
	testSetGetenv(t, "TESTENV", "")
}


//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2020
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/telegram/SequenceDispatcher.h"

#include "td/telegram/Global.h"
#include "td/telegram/net/NetQueryDispatcher.h"

#include "td/actor/PromiseFuture.h"

#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/Status.h"

#include <limits>

namespace td {

/*** Sequence Dispatcher ***/
// Sends queries with invokeAfter.
//
// Each query has three states Start/Wait/Finish
//
// finish_i points to the first not Finish query.
// next_i points to the next query to be sent.
//
// Each query has generation of InvokeAfter chain.
//
// When query is send, its generation is set to current chain generation.
//
// When query is failed and its generation is equals to current generation we must start new chain:
// increment the generation and set next_i to finish_i.
//
// last_sent_i points to the last sent query in current chain.
//
void SequenceDispatcher::send_with_callback(NetQueryPtr query, ActorShared<NetQueryCallback> callback) {
  cancel_timeout();
  query->debug("Waiting at SequenceDispatcher");
  auto query_weak_ref = query.get_weak();
  data_.push_back(Data{State::Start, std::move(query_weak_ref), std::move(query), std::move(callback), 0, 0.0, 0.0});
  loop();
}

void SequenceDispatcher::check_timeout(Data &data) {
  if (data.state_ != State::Start) {
    return;
  }
  data.query_->total_timeout_ += data.total_timeout_;
  data.total_timeout_ = 0;
  if (data.query_->total_timeout_ > data.query_->total_timeout_limit_) {
    LOG(WARNING) << "Fail " << data.query_ << " to " << data.query_->source_ << " because total_timeout "
                 << data.query_->total_timeout_ << " is greater than total_timeout_limit "
                 << data.query_->total_timeout_limit_;
    data.query_->set_error(Status::Error(
        429, PSLICE() << "Too Many Requests: retry after " << static_cast<int32>(data.last_timeout_ + 0.999)));
    data.state_ = State::Dummy;
    try_resend_query(data, std::move(data.query_));
  }
}

void SequenceDispatcher::try_resend_query(Data &data, NetQueryPtr query) {
  size_t pos = &data - &data_[0];
  CHECK(pos < data_.size());
  CHECK(data.state_ == State::Dummy);
  data.state_ = State::Wait;
  wait_cnt_++;
  auto token = pos + id_offset_;
  // TODO: if query is ok, use NetQueryCallback::on_result
  auto promise = PromiseCreator::lambda([&, self = actor_shared(this, token)](NetQueryPtr query) mutable {
    if (!query.empty()) {
      send_closure(std::move(self), &SequenceDispatcher::on_resend_ok, std::move(query));
    } else {
      send_closure(std::move(self), &SequenceDispatcher::on_resend_error);
    }
  });
  send_closure(data.callback_, &NetQueryCallback::on_result_resendable, std::move(query), std::move(promise));
}

SequenceDispatcher::Data &SequenceDispatcher::data_from_token() {
  auto token = narrow_cast<size_t>(get_link_token());
  auto pos = token - id_offset_;
  CHECK(pos < data_.size());
  auto &data = data_[pos];
  CHECK(data.state_ == State::Wait);
  CHECK(wait_cnt_ > 0);
  wait_cnt_--;
  data.state_ = State::Dummy;
  return data;
}

void SequenceDispatcher::on_resend_ok(NetQueryPtr query) {
  auto &data = data_from_token();
  data.query_ = std::move(query);
  do_resend(data);
  loop();
}

void SequenceDispatcher::on_resend_error() {
  auto &data = data_from_token();
  do_finish(data);
  loop();
}

void SequenceDispatcher::do_resend(Data &data) {
  CHECK(data.state_ == State::Dummy);
  data.state_ = State::Start;
  if (data.generation_ == generation_) {
    next_i_ = finish_i_;
    generation_++;
    last_sent_i_ = std::numeric_limits<size_t>::max();
  }
  check_timeout(data);
}

void SequenceDispatcher::do_finish(Data &data) {
  CHECK(data.state_ == State::Dummy);
  data.state_ = State::Finish;
  if (!parent_.empty()) {
    send_closure(parent_, &Parent::on_result);
  }
}

void SequenceDispatcher::on_result(NetQueryPtr query) {
  auto &data = data_from_token();
  size_t pos = &data - &data_[0];
  CHECK(pos < data_.size());

  if (query->last_timeout_ != 0) {
    for (auto i = pos + 1; i < data_.size(); i++) {
      data_[i].total_timeout_ += query->last_timeout_;
      data_[i].last_timeout_ = query->last_timeout_;
      check_timeout(data_[i]);
    }
  }

  if (query->is_error() && (query->error().code() == NetQuery::ResendInvokeAfter ||
                            (query->error().code() == 400 && query->error().message() == "MSG_WAIT_FAILED"))) {
    VLOG(net_query) << "Resend " << query;
    query->resend();
    query->debug("Waiting at SequenceDispatcher");
    data.query_ = std::move(query);
    do_resend(data);
  } else {
    try_resend_query(data, std::move(query));
  }
  loop();
}

void SequenceDispatcher::loop() {
  for (; finish_i_ < data_.size() && data_[finish_i_].state_ == State::Finish; finish_i_++) {
  }
  if (next_i_ < finish_i_) {
    next_i_ = finish_i_;
  }
  for (; next_i_ < data_.size() && data_[next_i_].state_ != State::Wait && wait_cnt_ < MAX_SIMULTANEOUS_WAIT;
       next_i_++) {
    if (data_[next_i_].state_ == State::Finish) {
      continue;
    }
    NetQueryRef invoke_after;
    if (last_sent_i_ != std::numeric_limits<size_t>::max() && data_[last_sent_i_].state_ == State::Wait) {
      invoke_after = data_[last_sent_i_].net_query_ref_;
    }
    data_[next_i_].query_->set_invoke_after(invoke_after);
    data_[next_i_].query_->last_timeout_ = 0;

    VLOG(net_query) << "Send " << data_[next_i_].query_;

    data_[next_i_].query_->debug("send to Td::send_with_callback");
    data_[next_i_].query_->set_session_rand(session_rand_);
    G()->net_query_dispatcher().dispatch_with_callback(std::move(data_[next_i_].query_),
                                                       actor_shared(this, next_i_ + id_offset_));
    data_[next_i_].state_ = State::Wait;
    wait_cnt_++;
    data_[next_i_].generation_ = generation_;
    last_sent_i_ = next_i_;
  }

  try_shrink();

  if (finish_i_ == data_.size() && !parent_.empty()) {
    set_timeout_in(5);
  }
}

void SequenceDispatcher::try_shrink() {
  if (finish_i_ * 2 > data_.size() && data_.size() > 5) {
    CHECK(finish_i_ <= next_i_);
    data_.erase(data_.begin(), data_.begin() + finish_i_);
    next_i_ -= finish_i_;
    if (last_sent_i_ != std::numeric_limits<size_t>::max()) {
      if (last_sent_i_ >= finish_i_) {
        last_sent_i_ -= finish_i_;
      } else {
        last_sent_i_ = std::numeric_limits<size_t>::max();
      }
    }
    id_offset_ += finish_i_;
    finish_i_ = 0;
  }
}

void SequenceDispatcher::timeout_expired() {
  if (finish_i_ != data_.size()) {
    return;
  }
  CHECK(!parent_.empty());
  set_timeout_in(1);
  LOG(DEBUG) << "SequenceDispatcher ready to close";
  send_closure(parent_, &Parent::ready_to_close);
}

void SequenceDispatcher::hangup() {
  stop();
}

void SequenceDispatcher::tear_down() {
  for (auto &data : data_) {
    if (data.query_.empty()) {
      continue;
    }
    data.state_ = State::Dummy;
    data.query_->set_error(Status::Error(500, "Request aborted"));
    do_finish(data);
  }
}

void SequenceDispatcher::close_silent() {
  for (auto &data : data_) {
    if (!data.query_.empty()) {
      data.query_->clear();
    }
  }
  stop();
}

/*** MultiSequenceDispatcher ***/
void MultiSequenceDispatcher::send_with_callback(NetQueryPtr query, ActorShared<NetQueryCallback> callback,
                                                 uint64 sequence_id) {
  CHECK(sequence_id != 0);
  auto it_ok = dispatchers_.emplace(sequence_id, Data{0, ActorOwn<SequenceDispatcher>()});
  auto &data = it_ok.first->second;
  if (it_ok.second) {
    LOG(DEBUG) << "Create SequenceDispatcher" << sequence_id;
    data.dispatcher_ = create_actor<SequenceDispatcher>("sequence dispatcher", actor_shared(this, sequence_id));
  }
  data.cnt_++;
  query->debug(PSTRING() << "send to SequenceDispatcher " << tag("sequence_id", sequence_id));
  send_closure(data.dispatcher_, &SequenceDispatcher::send_with_callback, std::move(query), std::move(callback));
}

void MultiSequenceDispatcher::on_result() {
  auto it = dispatchers_.find(get_link_token());
  CHECK(it != dispatchers_.end());
  it->second.cnt_--;
}

void MultiSequenceDispatcher::ready_to_close() {
  auto it = dispatchers_.find(get_link_token());
  CHECK(it != dispatchers_.end());
  if (it->second.cnt_ == 0) {
    LOG(DEBUG) << "Close SequenceDispatcher " << get_link_token();
    dispatchers_.erase(it);
  }
}

}  // namespace td


package cookoo

import (
	"fmt"
	"testing"
)

func Example() {
	// This is an admittedly contrived example in which we first store a
	// "Hello World" message, and then tell the logger to get that stored
	// message and write it to the log.
	reg, router, cxt := Cookoo()
	reg.AddRoute(Route{
		Name: "hello",
		Help: "Sends the log message 'Hello World'",
		Does: Tasks{
			// First, store the message "Hello World" in the context.
			Cmd{
				Name: "message",
				Fn:   AddToContext,
				Using: []Param{
					Param{
						Name:         "hello",
						DefaultValue: "Hello World",
					},
				},
			},
			// Now get that message and write it to the log.
			Cmd{
				Name: "log",
				Fn:   LogMessage,
				Using: []Param{
					Param{
						Name: "msg",
						From: "cxt:message",
					},
				},
			},
		},
	})

	router.HandleRequest("hello", cxt, false)
}

func ExampleCookoo() {
	reg, router, cxt := Cookoo()
	reg.AddRoute(Route{
		// The name of the route. You execute routes by name. (See router.HandleRequest below)
		Name: "hello",
		// This is for documentation/help tools.
		Help: "Print a message on standard output",

		// This is a list of things you want this route to do. When executed,
		// it will run these commands in order.
		Does: Tasks{
			// Declare a new command.
			Cmd{
				// Give the command a name. Programs reference command output
				// by this name.
				Name: "print",

				// Tell Cookoo what function to execute when we get to this
				// step.
				//
				// Usually we define functions elsewhere so we can re-use them.
				Fn: func(c Context, p *Params) (interface{}, Interrupt) {
					// Print whatever the content of the 'msg' parameter is.
					fmt.Println(p.Get("msg", "").(string))
					return nil, nil
				},
				// Send some parameters into Fn. Here we define the 'msg'
				// parameter that Fn prints. While we just use a default
				// value here, Cookoo can get that information from another
				// source and then send it into Fn.
				Using: []Param{
					Param{
						Name:         "msg",
						DefaultValue: "Hello World",
					},
				},
			},
		},
	})

	// Now we execute the "hello" chain of commands.
	router.HandleRequest("hello", cxt, false)
	// Output:
	// Hello World
}

func TestCookooForCoCo(t *testing.T) {
	registry, router, cxt := Cookoo()

	cxt.Put("Answer", 42)

	lifeUniverseEverything := cxt.Get("Answer", nil)

	if lifeUniverseEverything != 42 {
		t.Error("! Context is not working.")
	}

	registry.Route("foo", "test")

	ok := router.HasRoute("foo")

	if !ok {
		t.Error("! Router does not have 'foo' route.")
	}
}


<component name="libraryTable">
  <library name="support-v4-25.0.1">
    <CLASSES>
      <root url="jar://$USER_HOME$/.android/build-cache/2d2077e16d080107aeec9456f764b087a91e798c/output/jars/classes.jar!/" />
      <root url="file://$USER_HOME$/.android/build-cache/2d2077e16d080107aeec9456f764b087a91e798c/output/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


project('sizeof', 'c', 'cpp')

# Test with C
cc = meson.get_compiler('c')

intsize = cc.sizeof('int')
wcharsize = cc.sizeof('wchar_t', prefix : '#include<wchar.h>')

cd = configuration_data()
cd.set('INTSIZE', intsize)
cd.set('WCHARSIZE', wcharsize)
cd.set('CONFIG', 'config.h')
configure_file(input : 'config.h.in', output : 'config.h', configuration : cd)
s = configure_file(input : 'prog.c.in', output : 'prog.c', configuration : cd)

e = executable('prog', s)
test('sizeof test', e)

# Test with C++
cpp = meson.get_compiler('cpp')

intsize = cpp.sizeof('int')
wcharsize = cpp.sizeof('wchar_t', prefix : '#include<wchar.h>')

cdpp = configuration_data()
cdpp.set('INTSIZE', intsize)
cdpp.set('WCHARSIZE', wcharsize)
cdpp.set('CONFIG', 'config.hpp')
configure_file(input : 'config.h.in', output : 'config.hpp', configuration : cdpp)
spp = configure_file(input : 'prog.c.in', output : 'prog.cc', configuration : cdpp)

epp = executable('progpp', spp)
test('sizeof test c++', epp)


<?php
/*
  +---------------------------------------------------------------------------------+
  | Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L.                   |
  +---------------------------------------------------------------------------------+
  | Redistribution and use in source and binary forms, with or without              |
  | modification, are permitted provided that the following conditions are met:     |
  | 1. Redistributions of source code must retain the above copyright               |
  |    notice, this list of conditions and the following disclaimer.                |
  |                                                                                |
  | 2. Redistributions in binary form must reproduce the above copyright            |
  |    notice, this list of conditions and the following disclaimer in the          |
  |    documentation and/or other materials provided with the distribution.         |
  |                                                                                |
  | 3. All advertising materials mentioning features or use of this software        |
  |    must display the following acknowledgement:                                  |
  |    This product includes software developed by César D. Rodas.                  |
  |                                                                                |
  | 4. Neither the name of the César D. Rodas nor the                               |
  |    names of its contributors may be used to endorse or promote products         |
  |    derived from this software without specific prior written permission.        |
  |                                                                                |
  | THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY                   |
  | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED       |
  | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE          |
  | DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY                  |
  | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES      |
  | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;    |
  | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND     |
  | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT      |
  | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS   |
  | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE                     |
  +---------------------------------------------------------------------------------+
  | Authors: César Rodas <crodas@php.net>                                           |
  +---------------------------------------------------------------------------------+
*/

class Haanga_Extension_Filter extends Haanga_Extension
{
    /**
     *  isValid
     *
     *
     */
    final function isValid($filter)
    {
        static $cache = array();
        $filter = strtolower($filter);

        if (!isset($cache[$filter])) {
            $class_name = $this->getClassName($filter);
            if (class_exists($class_name)) {
                $cache[$filter] = TRUE;
            } else {
                $cache[$filter] = FALSE;
            }
        }

        return $cache[$filter];
    }

    final function getClassName($filter)
    {
        $filter = str_replace("_", "", ucfirst($filter));
        return "Haanga_Extension_Filter_{$filter}";
    }

}

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: sw=4 ts=4 fdm=marker
 * vim<600: sw=4 ts=4
 */


#! /bin/sh

if [ ! -f prereq ]; then
  mkdir -p prereq
fi
if [ ! -f local/lib ]; then
  mkdir -p local/lib
fi
if [ ! -f local/bin ]; then
  mkdir -p local/bin
fi
if [ ! -f local/include ]; then
  mkdir -p local/include
fi

ROOT=$(pwd)
pushd prereq

if [ ! -d bison-2.4.tar.gz ]; then
  curl http://ftp.gnu.org/gnu/bison/bison-2.4.tar.gz > bison-2.4.tar.gz
fi
if [ ! -f bison-2.4 ]; then
  tar -xf bison-2.4.tar.gz
fi
cd bison-2.4
mkdir build
./configure --prefix ${ROOT}/local
make -j 4;make install
cd ${ROOT}


<?php
/**
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */
namespace Piwik\Columns;

use Exception;

/**
 * @api
 * @since 3.1.0
 */
class Join
{
    private $table;
    private $column;
    private $targetColumn;

    /**
     * Join constructor.
     * @param $table
     * @param $column
     * @param $targetColumn
     * @throws Exception
     */
    public function __construct($table, $column, $targetColumn)
    {
        $this->table = $table;
        $this->column = $column;
        $this->targetColumn = $targetColumn;
    }

    /**
     * @return string
     */
    public function getTable()
    {
        return $this->table;
    }

    /**
     * @return string
     */
    public function getColumn()
    {
        return $this->column;
    }

    /**
     * @return string
     */
    public function getTargetColumn()
    {
        return $this->targetColumn;
    }

}


/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
*     * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*     * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*     * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef InspectorConsoleInstrumentation_h
#define InspectorConsoleInstrumentation_h

#include "InspectorInstrumentation.h"
#include "ScriptArguments.h"
#include "ScriptCallStack.h"
#include <wtf/PassRefPtr.h>

namespace WebCore {

inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        addMessageToConsoleImpl(inspectorAgent, source, type, level, message, arguments, callStack);
#endif
}

inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        addMessageToConsoleImpl(inspectorAgent, source, type, level, message, lineNumber, sourceID);
#endif
}

inline void InspectorInstrumentation::consoleCount(Page* page, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> stack)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        consoleCountImpl(inspectorAgent, arguments, stack);
#endif
}

inline void InspectorInstrumentation::startConsoleTiming(Page* page, const String& title)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        startConsoleTimingImpl(inspectorAgent, title);
#endif
}

inline void InspectorInstrumentation::stopConsoleTiming(Page* page, const String& title, PassRefPtr<ScriptCallStack> stack)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        stopConsoleTimingImpl(inspectorAgent, title, stack);
#endif
}

inline void InspectorInstrumentation::consoleMarkTimeline(Page* page, PassRefPtr<ScriptArguments> arguments)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentWithFrontendForPage(page))
        consoleMarkTimelineImpl(inspectorAgent, arguments);
#endif
}

#if ENABLE(JAVASCRIPT_DEBUGGER)
inline void InspectorInstrumentation::addStartProfilingMessageToConsole(Page* page, const String& title, unsigned lineNumber, const String& sourceURL)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        addStartProfilingMessageToConsoleImpl(inspectorAgent, title, lineNumber, sourceURL);
#endif
}

inline void InspectorInstrumentation::addProfile(Page* page, RefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        addProfileImpl(inspectorAgent, profile, callStack);
#endif
}

inline bool InspectorInstrumentation::profilerEnabled(Page* page)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        return profilerEnabledImpl(inspectorAgent);
#endif
    return false;
}

inline String InspectorInstrumentation::getCurrentUserInitiatedProfileName(Page* page, bool incrementProfileNumber)
{
#if ENABLE(INSPECTOR)
    if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
        return InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(inspectorAgent, incrementProfileNumber);
#endif
    return "";
}
#endif

} // namespace WebCore

#endif // !defined(InspectorConsoleInstrumentation_h)


#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments.  The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".

for i in `git status -s | awk '{ print $NF }'`; do
    j=$(echo $(basename $i)|cut -d'.' -f2)
    if [ "$j" = "c" -o "$j" = "h" -o "$j" = "md" -o "$j" = "mk" ] || [ "$i" = "makefile" -o "$i" = "make.settings" ]; then
        if [ "$(find $i -perm /111 2>/dev/null)" != "" ]; then
            chmod a-x $i
            echo "[chmod] $i"
            if [ "$(git status --short $i|cut -c1)" = "M" ]; then
                git add $i
            fi
        fi
    else
        echo "[skip ] $i"
    fi
done


; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> AXFR xn--mgberp4a5d4ar. @ns2.nic.net.sa. +nocomments +nocmd +noquestion +nostats +time=15
;; global options: +cmd
; Transfer failed.


# Oculte detalhes de erros dos usuários

### Explicação em um Parágrafo

A exposição dos detalhes de erros da aplicação ao cliente em produção deve ser evitada devido ao risco de expor detalhes confidenciais do aplicativo, como caminhos de arquivo do servidor, módulos de terceiros em uso e outros fluxos de trabalho internos da aplicação que poderiam ser explorados por um invasor.
O Express vem com um manipulador de erros embutido, que cuida de quaisquer erros que possam ser encontrados na aplicação. Essa função de middleware padrão de tratamento de erros é adicionada no final do stack de funções do middleware.
Se você passar um erro para `next()` e você não o manipular em um manipulador de erro personalizado, ele será tratado pelo manipulador de erros Express; o erro será gravado no cliente com o rastreamento de stack. Esse comportamento será verdadeiro quando `NODE_ENV` for definido como `development`, no entanto, quando `NODE_ENV` for definido como `production`, o rastreio de pilha não será gravado, apenas o código de resposta HTTP.

### Exemplo de código: Manipulador de erros do express

``` javascript
// manipulador de erros em produção
// nenhum rastreamento de stack vazou para o usuário
app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
        message: err.message,
        error: {}
    });
});
```

### Recursos Adicionais

🔗 [Documentação de manipulação de erros do Express.js](https://expressjs.com/en/guide/error-handling.html)


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package mf.org.apache.xerces.dom;

import mf.org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl;
import mf.org.apache.xerces.xni.NamespaceContext;
import mf.org.w3c.dom.DOMException;

/**
 * AttrNSImpl inherits from AttrImpl and adds namespace support.
 *

 * The qualified name is the node name, and we store localName which is also
 * used in all queries. On the other hand we recompute the prefix when
 * necessary.
 *
 * @author Arnaud  Le Hors, IBM
 * @author Andy Clark, IBM
 * @author Ralf Pfeiffer, IBM
 * @version $Id: AttrNSImpl.java 924245 2010-03-17 11:58:14Z mrglavas $
 * @xerces.internal
 */
public class AttrNSImpl
        extends AttrImpl {

    //
    // Constants
    //

    /**
     * Serialization version.
     */
    static final long serialVersionUID = -781906615369795414L;

    static final String xmlnsURI = "http://www.w3.org/2000/xmlns/";
    static final String xmlURI = "http://www.w3.org/XML/1998/namespace";

    //
    // Data
    //

    /**
     * DOM2: Namespace URI.
     */
    protected String namespaceURI;

    /**
     * DOM2: localName.
     */
    protected String localName;

    /*
     * Default constructor
     */
    public AttrNSImpl() {
    }

    /**
     * DOM2: Constructor for Namespace implementation.
     */
    protected AttrNSImpl(CoreDocumentImpl ownerDocument,
                         String namespaceURI,
                         String qualifiedName) {

        super(ownerDocument, qualifiedName);
        setName(namespaceURI, qualifiedName);
    }

    // when local name is known
    public AttrNSImpl(CoreDocumentImpl ownerDocument,
                      String namespaceURI,
                      String qualifiedName,
                      String localName) {
        super(ownerDocument, qualifiedName);

        this.localName = localName;
        this.namespaceURI = namespaceURI;
    }

    // for DeferredAttrImpl
    protected AttrNSImpl(CoreDocumentImpl ownerDocument,
                         String value) {
        super(ownerDocument, value);
    }

    private void setName(String namespaceURI, String qname) {
        CoreDocumentImpl ownerDocument = ownerDocument();
        String prefix;
        // DOM Level 3: namespace URI is never empty string.
        this.namespaceURI = namespaceURI;
        if (namespaceURI != null) {
            this.namespaceURI = (namespaceURI.length() == 0) ? null
                    : namespaceURI;

        }
        int colon1 = qname.indexOf(':');
        int colon2 = qname.lastIndexOf(':');
        ownerDocument.checkNamespaceWF(qname, colon1, colon2);
        if (colon1 < 0) {
            // there is no prefix
            localName = qname;
            if (ownerDocument.errorChecking) {
                ownerDocument.checkQName(null, localName);

                if (qname.equals("xmlns") && (namespaceURI == null
                        || !namespaceURI.equals(NamespaceContext.XMLNS_URI))
                        || (namespaceURI != null && namespaceURI.equals(NamespaceContext.XMLNS_URI)
                        && !qname.equals("xmlns"))) {
                    String msg =
                            DOMMessageFormatter.formatMessage(
                                    DOMMessageFormatter.DOM_DOMAIN,
                                    "NAMESPACE_ERR",
                                    null);
                    throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                }
            }
        } else {
            prefix = qname.substring(0, colon1);
            localName = qname.substring(colon2 + 1);
            ownerDocument.checkQName(prefix, localName);
            ownerDocument.checkDOMNSErr(prefix, namespaceURI);
        }
    }

    // Support for DOM Level 3 renameNode method.
    // Note: This only deals with part of the pb. It is expected to be
    // called after the Attr has been detached for one thing.
    // CoreDocumentImpl does all the work.
    void rename(String namespaceURI, String qualifiedName) {
        if (needsSyncData()) {
            synchronizeData();
        }
        this.name = qualifiedName;
        setName(namespaceURI, qualifiedName);
    }

    //
    // DOM2: Namespace methods
    //

    /**
     * Introduced in DOM Level 2.

     *

     * The namespace URI of this node, or null if it is unspecified.

     *

     * This is not a computed value that is the result of a namespace lookup
     * based on an examination of the namespace declarations in scope. It is
     * merely the namespace URI given at creation time.

     *

     * For nodes created with a DOM Level 1 method, such as createElement
     * from the Document interface, this is null.
     *
     * @since WD-DOM-Level-2-19990923
     */
    @Override
    public String getNamespaceURI() {
        if (needsSyncData()) {
            synchronizeData();
        }
        // REVIST: This code could/should be done at a lower-level, such that
        // the namespaceURI is set properly upon creation. However, there still
        // seems to be some DOM spec interpretation grey-area.
        return namespaceURI;
    }

    /**
     * Introduced in DOM Level 2.

     *

     * The namespace prefix of this node, or null if it is unspecified.

     *

     * For nodes created with a DOM Level 1 method, such as createElement
     * from the Document interface, this is null.

     *
     * @since WD-DOM-Level-2-19990923
     */
    @Override
    public String getPrefix() {
        if (needsSyncData()) {
            synchronizeData();
        }
        int index = name.indexOf(':');
        return index < 0 ? null : name.substring(0, index);
    }

    /**
     * Introduced in DOM Level 2.

     *

     * Note that setting this attribute changes the nodeName attribute, which
     * holds the qualified name, as well as the tagName and name attributes of
     * the Element and Attr interfaces, when applicable.

     *
     * @param prefix The namespace prefix of this node, or null(empty string) if it is unspecified.
     * @throws INVALID_CHARACTER_ERR Raised if the specified
     *                               prefix contains an invalid character.
     * @throws DOMException
     * @since WD-DOM-Level-2-19990923
     */
    @Override
    public void setPrefix(String prefix)
            throws DOMException {
        if (needsSyncData()) {
            synchronizeData();
        }
        if (ownerDocument().errorChecking) {
            if (isReadOnly()) {
                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
                throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
            }
            if (prefix != null && prefix.length() != 0) {

                if (!CoreDocumentImpl.isXMLName(prefix, ownerDocument().isXML11Version())) {
                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
                    throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
                }
                if (namespaceURI == null || prefix.indexOf(':') >= 0) {
                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
                    throw new DOMException(DOMException.NAMESPACE_ERR, msg);

                }
                if (prefix.equals("xmlns")) {
                    if (!namespaceURI.equals(xmlnsURI)) {
                        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
                        throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                    }
                } else if (prefix.equals("xml")) {
                    if (!namespaceURI.equals(xmlURI)) {
                        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
                        throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                    }
                } else if (name.equals("xmlns")) {
                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
                    throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                }
            }
        }

        // update node name with new qualifiedName
        if (prefix != null && prefix.length() != 0) {
            name = prefix + ":" + localName;
        } else {
            name = localName;
        }
    }

    /**
     * Introduced in DOM Level 2.

     *

     * Returns the local part of the qualified name of this node.
     *
     * @since WD-DOM-Level-2-19990923
     */
    @Override
    public String getLocalName() {
        if (needsSyncData()) {
            synchronizeData();
        }
        return localName;
    }

    /**
     * @see mf.org.w3c.dom.TypeInfo#getTypeName()
     */
    @Override
    public String getTypeName() {
        if (type != null) {
            if (type instanceof XSSimpleTypeDecl) {
                return ((XSSimpleTypeDecl) type).getName();
            }
            return (String) type;
        }
        return null;
    }

    /**
     * Introduced in DOM Level 3.

     * Checks if a type is derived from another by restriction. See:
     * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
     *
     * @param typeNamespaceArg The namspace of the ancestor type declaration
     * @param typeNameArg      The name of the ancestor type declaration
     * @param derivationMethod The derivation method
     * @return boolean True if the type is derived by restriciton for the
     * reference type
     */
    @Override
    public boolean isDerivedFrom(String typeNamespaceArg,
                                 String typeNameArg,
                                 int derivationMethod) {
        if (type != null) {
            if (type instanceof XSSimpleTypeDecl) {
                return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                        typeNamespaceArg, typeNameArg, derivationMethod);
            }
        }
        return false;
    }

    /**
     * @see mf.org.w3c.dom.TypeInfo#getTypeNamespace()
     */
    @Override
    public String getTypeNamespace() {
        if (type != null) {
            if (type instanceof XSSimpleTypeDecl) {
                return ((XSSimpleTypeDecl) type).getNamespace();
            }
            return DTD_URI;
        }
        return null;
    }

}


<!DOCTYPE html>

  <title>{{title}}</title>
  {{> includes/head.html }}

  {{> includes/header.html }}

      <form action="/auth/" method="post" class="form-register">
        <input type="hidden" name="redirectTo" value="{{{redirectTo}}" />

          Login
          Enter your username for our site to use with your preferred OAuth/OpenID service.

             WARNING: The username entered may include additional sanitizing for web friendly URLs and Userscript engine compatibility. If you wish to see the sanitization changes please enable JavaScript and start over.

            <input class="search form-control" type="text" name="username" value="{{wantname}}" placeholder="Username" spellcheck="false" autofocus="autofocus" autocomplete="username" autocorrect="off" autocapitalize="off" required="required">

          <select name="auth" class="form-control">
            {{#strategies}}
            <option value="{{strat}}" {{#selected}}selected="selected"{{/selected}}{{#disabled}} disabled="disabled"{{/disabled}}>{{display}}</option>
            {{/strategies}}
          </select>

 Terms of Service

 Privacy Policy

                <input type="checkbox" id="consent" name="consent" value="true" required="required"> I understand and agree to these binding terms & policies.

              <button class="btn btn-info" type="submit" id="action" class="pull-left">Next </button>

           CAUTION: The username that you choose to login with will be displayed to everyone. It is strongly recommended to not attempt to use an email address.

      </form>

  {{> includes/footer.html }}
  {{> includes/scripts/loginEcho.html }}
  {{> includes/scripts/formControlClear.html }}


% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/createObject.R
\name{createObject}
\alias{createObject}
\title{Create objects from list}
\usage{
createObject(objName = as.character(), targetValues = list())
}
\arguments{
\item{objName}{Name of object to be created}

\item{targetValues}{List of values representing slots in the object}
}
\description{
Allows creation of class objects based on a list.
}


import sys
i1 = eval(sys.argv[1])
i2 = eval(sys.argv[2])
r = i1 + i2
print '%s + %s becomes %s\nwith value %s' % \
      (type(i1), type(i2), type(r), r)


25--Soldier_Patrol/25_Soldier_Patrol_Soldier_Patrol_25_1045.jpg
2
71.4526 51.2233 265.779 369.653 0.988849
631.042 72.4986 287.816 387.547 0.925829


package winapi

import "syscall"

//sys RtlNtStatusToDosError(status uint32) (winerr error) = ntdll.RtlNtStatusToDosError

const (
	STATUS_REPARSE_POINT_ENCOUNTERED               = 0xC000050B
	ERROR_NO_MORE_ITEMS                            = 0x103
	ERROR_MORE_DATA                  syscall.Errno = 234
)

func NTSuccess(status uint32) bool {
	return status == 0
}


public class cave3_assert1 {
    public static void fct(int i) {
        assert(i == 0);
    }

	public static void main(String[] args) {

	}
}


package net.cyclestreets.views.overlay

import android.content.Intent
import android.content.SharedPreferences
import android.content.SharedPreferences.Editor
import android.graphics.Canvas
import android.util.Log
import android.view.*
import android.widget.Button
import android.widget.ImageView
import android.widget.Toast
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import net.cyclestreets.CycleStreetsPreferences
import net.cyclestreets.FeedbackActivity
import net.cyclestreets.RoutePlans
import net.cyclestreets.Undoable
import net.cyclestreets.iconics.IconicsHelper.materialIcon
import net.cyclestreets.routing.Journey
import net.cyclestreets.routing.Route
import net.cyclestreets.routing.Waypoints
import net.cyclestreets.util.Logging
import net.cyclestreets.util.MenuHelper.createMenuItem
import net.cyclestreets.util.MenuHelper.showMenuItem
import net.cyclestreets.util.MessageBox
import net.cyclestreets.util.Share
import net.cyclestreets.util.Theme
import net.cyclestreets.util.Theme.lowlightColor
import net.cyclestreets.util.Theme.lowlightColorInverse
import net.cyclestreets.view.R
import net.cyclestreets.views.CycleMapView
import org.osmdroid.api.IGeoPoint
import org.osmdroid.util.GeoPoint
import org.osmdroid.views.MapView
import org.osmdroid.views.overlay.Overlay

class TapToRouteOverlay(private val mapView: CycleMapView) : Overlay(), TapListener, ContextMenuListener,
                                                             Undoable, PauseResumeListener, Route.Listener {

    private val routingInfoRect: Button
    private val routeNowIcon: ImageView
    private val restartButton: FloatingActionButton

    private val context = mapView.context

    private val shareIcon = materialIcon(context, GoogleMaterial.Icon.gmd_share, lowlightColorInverse(context))
    private val commentIcon = materialIcon(context, GoogleMaterial.Icon.gmd_comment, lowlightColorInverse(context))
    private val changeRouteTypeIcon = materialIcon(context, GoogleMaterial.Icon.gmd_arrow_drop_down_circle, lowlightColorInverse(context))

    private val highlightColour = Theme.highlightColor(context) or 0xFF000000.toInt()
    private val lowlightColour = Theme.lowlightColor(context) or 0xFF000000.toInt()

    private val waymarks = WaymarkOverlay(mapView)
    private val controller = OverlayHelper(mapView).controller()

    private var tapState = TapToRoute.WAITING_FOR_START

    init {
        mapView.overlayPushTop(waymarks)

        // The view is shared, and has already been added by the RouteHighlightOverlay.
        // So find that, and don't inflate a second copy.
        val routeView = mapView.findViewById<View>(R.id.route_view)

        routingInfoRect = routeView.findViewById(R.id.routing_info_rect)
        routingInfoRect.setOnClickListener { _ -> onRouteNow(waypoints()) }

        restartButton = routeView.findViewById<FloatingActionButton>(R.id.restartbutton).apply {
            setImageDrawable(materialIcon(context, GoogleMaterial.Icon.gmd_replay, lowlightColor(context!!)))
            setOnClickListener { _ -> tapRestart() }
        }

        routeNowIcon = routeView.findViewById(R.id.route_now_icon)
    }

    private fun setRoute(noJourney: Boolean, waypointCount: Int) {
        controller.flushUndo(this)
        if (noJourney) {
            tapState = TapToRoute.fromCount(waypointCount)
            for (i in 1..waypointCount) controller.pushUndo(this)
        } else
            tapState = TapToRoute.ALL_DONE
    }

    private fun resetRoute() {
        tapState = TapToRoute.WAITING_FOR_START
        controller.flushUndo(this)
    }

    private fun onRouteNow(waypoints: Waypoints) {
        Route.PlotRoute(CycleStreetsPreferences.routeType(),
                CycleStreetsPreferences.speed(),
                context,
                waypoints)
    }

    ////////////////////////////////////////////
    fun waypoints(): Waypoints {
        return waymarks.waypoints()
    }

    private fun waypointsCount(): Int {
        return waymarks.waymarkersCount()
    }

    ////////////////////////////////////////////
    override fun onCreateOptionsMenu(menu: Menu) {
        createMenuItem(menu, R.string.route_menu_change, Menu.FIRST, changeRouteTypeIcon)
        createMenuItem(menu, R.string.route_menu_change_share, Menu.NONE, shareIcon)
        createMenuItem(menu, R.string.route_menu_change_comment, Menu.NONE, commentIcon)
    }

    override fun onPrepareOptionsMenu(menu: Menu) {
        showMenuItem(menu, R.string.route_menu_change, tapState.routeIsPlanned())
        showMenuItem(menu, R.string.route_menu_change_share, tapState.routeIsPlanned())
        showMenuItem(menu, R.string.route_menu_change_comment, tapState.routeIsPlanned())
    }

    override fun onCreateContextMenu(menu: ContextMenu) {
        if (!tapState.routeIsPlanned())
            return

        val currentPlan = Route.journey().plan()
        REPLAN_MENU_IDS
                .filter { id -> currentPlan != REPLAN_MENU_PLANS[id] }
                .forEach { id -> createMenuItem(menu, id)}

        if (mapView.isMyLocationEnabled)
            createMenuItem(menu, R.string.route_menu_change_reroute_from_here)

        createMenuItem(menu, R.string.route_menu_change_reverse)
    }

    override fun onMenuItemSelected(featureId: Int, item: MenuItem): Boolean {
        val menuId = item.itemId

        when (menuId) {
            R.string.route_menu_change ->
                mapView.showContextMenu()
            R.string.route_menu_change_reroute_from_here ->
                mapView.lastFix.apply {
                    if (this == null)
                        Toast.makeText(context, R.string.route_no_location, Toast.LENGTH_LONG).show()
                    else
                        onRouteNow(Waypoints.fromTo(GeoPoint(latitude, longitude), waymarks.finish()))
                }
            R.string.route_menu_change_reverse ->
                onRouteNow(waypoints().reversed())
            R.string.route_menu_change_share ->
                Share.Url(mapView,
                          Route.journey().url(),
                          Route.journey().name(),
                          "CycleStreets journey")
            R.string.route_menu_change_comment ->
                context.startActivity(Intent(context, FeedbackActivity::class.java))
            else ->
                if (REPLAN_MENU_PLANS.containsKey(menuId))
                    Route.RePlotRoute(REPLAN_MENU_PLANS[menuId]!!, context)
                else
                    return false
        }

        return true // we handled it!
    }

    ////////////////////////////////////////////
    override fun draw(canvas: Canvas, mapView: MapView, shadow: Boolean) {
        drawRoutingInfoRect()
        drawRestartButton()
    }

    private fun drawRestartButton() {
        if (tapState.routeIsPlanned()) {
            restartButton.show()
        } else {
            restartButton.hide()
        }
    }

    private fun drawRoutingInfoRect() {
        if (tapState.routeIsPlanned()) {
            // In this case, populating the routing info is done by the RouteHighlightOverlay
            return
        }

        routeNowIcon.visibility = if (tapState.canRoute()) View.VISIBLE else View.INVISIBLE

        routingInfoRect.apply {
            setBackgroundColor(if (tapState.canRoute()) highlightColour else lowlightColour)
            gravity = Gravity.CENTER
            text = tapState.actionDescription
            isEnabled = tapState.canRoute()
        }
    }

    //////////////////////////////////////////////
    override fun onSingleTap(event: MotionEvent): Boolean {
        return tapMarker(event)
    }

    override fun onDoubleTap(event: MotionEvent): Boolean {
        return false
    }

    private fun tapRestart(): Boolean {
        if (!CycleStreetsPreferences.confirmNewRoute())
            return stepBack(true)

        MessageBox.YesNo(mapView, "Start a new route?") { _, _ -> stepBack(true) }

        return true
    }

    override fun onBackPressed(): Boolean {
        return stepBack(false)
    }

    private fun stepBack(tap: Boolean): Boolean {
        if (!tap && !tapState.waypointingInProgress)
            return false

        when (tapState) {
            TapToRoute.WAITING_FOR_START -> return true
            TapToRoute.WAITING_TO_ROUTE,
            TapToRoute.WAITING_FOR_SECOND,
            TapToRoute.WAITING_FOR_NEXT -> waymarks.removeWaypoint()
            TapToRoute.ALL_DONE -> Route.resetJourney()
        }

        tapState = tapState.previous(waypointsCount())
        mapView.postInvalidate()

        return true
    }

    private fun tapMarker(event: MotionEvent): Boolean {
        val p = mapView.projection.fromPixels(event.x.toInt(), event.y.toInt())
        tapAction(p)
        return true
    }

    fun setNextMarker(point: IGeoPoint) {
        tapAction(point)
    }

    private fun tapAction(point: IGeoPoint) {
        if (tapState.noFurtherWaypoints()) {
            return
        }

        waymarks.addWaypoint(point)
        controller.pushUndo(this)
        tapState = tapState.next(waypointsCount())
        mapView.invalidate()
    }

    ////////////////////////////////////
    private enum class TapToRoute private constructor(val waypointingInProgress: Boolean, val actionDescription: String) {
        WAITING_FOR_START(false, "Tap map to set Start"),
        WAITING_FOR_SECOND(true, "Tap map to set Waypoint"),
        WAITING_FOR_NEXT(true, "Tap map to set Waypoint\nTap here to Route"),
        WAITING_TO_ROUTE(true, "Tap here to Route"),
        ALL_DONE(false, "");

        fun previous(count: Int): TapToRoute {
            val previous: TapToRoute
            when (this) {
                WAITING_FOR_START, WAITING_FOR_SECOND, ALL_DONE -> previous = WAITING_FOR_START
                WAITING_FOR_NEXT -> previous = if (count == 1) WAITING_FOR_SECOND else WAITING_FOR_NEXT
                WAITING_TO_ROUTE -> previous = WAITING_FOR_NEXT
            }
            Log.d(TAG, "Moving to previous TapToRoute state=${previous.name} with waypoints=$count")
            return previous
        }

        fun next(count: Int): TapToRoute {
            val next: TapToRoute
            when (this) {
                WAITING_FOR_START -> next = WAITING_FOR_SECOND
                WAITING_FOR_SECOND -> next = WAITING_FOR_NEXT
                WAITING_FOR_NEXT -> next = if (count == MAX_WAYPOINTS) WAITING_TO_ROUTE else WAITING_FOR_NEXT
                WAITING_TO_ROUTE, ALL_DONE -> next = ALL_DONE
            }
            Log.d(TAG, "Moving to next TapToRoute state=${next.name} with waypoints=$count")
            return next
        }

        fun canRoute(): Boolean {
            return this == TapToRoute.WAITING_FOR_NEXT || this == TapToRoute.WAITING_TO_ROUTE
        }
        fun noFurtherWaypoints(): Boolean {
            return this == TapToRoute.WAITING_TO_ROUTE || this == TapToRoute.ALL_DONE
        }
        fun routeIsPlanned(): Boolean {
            return this == TapToRoute.ALL_DONE
        }

        companion object {
            fun fromCount(count: Int): TapToRoute {
                val next: TapToRoute
                when (count) {
                    0 -> next = WAITING_FOR_START
                    1 -> next = WAITING_FOR_SECOND
                    MAX_WAYPOINTS -> next = WAITING_TO_ROUTE
                    else -> next = WAITING_FOR_NEXT
                }
                Log.d(TAG, "Restoring to TapToRoute state=" + next.name + " with waypoints=" + count)
                return next
            }
        }
    }

    ////////////////////////////////////
    override fun onResume(prefs: SharedPreferences) {
        Route.registerListener(this)
    }

    override fun onPause(edit: Editor) {
        Route.unregisterListener(this)
    }

    override fun onNewJourney(journey: Journey, waypoints: Waypoints) {
        setRoute(journey.isEmpty(), waypoints.count())
    }

    override fun onResetJourney() {
        resetRoute()
    }

    companion object {
        private val TAG = Logging.getTag(TapToRouteOverlay::class.java)
        private val REPLAN_MENU_IDS = arrayOf(
            R.string.route_menu_change_replan_quietest,
            R.string.route_menu_change_replan_balanced,
            R.string.route_menu_change_replan_fastest,
            R.string.route_menu_change_replan_shortest
        )
        private val REPLAN_MENU_PLANS = mapOf(
            R.string.route_menu_change_replan_quietest to RoutePlans.PLAN_QUIETEST,
            R.string.route_menu_change_replan_balanced to RoutePlans.PLAN_BALANCED,
            R.string.route_menu_change_replan_fastest to RoutePlans.PLAN_FASTEST,
            R.string.route_menu_change_replan_shortest to RoutePlans.PLAN_SHORTEST
        )
        private const val MAX_WAYPOINTS = 30
    }
}


'If you continue, topic and all subtopics will be detached from all articles, and deleted.': null
'Delete anyway': null
'Reset order': null
'Order changes will be lost. Are you sure you want to continue?': null
'Topics order saved.': null
'Show languages': null
'Save order': null
'Click to edit': null
'Add root topic': null
'Topic was deleted.': null
'The topic name is already in use by another topic.': 'Numele subiectului de discuţie este deja folosit de un alt subiect de discuţie.'
'You must enter a name for the topic.': 'Trebuie să selectezi o denumire pentru subiect.'
'You must choose a language for the topic.': 'Trebuie să selectezi o limbă pentru subiect.'
'This topic has subtopics, therefore it cannot be deleted.': 'Subiectul are sub-subiecte şi de aceea nu poate fi şters.'
'Add translation:': 'Adaugă traducere:'
'Add subtopic:': 'Adaugă sub-subiect:'
Top: Sus
'You do not have the right to add topics.': 'Nu ai dreptul să adăugi subiecte.'
'You do not have the right to delete topics.': 'Nu ai dreptul să ştergi subiecte.'
'Are you sure you want to delete the topic $1?': 'Eşti sigur că vrei să ştergi subiectul $1?'
'You do not have the right to change topic name.': 'Nu aveţi dreptul să modificaţi denumirea subiectului.'
'The topic $1 could not be deleted.': 'Subiectul $1 nu poate fi şters.'
'Adding new topic': 'Se adaugă subiect nou'
'Deleting topic': 'Şterge subiect'
'Change topic name': 'Schimbă denumirea subiectului'
'There are $1 articles using the topic.': 'Mai sunt $1 articole care folosesc subiectul.'
'Search for topics': null
topics:
    tip: null
    label:
        all: null
        filterbylang: null
        search: null
        filterplaceholder: null
        addroot: null
        topicname: null
        expandcollapse: null
        changename: null
        for: null
        addsubtopic: null
        subtopicname: null
        addtranslation: null
        topictranslations: null
        choose: null
        translationstring: null
        tree: null
    title: null
    btn:
        hide: null
        remove: null
        edit: null
        close: null
        add: null
        save: null
        saveandclose: null
        removetrans: null
    alerts:
        languagenotfound: null
        translationadded: null
        translationexists: null
        beforedelete: null
        wrongparams: null
        ordersaved: null
        saved: null
        beforedeleteinfo: null
    added: null
    failedfind: null
    failedfindTranslation: null
    removed: null
    exists: null
    existsname: null
    removedTranslation: null
    failedremoveTranslation: null
    updated: null
    error: null
    csrfinvalid: null
    tooshort: null
    toolong: null
    attachtopics: null
    attachedtopics: null
    attached: null


Markdown Cheat Sheet

      Headlines

      # Headline 1

      ## Headline 2

      ### Headline 3

      Styling

      *italic*

      **bold**

      ~~<s>strike through</s>~~

      Links

      http://url.com

      [link text](http://www.url.com)

      Quotes

      > Quote text

      ***Johnny Author***

      Images

      ![image alt text](image url)

      ***Image caption, description***

      Horizontal rule

      ---

      Inline Code

      `</span>var name = "John Doe";<span class="formatting">`

      Code block with syntax highlighting

      ``` codelanguage</span><br />
      function foo() {<br />
        return bar;<br />
      }<br />
      <span class="formatting">```

      Bulleted list

      - item 1

      - item 2

      - item 3

      Numbered list

      1. item 1

      2. item 2

      3. item 3


# Proposed Changes

*
*

Fixes # .


//
// "$Id: align_widget.cxx 5845 2007-05-20 00:01:06Z mike $"
//
// Alignment code for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
//     http://www.fltk.org/str.php
//

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include "Fl_Widget_Type.h"
#include "undo.h"

/**
 * the first behaviour always uses the first selected widget as a reference
 * the second behaviour uses the largest widget (most extreme positions) as
 * a reference.
 */
#define BREAK_ON_FIRST break
//#define BREAK_ON_FIRST

void align_widget_cb(Fl_Widget*, long how)
{
  const int max = 32768, min = -32768;
  int left, right, top, bot, wdt, hgt, n;
  Fl_Type *o;
  int changed = 0;
  switch ( how )
  {
  //---- align
  case 10: // align left
    left = max;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->x()<left)
	  left = w->x();
	BREAK_ON_FIRST;
      }
    if (left!=max)
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize(left, w->y(), w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize(left, w->y(), w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    break;
  case 11: // align h.center
    left = max; right = min;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->x()<left)
	  left = w->x();
	if (w->x()+w->w()>right)
	  right = w->x()+w->w();
	BREAK_ON_FIRST;
      }
    if (left!=max)
    {
      int center2 = left+right;
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize((center2-w->w())/2, w->y(), w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    }
    break;
  case 12: // align right
    right = min;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->x()+w->w()>right)
	  right = w->x()+w->w();
	BREAK_ON_FIRST;
      }
    if (right!=min)
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize(right-w->w(), w->y(), w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    break;
  case 13: // align top
    top = max;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->y()<top)
	  top = w->y();
	BREAK_ON_FIRST;
      }
    if (top!=max)
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize(w->x(), top, w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize(w->x(), top, w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    break;
  case 14: // align v.center
    top = max; bot = min;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->y()<top)
	  top = w->y();
	if (w->y()+w->h()>bot)
	  bot = w->y()+w->h();
	BREAK_ON_FIRST;
      }
    if (top!=max)
    {
      int center2 = top+bot;
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize(w->x(), (center2-w->h())/2, w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    }
    break;
  case 15: // align bottom
    bot = min;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->y()+w->h()>bot)
	  bot = w->y()+w->h();
	BREAK_ON_FIRST;
      }
    if (bot!=min)
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize( w->x(), bot-w->h(), w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    break;
  //---- space evently
  case 20: // space evenly across
    left = max; right = min; wdt = 0, n = 0;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->x()<left)
	  left = w->x();
	if (w->x()+w->w()>right)
	  right = w->x()+w->w();
	wdt += w->w();
	n++;
      }
    wdt = (right-left)-wdt;
    n--;
    if (n>0)
    {
      int cnt = 0, wsum = 0;
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	  cnt++;
	  wsum += w->w();
	}
    }
    break;
  case 21: // space evenly down
    top = max; bot = min; hgt = 0, n = 0;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->y()<top)
	  top = w->y();
	if (w->y()+w->h()>bot)
	  bot = w->y()+w->h();
	hgt += w->h();
	n++;
      }
    hgt = (bot-top)-hgt;
    n--;
    if (n>0)
    {
      int cnt = 0, hsum = 0;
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	  cnt++;
	  hsum += w->h();
	}
    }
    break;
  //---- make same size
  case 30: // same width
    wdt = min;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->w()>wdt)
	  wdt = w->w();
	BREAK_ON_FIRST;
      }
    if (wdt!=min)
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h());
	  } else {
	    // Otherwise, just do the widget...
	    w->resize(w->x(), w->y(), wdt, w->h());
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    break;
  case 31: // same height
    hgt = min;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->h()>hgt)
	  hgt = w->h();
	BREAK_ON_FIRST;
      }
    if (hgt!=min)
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt);
	  } else {
	    // Otherwise, just do the widget...
	    w->resize( w->x(), w->y(), w->w(), hgt);
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    break;
  case 32: // same size
    hgt = min; wdt = min;
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget())
      {
	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	if (w->w()>wdt)
	  wdt = w->w();
	if (w->h()>hgt)
	  hgt = w->h();
	BREAK_ON_FIRST;
      }
    if (hgt!=min)
      for (Fl_Type *o = Fl_Type::first; o; o = o->next)
	if (o->selected && o->is_widget())
	{
	  if (!changed) {
	    changed = 1;
	    set_modflag(1);
	    undo_checkpoint();
	  }

	  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	  if (o->next && o->next->level > o->level && !o->next->selected &&
	      !o->is_menu_button()) {
	    // When resizing a group, make sure we also move the children...
	    ((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt);
	  } else {
	    // Otherwise, just do the widget...
	    w->resize( w->x(), w->y(), wdt, hgt);
	  }
	  w->redraw();
	  if (w->window()) w->window()->redraw();
	}
    break;
  //---- center in group
  case 40: // center hor
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget() && o->parent)
      {
	if (!changed) {
	  changed = 1;
	  set_modflag(1);
	  undo_checkpoint();
	}

	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o;
	int center2;

	if (w->window() == p) center2 = p->w();
	else center2 = 2*p->x()+p->w();

	if (o->next && o->next->level > o->level && !o->next->selected &&
	    !o->is_menu_button() && !o->is_menu_button()) {
	  // When resizing a group, make sure we also move the children...
	  ((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h());
	} else {
	  // Otherwise, just do the widget...
	  w->resize((center2-w->w())/2, w->y(), w->w(), w->h());
	}
	w->redraw();
	if (w->window()) w->window()->redraw();
      }
    break;
  case 41: // center vert
    for (o = Fl_Type::first; o; o = o->next)
      if (o->selected && o->is_widget() && o->parent)
      {
	if (!changed) {
	  changed = 1;
	  set_modflag(1);
	  undo_checkpoint();
	}

	Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
	Fl_Widget *p = ((Fl_Widget_Type *)o->parent)->o;
	int center2;

	if (w->window() == p) center2 = p->h();
	else center2 = 2*p->y()+p->h();

	if (o->next && o->next->level > o->level && !o->next->selected &&
	    !o->is_menu_button()) {
	  // When resizing a group, make sure we also move the children...
	  ((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h());
	} else {
	  // Otherwise, just do the widget...
	  w->resize(w->x(), (center2-w->h())/2, w->w(), w->h());
	}
	set_modflag(1);
	w->redraw();
	if (w->window()) w->window()->redraw();
      }
    break;
  }
}

// Set sizes of selected widgets...
void widget_size_cb(Fl_Widget *, long size) {
  // Update any selected widgets...
  int changed = 0;
  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
    if (o->selected && o->is_widget()) {
      if (!changed) {
	changed = 1;
	set_modflag(1);
	undo_checkpoint();
      }

      Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
      w->labelsize((uchar)size);
      Fl_Font f;
      int s = (int)size;
      Fl_Color c;
      ((Fl_Widget_Type *)o)->textstuff(2, f, s, c);

      w->redraw();
      // since this may be a major change, the whole window should be redrawn
      if (w->window()) w->window()->redraw();
    }
  }
}

//
// End of "$Id: align_widget.cxx 5845 2007-05-20 00:01:06Z mike $".
//