/**************************************************************************

    This file is part of desktop95, a desktop manager for fvwm95.
    Copyright (C) 1996, 1997 David Barth, Hector Peraza.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

**************************************************************************/

#include <X11/cursorfont.h>

#include <xclass/OXClient.h>
#include <xclass/utils.h>

#include "OXFolder.h"
#include "OXNewClient.h"

extern int gray_width;
extern int gray_height;
extern unsigned char gray_bits[];

OXDesktopClient::OXDesktopClient(const char *DpyName) : OXClient(DpyName) {
  XGCValues gval;
  unsigned long gmask;

  OXFolderLabel::_defaultFontStruct = XLoadQueryFont(_dpy, "-adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1");

  gmask = GCForeground | GCBackground | GCFont |
          GCFillStyle | GCGraphicsExposures;
  gval.fill_style = FillSolid;
  gval.graphics_exposures = False;
  gval.foreground = _forecolor;
  gval.background = _backcolor;
  gval.font = OXFolderLabel::_defaultFontStruct->fid;
  OXFolderLabel::_defaultGC = XCreateGC(_dpy, _Root->GetId(), gmask, &gval);

  gmask = GCForeground | GCBackground | GCFunction | GCFillStyle |
          GCLineWidth  | GCLineStyle  | GCSubwindowMode | GCGraphicsExposures;
  gval.foreground = _white ^ _black;
  gval.background = _white;
  gval.function   = GXxor;
  gval.line_width = 0;
  gval.line_style = LineOnOffDash;
  gval.fill_style = FillSolid;
  gval.subwindow_mode = IncludeInferiors;
  gval.graphics_exposures = False;
  OXFolderContainer::_lineGC = XCreateGC(_dpy, _Root->GetId(), gmask, &gval);
  XSetDashes(_dpy, OXFolderContainer::_lineGC, 0, "\x1\x1", 2);

  OXFolder::_defaultCursor = XCreateFontCursor(_dpy, XC_top_left_arrow);
}
