/*
 Text
 Copyright (C) 2010 Martin Štrympl

 This library 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 3.0 of the License, or (at your option) any later version.

 This library 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 library.

 Martin Štrympl
 xstrym00@stud.feec.vutbr.cz
 */

/*
 *  module.c
 *  Text
 *
 *  Created by Martin Štrympl on 11/3/10.
 *  Copyright 2010 School. All rights reserved.
 *
 */

#include "main.h"

Mac_Fun_Gerber_Module_Start(Start)
{
  printf("Module Text: Version 1.1\n");
  printf("Module Text: Programed by Martin Stympl. Mail: xstrym00@stud.feec.vutbr.cz\n");
  printf("Module Text: Compiled time: %s %s\n", __DATE__, __TIME__);

  *pv_memory=NULL;
  return 0;
}
Mac_Fun_Gerber_Module_End(End)
{
}

Mac_Fun_Gerber_Draw_LineSegment(LineSegment)
{
  if (b_positive) printf("LINE: POSITIVE: FROM: %3.4f,%3.4f TO: %3.4f,%3.4f\n", (double)ps_From->ld_x, (double)ps_From->ld_y, (double)ps_To->ld_x, (double)ps_To->ld_y);
  else printf("LINE: NEGATIVE: FROM: %3.4f,%3.4f TO: %3.4f,%3.4f\n", (double)ps_From->ld_x, (double)ps_From->ld_y, (double)ps_To->ld_x, (double)ps_To->ld_y);

  return 0;
}
Mac_Fun_Gerber_Draw_OvalSegment(OvalSegment)
{
  if (b_positive) printf("OVAL: POSITIVE: CENTER: %3.4f,%3.4f RADIUSX: %3.4f RADIUSY: %3.4f ANGLE: %3.4f to %3.4f \n",
         (double)ps_centre->ld_x, (double)ps_centre->ld_y, (double)ld_radiusX, (double)ld_radiusY, (double)ld_aglefrom, (double)ld_agleto);
  else printf("OVAL: NEGATIVE: CENTER: %3.4f,%3.4f RADIUSX: %3.4f RADIUSY: %3.4f ANGLE: %3.4f to %3.4f \n",
              (double)ps_centre->ld_x, (double)ps_centre->ld_y, (double)ld_radiusX, (double)ld_radiusY, (double)ld_aglefrom, (double)ld_agleto);

  return 0;
}

#ifdef __WIN32__
#include <windows.h>
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
  switch (fdwReason)
  {
    case DLL_PROCESS_ATTACH:
      // attach to process
      // return FALSE to fail DLL load
      // inicializace manualni
      break;

    case DLL_PROCESS_DETACH:
      // detach from process
      // sem dat ukoncovaci funkci
      break;

    case DLL_THREAD_ATTACH:
      // attach to thread
      // vytvoreni vlakna
      break;

    case DLL_THREAD_DETACH:
      // detach from thread
      // konec vlakna
      break;
  }
  return TRUE; // succesful
}
#endif // __WIN32__

