//
// Copyright (C) 1999-2004 Toshikaz Hirabayashi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// TOSHIKAZ HIRABAYASHI BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Except as contained in this notice, the name of Toshikaz Hirabayashi shall
// not be used in advertising or otherwise to promote the sale, use or other
// dealings in this Software without prior written authorization from
// Toshikaz Hirabayashi.

#include <WScom.h>
#include <WSCvpolyAttr.h>
#include <WSCclassInformation.h>
#include <WSCdevice.h>
#include <WSCblink.h>
#include <WSCcolorSet.h>
#include <WSDdev.h>
#include <WSDcolor.h>
#include <WSCblink.h>

WSMFguiClassInitialize(WSCvpolyAttr, WSCnwbase);
WSMFversion(WSCvpolyAttr, WSCnwbase);

WSCvpolyAttr::WSCvpolyAttr(WSCbase* base, char* objname):
               WSCnwbase(base,objname){
  _lw = 2;
  _lt = 0;
  _stippled = False;
  _hatch_pattern = 0;
//  _hatch_color = WSGFcolor("gray85");
//  _hatch_blink_color = WSGFcolor("gray65");
//  _back_color = WSGFcolor("gray85");
//  _back_blink_color = WSGFcolor("gray65");
  _hatch_color = WS_DF_NWBACKCOLOR;
  _hatch_blink_color = WS_DF_NWBACKCOLOR;
  _back_color = WS_DF_NWBACKCOLOR;
  _back_blink_color = WS_DF_NWBACKCOLOR;
  _back_color_flag = False;
  _blink_type = WS_FORE;


  WSMFpropertyCreateStart
    WSMFparentCheckVerSrc(WSCvpolyAttr);

    WSMFpropertyCreate(WSNlineWidth, WSCushort, _lw,WSSlineWidth);
    WSMFpropertyCreate(WSNlineType,  WSCuchar, _lt,WSSlineType);
      WSMFpropertySetSelection(WSRlineType, WSRlineTypeD);
    WSMFpropertyCreate(WSNstippled,WSCbool,_stippled,WSSstippled );
      WSMFpropertySetSelection(WSRbool4, WSRbool4D);
    WSMFpropertyCreate(WSNhatchPattern,WSCuchar,_hatch_pattern,WSShatchPattern);
      WSMFpropertySetSelection(WSRhatchPattern, WSRhatchPatternD);
    WSMFpropertyCreate(WSNhatchColor,short,_hatch_color,WSShatchColor);
    WSMFpropertyCreate(WSNhatchBlinkColor,short,_hatch_blink_color,WSShatchBlinkColor);
    WSMFpropertyCreate(WSNbackColorFlag,WSCbool,_back_color_flag,WSSbackColorFlag);
      WSMFpropertySetSelection(WSRbool4, WSRbool4D);
    WSMFpropertyCreate(WSNbackColor,short,_back_color,WSSbackColor);
    WSMFpropertyCreate(WSNbackBlinkColor,short,_back_blink_color,WSSbackBlinkColor);
    WSMFpropertyCreate(WSNblinkType,WSCuchar,_blink_type,WSSblinkType);
      WSMFpropertySetSelection(WSRblinkType, WSRblinkTypeD);

    WSMFdelTrigger(WSEV_MOUSE_IN    );
    WSMFdelTrigger(WSEV_MOUSE_OUT   );
    WSMFdelTrigger(WSEV_MOUSE_MOVE  );
    WSMFdelTrigger(WSEV_MOUSE_PRESS   );
    WSMFdelTrigger(WSEV_MOUSE_RELEASE );

  WSMFpropertyCreateEnd

}

WSMFproperty(WSCvpolyAttr, WSNlineWidth, WSCushort, _lw, 2);
WSMFproperty(WSCvpolyAttr, WSNlineType,  WSCuchar,      _lt, 0);
WSMFproperty(WSCvpolyAttr, WSNstippled,  WSCbool,_stippled,     False);
WSMFproperty(WSCvpolyAttr, WSNhatchPattern, WSCuchar,   _hatch_pattern,0    );
//WSMFproperty(WSCvpolyAttr, WSNhatchColor,  short,  _hatch_color,WSGFcolor("gray85"));
WSMFproperty(WSCvpolyAttr, WSNhatchColor,  short,  _hatch_color,WS_DF_NWBACKCOLOR);
//WSMFproperty(WSCvpolyAttr, WSNhatchBlinkColor,short,_hatch_blink_color,WSGFcolor("gray65"));
WSMFproperty(WSCvpolyAttr, WSNhatchBlinkColor,short,_hatch_blink_color,WS_DF_NWBACKCOLOR);
//WSMFproperty(WSCvpolyAttr, WSNbackColor,short,_back_color,WSGFcolor("gray85"));
WSMFproperty(WSCvpolyAttr, WSNbackColor,short,_back_color,WS_DF_NWBACKCOLOR);
//WSMFproperty(WSCvpolyAttr, WSNbackBlinkColor,short,_back_blink_color,WSGFcolor("gray65"));
WSMFproperty(WSCvpolyAttr, WSNbackBlinkColor,short,_back_blink_color,WS_DF_NWBACKCOLOR);
WSMFproperty(WSCvpolyAttr, WSNbackColorFlag,WSCbool,_back_color_flag,False);
WSMFproperty(WSCvpolyAttr, WSNblinkType,WSCuchar,_blink_type,WS_FORE);

void WSCvpolyAttr::setWorkWSNlineWidth(WSCushort){
}

void WSCvpolyAttr::getWorkWSNlineWidth(WSCushort*){
}

void WSCvpolyAttr::setWorkWSNlineType(WSCuchar){
}

void WSCvpolyAttr::getWorkWSNlineType(WSCuchar*){
}

void WSCvpolyAttr::setWorkWSNstippled(WSCbool){
}

void WSCvpolyAttr::getWorkWSNstippled(WSCbool*){
}

void WSCvpolyAttr::setWorkWSNhatchPattern(WSCuchar){
}

void WSCvpolyAttr::getWorkWSNhatchPattern(WSCuchar*){
}

void WSCvpolyAttr::setWorkWSNhatchColor(short){
}

void WSCvpolyAttr::getWorkWSNhatchColor(short*){
}

void WSCvpolyAttr::setWorkWSNhatchBlinkColor(short){
}

void WSCvpolyAttr::getWorkWSNhatchBlinkColor(short*){
}

void WSCvpolyAttr::setWorkWSNbackColorFlag(WSCbool){
}

void WSCvpolyAttr::getWorkWSNbackColorFlag(WSCbool*){
}

void WSCvpolyAttr::setWorkWSNbackColor(short){
}

void WSCvpolyAttr::getWorkWSNbackColor(short*){
}

void WSCvpolyAttr::setWorkWSNbackBlinkColor(short){
}

void WSCvpolyAttr::getWorkWSNbackBlinkColor(short*){
}

void WSCvpolyAttr::setWorkWSNblinkType(WSCuchar){
}

void WSCvpolyAttr::getWorkWSNblinkType(WSCuchar*){
}
WSCvpolyAttr::~WSCvpolyAttr(){
}
#if 0
void WSCvpolyAttr::setWorkWSNblinkFlag(WSCbool fl) {
  if (fl != False){
    WSGIappBlink()->addBlinkInstance(this,_blink_rate,_bl_refreshing);
  }else{
    WSGIappBlink()->delBlinkInstance(this);
  }
}
#endif
