{$if not def GADGETS_PAGE_H} CONST GADGETS_PAGE_H=0;

{**
 **    $VER:  gadgets/page.h 1.0 (09.09.96)
 **
 **    main include file for BOOPSI page.gadget
 **
 **    (C) Copyright 1996 by Jens Tröger
 **    All rights reserved.
 **
 **    KickPascal/MaxonPASCAL-Interface is (c) by Falk Zühlsdorff 1996
 **
 **}

{$if not def UTILITY_HOOKS_H;incl "utility/hooks.h";endif}
{$if not def EXEC_LIBRARIES_H;incl "exec/libraries.h";endif}

{* this defines the PageBase-structure
   NOTE:  only call OpenLibrary("gadgets/page.gadgets",0) to get
          pointers to all the other library-bases defined in this
          structure
          (guess this will save a lot of boring stuff) *}

TYPE p_PageBase = ^_PageBase;

TYPE _PageBase  = RECORD
                   page_LibNode         : _Library;
                   page_Flags           : byte;
                   page_PadByte         : byte;
                   page_SegList         : PTR;
                   page_SysBase         : PTR;
                   page_DOSBase         : PTR;
                   page_IntuitionBase   : PTR;
                   page_GfxBase         : PTR;
                   page_GadtoolsBase    : PTR;
                   page_UtilityBase     : PTR;
                   page_DiskfontBase    : PTR;

                   {* PRIVATE... lots of data will follow: hands off *}

                  END;

{- the tags you may pass to NewObject() or SetGadgetAttrsA() or GetAttrsA() -}

CONST

 PAGE_Pages       = (TAG_USER + 0);  {* ti_Data holds pointer to the first Page-structure *}
 PAGE_Layout      = (TAG_USER + 1);  {* defines the look of the pages (see PGLYT_* flags) *}
 PAGE_Underscore  = (TAG_USER + 2);  {* same as the GT_Underscore *}
 PAGE_Active      = (TAG_USER + 3);  {* the active page (starts with 0 !!) *}
 PAGE_TextFont    = (TAG_USER + 4);  {* ptr to TextFont of the page-gadget *}
 PAGE_TextAttr    = (TAG_USER + 5);  {* ptr to TextAttr of the page-gadget *}
 PAGE_ActiveStyle = (TAG_USER + 6);  {* defines the look of the selected page (see PGAST_* flags) *}
 PAGE_ClearBBox   = (TAG_USER + 7);  {* ptr to BevelBox... defines the to-be-cleared-rect *}

{- this structure defines a node called BevelBox; use a linked list of such
   nodes to auto-draw all bevel-boxes of one page -}

TYPE  p_BevelBox  = ^BevelBox;

TYPE  BevelBox    = RECORD
                     NextBBox : p_BevelBox; {* pointer to next node or NULL *}
                     Left     : Word;      {* left, top, width, height of bevel-box *}
                     Top      : Word;
                     Width    : Word;
                     Height   : Word;
                     Flags    : Long;      {* see BBFLG_* below *}
                     PtrnAPen : Word;
                     PtrnBPen : Word;
                     BoxShine : Word;      {* shine/shadow pen for bevel-box *}
                     BoxShadow: Word;
                  END;

{- flags of one BevelBox (used by BevelBox.Flags) -}

CONST

 BBFLG_BACKFILL    = 1;  {(1L<<0)} {* fill bevel-box with BackPen color *}
 BBFLG_PATTERNFILL = 2;  {(1L<<1)} {* if BBFLG_BACKFILL then draw pattern *}
 BBFLG_RECESSED    = 4;  {(1L<<2)} {* recessed-look of bevel-box *}
 BBFLG_FRAMENONE   = 8;  {(1L<<3)} {* bevel-box without any borders *}
 BBFLG_FRAMEBUTTON = 16; {(1L<<4)} {* simple button-look *}
 BBFLG_FRAMERIDGE  = 32; {(1L<<5)} {* looks like a string-gadget *}

{- the most important structure: build a linked list of these will
   define the complete page-gadget -}

TYPE p_Page        = ^Page;

TYPE Page          = RECORD
                      NextPage     : p_Page;      {* pointer to next or NULL *}
                      Name         : STR;  {^byte}{* pointer to the name of this page *}
                      NameStyle    : Long;        {* the style of the name (bold etc..) *}
                      FirstGadget  : p_Gadget;    {* optionally pointer to first gadget of this page or NULL *}
                      FirstIText   : p_IntuiText; {* optionally pointer to first intui-text of this page or NULL *}
                      FirstBBox    : p_BevelBox;  {* optionally pointer to first bevel-box of this page or NULL *}
                      FirstImage   : p_Image;
                      ThisPageHook : p_Hook;
                     END;

{- the flags -}

CONST

 PGLYT_SIMPLE      = 0;   {* PAGE_Layout *}
 PGLYT_MUISTYLE    = 1;
 PGLYT_GADTOOLS    = 2;

 PGAST_NORMAL      = 0;   {* PAGE_ActiveStyle *}
 PGAST_HILIGHT     = 1;
 PGAST_SHADOW      = 2;

{- the hook-object strcuture
   your hook-function gets a pointer to this structure -}

TYPE p_PGMsg = ^PGMsg

TYPE PGMsg = RECORD
              pgm_GInfo : p_GadgetInfo;
              pgm_ActivePage : p_Page;
             END;

{$endif}













