%%%==============================================================================
%% Copyright 2022-23 by Alceu Frigeri
%%
%% This work may be distributed and/or modified under the conditions of
%%
%% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
%%   version 1.3c (or later), and/or
%% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html),
%%   version 3 (or later)
%%
%% This work has the LPPL maintenance status *maintained*.
%%
%% The Current Maintainer of this work is Alceu Frigeri
%%
%% This is version 1.10 (2023/05/11)
%%
%% The list of files that compose this work can be found in the README.md file at
%% https://ctan.org/pkg/ufrgscca
%%
%%%==============================================================================
%% UFRGS stands for "Federal University of Rio Grande do Sul" in south Brazil
%% EE    stands for "Engineering School"
%% CCA   stands for "Control and Automation Engineering Course" (Portuguese acronym)
%%%==============================================================================
\NeedsTeXFormat{LaTeX2e}[2022/06/01]
\def\tc@tmp@packname{ufrgscca-lists}
\def\tc@tmp@altpackname{ufrgsccalists}
\def\tc@tmp@packdesc{UFRGS/CCA auxiliary lists commands}
\def\tc@tmp@packdate{2023/05/11}
\def\tc@tmp@packversion{1.10}
\let\@exp\expandafter
\@exp\edef\csname\tc@tmp@altpackname version\endcsname{\tc@tmp@packversion}
\@exp\@exp\@exp\ProvidesPackage\@exp\@exp\@exp{\@exp\tc@tmp@packname\@exp}\@exp[\tc@tmp@packdate\space v\tc@tmp@packversion\space\tc@tmp@packdesc]


\DeclareKeys[ufrgscca-lst]{
    relnum.usage = load,
	relnum.if = tcif@relnum,
}
\ProcessKeyOptions[ufrgscca-lst]\relax

%%%%%%%%%%%%%%%%%%%%%
%%% Packages Loading
%%%%%%%%%%%%%%%%%%%%%

\RequirePackage{newfloat}
\RequirePackage{listings}%
\RequirePackage{xcolor}%

%%%
%%% command to declare a new 'list of ...' things {package newfloat}
%%%
\NewDocumentCommand{\DeclareNewFloat}{mmmm}{%
 \DeclareFloatingEnvironment[%
  fileext={#2},%
	listname={#4},%
	name={#3},%
	placement=htb,%
	chapterlistsgaps=off]{#1} %
 \iftcif@relnum\SetupFloatingEnvironment{#1}{within=chapter}%
   \else\SetupFloatingEnvironment{#1}{within=none}%
 \fi %
}%


%
%%%%\def\listoflistings{\lstlistoflistings}%
\definecolor{lstgray}{rgb}{0.965,0.965,0.965}%
\lstset{basicstyle=\ttfamily\small,%
  columns=fullflexible,%
  keepspaces=true,%
  frame=tb,%
  inputencoding=latin1,%
%  inputencoding=utf8,%
  extendedchars=true,%
  backgroundcolor=\color{lstgray},%
	breaklines=true,%
%	xleftmargin=7pt,%
%	xrightmargin=7pt%
}%
%
\def\listingname{Listing}%
\def\listlistingname{List of Listings}%
\DeclareNewFloat{codelist}{lox}{\listingname}{\listlistingname}%%


