\section{rox.c File Reference}
\label{rox_8c}\index{rox.c@{rox.c}}
General ROX functions. 

{\tt \#include \char`\"{}rox-clib.h\char`\"{}}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$sys/types.h$>$}\par
{\tt \#include $<$sys/stat.h$>$}\par
{\tt \#include $<$glib.h$>$}\par
{\tt \#include $<$gtk/gtk.h$>$}\par
{\tt \#include \char`\"{}rox.h\char`\"{}}\par
{\tt \#include \char`\"{}options.h\char`\"{}}\par
{\tt \#include \char`\"{}rox\_\-dnd.h\char`\"{}}\par
{\tt \#include \char`\"{}mime.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf rox\_\-init} (const char $\ast${\bf program}, int $\ast$argc, char $\ast$$\ast$$\ast$argv)
\item 
void {\bf rox\_\-init\_\-with\_\-domain} (const char $\ast${\bf program}, const char $\ast$domain, int $\ast$argc, char $\ast$$\ast$$\ast$argv)
\item 
const gchar $\ast$ {\bf rox\_\-get\_\-program\_\-name} (void)
\item 
const gchar $\ast$ {\bf rox\_\-get\_\-program\_\-domain} (void)
\item 
const gchar $\ast$ {\bf rox\_\-get\_\-app\_\-dir} (void)
\item 
Gdk\-Pixbuf $\ast$ {\bf rox\_\-get\_\-program\_\-icon} (void)
\item 
int {\bf rox\_\-clib\_\-version\_\-number} (void)
\item 
const char $\ast$ {\bf rox\_\-clib\_\-version\_\-string} (void)
\item 
int {\bf rox\_\-clib\_\-gtk\_\-version\_\-number} (void)
\item 
const char $\ast$ {\bf rox\_\-clib\_\-gtk\_\-version\_\-string} (void)
\item 
void {\bf rox\_\-add\_\-window} (Gtk\-Widget $\ast$window)
\item 
int {\bf rox\_\-get\_\-n\_\-windows} (void)
\item 
void {\bf rox\_\-main\_\-loop} (void)
\item 
void {\bf rox\_\-main\_\-quit} (void)
\item 
void {\bf rox\_\-deprecated\_\-warning} (const char $\ast$func, const char $\ast$use)
\item 
int {\bf rox\_\-is\_\-appdir} (const char $\ast$path)
\item 
char $\ast$ {\bf rox\_\-find\_\-appdir} (const char $\ast$name, gchar $\ast$$\ast$dirs, const char $\ast$env\_\-name)
\item 
char $\ast$ {\bf rox\_\-clib\_\-find} (void)
\end{CompactItemize}


\subsection{Detailed Description}
General ROX functions. 



\subsection{Function Documentation}
\index{rox.c@{rox.c}!rox_add_window@{rox\_\-add\_\-window}}
\index{rox_add_window@{rox\_\-add\_\-window}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void rox\_\-add\_\-window (Gtk\-Widget $\ast$ {\em window})}\label{rox_8c_0f17442b7470faab37d98b8ad96ea55a}


Add this window to the ones which are being counted. When it is destroyed this will be noted and the window count decreased.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em window}]Window or other widget to count \end{description}
\end{Desc}
\index{rox.c@{rox.c}!rox_clib_find@{rox\_\-clib\_\-find}}
\index{rox_clib_find@{rox\_\-clib\_\-find}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ rox\_\-clib\_\-find (void)}\label{rox_8c_1d975f8f62b3d1dd341bcd59af4744c5}


Return the path to ROX-CLib's App\-Dir. This tries\begin{itemize}
\item \$ROX\_\-CLIB\item rox\_\-find\_\-appdir(\char`\"{}ROX-CLib\char`\"{}, NULL, \char`\"{}LIBDIRPATH\char`\"{})\item rox\_\-find\_\-appdir(\char`\"{}ROX-CLib\char`\"{}, NULL, \char`\"{}APPDIRPATH\char`\"{})\item rox\_\-find\_\-appdir(\char`\"{}ROX-CLib\char`\"{}, NULL, \char`\"{}PATH\char`\"{}) returning the first valid App\-Dir found.\end{itemize}


\begin{Desc}
\item[Returns:]path to ROX-CLib (pass to g\_\-free()), or {\tt NULL} if not found. \end{Desc}
\index{rox.c@{rox.c}!rox_clib_gtk_version_number@{rox\_\-clib\_\-gtk\_\-version\_\-number}}
\index{rox_clib_gtk_version_number@{rox\_\-clib\_\-gtk\_\-version\_\-number}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int rox\_\-clib\_\-gtk\_\-version\_\-number (void)}\label{rox_8c_976744fae1cd47ec53b69223877cbbf6}


Returns the version number of the GTK+ library encoded as an int

\begin{Desc}
\item[Returns:]10000$\ast$major+100$\ast$minor+micro \end{Desc}
\index{rox.c@{rox.c}!rox_clib_gtk_version_string@{rox\_\-clib\_\-gtk\_\-version\_\-string}}
\index{rox_clib_gtk_version_string@{rox\_\-clib\_\-gtk\_\-version\_\-string}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ rox\_\-clib\_\-gtk\_\-version\_\-string (void)}\label{rox_8c_8f28288d4c7e0d43840ebdb5f6ebc587}


Returns the version number of the GTK+ library as a string

\begin{Desc}
\item[Returns:]\char`\"{}major.minor.micro\char`\"{} \end{Desc}
\index{rox.c@{rox.c}!rox_clib_version_number@{rox\_\-clib\_\-version\_\-number}}
\index{rox_clib_version_number@{rox\_\-clib\_\-version\_\-number}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int rox\_\-clib\_\-version\_\-number (void)}\label{rox_8c_3a8f6d7bc6401a81c4ab6714e9804964}


Returns the version number of the library encoded as an int

\begin{Desc}
\item[Returns:]10000$\ast$major+100$\ast$minor+micro \end{Desc}
\index{rox.c@{rox.c}!rox_clib_version_string@{rox\_\-clib\_\-version\_\-string}}
\index{rox_clib_version_string@{rox\_\-clib\_\-version\_\-string}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ rox\_\-clib\_\-version\_\-string (void)}\label{rox_8c_6e550ae036479942349fc8e22a28dd05}


Returns the version number of the library as a string

\begin{Desc}
\item[Returns:]\char`\"{}major.minor.micro\char`\"{} \end{Desc}
\index{rox.c@{rox.c}!rox_deprecated_warning@{rox\_\-deprecated\_\-warning}}
\index{rox_deprecated_warning@{rox\_\-deprecated\_\-warning}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void rox\_\-deprecated\_\-warning (const char $\ast$ {\em func}, const char $\ast$ {\em use})}\label{rox_8c_149074efced3930d05f366fea4922b57}


Warn about use of a deprecated function and indicate it's replacement. This warning is enabled by ROX\_\-CLIB\_\-DEPRECATION\_\-WARNING=1 and disabled by ROX\_\-CLIB\_\-DEPRECATION\_\-WARNING=0 (the default state depends on the release). This function is for internal use. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftarrow$} {\em func}]name of function that is deprecated \item[\mbox{$\leftarrow$} {\em use}]name or description of replacement \end{description}
\end{Desc}
\index{rox.c@{rox.c}!rox_find_appdir@{rox\_\-find\_\-appdir}}
\index{rox_find_appdir@{rox\_\-find\_\-appdir}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ rox\_\-find\_\-appdir (const char $\ast$ {\em name}, gchar $\ast$$\ast$ {\em dirs}, const char $\ast$ {\em env\_\-name})}\label{rox_8c_92e6cc336498c609b04c994da1672619}


Return the path to an App\-Dir.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftarrow$} {\em name}]name of application to find \item[\mbox{$\leftarrow$} {\em dirs}]{\tt NULL} terminated array of directories to look in. If {\em dirs\/} is {\tt NULL} then {\em env\_\-name\/} is used instead \item[\mbox{$\leftarrow$} {\em env\_\-name}]if {\em dirs\/} is {\tt NULL} then this is the name of an environment variable that will contain a colon-separated list of directories. If {\em env\_\-name\/} is {\tt NULL} \char`\"{}APPDIRPATH\char`\"{} is used. Default values for the variables \char`\"{}APPDIRPATH\char`\"{} and \char`\"{}LIBDIRPATH\char`\"{} are assumed if they are not set. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]path to App\-Dir (pass to g\_\-free()), or {\tt NULL} if not found. \end{Desc}
\index{rox.c@{rox.c}!rox_get_app_dir@{rox\_\-get\_\-app\_\-dir}}
\index{rox_get_app_dir@{rox\_\-get\_\-app\_\-dir}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const gchar$\ast$ rox\_\-get\_\-app\_\-dir (void)}\label{rox_8c_fd45284740047acd04231f0f1a8f498d}


Returns the application directory.

\begin{Desc}
\item[Returns:]the application directory, which may be NULL or \char`\"{}\char`\"{} if the App\-Run script wasn't called \end{Desc}
\index{rox.c@{rox.c}!rox_get_n_windows@{rox\_\-get\_\-n\_\-windows}}
\index{rox_get_n_windows@{rox\_\-get\_\-n\_\-windows}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int rox\_\-get\_\-n\_\-windows (void)}\label{rox_8c_535bea3252ea4e0a0a8adef95d477f17}


Return the number of windows ROX-CLib is tracking

\begin{Desc}
\item[Returns:]the number of windows passed to \doxyref{rox\_\-add\_\-window()}{p.}{rox_8c_0f17442b7470faab37d98b8ad96ea55a}, minus the number of those destroyed \end{Desc}
\index{rox.c@{rox.c}!rox_get_program_domain@{rox\_\-get\_\-program\_\-domain}}
\index{rox_get_program_domain@{rox\_\-get\_\-program\_\-domain}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const gchar$\ast$ rox\_\-get\_\-program\_\-domain (void)}\label{rox_8c_b75e87b72c62511219e8894cec33fe5e}


Returns the program domain as passed to \doxyref{rox\_\-init\_\-with\_\-domain()}{p.}{rox_8c_74e2d8a486c8aedc955851dc7b71b660}

\begin{Desc}
\item[Returns:]the domain, or {\tt NULL} if no domain was given. \end{Desc}
\index{rox.c@{rox.c}!rox_get_program_icon@{rox\_\-get\_\-program\_\-icon}}
\index{rox_get_program_icon@{rox\_\-get\_\-program\_\-icon}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Gdk\-Pixbuf$\ast$ rox\_\-get\_\-program\_\-icon (void)}\label{rox_8c_a69de80247601d0945312e407b392129}


Returns the program icon used for the windows

\begin{Desc}
\item[Returns:]the program icon, or NULL if there isn't one \end{Desc}
\index{rox.c@{rox.c}!rox_get_program_name@{rox\_\-get\_\-program\_\-name}}
\index{rox_get_program_name@{rox\_\-get\_\-program\_\-name}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const gchar$\ast$ rox\_\-get\_\-program\_\-name (void)}\label{rox_8c_17af9699ab73a5cfc8657bc3061f16bd}


Returns the program name as passed to \doxyref{rox\_\-init\_\-with\_\-domain()}{p.}{rox_8c_74e2d8a486c8aedc955851dc7b71b660}

\begin{Desc}
\item[Returns:]the program name \end{Desc}
\index{rox.c@{rox.c}!rox_init@{rox\_\-init}}
\index{rox_init@{rox\_\-init}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void rox\_\-init (const char $\ast$ {\em program}, int $\ast$ {\em argc}, char $\ast$$\ast$$\ast$ {\em argv})}\label{rox_8c_afe930e2bcbe2cf1dd0834fafe43a1a3}


Initialize the library. Equivalent to rox\_\-init\_\-with\_\-domain(program, NULL, argc, argv). \begin{Desc}
\item[{\bf Deprecated}]Use \doxyref{rox\_\-init\_\-with\_\-domain()}{p.}{rox_8c_74e2d8a486c8aedc955851dc7b71b660} instead.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftarrow$} {\em program}]name of program \item[\mbox{$\leftrightarrow$} {\em argc}]pointer to argc passed to main() \item[\mbox{$\leftrightarrow$} {\em argv}]pointer to argv passed to main() \end{description}
\end{Desc}
\index{rox.c@{rox.c}!rox_init_with_domain@{rox\_\-init\_\-with\_\-domain}}
\index{rox_init_with_domain@{rox\_\-init\_\-with\_\-domain}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void rox\_\-init\_\-with\_\-domain (const char $\ast$ {\em program}, const char $\ast$ {\em domain}, int $\ast$ {\em argc}, char $\ast$$\ast$$\ast$ {\em argv})}\label{rox_8c_74e2d8a486c8aedc955851dc7b71b660}


Initialize the library. This calls:\begin{itemize}
\item gtk\_\-init()\item \doxyref{rox\_\-debug\_\-init()}{p.}{rox__debug_8c_f0ff727abefea4cc9ccc4be13c782190}\item \doxyref{choices\_\-init()}{p.}{choices_8c_ff60d2e869ba539004144074bab30edd}\item \doxyref{options\_\-init\_\-with\_\-domain()}{p.}{options_8c_07b3271cd763892a539ac715cd1a299a} (if {\tt Options.xml} in {\em \$APP\_\-DIR\/})\item \doxyref{rox\_\-dnd\_\-init()}{p.}{rox__dnd_8c_fd4c8fc87c977a9746d58017ccb80caf}\item \doxyref{mime\_\-init()}{p.}{mime_8c_dedf2ef52ff9b5b1640728a860f443bf}\end{itemize}


If {\tt }.Dir\-Icon exists in {\em \$APP\_\-DIR\/} it is set as the default icon for all windows.

If the ROX-CLib App\-Dir can be located by \doxyref{rox\_\-clib\_\-find()}{p.}{rox_8c_1d975f8f62b3d1dd341bcd59af4744c5} then the translations for ROX-CLib are made available from ROX-CLib/Messages. The default location for the applications translations is set to \$APP\_\-DIR/Messages.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftarrow$} {\em program}]name of program \item[\mbox{$\leftarrow$} {\em domain}]domain under the control of the programmer. Used in options and choices \item[\mbox{$\leftrightarrow$} {\em argc}]pointer to argc passed to main() \item[\mbox{$\leftrightarrow$} {\em argv}]pointer to argv passed to main() \end{description}
\end{Desc}
\index{rox.c@{rox.c}!rox_is_appdir@{rox\_\-is\_\-appdir}}
\index{rox_is_appdir@{rox\_\-is\_\-appdir}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int rox\_\-is\_\-appdir (const char $\ast$ {\em path})}\label{rox_8c_7f3e1086cbd2b11f645013b483bfd933}


Confirm that {\em path\/} exists and is a valid App\-Dir. This includes checking ownership and permissions.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[\mbox{$\leftarrow$} {\em path}]path to object to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]{\tt FALSE} if not a valid App\-Dir \end{Desc}
\index{rox.c@{rox.c}!rox_main_loop@{rox\_\-main\_\-loop}}
\index{rox_main_loop@{rox\_\-main\_\-loop}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void rox\_\-main\_\-loop (void)}\label{rox_8c_4a08d515baaa3cfccda90a08f12e068e}


Call gtk\_\-main() repeatedly until either \doxyref{rox\_\-get\_\-n\_\-windows()}{p.}{rox_8c_535bea3252ea4e0a0a8adef95d477f17} returns less than one, or \doxyref{rox\_\-main\_\-quit()}{p.}{rox_8c_c3968ab0dc07cd3ac915b08638482ce2} is called \index{rox.c@{rox.c}!rox_main_quit@{rox\_\-main\_\-quit}}
\index{rox_main_quit@{rox\_\-main\_\-quit}!rox.c@{rox.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void rox\_\-main\_\-quit (void)}\label{rox_8c_c3968ab0dc07cd3ac915b08638482ce2}


Cause \doxyref{rox\_\-main\_\-loop()}{p.}{rox_8c_4a08d515baaa3cfccda90a08f12e068e} to exit. If \doxyref{rox\_\-main\_\-loop()}{p.}{rox_8c_4a08d515baaa3cfccda90a08f12e068e} has been called recursivly only the innermost is exited. 