/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                   Copyright (c) 2002 Zanoza Software.                   *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg Melashenko
 *--------------------------------------------------------------------------
 * @purpose:
   *--------------------------------------------------------------------------
 * @created: Saturday, September 28, 2002 12:20:29
 */

#if !defined(uiTypes_h_included)
#define uiTypes_h_included

#include <zmodeler.h>

namespace core
{
  namespace ui
  {
//------------------------------------------------
// docking states:
#define ZM_UI_DOCKABLE        0x01000000
#define ZM_UI_NOT_DOCKABLE    0x00000002
#define ZM_UI_INITDOCKED      0x00000004
#define ZM_UI_RESIZEABLE      (0x00000010 | ZM_UI_DOCKABLE)

//------------------------------------------------
// docking positions:
//------------------------------------------------
#define ZM_UI_DOCK_ANY        CBRS_ALIGN_ANY
#define ZM_UI_DOCK_LEFT       CBRS_ALIGN_LEFT
#define ZM_UI_DOCK_RIGHT      CBRS_ALIGN_RIGHT
#define ZM_UI_DOCK_TOP        CBRS_ALIGN_TOP
#define ZM_UI_DOCK_BOTTOM     CBRS_ALIGN_BOTTOM
#define ZM_UI_DOCK_CLIENT     ZM_UI_DOCK_ANY
#define ZM_UI_DOCK_VIRTUAL   (CBRS_ALIGN_ANY+1)

// Views layout identifiers are zero-based sequences.
// NULL id is the main split. '0' - '4' are it's subsplits (panes)
// '01' is the second sub-pane in first pane of main split.
// '00' is always the left-top-most pane.
// splits:
//
//    cross:   0  1
//             2  3
//
//  horizontal:   0
//                1
//
//                0
//  horizontal2:  1
//                2
//
//    vertical:    0  1
//
//    vertical2: 0  1  2
//

    //--------------------------------------
    // Workspace panes split mode
    typedef enum eWorkspaceSplit
    {
      WPS_PANE,
      WPS_CROSS,
      WPS_HORIZONTAL,
      WPS_VERTICAL,
      WPS_HORIZONTAL2,
      WPS_VERTICAL2,
    };

    //--------------------------------------
    // Graph Manager
    typedef enum eImageResource
    {
      IMG_BUTTON_CLOSE_DEF,
      IMG_BUTTON_CLOSE_HL,
      IMG_BUTTON_CLOSE_PSH,
      IMG_BUTTON_MINIMIZE_DEF,
      IMG_BUTTON_MINIMIZE_HL,
      IMG_BUTTON_MINIMIZE_PSH,
      IMG_BUTTON_MAXIMIZE_DEF,
      IMG_BUTTON_MAXIMIZE_HL,
      IMG_BUTTON_MAXIMIZE_PSH,
      IMG_BUTTON_RESTORE_DEF,
      IMG_BUTTON_RESTORE_HL,
      IMG_BUTTON_RESTORE_PSH,
      IMG_ICON_ZMODELER,
      IMG_ICON_QUESTION,
      IMG_ICON_EXCLAMATION,
      IMG_ICON_INFORMATION,
      IMG_ICON_STOP,//hand
      IMG_ICON_BUSY,//hourglass
      IMG_USER,     //user-defined image
    }eImageResource;

    typedef enum eBrushResource
    {
      BURSH_FOREGROUND,       //windows:gray or pattern
      BURSH_CAPTION_ACTIVE,   //gradient
      BURSH_CAPTION_INACTIVE, //gradient
      BURSH_WINDOW,
      BURSH_WORKSPACE,
      BURSH_SHADOW,           //gradient: gray-to-transparent
      BURSH_HINT_BACKGROUND,
      BURSH_TEXT_GUI,
      BURSH_TEXT_ACTIVE_CAPTION,
      BURSH_TEXT_INACTIVE_CAPTION,
      BURSH_ITEM_HIGHLIGHT
    }eBrushResource;

    typedef enum ePenResource
    {
      PEN_FOREGROUND,
      PEN_HIGHLIGHT,
      PEN_SHADOW,
      PEN_ITEM_HIGHLIGHT
    }ePenResource;

    typedef enum eFontResource
    {
      FONT_GUI,         //generic labels
      FONT_BOLDGUI,     //custom gui labels
      FONT_LOG,         //log window
      FONT_MESSAGES,    //messageboxes, etc.
      FONT_CAPTION,     //window caption.
      FONT_MINI_CAPTION,//window caption.
    }eFontResource;

    typedef enum eColorResource
    {
      ZCOLOR_BACKGROUND       = 0,  // views
      ZCOLOR_3DBACKGROUND     = 1,  // 3d view
      ZCOLOR_CAPTION_ACTIVE   = 2,  // first color if gradient
      ZCOLOR_CAPTION_INACTIVE = 3,  // first color if gradient
      ZCOLOR_ACTIVECAPTIONTEXT= 4,
      ZCOLOR_MENUHIGHLIGHT    = 5,  // highlight of menu items (brighter thanZCOLOR_HIGHLIGHT)
      ZCOLOR_WINDOW           = ZCOLOR_BACKGROUND,
      ZCOLOR_FOREGROUND       = 7,
      ZCOLOR_BTNFACE          = ZCOLOR_FOREGROUND,
      ZCOLOR_BTNSHADOW        = 8,
      ZCOLOR_GRAYTEXT         = 9,  //inactive buttons and captions text
      ZCOLOR_BTNTEXT          = 10,
      ZCOLOR_BTNHIGHLIGHT     = 11,
      ZCOLOR_HIGHLIGHT        = 20, // menu items, toolbar items
      ZCOLOR_HIGHLIGHTTEXT    = 21,

      ZCOLOR_MESH_DEFAULT     = 40,
      ZCOLOR_MESH_DISABLED    = 41,
      ZCOLOR_MESH_ACTIVE      = 42,
      ZCOLOR_MESH_SELECTED    = 43,
      ZCOLOR_MESH_SELACTIVE   = 44,
      ZCOLOR_MESH_USERSTATE   = 45,
      ZCOLOR_MESH_NORMALS     = 46,
      ZCOLOR_MESH_VERTDOTS    = 47,
      ZCOLOR_MESH_POLYDOTS    = 48,

      //curve points. curve lines uses ZCOLOR_MESH_*
      ZCOLOR_CURVE_DEFAULT    = 60,
      ZCOLOR_CURVE_DISABLED   = 61,
      ZCOLOR_CURVE_ACTIVE     = 62,
      ZCOLOR_CURVE_SELECTED   = 63,
      ZCOLOR_CURVE_SELACTIVE  = 64,

      //manipulators:
      ZCOLOR_MANIP_DEFAULT    = 70,
      ZCOLOR_MANIP_DISABLED   = 71,
      ZCOLOR_MANIP_ACTIVE     = 72,
      ZCOLOR_MANIP_SELECTED   = 73,
      ZCOLOR_MANIP_SELACTIVE  = 74,

      //
      // other colors allowed here
      //
      ZCOLOR_LAST             = 255,
    }eColorResource;

    typedef enum eCursorResource
    {
      CURSOR_DEFAULT    = 0,
      CURSOR_PICK       = 3,
      CURSOR_CREATE     = 6,
      CURSOR_BRUSH      = 10,
      CURSOR_BIND       = 20,
    }eCursorResource;
    
    typedef enum eSizeLimits
    {
      SL_DEFAULT,
      SL_MIN_FLOAT,
      SL_MIN_DOCKED,
      SL_MAX_FLOAT,
      SL_MAX_DOCKED
    };

    //--------------------------------------
    //    Viewport kind
    //--------------------------------------
    // bits 0-7   are viewport-id. 
    // bits 8-23  are standard viewport config
    // bits 24-31 are implemenation-specific
#define ZM_UI_VIEWPORT_FRONTAL      0x000100
#define ZM_UI_VIEWPORT_SIDE         0x000200
#define ZM_UI_VIEWPORT_TOP          0x000400
#define ZM_UI_VIEWPORT_NEGATIVE     0x000800
#define ZM_UI_VIEWPORT_SCENE        0x001000
#define ZM_UI_VIEWPORT_PLANAR       0x002000
#define ZM_UI_VIEWPORT_3D           0x004000
#define ZM_UI_VIEWPORT_PERSPECTIVE  0x008000
#define ZM_UI_VIEWPORT_HIGHQUALITY  0x010000
//can't be used with HIGHQUALITY
#define ZM_UI_VIEWPORT_EDITABLE     0x020000
#define ZM_UI_VIEWPORT_UVMAPPER     0x040000

#define IS_SCENE_VIEWPORT(vp)       (0!=((vp) & ZM_UI_VIEWPORT_SCENE))
#define IS_3D_VIEWPORT(vp)          (0!=((vp) & ZM_UI_VIEWPORT_3D))
#define IS_PERSPECTIVE_VIEWPORT(vp) (0!=((vp) & ZM_UI_VIEWPORT_PERSPECTIVE))
#define IS_PLANAR_VIEWPORT(vp)      (0!=((vp) & ZM_UI_VIEWPORT_PLANAR))
#define IS_FRONTAL_VIEWPORT(vp)     (0!=((vp) & ZM_UI_VIEWPORT_FRONTAL))
#define IS_SIDE_VIEWPORT(vp)        (0!=((vp) & ZM_UI_VIEWPORT_SIDE))
#define IS_TOP_VIEWPORT(vp)         (0!=((vp) & ZM_UI_VIEWPORT_TOP))
#define IS_EDITABLE_VIEWPORT(vp)    (0!=((vp) & ZM_UI_VIEWPORT_EDITABLE))
#define IS_UVMAPPER_VIEWPORT(vp)    (0!=((vp) & ZM_UI_VIEWPORT_UVMAPPER))
#define IS_HIGHQUALITY_VIEWPORT(vp) (0!=((vp) & ZM_UI_VIEWPORT_HIGHQUALITY))

    typedef enum eViewport
    {
      VIEWPORT_UNDEFINED  = 0,
      VIEWPORT_FRONT      = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_PLANAR | ZM_UI_VIEWPORT_FRONTAL | ZM_UI_VIEWPORT_EDITABLE,
      VIEWPORT_BACK       = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_PLANAR | ZM_UI_VIEWPORT_FRONTAL | ZM_UI_VIEWPORT_EDITABLE | ZM_UI_VIEWPORT_NEGATIVE,
      VIEWPORT_TOP        = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_PLANAR | ZM_UI_VIEWPORT_TOP | ZM_UI_VIEWPORT_EDITABLE,
      VIEWPORT_BOTTOM     = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_PLANAR | ZM_UI_VIEWPORT_TOP | ZM_UI_VIEWPORT_EDITABLE | ZM_UI_VIEWPORT_NEGATIVE,
      VIEWPORT_LEFT       = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_PLANAR | ZM_UI_VIEWPORT_SIDE | ZM_UI_VIEWPORT_EDITABLE,
      VIEWPORT_RIGHT      = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_PLANAR | ZM_UI_VIEWPORT_SIDE | ZM_UI_VIEWPORT_EDITABLE | ZM_UI_VIEWPORT_NEGATIVE,
      VIEWPORT_3D         = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_3D | ZM_UI_VIEWPORT_PERSPECTIVE | ZM_UI_VIEWPORT_HIGHQUALITY,
      VIEWPORT_USER       = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_3D | ZM_UI_VIEWPORT_EDITABLE,
      VIEWPORT_PERSPECTIVE= ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_3D | ZM_UI_VIEWPORT_PERSPECTIVE | ZM_UI_VIEWPORT_EDITABLE,
      VIEWPORT_UVMAPPER   = ZM_UI_VIEWPORT_SCENE | ZM_UI_VIEWPORT_PLANAR | ZM_UI_VIEWPORT_EDITABLE | ZM_UI_VIEWPORT_FRONTAL | ZM_UI_VIEWPORT_UVMAPPER,
      
      VIEWPORT_DWORD  = 0x7FFFFFFF
    };

    typedef ZSequence<eViewport>  tViewportSeq;
#define Z3D_WORKSPACE_RESOLVATION   _T("ZModeler::Workspace")
  };//ui
};//core

#endif