function figureChanged = notebookCompareFigures(varargin)
%NOTEBOOKCOMPAREFIGURES	Notebook utility routine to compare figures

% Copyright 1984-2003 The MathWorks, Inc.
% $Revision: 1.1.6.3 $  $Date: 2004/11/29 23:30:21 $

% This variable is passed in by notebookCaptureFigures.m   We don't use
% globals because the Notebook command that gets executed between the
% notebookCaptureFigures & the notebookCompareFigures may have a 'clear all'
persistent notebookGlobalData
mlock  % insure that the persistent variable remains

if (nargin > 0)
   notebookGlobalData = varargin{1};
   figureChanged = 0;
else
   global notebookGlobalFigureList % used by notebookDeleteFigures
   notebookGlobalFigureList = compareFigures(notebookGlobalData);

   % Return 0 if no figures have changed; otherwise return 1
   if isempty(notebookGlobalFigureList)
       figureChanged = 0;
       clear global notebookGlobalFigureList
   else
       figureChanged = 1;
   end
end
