%%
%% This style is derived from the docbook one.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]

\usepackage[english]{babel}
\usepackage{framed}
\def\lt{<}
\def\gt{>}

% Set page geometry
\usepackage[
  letterpaper,
  hmargin=0.9in,
  bmargin=1in,
  twoside
]{geometry}
\raggedbottom
\raggedright

%% Just use the original package and pass the options.
\RequirePackageWithOptions{docbook}

% Sidebar is a boxed minipage that can contain verbatim.
% Changed shadow box to double box.
\renewenvironment{sidebar}[1][0.95\textwidth]{
  \hspace{0mm}\newline%
  \noindent\begin{framed}%
  \setlength\parskip{\medskipamount}%
}{
  \end{framed}%
}

\renewcommand\_{\textunderscore\allowbreak}

\lstdefinelanguage{GLSL}
{
   sensitive=true,
   morekeywords=[1]{
      attribute, const, uniform, varying,
      layout, centroid, flat, smooth,
      noperspective, break, continue, do,
      for, while, switch, case, default, if,
      else, in, out, inout, float, int, void,
      bool, true, false, invariant, discard,
      return, mat2, mat3, mat4, mat2x2, mat2x3,
      mat2x4, mat3x2, mat3x3, mat3x4, mat4x2,
      mat4x3, mat4x4, vec2, vec3, vec4, ivec2,
      ivec3, ivec4, bvec2, bvec3, bvec4, uint,
      uvec2, uvec3, uvec4, lowp, mediump, highp,
      precision, sampler1D, sampler2D, sampler3D,
      samplerCube, sampler1DShadow,
      sampler2DShadow, samplerCubeShadow,
      sampler1DArray, sampler2DArray,
      sampler1DArrayShadow, sampler2DArrayShadow,
      isampler1D, isampler2D, isampler3D,
      isamplerCube, isampler1DArray,
      isampler2DArray, usampler1D, usampler2D,
      usampler3D, usamplerCube, usampler1DArray,
      usampler2DArray, sampler2DRect,
      sampler2DRectShadow, isampler2DRect,
      usampler2DRect, samplerBuffer,
      isamplerBuffer, usamplerBuffer, sampler2DMS,
      isampler2DMS, usampler2DMS,
      sampler2DMSArray, isampler2DMSArray,
   usampler2DMSArray, struct},
   morekeywords=[2]{
      radians,degrees,sin,cos,tan,asin,acos,atan,
      atan,sinh,cosh,tanh,asinh,acosh,atanh,pow,
      exp,log,exp2,log2,sqrt,inversesqrt,abs,sign,
      floor,trunc,round,roundEven,ceil,fract,mod,modf,
      min,max,clamp,mix,step,smoothstep,isnan,isinf,
      floatBitsToInt,floatBitsToUint,intBitsToFloat,
      uintBitsToFloat,length,distance,dot,cross,
      normalize,faceforward,reflect,refract,
      matrixCompMult,outerProduct,transpose,
      determinant,inverse,lessThan,lessThanEqual,
      greaterThan,greaterThanEqual,equal,notEqual,
      any,all,not,textureSize,texture,textureProj,
      textureLod,textureOffset,texelFetch,
      texelFetchOffset,textureProjOffset,
      textureLodOffset,textureProjLod,
      textureProjLodOffset,textureGrad,
      textureGradOffset,textureProjGrad,
      textureProjGradOffset,texture1D,texture1DProj,
      texture1DProjLod,texture2D,texture2DProj,
      texture2DLod,texture2DProjLod,texture3D,
      texture3DProj,texture3DLod,texture3DProjLod,
      textureCube,textureCubeLod,shadow1D,shadow2D,
      shadow1DProj,shadow2DProj,shadow1DLod,
      shadow2DLod,shadow1DProjLod,shadow2DProjLod,
      dFdx,dFdy,fwidth,noise1,noise2,noise3,noise4,
   EmitVertex,EndPrimitive},
   morekeywords=[3]{
      gl_VertexID,gl_InstanceID,gl_Position,
      gl_PointSize,gl_ClipDistance,gl_PerVertex,
      gl_Layer,gl_ClipVertex,gl_FragCoord,
      gl_FrontFacing,gl_ClipDistance,gl_FragColor,
      gl_FragData,gl_MaxDrawBuffers,gl_FragDepth,
      gl_PointCoord,gl_PrimitiveID,
      gl_MaxVertexAttribs,gl_MaxVertexUniformComponents,
      gl_MaxVaryingFloats,gl_MaxVaryingComponents,
      gl_MaxVertexOutputComponents,
      gl_MaxGeometryInputComponents,
      gl_MaxGeometryOutputComponents,
      gl_MaxFragmentInputComponents,
      gl_MaxVertexTextureImageUnits,
      gl_MaxCombinedTextureImageUnits,
      gl_MaxTextureImageUnits,
      gl_MaxFragmentUniformComponents,
      gl_MaxDrawBuffers,gl_MaxClipDistances,
      gl_MaxGeometryTextureImageUnits,
      gl_MaxGeometryOutputVertices,
      gl_MaxGeometryOutputVertices,
      gl_MaxGeometryTotalOutputComponents,
      gl_MaxGeometryUniformComponents,
   gl_MaxGeometryVaryingComponents,gl_DepthRange},
   morecomment=[l]{//},
   morecomment=[s]{/*}{*/},
   morecomment=[l][keywordstyle4]{\#},
}

% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`.
\usepackage{alltt}
