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

    This file is part of notepad95, a text editor for fvwm95.
    Copyright (C) 1997, Harald Radke.                   

    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 <stdlib.h>
#include <stdio.h>

#include <xclass/OXWindow.h>
#include <xclass/OXFrame.h>
#include <xclass/OXWidgets.h>
#include <xclass/OXMsgBox.h>
#include <xclass/OString.h>

typedef struct search_type
{
 bool direction;
 bool caseSensitive;
 char *buffer;
} search_struct;

static char *printerIconData[] = {
/* width height num_colors chars_per_pixel */
"    32    32        8            1",
/* colors */
". c #000000",
"# c #ff0000",
"a c #5a5a5a",
"b c #848484",
"c c #00ff00",
"d c #c6c6c6",
"e c None s None",
"f c #ffffff",
/* pixels */
"eeeeeeeeeeeeeeeeeeeebbbeeeeeeeee",
"eeeeeeeeeeeeeeeeeeebfffbbeeeeeee",
"eeeeeeeeeeeeeeeeeebffffffbbeeeee",
"eeeeeeeeeeeeeeeeebffaafffffbbeee",
"eeeeeeeeeeeeeeeebfffffaaffd..eee",
"eeeeeeeeeeeeeeebffaafffffd.eeeee",
"eeeeeeeeeeeeebbbffffaaffd.eeeeee",
"eeeeeeeeeeebbfbffaaffffd.eeeeeee",
"eeeeeeeeebbfddbffffaafd.eeeeeeee",
"eeeeeeebbfddbbffaaffff.bbbeeeeee",
"eeeeebbfddbbb..fffaafd.bddbbeeee",
"eeebbfddbbbbddd..ffff.ddbbddb.ee",
"ebbeddbbddbbddddd..fd.bbddbbb.ee",
"ebeebbddccddbbddddd.bbddbbbbb.ee",
"ebedbffddd##ddbbddbbddbbbbbbb.ee",
"ebedbddffdddddddbbddbbbbbbbbb.ee",
"ebedbddddffdddbbddbbbbbbbbbbb.ee",
"ebedbddddddfbbddbbbbbbbbbbbbb.ee",
"ebedbdddddddbfbbbbbbbbbbbbbb..ee",
"ebbdbdddddddbdbbbbbbbbbbbb...eee",
"eeebbdddddddbdbbbbbbbbbb..eeeeee",
"eeeeebbdddddbdbbbbbbbb..b...eeee",
"eeeeeeebbdddbdbbbbbb..ebfbbb..ee",
"eeeeeeeeebbdbdbbbb..ebbfffffbb.e",
"eeeeeeeeeeebbdbb..ebbfffaaffffbd",
"eeeeeeeeeeeeeb..eebbfaafffaafd.d",
"eeeeeeeeeeeeeeeeebbffffaaffdd.d.",
"eeeeeeeeeeeeeeeebbfaafffffd..d.e",
"eeeeeeeeeeeeeeebbffffaaffd.dd.ee",
"eeeeeeeeeeeeeeeddbbfffffd.d..eee",
"eeeeeeeeeeeeeeebbddbbffd.d.eeeee",
"eeeeeeeeeeeeeeeeebbddbd.d.eeeeee"
};


class OXGotoBox : public OXTransientFrame {
public:
  OXGotoBox(const OXWindow *p, const OXWindow *main, int w, int h,
                 long *ret_val,
               unsigned long options = MAIN_FRAME | VERTICAL_FRAME);
  virtual ~OXGotoBox();
   virtual void CloseWindow();
  virtual int ProcessMessage(long msg, long parm1, long parm2);

protected:
  OXCompositeFrame *f1, *f2;
  OXButton *GotoButton, *CancelButton;
  OLayoutHints *L1, *L5, *L6, *L21;
  OXTextEntry  *goTo;
  OTextBuffer  *tbgoTo;
  OXLabel  *lgoTo;
  long *ret;
};

class OXSearchBox : public OXTransientFrame {
public:
  OXSearchBox(const OXWindow *p, const OXWindow *main, int w, int h,
                search_struct *sstruct, int *ret_val,
               unsigned long options = MAIN_FRAME | VERTICAL_FRAME);
  virtual ~OXSearchBox();
  
  virtual void CloseWindow();
  virtual int ProcessMessage(long msg, long parm1, long parm2);

protected:
  OXCompositeFrame *f1, *f2, *f3, *f4;
  OXButton *SearchButton, *CancelButton;
  OXRadioButton *direction_radio[2];
  OXCheckButton *case_check;
  OXGroupFrame *g1, *g2;
  OLayoutHints *L1, *L2, *L3, *L4, *L5, *L6, *L21, *L9, *L10;
  OXTextEntry  *search;
  OTextBuffer  *tbsearch;
  OXLabel  *lsearch;
  search_struct *s;
  int *ret;
};

class OXPrintBox: public OXTransientFrame {
public:
  OXPrintBox(const OXWindow *p, const OXWindow *main, int w, int h,
                char **printerName, char **printProg, int *ret_val,
               unsigned long options = MAIN_FRAME | VERTICAL_FRAME);
  virtual ~OXPrintBox();

  virtual void CloseWindow();
  virtual int ProcessMessage(long msg, long parm1, long parm2);

protected:
  char **pprinter, **pprintCommand;
  OXCompositeFrame *f1, *f2, *f3, *f4, *f5;
  const OPicture *printerPicture;
  OXIcon *printerIcon;
  OXButton *PrintButton, *CancelButton;
  OLayoutHints *L1, *L2, *L3, *L5, *L6, *L21;
  OXTextEntry  *printer, *printCommand;   
  OTextBuffer  *tbprinter, *tbprintCommand;
  OXLabel  *lprinter, *lprintCommand; 
  int *ret;   
};


