// generated by Fast Light User Interface Designer (fluid) version 1.0107

#include <libintl.h>
#include "icc_betrachter.h"
#include "icc_gl.h"
#include "icc_draw.h"
#include "icc_kette.h"
#include "icc_oyranos_extern.h"
#include "fl_i18n/fl_i18n.H"
using namespace icc_examin_ns;

const char* iccReadInfo(char* filename) {
  DBG_PROG_START
  char systemBefehl[1024];
  const char *textfile = "/tmp/icc_temp.txt";


  sprintf (systemBefehl, "iccdump \"%s\" > %s",
                                    filename, textfile);
  system (systemBefehl);

  return textfile;
  DBG_PROG_ENDE
}

TagBrowser::TagBrowser(int X,int Y,int W,int H,const char* start_info) : Fl_Hold_Browser(X,Y,W,H,start_info), X(X), Y(Y), W(W), H(H) {
}

void TagBrowser::reopen_nicht() {
  DBG_PROG_START
  DBG_PROG_ENDE
}

void TagBrowser::selectItem(int item) {
  DBG_PROG_START
  // selection from tag_browser

  status("")

  item -= 6;
  DBG_PROG_S( item << ". Tag " )
  
  std::string text = icc_examin->waehleTag(item);
  if (text != "")
    selectedTagName = text;
  DBG_PROG_V( text );
  DBG_PROG_ENDE
}

int TagBrowser::visible() {
  return Fl_Widget::visible();
}

TagTexts::TagTexts(int X,int Y,int W,int H,const char* start_info) : Fl_Hold_Browser(X,Y,W,H,start_info), X(X), Y(Y), W(W), H(H) {
  cb = NULL;
}

void TagTexts::hinein(std::string text, std::vector<int> patches) {
  DBG_PROG_START
  //show text from tag_browser

      inspekt_topline = this->topline();

      this->clear();

      std::vector <std::string> texte = icc_parser::zeilenNachVector( text );
      int odd = 1;
      int k = 0;
      for (unsigned int i = 0; i < texte.size(); i++)
      {
        std::string text;
        if( patches.size() > k )
        if( patches[k] == (int)i )
        { 
          if(odd) {
#if 0
            char t[8];
            sprintf(t, "%d", k/2); // test for a goof colour @31
            text = "@B";
            text.append( t );
            text.append("@.");
#else
            text = "@B7@.";
#endif
          }
          odd = !odd;
          ++k;
        }

        text.append( texte[i] );
        this->add( text.c_str(), 0);
      }

      this->topline(inspekt_topline);
      this->textfont(FL_COURIER);
      this->textsize(14);
  DBG_PROG_ENDE
}

void TagTexts::hinein(std::string text) {
  DBG_PROG_START
  std::vector<int> patches;
this->hinein( text, patches );
  DBG_PROG_ENDE
}

void TagTexts::selectItem(int item) {
  DBG_PROG_START
  // selection from tag_browser

  const char * txt = 0;
  int i = item;

  status("")

  DBG_PROG_S( item << ". Tag " )
  
  if (cb)
    txt = (*cb) ( &i );

  if(i != item)
    select(i);
  DBG_PROG_ENDE
}
#include <FL/fl_draw.H>

MftChoice::MftChoice(int X,int Y,int W,int H,const char* start_info) : Fl_Choice(X,Y,W,H,start_info), X(X), Y(Y), W(W), H(H) {
  gewaehlter_eintrag = 0;
}

void MftChoice::profilTag(int _tag, std::string text) {
  DBG_PROG_START
  icc_examin->icc_betrachter->tag_nummer = _tag;

// = profile.profil()->printTagInfo(icc_examin->icc_betrachter->tag_nummer);
    sprintf (&typ[0], profile.profil()->printTagInfo(icc_examin->icc_betrachter->tag_nummer)[1].c_str());

    DBG_PROG_V( profile.profil()->printTagInfo(icc_examin->icc_betrachter->tag_nummer)[1].c_str() )

    Info = icc_parser::zeilenNachVector (text);

    if ( strstr (typ,"mft2") != 0 )
    { DBG_PROG
      Fl_Menu_Item *mft_menue = (Fl_Menu_Item *)calloc (sizeof (Fl_Menu_Item), 6);

      mft_menue[0].text = Info[0].c_str();
      mft_menue[1].text = Info[4].c_str();
      mft_menue[2].text = Info[5].c_str();
      mft_menue[3].text = Info[6].c_str();
      mft_menue[4].text = Info[7].c_str();
      mft_menue[5].text = 0;
      icc_examin->icc_betrachter->mft_choice->menu(mft_menue);
    } else { DBG_PROG
      Fl_Menu_Item *mft_menue = (Fl_Menu_Item *)calloc (sizeof (Fl_Menu_Item), 6);

      mft_menue[0].text = Info[0].c_str();
      mft_menue[1].text = Info[4].c_str();
      mft_menue[2].text = _("lineare entrance curve with 256 steps");
      mft_menue[3].text = Info[5].c_str();
      mft_menue[4].text = _("lineare exit curve with 256 steps");
      mft_menue[5].text = 0;
      icc_examin->icc_betrachter->mft_choice->menu(mft_menue);
    }

    icc_examin->icc_betrachter->mft_choice->value( gewaehlter_eintrag );

  //auswahlCb();
  DBG_PROG_ENDE
}

void MftChoice::auswahlCb(void) {
  DBG_PROG_START
  //Auswahl aus mft_choice

  status("")

  Fl_Menu_* mw = (Fl_Menu_*)this;
  const Fl_Menu_Item* m = mw->mvalue();
  if (!m) {
    DBG_PROG_S("NULL \n")
  } else if (m->shortcut()) {
    DBG_PROG_S("%s - %s \n" << m->label() << fl_shortcut_label(m->shortcut()))
  } else {
    DBG_PROG_S("%s \n" << m->label())
  }

  icc_examin->waehleMft( mw->value() );

  DBG_PROG
  DBG_PROG_ENDE
}

My_Fl_Box::My_Fl_Box(int X,int Y,int W, int H, const char* title ) : Fl_Box(X,Y,W,H,title) {
}

int My_Fl_Box::handle( int event ) {
  int ergebnis = tastatur(event);
  if(!ergebnis)
    ;//ergebnis = Fl_Box::handle(event);
  return ergebnis;
}

static void mft_gl_menueCb_(Fl_Widget * w, void * data) {
  icc_examin->icc_betrachter->mft_gl->menueAufruf( (intptr_t) data );
}

void ICCfltkBetrachter::cb_ja_i(Fl_Button*, void*) {
  ueber->hide();
}
void ICCfltkBetrachter::cb_ja(Fl_Button* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_ja_i(o,v);
}

void ICCfltkBetrachter::cb_vcgt_set_button_i(Fl_Button*, void*) {
  icc_examin->moniSetzen();
}
void ICCfltkBetrachter::cb_vcgt_set_button(Fl_Button* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_vcgt_set_button_i(o,v);
}

void ICCfltkBetrachter::cb_vcgt_reset_button_i(Fl_Button*, void*) {
  icc_examin->standardGamma();
}
void ICCfltkBetrachter::cb_vcgt_reset_button(Fl_Button* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_vcgt_reset_button_i(o,v);
}

void ICCfltkBetrachter::cb_vcgt_load_button_i(Fl_Button*, void*) {
  icc_examin->moniHolen();
}
void ICCfltkBetrachter::cb_vcgt_load_button(Fl_Button* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_vcgt_load_button_i(o,v);
}

void ICCfltkBetrachter::cb_vcgt_close_button_i(Fl_Button*, void*) {
  icc_examin->vcgtStoppen();
}
void ICCfltkBetrachter::cb_vcgt_close_button(Fl_Button* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_vcgt_close_button_i(o,v);
}

void ICCfltkBetrachter::cb_Quit_i(Fl_Menu_*, void*) {
  quit();
}
void ICCfltkBetrachter::cb_Quit(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_Quit_i(o,v);
}

void ICCfltkBetrachter::cb_DD_menueintrag_Voll_i(Fl_Menu_* o, void*) {
  Fl_Window *w = o->window();

  if (!fullscreen) {
    px = w->x();
    py = w->y();
    pw = w->w();
    ph = w->h();

    w->fullscreen();
    fullscreen = true;
  } else {
    w->fullscreen_off(px,py,pw,ph);
    fullscreen = false;
  };
}
void ICCfltkBetrachter::cb_DD_menueintrag_Voll(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_DD_menueintrag_Voll_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_gamutwarn_i(Fl_Menu_* o, void*) {
  Fl_Menu_* mw = (Fl_Menu_*)o;
  const Fl_Menu_Item* m = mw->mvalue();

  DBG_PROG_S (m->value())

  icc_examin->gamutwarn(m->value());
}
void ICCfltkBetrachter::cb_menueintrag_gamutwarn(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_gamutwarn_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_phot_intent_i(Fl_Menu_* o, void*) {
  Fl_Menu_* mw = (Fl_Menu_*)o;
  const Fl_Menu_Item* m = mw->mvalue();

  DBG_PROG_S (m->value())

  menueintrag_rel_col_intent->clear();
  menueintrag_abs_col_intent->clear();

  if(m->value())
    icc_examin->intent(0);
  else
    icc_examin->intent(-1);
}
void ICCfltkBetrachter::cb_menueintrag_phot_intent(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_phot_intent_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_rel_col_intent_i(Fl_Menu_* o, void*) {
  Fl_Menu_* mw = (Fl_Menu_*)o;
  const Fl_Menu_Item* m = mw->mvalue();

  DBG_PROG_S (m->value())

  menueintrag_phot_intent->clear();
  menueintrag_abs_col_intent->clear();

  if(m->value())
    icc_examin->intent(1);
  else
    icc_examin->intent(-1);
}
void ICCfltkBetrachter::cb_menueintrag_rel_col_intent(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_rel_col_intent_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_abs_col_intent_i(Fl_Menu_* o, void*) {
  Fl_Menu_* mw = (Fl_Menu_*)o;
  const Fl_Menu_Item* m = mw->mvalue();

  DBG_PROG_S (m->value())

  menueintrag_phot_intent->clear();
  menueintrag_rel_col_intent->clear();

  if(m->value())
    icc_examin->intent(3);
  else
    icc_examin->intent(-1);
}
void ICCfltkBetrachter::cb_menueintrag_abs_col_intent(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_abs_col_intent_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_bpc_i(Fl_Menu_* o, void*) {
  Fl_Menu_* mw = (Fl_Menu_*)o;
  const Fl_Menu_Item* m = mw->mvalue();

  DBG_PROG_S (m->value())

  if(m->value())
    icc_examin->bpc(0);
  else
    icc_examin->bpc(1);
}
void ICCfltkBetrachter::cb_menueintrag_bpc(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_bpc_i(o,v);
}

void ICCfltkBetrachter::cb_Show_i(Fl_Menu_*, void*) {
  DBG_PROG_START
  details->show();
  DBG_PROG_ENDE;
}
void ICCfltkBetrachter::cb_Show(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_Show_i(o,v);
}

Fl_Menu_Item ICCfltkBetrachter::menu_DD_menueleiste[] = {
 {_("File"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Quit"), 0x40071,  (Fl_Callback*)ICCfltkBetrachter::cb_Quit, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {_("View"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Whole Screen on/off"), 0x40076,  (Fl_Callback*)ICCfltkBetrachter::cb_DD_menueintrag_Voll, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {_("Settings"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Gamut Warning"), 0x40077,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_gamutwarn, 0, 2, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Perceptual"), 0x40066,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_phot_intent, 0, 2, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Relative Colorimetric"), 0x40072,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_rel_col_intent, 0, 2, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Absolute Colorimetric"), 0x40061,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_abs_col_intent, 0, 2, FL_NORMAL_LABEL, 0, 14, 0},
 {_("BPC"), 0x40062,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_bpc, 0, 2, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {_("Windows"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Show Main Window"), 0x4006d,  (Fl_Callback*)ICCfltkBetrachter::cb_Show, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {0,0,0,0,0,0,0,0,0}
};
Fl_Menu_Item* ICCfltkBetrachter::DD_menueintrag_Voll = ICCfltkBetrachter::menu_DD_menueleiste + 4;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_gamutwarn = ICCfltkBetrachter::menu_DD_menueleiste + 7;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_phot_intent = ICCfltkBetrachter::menu_DD_menueleiste + 8;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_rel_col_intent = ICCfltkBetrachter::menu_DD_menueleiste + 9;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_abs_col_intent = ICCfltkBetrachter::menu_DD_menueleiste + 10;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_bpc = ICCfltkBetrachter::menu_DD_menueleiste + 11;

void ICCfltkBetrachter::cb_Open_i(Fl_Menu_*, void*) {
  icc_examin->oeffnen();
}
void ICCfltkBetrachter::cb_Open(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_Open_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_html_speichern_i(Fl_Menu_*, void*) {
  DBG_PROG_START

  icc_examin->berichtSpeichern ();

  DBG_PROG_ENDE;
}
void ICCfltkBetrachter::cb_menueintrag_html_speichern(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_html_speichern_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_gamut_speichern_i(Fl_Menu_*, void*) {
  DBG_PROG_START

  icc_examin->gamutSpeichern (icc_examin_ns::ICC_ABSTRACT);

  DBG_PROG_ENDE;
}
void ICCfltkBetrachter::cb_menueintrag_gamut_speichern(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_gamut_speichern_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_gamut_vrml_speichern_i(Fl_Menu_*, void*) {
  DBG_PROG_START

  icc_examin->gamutSpeichern (icc_examin_ns::ICC_VRML);

  DBG_PROG_ENDE;
}
void ICCfltkBetrachter::cb_menueintrag_gamut_vrml_speichern(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_gamut_vrml_speichern_i(o,v);
}

void ICCfltkBetrachter::cb_Quit1_i(Fl_Menu_*, void*) {
  quit();
}
void ICCfltkBetrachter::cb_Quit1(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_Quit1_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_huelle_i(Fl_Menu_*, void*) {
  DBG_PROG_START
  icc_examin->zeig3D();
  DBG_PROG_ENDE;
}
void ICCfltkBetrachter::cb_menueintrag_huelle(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_huelle_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_Voll_i(Fl_Menu_*, void*) {
  Fl_Window *w = (Fl_Window *)details;

  if (!fullscreen) {
    px = w->x();
    py = w->y();
    pw = w->w();
    ph = w->h();

    w->fullscreen();
    fullscreen = true;
  } else {
    w->fullscreen_off(px,py,pw,ph);
    fullscreen = false;
  };
}
void ICCfltkBetrachter::cb_menueintrag_Voll(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_Voll_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_oyranos_i(Fl_Menu_*, void*) {
  icc_examin->oyranos_einstellungen();
}
void ICCfltkBetrachter::cb_menueintrag_oyranos(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_oyranos_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_lang_i(Fl_Menu_*, void*) {
  system("echo $LANG");
# ifdef USE_GETTEXT
  DBG_S( "domain     : " << textdomain(NULL) );
  DBG_S( "domain_path: " << bindtextdomain(NULL,NULL) );
# endif
}
void ICCfltkBetrachter::cb_menueintrag_lang(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_lang_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_3D_i(Fl_Menu_*, void*) {
  DBG_PROG_START
  icc_examin->zeig3D();
  DBG_PROG_ENDE;
}
void ICCfltkBetrachter::cb_menueintrag_3D(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_3D_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_inspekt_i(Fl_Menu_*, void*) {
  icc_examin->zeigPrueftabelle();
}
void ICCfltkBetrachter::cb_menueintrag_inspekt(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_inspekt_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_zeigcgats_i(Fl_Menu_* o, void*) {
  #ifdef DEBUG
  Fl_Menu_* mw = (Fl_Menu_*)o;
  const Fl_Menu_Item* m = mw->mvalue();

  DBG_PROG_S (m->value())
#endif

  icc_examin->zeigCGATS();
}
void ICCfltkBetrachter::cb_menueintrag_zeigcgats(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_zeigcgats_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_vcgt_i(Fl_Menu_*, void*) {
  icc_examin->vcgtStoppen();
vcgt->show();
icc_examin->vcgtZeigen();
}
void ICCfltkBetrachter::cb_menueintrag_vcgt(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_vcgt_i(o,v);
}

void ICCfltkBetrachter::cb_menueintrag_testkurven_i(Fl_Menu_*, void*) {
  vcgt->show();
icc_examin->testZeigen();
}
void ICCfltkBetrachter::cb_menueintrag_testkurven(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_menueintrag_testkurven_i(o,v);
}

void ICCfltkBetrachter::cb_About_i(Fl_Menu_*, void*) {
  ueber->hotspot(ueber_html);
  ueber->show();
  initHilfe();

  /* set visible */
  Fl_Tabs *tb = dynamic_cast<Fl_Tabs*>(hilfe_html->parent());
  if(tb)
    tb->value(icc_examin->icc_betrachter->ueber_html);
}
void ICCfltkBetrachter::cb_About(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_About_i(o,v);
}

void ICCfltkBetrachter::cb_Help_i(Fl_Menu_*, void*) {
  ueber->hotspot(hilfe_html);
  ueber->show();
  initHilfe();

  /* set visible */
  Fl_Tabs *tb = dynamic_cast<Fl_Tabs*>(hilfe_html->parent());
  if(tb)
    tb->value(icc_examin->icc_betrachter->hilfe_html);
}
void ICCfltkBetrachter::cb_Help(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_Help_i(o,v);
}

void ICCfltkBetrachter::cb_License_i(Fl_Menu_*, void*) {
  ueber->hotspot(lizenz_html);
  ueber->show();
  initHilfe();

  /* set visible */
  Fl_Tabs *tb = dynamic_cast<Fl_Tabs*>(hilfe_html->parent());
  if(tb)
    tb->value(icc_examin->icc_betrachter->lizenz_html);
}
void ICCfltkBetrachter::cb_License(Fl_Menu_* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->user_data()))->cb_License_i(o,v);
}

Fl_Menu_Item ICCfltkBetrachter::menu_menueleiste[] = {
 {_("File"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Open"), 0x4006f,  (Fl_Callback*)ICCfltkBetrachter::cb_Open, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Save Report"), 0,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_html_speichern, 0, 129, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Save Gamut as Profile"), 0,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_gamut_speichern, 0, 1, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Save Gamut as VRML"), 0,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_gamut_vrml_speichern, 0, 129, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Quit"), 0x40071,  (Fl_Callback*)ICCfltkBetrachter::cb_Quit1, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {_("Gamut"), 0x40068,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_huelle, 0, 16, FL_NORMAL_LABEL, 0, 14, 0},
 {_("View"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Whole Screen on/off"), 0x40076,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_Voll, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {_("Settings"), 0,  0, 0, 80, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Oyranos Settings"), 0,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_oyranos, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {_("LANG"), 0,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_lang, 0, 17, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {_("Windows"), 0,  0, 0, 192, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Gamut"), 0x40068,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_3D, 0, 128, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Report View"), 0x40062,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_inspekt, 0, 1, FL_NORMAL_LABEL, 0, 14, 0},
 {_("CGATS View"), 0x40067,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_zeigcgats, 0, 129, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Videocard Gamma"), 0x40074,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_vcgt, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Test Curves"), 0x50074,  (Fl_Callback*)ICCfltkBetrachter::cb_menueintrag_testkurven, 0, 16, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {_("Help"), 0,  0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
 {_("About"), 0,  (Fl_Callback*)ICCfltkBetrachter::cb_About, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {_("Help"), 0xffbe,  (Fl_Callback*)ICCfltkBetrachter::cb_Help, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {_("License"), 0,  (Fl_Callback*)ICCfltkBetrachter::cb_License, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0},
 {0,0,0,0,0,0,0,0,0}
};
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_html_speichern = ICCfltkBetrachter::menu_menueleiste + 2;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_gamut_speichern = ICCfltkBetrachter::menu_menueleiste + 3;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_gamut_vrml_speichern = ICCfltkBetrachter::menu_menueleiste + 4;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_huelle = ICCfltkBetrachter::menu_menueleiste + 7;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_Voll = ICCfltkBetrachter::menu_menueleiste + 9;
Fl_Menu_Item* ICCfltkBetrachter::menu_einstellungen = ICCfltkBetrachter::menu_menueleiste + 11;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_oyranos = ICCfltkBetrachter::menu_menueleiste + 12;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_lang = ICCfltkBetrachter::menu_menueleiste + 13;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_3D = ICCfltkBetrachter::menu_menueleiste + 16;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_inspekt = ICCfltkBetrachter::menu_menueleiste + 17;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_zeigcgats = ICCfltkBetrachter::menu_menueleiste + 18;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_vcgt = ICCfltkBetrachter::menu_menueleiste + 19;
Fl_Menu_Item* ICCfltkBetrachter::menueintrag_testkurven = ICCfltkBetrachter::menu_menueleiste + 20;
Fl_Menu_Item* ICCfltkBetrachter::menu_hilfe = ICCfltkBetrachter::menu_menueleiste + 22;

void ICCfltkBetrachter::cb_tag_browser_i(TagBrowser* o, void*) {
  o->selectItem( o->value() );
}
void ICCfltkBetrachter::cb_tag_browser(TagBrowser* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_tag_browser_i(o,v);
}

void ICCfltkBetrachter::cb_mft_choice_i(MftChoice* o, void*) {
  o->auswahlCb();
}
void ICCfltkBetrachter::cb_mft_choice(MftChoice* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_mft_choice_i(o,v);
}

void ICCfltkBetrachter::cb_mft_text_i(TagTexts* o, void*) {
  o->selectItem( o->value() );
}
void ICCfltkBetrachter::cb_mft_text(TagTexts* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->parent()->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_mft_text_i(o,v);
}

void ICCfltkBetrachter::cb_mft_gl_alltables_button_i(Fl_Button*, void*) {
  icc_examin->zeigMftTabellen();
}
void ICCfltkBetrachter::cb_mft_gl_alltables_button(Fl_Button* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->parent()->parent()->parent()->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_mft_gl_alltables_button_i(o,v);
}

void ICCfltkBetrachter::cb_tag_text_i(TagTexts* o, void*) {
  o->selectItem( o->value() );
}
void ICCfltkBetrachter::cb_tag_text(TagTexts* o, void* v) {
  ((ICCfltkBetrachter*)(o->parent()->parent()->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_tag_text_i(o,v);
}

icc_examin_ns::MyFl_Double_Window* ICCfltkBetrachter::init(int argc, char** argv) {
  icc_examin_ns::MyFl_Double_Window* w;
  DBG_PROG_START
  fullscreen = false;
  setTitleUrl = true;
  { icc_examin_ns::MyFl_Double_Window* o = ueber = new icc_examin_ns::MyFl_Double_Window(365, 295, _("About ICC Examin"));
    w = o;
    o->box(FL_FLAT_BOX);
    o->color(FL_BACKGROUND_COLOR);
    o->selection_color(FL_BACKGROUND_COLOR);
    o->labeltype(FL_NO_LABEL);
    o->labelfont(0);
    o->labelsize(14);
    o->labelcolor(FL_FOREGROUND_COLOR);
    o->user_data((void*)(this));
    o->align(FL_ALIGN_TOP);
    o->when(FL_WHEN_RELEASE);
    { Fl_Group* o = new Fl_Group(0, 0, 375, 295);
      { Fl_Tabs* o = new Fl_Tabs(0, 0, 365, 260);
        { Fl_Help_View* o = ueber_html = new Fl_Help_View(0, 25, 365, 235, _("About"));
          o->box(FL_THIN_UP_BOX);
          o->color(FL_BACKGROUND_COLOR);
          o->selection_color(FL_DARK1);
        }
        { Fl_Help_View* o = hilfe_html = new Fl_Help_View(0, 25, 365, 235, _("Help"));
          o->box(FL_THIN_UP_BOX);
          o->color(FL_BACKGROUND_COLOR);
          o->selection_color(FL_DARK1);
          o->hide();
        }
        { Fl_Help_View* o = lizenz_html = new Fl_Help_View(0, 25, 365, 235, _("License"));
          o->box(FL_THIN_UP_BOX);
          o->color(FL_BACKGROUND_COLOR);
          o->selection_color(FL_DARK1);
          o->hide();
          Fl_Group::current()->resizable(o);
        }
        { Fl_Help_View* o = dank_html = new Fl_Help_View(0, 25, 365, 235, _("Acknowlegement"));
          o->box(FL_THIN_UP_BOX);
          o->color(FL_BACKGROUND_COLOR);
          o->selection_color(FL_DARK1);
          o->hide();
        }
        { Fl_Output* o = links_text = new Fl_Output(10, 35, 345, 215, _("Links"));
          o->type(12);
          o->box(FL_THIN_DOWN_BOX);
          o->color(FL_BACKGROUND_COLOR);
          o->selection_color(FL_DARK1);
          o->hide();
        }
        o->end();
        Fl_Group::current()->resizable(o);
      }
      { Fl_Button* o = ja = new Fl_Button(130, 264, 110, 25, _("Yes"));
        o->callback((Fl_Callback*)cb_ja);
      }
      o->end();
    }
    o->hide();
    o->use_escape_hide = true;
    o->end();
    o->resizable(o);
  }
  { icc_examin_ns::MyFl_Double_Window* o = vcgt = new icc_examin_ns::MyFl_Double_Window(370, 405, _("Grafic Card Gamma Table"));
    w = o;
    o->box(FL_FLAT_BOX);
    o->color(FL_BACKGROUND_COLOR);
    o->selection_color(FL_BACKGROUND_COLOR);
    o->labeltype(FL_NO_LABEL);
    o->labelfont(0);
    o->labelsize(14);
    o->labelcolor(FL_FOREGROUND_COLOR);
    o->user_data((void*)(this));
    o->align(FL_ALIGN_TOP);
    o->when(FL_WHEN_RELEASE);
    { Fl_Group* o = new Fl_Group(0, 0, 370, 395);
      { TagDrawings* o = vcgt_viewer = new TagDrawings(0, 0, 370, 360);
        o->box(FL_NO_BOX);
        o->color(FL_BACKGROUND_COLOR);
        o->selection_color(FL_BACKGROUND_COLOR);
        o->labeltype(FL_NORMAL_LABEL);
        o->labelfont(0);
        o->labelsize(14);
        o->labelcolor(FL_FOREGROUND_COLOR);
        o->align(FL_ALIGN_CENTER);
        o->when(FL_WHEN_RELEASE);
        Fl_Group::current()->resizable(o);
        o->show();
      }
      { Fl_Button* o = vcgt_set_button = new Fl_Button(10, 370, 85, 25, _("Set"));
        o->tooltip(_("Set the current profile as monitor profile and upload vcgt tag to the video c\
ard"));
        o->callback((Fl_Callback*)cb_vcgt_set_button);
        w->hotspot(o);
      }
      { Fl_Button* o = vcgt_reset_button = new Fl_Button(95, 370, 90, 25, _("Reset"));
        o->tooltip(_("reset to standard gamma"));
        o->callback((Fl_Callback*)cb_vcgt_reset_button);
        w->hotspot(o);
      }
      { Fl_Button* o = vcgt_load_button = new Fl_Button(185, 370, 90, 25, _("Load"));
        o->tooltip(_("Load the current monitor profile"));
        o->callback((Fl_Callback*)cb_vcgt_load_button);
        w->hotspot(o);
      }
      { Fl_Button* o = vcgt_close_button = new Fl_Button(275, 370, 90, 25, _("Close"));
        o->callback((Fl_Callback*)cb_vcgt_close_button);
      }
      o->end();
    }
    o->hide();
    o->use_escape_hide = true;
    o->end();
    o->resizable(o);
  }
  { icc_examin_ns::MyFl_Double_Window* o = DD = new icc_examin_ns::MyFl_Double_Window(385, 520, _("Gamut"));
    w = o;
    o->box(FL_NO_BOX);
    o->color(FL_BACKGROUND_COLOR);
    o->selection_color(FL_BACKGROUND_COLOR);
    o->labeltype(FL_NO_LABEL);
    o->labelfont(0);
    o->labelsize(14);
    o->labelcolor(FL_FOREGROUND_COLOR);
    o->user_data((void*)(this));
    o->align(FL_ALIGN_TOP);
    o->when(FL_WHEN_RELEASE);
    { Fl_Group* o = new Fl_Group(0, 0, 385, 520);
      { Fl_Menu_Bar* o = DD_menueleiste = new Fl_Menu_Bar(0, 0, 385, 25);
        o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
        o->when(3);
        { Fl_Menu_Item* o = &menu_DD_menueleiste[7];
          if(icc_examin->gamutwarn()) o->set();
        }
        o->menu(menu_DD_menueleiste);
      }
      { Fl_Tile* o = new Fl_Tile(0, 25, 385, 495);
        { GL_Ansicht* o = DD_farbraum = new GL_Ansicht(0, 25, 385, 470);
          o->box(FL_THIN_DOWN_BOX);
          o->color(FL_BACKGROUND_COLOR);
          o->selection_color(FL_BACKGROUND_COLOR);
          o->labeltype(FL_NORMAL_LABEL);
          o->labelfont(0);
          o->labelsize(14);
          o->labelcolor(FL_FOREGROUND_COLOR);
          o->align(FL_ALIGN_CENTER);
          o->when(FL_WHEN_RELEASE);
          Fl_Group::current()->resizable(o);
          o->hide();
          o->typ( 1 ); // wandert ins 1. Nebenfenster
        }
        { Fl_Box* o = DD_box_stat = new Fl_Box(0, 495, 385, 25);
          o->box(FL_FLAT_BOX);
          o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
        }
        o->end();
        Fl_Group::current()->resizable(o);
      }
      o->end();
    }
    { My_Fl_Box* o = no_box2 = new My_Fl_Box(0, 0, 385, 520);
      o->box(FL_NO_BOX);
      o->color(FL_BACKGROUND_COLOR);
      o->selection_color(FL_BACKGROUND_COLOR);
      o->labeltype(FL_NORMAL_LABEL);
      o->labelfont(0);
      o->labelsize(14);
      o->labelcolor(FL_FOREGROUND_COLOR);
      o->align(FL_ALIGN_CENTER);
      o->when(FL_WHEN_RELEASE);
      o->box(FL_NO_BOX);
    }
    o->end();
    o->resizable(o);
  }
  { icc_examin_ns::MyFl_Double_Window* o = details = new icc_examin_ns::MyFl_Double_Window(385, 520, _("ICC Examin"));
    w = o;
    o->box(FL_NO_BOX);
    o->color(FL_BACKGROUND_COLOR);
    o->selection_color(FL_BACKGROUND_COLOR);
    o->labeltype(FL_NO_LABEL);
    o->labelfont(0);
    o->labelsize(14);
    o->labelcolor(FL_FOREGROUND_COLOR);
    o->user_data((void*)(this));
    o->align(FL_ALIGN_TOP);
    o->when(FL_WHEN_RELEASE);
    { Fl_Group* o = new Fl_Group(0, 0, 385, 520, _("all_invisible"));
      { Fl_Menu_Bar* o = menueleiste = new Fl_Menu_Bar(0, 0, 385, 25, _("menuleiste_invisible"));
        o->align(FL_ALIGN_LEFT);
        o->when(3);
        { Fl_Menu_Item* o = &menu_menueleiste[19];
          o->hide();
        }
        o->menu(menu_menueleiste);
      }
      { Fl_Group* o = new Fl_Group(0, 25, 385, 470, _("tags_group_invisible"));
        o->align(FL_ALIGN_LEFT);
        { Fl_Group* o = new Fl_Group(0, 25, 385, 470, _("inspect_html_group_invisible"));
          o->align(FL_ALIGN_LEFT);
          { Fl_Help_View* o = inspekt_html = new Fl_Help_View(0, 25, 385, 470, _("Inspect_html_invisible"));
            o->box(FL_FLAT_BOX);
            o->color(FL_BACKGROUND_COLOR);
            o->align(FL_ALIGN_LEFT);
            Fl_Group::current()->resizable(o);
            o->hide();
          }
          o->end();
        }
        { Fl_Tile* o = examin = new Fl_Tile(0, 25, 385, 470, _("examin_invisible"));
          o->align(FL_ALIGN_LEFT);
          { TagBrowser* o = tag_browser = new TagBrowser(0, 25, 385, 135, _("tag_browser_invisible"));
            o->tooltip(_("Choose one profile tag"));
            o->box(FL_THIN_DOWN_BOX);
            o->color(FL_BACKGROUND_COLOR);
            o->selection_color(FL_SELECTION_COLOR);
            o->labeltype(FL_NORMAL_LABEL);
            o->labelfont(0);
            o->labelsize(14);
            o->labelcolor(FL_FOREGROUND_COLOR);
            o->callback((Fl_Callback*)cb_tag_browser);
            o->align(FL_ALIGN_LEFT);
            o->when(FL_WHEN_RELEASE_ALWAYS);
          }
          { Fl_Group* o = ansichtsgruppe = new Fl_Group(0, 160, 385, 335, _("ansichtsgruppe_invisible"));
            o->align(FL_ALIGN_LEFT);
            { Fl_Group* o = tabellengruppe = new Fl_Group(0, 160, 385, 335, _("tabellengruppe_invisible"));
              o->align(FL_ALIGN_LEFT);
              { Fl_Pack* o = new Fl_Pack(0, 160, 385, 335, _("tabellenpack_invisible"));
                o->align(FL_ALIGN_LEFT);
                { MftChoice* o = mft_choice = new MftChoice(0, 160, 385, 25, _("Chain selection"));
                o->tooltip(_("Choose a attribute"));
                o->box(FL_NO_BOX);
                o->down_box(FL_BORDER_BOX);
                o->color(FL_BACKGROUND2_COLOR);
                o->selection_color(FL_SELECTION_COLOR);
                o->labeltype(FL_NORMAL_LABEL);
                o->labelfont(0);
                o->labelsize(14);
                o->labelcolor(FL_FOREGROUND_COLOR);
                o->callback((Fl_Callback*)cb_mft_choice);
                o->align(FL_ALIGN_LEFT);
                o->when(FL_WHEN_RELEASE);
                o->show();
                }
                { Fl_Group* o = new Fl_Group(0, 185, 385, 310, _("tabellengruppe2_invisible"));
                o->align(FL_ALIGN_LEFT);
                { TagDrawings* o = mft_viewer = new TagDrawings(0, 185, 385, 310, _("mft_viewer_invisible"));
                o->box(FL_NO_BOX);
                o->color(FL_BACKGROUND_COLOR);
                o->selection_color(FL_BACKGROUND_COLOR);
                o->labeltype(FL_NORMAL_LABEL);
                o->labelfont(0);
                o->labelsize(14);
                o->labelcolor(FL_FOREGROUND_COLOR);
                o->align(FL_ALIGN_LEFT);
                o->when(FL_WHEN_RELEASE);
                o->show();
                }
                { TagTexts* o = mft_text = new TagTexts(0, 185, 385, 310, _("mft_text_invisible"));
                o->box(FL_FLAT_BOX);
                o->color(FL_BACKGROUND_COLOR);
                o->selection_color(FL_SELECTION_COLOR);
                o->labeltype(FL_NORMAL_LABEL);
                o->labelfont(0);
                o->labelsize(14);
                o->labelcolor(FL_FOREGROUND_COLOR);
                o->callback((Fl_Callback*)cb_mft_text);
                o->align(FL_ALIGN_LEFT);
                o->when(FL_WHEN_RELEASE_ALWAYS);
                o->show();
                }
                { Fl_Group* o = mft_gl_group = new Fl_Group(0, 185, 385, 310, _("mft_gl_group_invisible"));
                o->align(FL_ALIGN_LEFT);
                { Fl_Box* o = new Fl_Box(0, 185, 385, 310, _("mft_gl_box_invisible"));
                o->box(FL_FLAT_BOX);
                o->align(FL_ALIGN_LEFT);
                }
                { GL_Ansicht* o = mft_gl = new GL_Ansicht(0, 185, 360, 310, _("mft_gl_invisible"));
                o->box(FL_NO_BOX);
                o->color(FL_BACKGROUND_COLOR);
                o->selection_color(FL_BACKGROUND_COLOR);
                o->labeltype(FL_NORMAL_LABEL);
                o->labelfont(0);
                o->labelsize(14);
                o->labelcolor(FL_FOREGROUND_COLOR);
                o->align(FL_ALIGN_LEFT);
                o->when(FL_WHEN_RELEASE);
                Fl_Group::current()->resizable(o);
                o->hide();
                o->typ( 2 ); // bleibt zumeist im Hauptfenster
                }
                { Fl_Pack* o = mft_gl_button_pack = new Fl_Pack(360, 185, 25, 310);
                { Fl_Button* o = mft_gl_alltables_button = new Fl_Button(360, 185, 25, 25, _("o"));
                o->tooltip(_("Show all channels of this table a own window."));
                o->callback((Fl_Callback*)cb_mft_gl_alltables_button);
                o->show();
                }
                o->end();
                }
                o->end();
                Fl_Group::current()->resizable(o);
                }
                o->end();
                Fl_Group::current()->resizable(o);
                }
                o->end();
                Fl_Group::current()->resizable(o);
              }
              o->show();
              o->end();
            }
            { Fl_Pack* o = twoD_pack = new Fl_Pack(0, 160, 385, 335, _("tag_pack_invisible"));
              o->align(FL_ALIGN_LEFT);
              { Fl_Box* o = new Fl_Box(0, 160, 385, 5, _("tag_box_invisible"));
                o->box(FL_UP_BOX);
                o->align(FL_ALIGN_LEFT);
              }
              { Fl_Group* o = new Fl_Group(0, 165, 385, 330, _("tag_group_invisible"));
                o->align(FL_ALIGN_LEFT);
                { TagTexts* o = tag_text = new TagTexts(0, 165, 385, 330, _(" tag_text_invisible"));
                o->box(FL_FLAT_BOX);
                o->color(FL_BACKGROUND_COLOR);
                o->selection_color(FL_SELECTION_COLOR);
                o->labeltype(FL_NORMAL_LABEL);
                o->labelfont(0);
                o->labelsize(14);
                o->labelcolor(FL_FOREGROUND_COLOR);
                o->callback((Fl_Callback*)cb_tag_text);
                o->align(FL_ALIGN_LEFT);
                o->when(FL_WHEN_RELEASE_ALWAYS);
                o->show();
                }
                { TagDrawings* o = tag_viewer = new TagDrawings(0, 165, 385, 330, _("tag_viewer_invisible"));
                o->box(FL_NO_BOX);
                o->color(FL_BACKGROUND_COLOR);
                o->selection_color(FL_BACKGROUND_COLOR);
                o->labeltype(FL_NORMAL_LABEL);
                o->labelfont(0);
                o->labelsize(14);
                o->labelcolor(FL_FOREGROUND_COLOR);
                o->align(FL_ALIGN_LEFT);
                o->when(FL_WHEN_RELEASE);
                o->hide();
                }
                o->end();
                Fl_Group::current()->resizable(o);
              }
              o->end();
            }
            o->end();
          }
          o->end();
          Fl_Group::current()->resizable(o);
        }
        o->end();
        Fl_Group::current()->resizable(o);
      }
      { Fl_Group* o = new Fl_Group(0, 495, 385, 25, _("status_group_invisible"));
        o->align(FL_ALIGN_LEFT);
        { Fl_Box* o = box_stat = new Fl_Box(0, 495, 385, 25, _("..."));
          o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
        }
        { Fl_Progress* o = load_progress = new Fl_Progress(0, 495, 385, 25, _("Loading .."));
          o->box(FL_THIN_UP_BOX);
          o->color(FL_BACKGROUND_COLOR);
          o->hide();
          o->minimum(0.0);
          o->maximum(1.0);
        }
        o->end();
      }
      o->end();
    }
    { My_Fl_Box* o = no_box = new My_Fl_Box(0, 0, 385, 520, _("no_box_invisible"));
      o->box(FL_NO_BOX);
      o->color(FL_BACKGROUND_COLOR);
      o->selection_color(FL_BACKGROUND_COLOR);
      o->labeltype(FL_NORMAL_LABEL);
      o->labelfont(0);
      o->labelsize(14);
      o->labelcolor(FL_FOREGROUND_COLOR);
      o->align(FL_ALIGN_LEFT);
      o->when(FL_WHEN_RELEASE);
      o->box(FL_NO_BOX);
    }
    o->main_win = o;
    o->end();
  }
  tag_text->inspekt_topline = 0;

  details->resizable(tag_text);
  //Fl::background(190,190,190);
  //Fl::background(255,255,255);
  //Fl::scheme(NULL);
  Fl_File_Icon::load_system_icons();
  Fl::get_system_colors();
  details->show((int)argc, (char**)argv);
  { // plastic sets a background image, for others unset a transparent box
    const char* style = Fl::scheme();
    if(!style || (style && strstr(style,"plastic") == 0))
      box_stat->box(FL_FLAT_BOX);
  }
  DBG_PROG
  DBG_PROG_ENDE
  return w;
}

int ICCfltkBetrachter::run(int argc, char** argv) {
  DBG_PROG_START
  int ret = Fl::run();

  DBG_PROG_ENDE;
  return ret;
}

std::vector<std::string> ICCfltkBetrachter::open_veraltet(std::vector<std::string> dateinamen) {
  DBG_PROG_START
  #include "icc_vrml.h"

  //Fl_File_Icon	*icon;	// New file icon
  DBG_PROG

    const char* ptr = NULL;
    if (dateinamen.size()) {
      ptr = dateinamen[0].c_str();
      dateiwahl->value(ptr);
      DBG_PROG_S( dateinamen[0])
    } 
      if(ptr) DBG_PROG_V( ptr );
    if (!ptr)
      ptr = getenv("PWD");

      if(ptr) DBG_PROG_V( ptr )
    if(( ptr &&
        (ptr[0] == '/') &&
        (strlen(ptr) == 1) ) ||
        !ptr )
    {
      ptr = getenv("HOME");
    }

    dateiwahl->show();

    if(ptr)
      dateiwahl->value(ptr);


    while (dateiwahl->visible())
      Fl::wait();

    DBG_NUM_V( dateiwahl->count() )
    if (dateiwahl->count() && dateiwahl->value()) {
      DBG_NUM_V( dateiwahl->value() )
      dateinamen.resize(dateiwahl->count());
      for (int i = 1; i <= dateiwahl->count(); i++)
        dateinamen[i-1] = dateiwahl->value(i);
    }
  DBG_PROG


  if (dateinamen.size() == 0) {
    DBG_PROG_ENDE
    return dateinamen;
  }

  DBG_PROG_ENDE
  return dateinamen;
}

void ICCfltkBetrachter::quit(void) {
  DBG_PROG_START
  /*Fl::remove_timeout((void (*)(void *))timeIT, (void *)viewer);
  delete viewer;
  delete browser;
  delete canvas;
  details->hide();*/
  icc_examin->quit();
  DBG_PROG_ENDE
}

void ICCfltkBetrachter::zeig_mich_(void* widget) {
  DBG_PROG_START
  // zeigt das ausgewaehlte Fenster (widget)

  mft_viewer->hide();
  mft_text->hide();
  tag_viewer->hide(); DBG_PROG
  tag_viewer->clear_visible(); DBG_PROG
  tag_text->hide();
  inspekt_html->hide();

  // stop
  if (widget != mft_gl) {
    mft_gl->hide();
  }
  if (widget != DD_farbraum ) {
    DD_farbraum->hide();
  }

  // start
  if( widget == inspekt_html )
  { DBG_PROG_S("inspekt_html handling")
    if( menueintrag_inspekt->value() )
      inspekt_html->show();
    else
      inspekt_html->hide();
  }

  if (widget != mft_gl &&
      widget != DD_farbraum )
  { 
    ((Fl_Widget*)widget)->show(); DBG_PROG
    if( !menueintrag_inspekt->value() &&
        !menueintrag_3D->value() )
      ;//selectItem(icc_examin->tag_nr()+6);
  } else if (widget == mft_gl) {
    DBG_PROG_S( "leave mft GL window." )
    mft_gl->show();
  } else if (widget == DD_farbraum) {
    DBG_PROG_S( "leave 3D GL window." )
    DD_farbraum->show();
  }
  DBG_PROG_ENDE
}

void ICCfltkBetrachter::measurement(bool has_measurement) {
  if (has_measurement) {
    DBG_PROG_S(menueintrag_inspekt->value())
    if (menueintrag_inspekt->value()) {
      inspekt_html->value(profile.profil()->report(false).c_str());
      if (inspekt_html->size() -75 < tag_text->inspekt_topline)
        inspekt_html->topline (inspekt_html->size() - 75);
      else
        inspekt_html->topline (tag_text->inspekt_topline);
    }
    menueintrag_inspekt->activate();
    menueintrag_html_speichern->activate();
    menueintrag_zeigcgats->activate();
  } else {
    menueintrag_inspekt->deactivate();
    menueintrag_html_speichern->deactivate();
    menueintrag_zeigcgats->deactivate();
  }
}

void ICCfltkBetrachter::mft_gl_boxAdd( const char ** names_short, const char** names, int n, int actual ) {
  DBG_PROG_START
  int i;
    int h = mft_gl_alltables_button->h(),
        w = mft_gl_alltables_button->w();
    Fl_Button * o;

    mft_gl_group->begin();
    if(mft_gl_tables_buttons)
      for(i = 1; i <= (intptr_t)mft_gl_tables_buttons[0] + 1; ++i)
      {
        mft_gl_tables_buttons[i]->hide();
        mft_gl_button_pack->remove( mft_gl_tables_buttons[i] );
        if(mft_gl_tables_buttons[i])
          delete mft_gl_tables_buttons[i];
      }

    mft_gl_button_pack->begin();
    mft_gl_button_pack->size( mft_gl_button_pack->w(), mft_gl_group->h() );

    mft_gl_tables_buttons = new Fl_Button* [n+2];
    mft_gl_tables_buttons[0] = (Fl_Button*)(intptr_t) n;

    for(i = 1; i <= (intptr_t)mft_gl_tables_buttons[0]; ++i)
    {
      int kanal = i - 1;

      mft_gl_tables_buttons[i] = o = 
        new Fl_Button( mft_gl_alltables_button->x(),
                       mft_gl_alltables_button->y() + i*h,
                       w,h );
      o->copy_label( names_short[ kanal ] );
      o->callback( (Fl_Callback*)mft_gl_menueCb_ );
      o->user_data( (void*)(intptr_t)(GL_Ansicht::MENU_MAX + kanal) );
      o->tooltip( icc_strdup_m( names[ kanal ] ) );
      o->when(FL_WHEN_RELEASE);
      if(i-1 == actual)
        o->take_focus();
    }
    int oh = mft_gl_button_pack->y() + mft_gl_group->h() - (mft_gl_tables_buttons[i-1]->y() + h);

    mft_gl_tables_buttons[i] = o = new Fl_Button( mft_gl_alltables_button->x(),
                       mft_gl_alltables_button->y() + i*h,
                       w,oh );
    o->box(FL_NO_BOX);
    mft_gl_button_pack->end();
    mft_gl_button_pack->resizable(o);
  mft_gl_group->end();
  
  DBG_PROG_ENDE
}

void dHaendler(void* o) {
  DBG_PROG_START
  Fl::remove_timeout( (void(*)(void*))dHaendler, 0 );

  if (!Fl::has_timeout( (void(*)(void*))dHaendler, 0 )
   && ((TagDrawings*)o)->active()
   && ((TagDrawings*)o)->visible_r()
   && ((TagDrawings*)o)->wiederholen)
  {
    ((TagDrawings*)o)->ruhigNeuzeichnen();

    #ifdef DEBUG
    DBG_PROG_V( ((TagDrawings*)o)->wiederholen )
    #endif
  }
  DBG_PROG_ENDE
}

void initHilfe() {
  /* aktualisieren */
  icc_examin->icc_betrachter->ueber_html->value(getUeberHtml().c_str());
  icc_examin->icc_betrachter->hilfe_html->value(getHilfeHtml().c_str());
  icc_examin->icc_betrachter->lizenz_html->value(getLizenzHtml().c_str());
  icc_examin->icc_betrachter->dank_html->value(getDankHtml().c_str());
  icc_examin->icc_betrachter->links_text->value(getLinksText().c_str());
}
