unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, Buttons, ComCtrls,
  Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9,
  Stack, Tree;

const WS: set of Char = [#9,#10,#13,#32];
      NM: set of Char = ['A'..'z','0'..'9','.','-',':','_'];

      SS: set of Char = ['?','+','*'];
      TS: set of Char = ['?','!','+','*','|'];

      INSIDE_FLAG = $1;
      CLOSURE_FLAG = $2;

      EM_EXLINEFROMCHAR	= WM_USER + 54;

type
{  TXMLTreeNode = record
                   S,E: Longint;
                   CS,CE: Longint;
                   Empty,Closure: Boolean;
                 end;
  PXMLTreeNode = ^TXMLTreeNode;
  PString = ^String;}
  //v listoch
  TAttrStruct = record
                  name: String;
                  value: String;
                end;

implementation

uses Unit1;

var Pos: Longint;
    XS: String;
    XSLength: Longint;

{$R *.DFM}

procedure TContForm.Panel3UnDock(Sender: TObject; Client: TControl;
  NewTarget: TWinControl; var Allow: Boolean);
begin
  Panel3.AutoSize := True;
end;


//VERSION    #:   0.01.038.2001
//WORKTIME   #:   285 hours
//KNOWN BUGS #:
//                X1#:graficky bug na hlavnom paneli, priesvitne listy( toolbars) - KILLED
//                2#:zakazat presuny mysou !!!!!!!!!!!!!!!!!!!!! ->  NEDA SA - WINDOWS 98 BUG!!!!!!!!!
//                SOLUTION - NONE!!!
//                X3#:uff...., bug pri deletovani v insert mode  napr. stlacit delete ked je kurzor pred IkurzorI<DATE> - KILLED
//                4#:debilny TreeView, po viac ako 1000 blbne( redeklaruje root a pod., cimz mi kazi rekurzie v DTD)
//                SOLUTION - pouzit vlastny strom, neskor obojsmerny graf
//
//KNOWN CONTRAINTS #:
//                1#:XMLNameSpaces( i.e. XLS:BODY) not supported( only lefts : without an additional parsing)
//                2#:<,> as an attribute value not supported( in IE 5.5 < is supported) - use &lt;,&gt;
//                SOLUTION - pri hladani < treba checkovat ' or " a potom ich par a preskocit za, a hladat dalej <,
//                           ak par neexistuje, tak Error
//                           podobne aj pri hladani >
//                           zrejme to dost spomali checkovanie, ale je to mozne
//                3#:AdvancedRebuildTree not yet fully optimized
//                4#:Syntax Highlighting is slow, therefore is not that, what it was meant to be
//                5#:Ignores IGNORE sections in DTD( that means: it includes them)
//                6#:Parametric & Character entities are slightly different from the standard
//                7#:Notation only loaded, but not actually used
//
//SPECIAL - IDEAS  #:
//                ??????? editovatelny treeview pre XML
//                ??????? Canonical XML
//                ??????? XMLError autocorrection
//                ??????? nefatalne errory, teda take, ze bude dalej checkovat dalsie errory
//                ??????? auto-build-dtd
//
//OVERALL STATUS:
//Interface:      viacero kontajnerov sucasne - 100%
//                vyhadzovanie z pola pri Close( trochu ine riesenie) - 100%
//                resizovanie panelov pri closeovani formov - 100%
//                otvaranie a dockovanie okien typu DTDTree a pod. po tom co boli zatvorene - 00% -> bude asi hard
//                insert/delete mode - 100% -> bude velmi hard
//
//XML Editor:
//                hlavicka - 00%  -> presunute do PHASE @3(@4)
//                CDATA - 90%
//                komentare - 90%
//                prazdne tagy - 99%
//DTD Validator:
//                #PCDATA - 90%
//                EMPTY - 90%
//                ANY - 90%
//
//                Warning: Treba zatvorkovat - napr. (H|L,A,B,C) - bude zle interpretovane,
//                         treba zmenit na ((H|L),A,B,C) - bude OK
//
//TIME SCHEDULE:
//
//<:::::::::::>
//YEAR 2000<::>
//<:::::::::::>
//
//PHASE @1:
//                Load/Save - 98%
//                Resizovanie okien podla fyzickeho rozlisenia a.k.a 640x480 v H6 - 98%
//                zlepsit detekciu OuterNode pre selekciu( nevracat Outer Worlds, ale najmensie pokrytie) - 98%
//                dorobit updatovanie stromu - 98%
//                vlastny strom aspon na XML - 99%
//                co s presuvanim,deletovanim,kopirovanim tagov????? - 98%
//                zakladne entity - 98%
//                text pred rootom a za rootom tj. asgsdg <root>....</root> asdfs - 100%
//PHASE @2:
//                zrychlit GetXMLElement,CheckXMLTag - 50%
//                HOW TO - prepisat SearchFor.... na cykly, prepisat Copy na tvar (S[I]='a' and S[I+1]='b' and S[I+2] = 'c')
//                       - GUARANTEED!
//                dorobit error pri vyskyte ]]> vo vnutrajsku tagu - 100%
//                dorobit volne miesto za nazvom tagu example: <abc   >, ale nie <  abc> - 100%
//                dorobit v closure nemoze byt nic okrem Whitespace na konci - 100%
//                dorobit XMLError Messaging - 99%
//                dorobit prepocet z position do row,column - 100%
//                dorobit XMLError identifying( jump to row,column of error) - 100%
//                dorobit kontrolu na Attributy - 99%
//                ANOTHER WAY - najprv updatovat cely strom s dalsim stringov - HiddenText a potom parsovat atributy len z HTextu
//                              tymto by sa to dalo zjednodusit
//
//                dorobit XML syntax highlighting - 98%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//                HOW TO - aby to islo rychlo, tak EM_GETFIRSTVISIBLELINE, alebo tak nejak
//                         potom VISIBLELINECOUNT zistit, a potom zobrat S,E a hodit do XMLTree a zobrazit farebne,len to co vidim
//                       - absolutne nepomaha, extremne pomale!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//                       - osetrenie dalsich farebnych bugov bude este radovo pomalsie!!!!!!!!!!!!!!!
//
//<:::::::::::>
//YEAR 2001<::>
//<:::::::::::>
//-JANUARY-
//                dorobit XML AttributeAnalyzer, ukladanie do datovej struktury, novy parameter v GetXMLElement - 100%
//                dorobit v XML strome, data pointre na datovu strukturu AttributeList(pole meno - hodnota) - 98%
//                dorobit DTD entities replacing in DTD (a.k.a % title = 'Flash') - 98%
//                dorobit DTD attributes parsing - 98%
//-FEBRUARY-
//PHASE @3:
//                nova datova struktura na DTD ENTITIES, DTD NOTATIONS - 100%
//>-----------------NOW-----------------<
//                dorobit right-click
//                dorobit XML entities(suvisi s rigth-clickom)
//                dorobit XML Document Validation
//                dorobit form na editovanie noveho tagu
//                dorobit form na vyber atributov
//                dorobit editor hlavicky XML, loadovanie XML hlavicky, DTD linking, DTD extracting
//-APRIL-
//PHASE @4:
//                dorobit interface
//                dorobit UNDO/REDO - peklo( ani nie nefektivny pomocou InitXMLTree)
//                dorobit zakladne searchovacie rutinky, Find,Replace,...
//                dorobit Options
//                dorobit Help
//                dorobit About...


procedure TContForm.FormCreate(Sender: TObject);
begin
  PostMessage(handle, WM_USER, 0, 0);
end;

procedure TContForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Stack.Destroy;
  Tree.Erase;

  MainForm.Tag := -1;
  MainForm.Formy[Tag].Free;
  MainForm.Formy[Tag] := nil;
  {tu by malo byt vyhadzovanie z pola kontajnerov}
end;

end.
