681 if(_title.size()>0) os << "%%Title: " << _title << '\n'; |
675 if(_title.size()>0) os << "%%Title: " << _title << '\n'; |
682 if(_copyright.size()>0) os << "%%Copyright: " << _copyright << '\n'; |
676 if(_copyright.size()>0) os << "%%Copyright: " << _copyright << '\n'; |
683 os << "%%Creator: LEMON, graphToEps()\n"; |
677 os << "%%Creator: LEMON, graphToEps()\n"; |
684 |
678 |
685 { |
679 { |
|
680 os << "%%CreationDate: "; |
686 #ifndef WIN32 |
681 #ifndef WIN32 |
687 timeval tv; |
682 timeval tv; |
688 gettimeofday(&tv, 0); |
683 gettimeofday(&tv, 0); |
689 |
684 |
690 char cbuf[26]; |
685 char cbuf[26]; |
691 ctime_r(&tv.tv_sec,cbuf); |
686 ctime_r(&tv.tv_sec,cbuf); |
692 os << "%%CreationDate: " << cbuf; |
687 os << cbuf; |
693 #else |
688 #else |
694 SYSTEMTIME time; |
689 os << bits::getWinFormattedDate(); |
695 GetSystemTime(&time); |
|
696 #if defined(_MSC_VER) && (_MSC_VER < 1500) |
|
697 LPWSTR buf1, buf2, buf3; |
|
698 if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
699 L"ddd MMM dd", buf1, 11) && |
|
700 GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
701 L"HH':'mm':'ss", buf2, 9) && |
|
702 GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
703 L"yyyy", buf3, 5)) { |
|
704 os << "%%CreationDate: " << buf1 << ' ' |
|
705 << buf2 << ' ' << buf3 << std::endl; |
|
706 } |
|
707 #else |
|
708 char buf1[11], buf2[9], buf3[5]; |
|
709 if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
710 "ddd MMM dd", buf1, 11) && |
|
711 GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
712 "HH':'mm':'ss", buf2, 9) && |
|
713 GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
714 "yyyy", buf3, 5)) { |
|
715 os << "%%CreationDate: " << buf1 << ' ' |
|
716 << buf2 << ' ' << buf3 << std::endl; |
|
717 } |
|
718 #endif |
690 #endif |
719 #endif |
691 } |
720 } |
692 os << std::endl; |
721 |
693 |
722 if (_autoArcWidthScale) { |
694 if (_autoArcWidthScale) { |
723 double max_w=0; |
695 double max_w=0; |
724 for(ArcIt e(g);e!=INVALID;++e) |
696 for(ArcIt e(g);e!=INVALID;++e) |
725 max_w=std::max(double(_arcWidths[e]),max_w); |
697 max_w=std::max(double(_arcWidths[e]),max_w); |