wineview: Rename view to wineview and install it
André Hentschel
nerv at dawncrow.de
Mon Aug 29 14:07:13 CDT 2011
i think wineview is a better name for installation
this also merges the resources
---
configure.ac | 2 +-
programs/view/Cs.rc | 32 ----
programs/view/Cy.rc | 29 ---
programs/view/Da.rc | 29 ---
programs/view/De.rc | 31 ---
programs/view/En.rc | 30 ---
programs/view/Eo.rc | 29 ---
programs/view/Es.rc | 29 ---
programs/view/Fr.rc | 35 ----
programs/view/He.rc | 33 ----
programs/view/It.rc | 34 ----
programs/view/Ja.rc | 33 ----
programs/view/Ko.rc | 33 ----
programs/view/Lt.rc | 32 ----
programs/view/Makefile.in | 37 ----
programs/view/Nl.rc | 28 ---
programs/view/No.rc | 29 ---
programs/view/Pl.rc | 30 ---
programs/view/Pt.rc | 33 ----
programs/view/Ro.rc | 30 ---
programs/view/Ru.rc | 31 ---
programs/view/Si.rc | 31 ---
programs/view/Sv.rc | 29 ---
programs/view/Tr.rc | 29 ---
programs/view/Uk.rc | 34 ----
programs/view/Zh.rc | 39 ----
programs/view/resource.h | 29 ---
programs/view/view.c | 405 -----------------------------------------
programs/view/view.rc | 47 -----
programs/wineview/Makefile.in | 13 ++
programs/wineview/resource.h | 29 +++
programs/wineview/view.c | 405 +++++++++++++++++++++++++++++++++++++++++
programs/wineview/view.rc | 52 ++++++
33 files changed, 500 insertions(+), 1271 deletions(-)
delete mode 100644 programs/view/Cs.rc
delete mode 100644 programs/view/Cy.rc
delete mode 100644 programs/view/Da.rc
delete mode 100644 programs/view/De.rc
delete mode 100644 programs/view/En.rc
delete mode 100644 programs/view/Eo.rc
delete mode 100644 programs/view/Es.rc
delete mode 100644 programs/view/Fr.rc
delete mode 100644 programs/view/He.rc
delete mode 100644 programs/view/It.rc
delete mode 100644 programs/view/Ja.rc
delete mode 100644 programs/view/Ko.rc
delete mode 100644 programs/view/Lt.rc
delete mode 100644 programs/view/Makefile.in
delete mode 100644 programs/view/Nl.rc
delete mode 100644 programs/view/No.rc
delete mode 100644 programs/view/Pl.rc
delete mode 100644 programs/view/Pt.rc
delete mode 100644 programs/view/Ro.rc
delete mode 100644 programs/view/Ru.rc
delete mode 100644 programs/view/Si.rc
delete mode 100644 programs/view/Sv.rc
delete mode 100644 programs/view/Tr.rc
delete mode 100644 programs/view/Uk.rc
delete mode 100644 programs/view/Zh.rc
delete mode 100644 programs/view/resource.h
delete mode 100644 programs/view/view.c
delete mode 100644 programs/view/view.rc
create mode 100644 programs/wineview/Makefile.in
create mode 100644 programs/wineview/resource.h
create mode 100644 programs/wineview/view.c
create mode 100644 programs/wineview/view.rc
diff --git a/configure.ac b/configure.ac
index ae89108..40f30e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2948,7 +2948,6 @@ WINE_CONFIG_PROGRAM(taskmgr,,[install,po])
WINE_CONFIG_PROGRAM(termsv,,[install])
WINE_CONFIG_PROGRAM(uninstaller,,[install,po])
WINE_CONFIG_PROGRAM(unlodctr,,[install])
-WINE_CONFIG_PROGRAM(view,,[po])
WINE_CONFIG_PROGRAM(wineboot,,[install,installbin,manpage])
WINE_CONFIG_PROGRAM(winebrowser,,[install])
WINE_CONFIG_PROGRAM(winecfg,,[install,installbin,manpage,po])
@@ -2962,6 +2961,7 @@ WINE_CONFIG_PROGRAM(winemsibuilder,,[install])
WINE_CONFIG_PROGRAM(winepath,,[install,installbin,manpage])
WINE_CONFIG_PROGRAM(winetest)
WINE_CONFIG_PROGRAM(winevdm,enable_win16,[install])
+WINE_CONFIG_PROGRAM(wineview,,[install,po])
WINE_CONFIG_PROGRAM(winhelp.exe16,enable_win16,[install])
WINE_CONFIG_PROGRAM(winhlp32,,[install,po])
WINE_CONFIG_PROGRAM(winoldap.mod16,enable_win16,[install])
diff --git a/programs/view/Cs.rc b/programs/view/Cs.rc
deleted file mode 100644
index 2885389..0000000
--- a/programs/view/Cs.rc
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Hey, Emacs, open this file with -*- coding: cp1250 -*-
- *
- * View
- * Czech Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- * Copyright 2004 David Kredba
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Cy.rc b/programs/view/Cy.rc
deleted file mode 100644
index e4f1763..0000000
--- a/programs/view/Cy.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Cefnogaeth iaith Cymraeg
- * Welsh language support
- *
- * Copyright 2010 Ken Sharp
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_WELSH, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Da.rc b/programs/view/Da.rc
deleted file mode 100644
index ff3adb7..0000000
--- a/programs/view/Da.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * View
- * Danish Language Support
- *
- * Copyright 2008 Jens Albretsen <jens at albretsen.dk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/De.rc b/programs/view/De.rc
deleted file mode 100644
index 52c587c..0000000
--- a/programs/view/De.rc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * View
- * German Language Support
- *
- * Copyright 2004 Henning Gerhardt
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-#pragma code_page(65001)
-
-LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/En.rc b/programs/view/En.rc
deleted file mode 100644
index 7053de1..0000000
--- a/programs/view/En.rc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * View
- * English Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Eo.rc b/programs/view/Eo.rc
deleted file mode 100644
index 8a5fae9..0000000
--- a/programs/view/Eo.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * View - Resources
- * Esperanto Language Support
- *
- * Copyright 2006 Antonio Codazzi
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Es.rc b/programs/view/Es.rc
deleted file mode 100644
index 673f4e1..0000000
--- a/programs/view/Es.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * View
- * Spanish Language Support
- *
- * Copyright 2003 José Manuel Ferrer Ortiz
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Fr.rc b/programs/view/Fr.rc
deleted file mode 100644
index ac30dc0..0000000
--- a/programs/view/Fr.rc
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * View
- * French Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- * Copyright 2003 Vincent Béron
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-/* UTF-8 */
-#pragma code_page(65001)
-
-LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
-
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/He.rc b/programs/view/He.rc
deleted file mode 100644
index 532210a..0000000
--- a/programs/view/He.rc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * View
- * Hebrew Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- * Copyright 2010 Yaron Shahrabani <sh.yaron at gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-#pragma code_page(65001)
-
-LANGUAGE LANG_HEBREW, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/It.rc b/programs/view/It.rc
deleted file mode 100644
index fd1d508..0000000
--- a/programs/view/It.rc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * View
- * Italian Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- * Copyright 2003 Ivan Leo Puoti
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-/* UTF-8 */
-#pragma code_page(65001)
-
-LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Ja.rc b/programs/view/Ja.rc
deleted file mode 100644
index 41e76c9..0000000
--- a/programs/view/Ja.rc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * View
- * Japanese Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-/* UTF-8 */
-#pragma code_page(65001)
-
-LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Ko.rc b/programs/view/Ko.rc
deleted file mode 100644
index 2ac6041..0000000
--- a/programs/view/Ko.rc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * View
- * Korean Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- * Copyright 2005,2011 YunSong Hwang
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-#pragma code_page(65001)
-
-LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Lt.rc b/programs/view/Lt.rc
deleted file mode 100644
index ed71605..0000000
--- a/programs/view/Lt.rc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * View
- * Lithuanian Language Support
- *
- * Copyright 2009 Aurimas Fišeras <aurimas at gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-/* UTF-8 */
-#pragma code_page(65001)
-
-LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Makefile.in b/programs/view/Makefile.in
deleted file mode 100644
index 1be6ca3..0000000
--- a/programs/view/Makefile.in
+++ /dev/null
@@ -1,37 +0,0 @@
-MODULE = view.exe
-APPMODE = -mwindows
-IMPORTS = comdlg32 user32 gdi32
-
-C_SRCS = \
- view.c
-
-RC_SRCS = \
- Cs.rc \
- Cy.rc \
- Da.rc \
- De.rc \
- En.rc \
- Eo.rc \
- Es.rc \
- Fr.rc \
- He.rc \
- It.rc \
- Ja.rc \
- Ko.rc \
- Lt.rc \
- Nl.rc \
- No.rc \
- Pl.rc \
- Pt.rc \
- Ro.rc \
- Ru.rc \
- Si.rc \
- Sv.rc \
- Tr.rc \
- Uk.rc \
- Zh.rc \
- view.rc
-
-PO_SRCS = view.rc
-
- at MAKE_PROG_RULES@
diff --git a/programs/view/Nl.rc b/programs/view/Nl.rc
deleted file mode 100644
index 6eb2418..0000000
--- a/programs/view/Nl.rc
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * View (Dutch resources)
- *
- * Copyright 2003 Hans Leidekker
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/No.rc b/programs/view/No.rc
deleted file mode 100644
index e6f3332..0000000
--- a/programs/view/No.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * View
- * Norwegian Bokmål Language Support
- *
- * Copyright 2005 Alexander N. Sørnes <alex at thehandofagony.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Pl.rc b/programs/view/Pl.rc
deleted file mode 100644
index 2fa0af7..0000000
--- a/programs/view/Pl.rc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * View
- * Polish Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Pt.rc b/programs/view/Pt.rc
deleted file mode 100644
index f637970..0000000
--- a/programs/view/Pt.rc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * View
- * Portuguese Language Support
- *
- * Copyright 2003 Marcelo Duarte
- * Copyright 2004 Américo José Melo
- * Copyright 2010 Gustavo Henrique Milaré
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-#pragma code_page(65001)
-
-LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Ro.rc b/programs/view/Ro.rc
deleted file mode 100644
index ee47f59..0000000
--- a/programs/view/Ro.rc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- * Copyright 2008 Michael Stefaniuc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
-
-#pragma code_page(65001)
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Ru.rc b/programs/view/Ru.rc
deleted file mode 100644
index a04f2d5..0000000
--- a/programs/view/Ru.rc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * View (Russian resources)
- *
- * Copyright 2003 Igor Stepin
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-/* UTF-8 */
-#pragma code_page(65001)
-
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Si.rc b/programs/view/Si.rc
deleted file mode 100644
index 2255711..0000000
--- a/programs/view/Si.rc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * View
- * Slovenian Language Support
- *
- * Copyright 2003, 2008 Rok Mandeljc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-#pragma code_page(65001)
-
-LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Sv.rc b/programs/view/Sv.rc
deleted file mode 100644
index 4c12b44..0000000
--- a/programs/view/Sv.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * View
- * Swedish Language Support
- *
- * Copyright 2009 Anders Jonsson
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Tr.rc b/programs/view/Tr.rc
deleted file mode 100644
index 9235f30..0000000
--- a/programs/view/Tr.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * View
- * Turkish Language Support
- *
- * Copyright 2006 Fatih Aþýcý
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Uk.rc b/programs/view/Uk.rc
deleted file mode 100644
index bcb85cb..0000000
--- a/programs/view/Uk.rc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * View
- * Ukrainian Language Support
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- * Copyright 2010 Igor Paliychuk
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-/* UTF-8 */
-#pragma code_page(65001)
-
-LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/Zh.rc b/programs/view/Zh.rc
deleted file mode 100644
index 1137916..0000000
--- a/programs/view/Zh.rc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * View (Simplified and Traditional Chinese Resource)
- *
- * Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
- * Copyright 2010 Cheer Xiao <xiaqqaix.at.gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-/* Chinese text is encoded in UTF-8 */
-#pragma code_page(65001)
-
-LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
-
-LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
-
-VIEW ACCELERATORS
-BEGIN
- "Q", IDM_EXIT, VIRTKEY, CONTROL
-END
diff --git a/programs/view/resource.h b/programs/view/resource.h
deleted file mode 100644
index 7932687..0000000
--- a/programs/view/resource.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 1998 Douglas Ridgway
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include <windef.h>
-
-#define IDS_DESCRIPTION 2
-#define IDI_APPICON 101
-#define IDM_EXIT 1000
-#define IDM_OPEN 502
-#define IDM_SET_EXT_TO_WIN 503
-#define IDM_LEFT 601
-#define IDM_RIGHT 602
-#define IDM_UP 603
-#define IDM_DOWN 604
diff --git a/programs/view/view.c b/programs/view/view.c
deleted file mode 100644
index 0ce3ea4..0000000
--- a/programs/view/view.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Copyright 1998 Douglas Ridgway
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include <windows.h>
-#include <windowsx.h>
-#include "resource.h"
-
-#include <stdio.h>
-
-static HINSTANCE hInst;
-static HWND hMainWnd;
-static char szAppName[5] = "View";
-static char szTitle[80];
-
-static HMETAFILE hmf;
-static HENHMETAFILE enhmf;
-static int deltax = 0, deltay = 0;
-static int width = 0, height = 0;
-static BOOL isAldus, isEnhanced;
-
-#include "pshpack1.h"
-typedef struct
-{
- DWORD key;
- WORD hmf;
- SMALL_RECT bbox;
- WORD inch;
- DWORD reserved;
- WORD checksum;
-} APMFILEHEADER;
-#include "poppack.h"
-
-#define APMHEADER_KEY 0x9AC6CDD7l
-
-
-static BOOL FileOpen(HWND hWnd, char *fn, int fnsz)
-{
- OPENFILENAME ofn = { sizeof(OPENFILENAME),
- 0, 0, NULL, NULL, 0, 0, NULL,
- fnsz, NULL, 0, NULL, NULL,
- OFN_SHOWHELP, 0, 0, NULL, 0, NULL };
- ofn.lpstrFilter = "Metafiles\0*.wmf;*.emf\0";
- ofn.hwndOwner = hWnd;
- ofn.lpstrFile = fn;
- if( fnsz < 1 )
- return FALSE;
- *fn = 0;
- return GetOpenFileName(&ofn);
-}
-
-static BOOL FileIsEnhanced( LPCSTR szFileName )
-{
- HFILE hInFile;
- ENHMETAHEADER enh;
-
- if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR )
- return FALSE;
-
- if( _lread( hInFile, &enh, sizeof(ENHMETAHEADER) ) != sizeof(ENHMETAHEADER) )
- {
- _lclose( hInFile );
- return FALSE;
- }
- _lclose( hInFile );
-
- /* Is it enhanced? */
- return (enh.dSignature == ENHMETA_SIGNATURE);
-}
-
-static BOOL FileIsPlaceable( LPCSTR szFileName )
-{
- HFILE hInFile;
- APMFILEHEADER apmh;
-
- if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR )
- return FALSE;
-
- if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) )
- != sizeof(APMFILEHEADER) )
- {
- _lclose( hInFile );
- return FALSE;
- }
- _lclose( hInFile );
-
- /* Is it placeable? */
- return (apmh.key == APMHEADER_KEY);
-}
-
-static HMETAFILE GetPlaceableMetaFile( LPCSTR szFileName )
-{
- LPBYTE lpData;
- METAHEADER mfHeader;
- APMFILEHEADER APMHeader;
- HFILE fh;
- HMETAFILE hmf;
- WORD checksum, *p;
- HDC hdc;
- int i;
-
- if( (fh = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR ) return 0;
- _llseek(fh, 0, 0);
- if (!_lread(fh, &APMHeader, sizeof(APMFILEHEADER))) return 0;
- _llseek(fh, sizeof(APMFILEHEADER), 0);
- checksum = 0;
- p = (WORD *) &APMHeader;
-
- for(i=0; i<10; i++)
- checksum ^= *p++;
- if (checksum != APMHeader.checksum) {
- char msg[128];
- sprintf(msg, "Computed checksum %04x != stored checksum %04x\n",
- checksum, APMHeader.checksum);
- MessageBox(hMainWnd, msg, "Checksum failed", MB_OK);
- return 0;
- }
-
- if (!_lread(fh, &mfHeader, sizeof(METAHEADER))) return 0;
-
- if (!(lpData = GlobalAlloc(GPTR, (mfHeader.mtSize * 2L)))) return 0;
-
- _llseek(fh, sizeof(APMFILEHEADER), 0);
- if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L)))
- {
- GlobalFree(lpData);
- _lclose(fh);
- return 0;
- }
- _lclose(fh);
-
- if (!(hmf = SetMetaFileBitsEx(mfHeader.mtSize*2, lpData)))
- return 0;
-
-
- width = APMHeader.bbox.Right - APMHeader.bbox.Left;
- height = APMHeader.bbox.Bottom - APMHeader.bbox.Top;
-
- /* printf("Ok! width %d height %d inch %d\n", width, height, APMHeader.inch); */
- hdc = GetDC(hMainWnd);
- width = width * GetDeviceCaps(hdc, LOGPIXELSX)/APMHeader.inch;
- height = height * GetDeviceCaps(hdc,LOGPIXELSY)/APMHeader.inch;
- ReleaseDC(hMainWnd, hdc);
-
- deltax = 0;
- deltay = 0 ;
- return hmf;
-}
-
-static void DoOpenFile(LPCSTR filename)
-{
- if (!filename) return;
-
- isAldus = FileIsPlaceable(filename);
- if (isAldus) {
- hmf = GetPlaceableMetaFile(filename);
- } else {
- RECT r;
- isEnhanced = FileIsEnhanced(filename);
- if (isEnhanced)
- enhmf = GetEnhMetaFile(filename);
- else
- hmf = GetMetaFile(filename);
- GetClientRect(hMainWnd, &r);
- width = r.right - r.left;
- height = r.bottom - r.top;
- }
- InvalidateRect( hMainWnd, NULL, TRUE );
-}
-
-static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
-{
- switch (uMessage)
- {
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- BeginPaint(hwnd, &ps);
- SetMapMode(ps.hdc, MM_ANISOTROPIC);
- /* Set the window extent to a sane value in case the metafile doesn't */
- SetWindowExtEx(ps.hdc, width, height, NULL);
- SetViewportExtEx(ps.hdc, width, height, NULL);
- SetViewportOrgEx(ps.hdc, deltax, deltay, NULL);
- if (isEnhanced && enhmf)
- {
- RECT r;
- GetClientRect(hwnd, &r);
- PlayEnhMetaFile(ps.hdc, enhmf, &r);
- }
- else if (hmf)
- PlayMetaFile(ps.hdc, hmf);
- EndPaint(hwnd, &ps);
- }
- break;
-
- case WM_COMMAND: /* message: command from application menu */
- switch (GET_WM_COMMAND_ID(wparam,lparam))
- {
- case IDM_OPEN:
- {
- char filename[MAX_PATH];
- if (FileOpen(hwnd, filename, sizeof(filename)))
- DoOpenFile(filename);
- }
- break;
-
- case IDM_SET_EXT_TO_WIN:
- {
- RECT r;
- GetClientRect(hwnd, &r);
- width = r.right - r.left;
- height = r.bottom - r.top;
- deltax = deltay = 0;
- InvalidateRect( hwnd, NULL, TRUE );
- }
- break;
-
-
- case IDM_LEFT:
- deltax += 100;
- InvalidateRect( hwnd, NULL, TRUE );
- break;
- case IDM_RIGHT:
- deltax -= 100;
- InvalidateRect( hwnd, NULL, TRUE );
- break;
- case IDM_UP:
- deltay += 100;
- InvalidateRect( hwnd, NULL, TRUE );
- break;
- case IDM_DOWN:
- deltay -= 100;
- InvalidateRect( hwnd, NULL, TRUE );
- break;
-
- case IDM_EXIT:
- DestroyWindow(hwnd);
- break;
-
- default:
- return DefWindowProc(hwnd, uMessage, wparam, lparam);
- }
- break;
-
- case WM_DESTROY: /* message: window being destroyed */
- PostQuitMessage(0);
- break;
-
- default: /* Passes it on if unprocessed */
- return DefWindowProc(hwnd, uMessage, wparam, lparam);
- }
- return 0;
-}
-
-static BOOL InitApplication(HINSTANCE hInstance)
-{
- WNDCLASSEX wc;
-
- /* Load the application description strings */
- LoadString(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle));
-
- /* Fill in window class structure with parameters that describe the
- main window */
-
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s) */
- wc.lpfnWndProc = WndProc; /* Window Procedure */
- wc.cbClsExtra = 0; /* No per-class extra data */
- wc.cbWndExtra = 0; /* No per-window extra data */
- wc.hInstance = hInstance; /* Owner of this class */
- wc.hIcon = NULL;
- wc.hIconSm = NULL;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW); /* Cursor */
- wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); /* Default color */
- wc.lpszMenuName = szAppName; /* Menu name from .rc */
- wc.lpszClassName = szAppName; /* Name to register as */
-
- /* Register the window class and return FALSE if unsuccessful */
-
- if (!RegisterClassEx(&wc))
- {
- if (!RegisterClass((LPWNDCLASS)&wc.style))
- return FALSE;
- }
-
- /* Call module specific initialization functions here */
-
- return TRUE;
-}
-
-static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
-{
- /* Save the instance handle in a global variable for later use */
- hInst = hInstance;
-
- /* Create main window */
- hMainWnd = CreateWindow(szAppName, /* See RegisterClass() call */
- szTitle, /* window title */
- WS_OVERLAPPEDWINDOW, /* Window style */
- CW_USEDEFAULT, 0, /* positioning */
- CW_USEDEFAULT, 0, /* size */
- NULL, /* Overlapped has no parent */
- NULL, /* Use the window class menu */
- hInstance,
- NULL);
-
- if (!hMainWnd)
- return FALSE;
-
- /* Call module specific instance initialization functions here */
-
- /* show the window, and paint it for the first time */
- ShowWindow(hMainWnd, nCmdShow);
- UpdateWindow(hMainWnd);
-
- return TRUE;
-}
-
-static void HandleCommandLine(LPSTR cmdline)
-{
- CHAR delimiter;
-
- /* skip white space */
- while (*cmdline == ' ') cmdline++;
-
- /* skip executable name */
- delimiter = (*cmdline == '"' ? '"' : ' ');
-
- if (*cmdline == delimiter) cmdline++;
- while (*cmdline && *cmdline != delimiter) cmdline++;
- if (*cmdline == delimiter) cmdline++;
-
- if (*cmdline)
- {
- /* file name is passed on the command line */
- if (cmdline[0] == '"')
- {
- cmdline++;
- cmdline[lstrlen(cmdline) - 1] = 0;
- }
- DoOpenFile(cmdline);
- }
-}
-
-int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
-{
- MSG msg;
- HANDLE hAccelTable;
-
- /* Other instances of app running? */
- if (!hPrevInstance)
- {
- /* stuff to be done once */
- if (!InitApplication(hInstance))
- {
- return FALSE; /* exit */
- }
- }
-
- /* stuff to be done every time */
- if (!InitInstance(hInstance, nCmdShow))
- {
- return FALSE;
- }
-
- HandleCommandLine(GetCommandLine());
-
- hAccelTable = LoadAccelerators(hInstance, szAppName);
-
- /* Main loop */
- /* Acquire and dispatch messages until a WM_QUIT message is received */
- while (GetMessage(&msg, NULL, 0, 0))
- {
- /* Add other Translation functions (for modeless dialogs
- and/or MDI windows) here. */
-
- if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
-
- /* Add module specific instance free/delete functions here */
-
- /* Returns the value from PostQuitMessage */
- return msg.wParam;
-}
diff --git a/programs/view/view.rc b/programs/view/view.rc
deleted file mode 100644
index aae88e8..0000000
--- a/programs/view/view.rc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * View resources
- *
- * Copyright 1998 Douglas Ridgway
- * Copyright 2003 Marcelo Duarte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "resource.h"
-
-LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
-
-VIEW MENU
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "&Open...", IDM_OPEN
- MENUITEM "E&xit", IDM_EXIT
- END
- POPUP "&Pan"
- BEGIN
- MENUITEM "&Scale to Window", IDM_SET_EXT_TO_WIN
- MENUITEM SEPARATOR
- MENUITEM "&Left", IDM_LEFT
- MENUITEM "&Right", IDM_RIGHT
- MENUITEM "&Up", IDM_UP
- MENUITEM "&Down", IDM_DOWN
- END
-END
-
-STRINGTABLE
-BEGIN
- IDS_DESCRIPTION "Regular Metafile Viewer"
-END
diff --git a/programs/wineview/Makefile.in b/programs/wineview/Makefile.in
new file mode 100644
index 0000000..51c78b3
--- /dev/null
+++ b/programs/wineview/Makefile.in
@@ -0,0 +1,13 @@
+MODULE = wineview.exe
+APPMODE = -mwindows
+IMPORTS = comdlg32 user32 gdi32
+
+C_SRCS = \
+ view.c
+
+RC_SRCS = \
+ view.rc
+
+PO_SRCS = view.rc
+
+ at MAKE_PROG_RULES@
diff --git a/programs/wineview/resource.h b/programs/wineview/resource.h
new file mode 100644
index 0000000..7932687
--- /dev/null
+++ b/programs/wineview/resource.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 1998 Douglas Ridgway
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <windef.h>
+
+#define IDS_DESCRIPTION 2
+#define IDI_APPICON 101
+#define IDM_EXIT 1000
+#define IDM_OPEN 502
+#define IDM_SET_EXT_TO_WIN 503
+#define IDM_LEFT 601
+#define IDM_RIGHT 602
+#define IDM_UP 603
+#define IDM_DOWN 604
diff --git a/programs/wineview/view.c b/programs/wineview/view.c
new file mode 100644
index 0000000..f579335
--- /dev/null
+++ b/programs/wineview/view.c
@@ -0,0 +1,405 @@
+/*
+ * Copyright 1998 Douglas Ridgway
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <windows.h>
+#include <windowsx.h>
+#include "resource.h"
+
+#include <stdio.h>
+
+static HINSTANCE hInst;
+static HWND hMainWnd;
+static char szAppName[] = "Wineview";
+static char szTitle[80];
+
+static HMETAFILE hmf;
+static HENHMETAFILE enhmf;
+static int deltax = 0, deltay = 0;
+static int width = 0, height = 0;
+static BOOL isAldus, isEnhanced;
+
+#include "pshpack1.h"
+typedef struct
+{
+ DWORD key;
+ WORD hmf;
+ SMALL_RECT bbox;
+ WORD inch;
+ DWORD reserved;
+ WORD checksum;
+} APMFILEHEADER;
+#include "poppack.h"
+
+#define APMHEADER_KEY 0x9AC6CDD7l
+
+
+static BOOL FileOpen(HWND hWnd, char *fn, int fnsz)
+{
+ OPENFILENAME ofn = { sizeof(OPENFILENAME),
+ 0, 0, NULL, NULL, 0, 0, NULL,
+ fnsz, NULL, 0, NULL, NULL,
+ OFN_SHOWHELP, 0, 0, NULL, 0, NULL };
+ ofn.lpstrFilter = "Metafiles\0*.wmf;*.emf\0";
+ ofn.hwndOwner = hWnd;
+ ofn.lpstrFile = fn;
+ if( fnsz < 1 )
+ return FALSE;
+ *fn = 0;
+ return GetOpenFileName(&ofn);
+}
+
+static BOOL FileIsEnhanced( LPCSTR szFileName )
+{
+ HFILE hInFile;
+ ENHMETAHEADER enh;
+
+ if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR )
+ return FALSE;
+
+ if( _lread( hInFile, &enh, sizeof(ENHMETAHEADER) ) != sizeof(ENHMETAHEADER) )
+ {
+ _lclose( hInFile );
+ return FALSE;
+ }
+ _lclose( hInFile );
+
+ /* Is it enhanced? */
+ return (enh.dSignature == ENHMETA_SIGNATURE);
+}
+
+static BOOL FileIsPlaceable( LPCSTR szFileName )
+{
+ HFILE hInFile;
+ APMFILEHEADER apmh;
+
+ if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR )
+ return FALSE;
+
+ if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) )
+ != sizeof(APMFILEHEADER) )
+ {
+ _lclose( hInFile );
+ return FALSE;
+ }
+ _lclose( hInFile );
+
+ /* Is it placeable? */
+ return (apmh.key == APMHEADER_KEY);
+}
+
+static HMETAFILE GetPlaceableMetaFile( LPCSTR szFileName )
+{
+ LPBYTE lpData;
+ METAHEADER mfHeader;
+ APMFILEHEADER APMHeader;
+ HFILE fh;
+ HMETAFILE hmf;
+ WORD checksum, *p;
+ HDC hdc;
+ int i;
+
+ if( (fh = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR ) return 0;
+ _llseek(fh, 0, 0);
+ if (!_lread(fh, &APMHeader, sizeof(APMFILEHEADER))) return 0;
+ _llseek(fh, sizeof(APMFILEHEADER), 0);
+ checksum = 0;
+ p = (WORD *) &APMHeader;
+
+ for(i=0; i<10; i++)
+ checksum ^= *p++;
+ if (checksum != APMHeader.checksum) {
+ char msg[128];
+ sprintf(msg, "Computed checksum %04x != stored checksum %04x\n",
+ checksum, APMHeader.checksum);
+ MessageBox(hMainWnd, msg, "Checksum failed", MB_OK);
+ return 0;
+ }
+
+ if (!_lread(fh, &mfHeader, sizeof(METAHEADER))) return 0;
+
+ if (!(lpData = GlobalAlloc(GPTR, (mfHeader.mtSize * 2L)))) return 0;
+
+ _llseek(fh, sizeof(APMFILEHEADER), 0);
+ if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L)))
+ {
+ GlobalFree(lpData);
+ _lclose(fh);
+ return 0;
+ }
+ _lclose(fh);
+
+ if (!(hmf = SetMetaFileBitsEx(mfHeader.mtSize*2, lpData)))
+ return 0;
+
+
+ width = APMHeader.bbox.Right - APMHeader.bbox.Left;
+ height = APMHeader.bbox.Bottom - APMHeader.bbox.Top;
+
+ /* printf("Ok! width %d height %d inch %d\n", width, height, APMHeader.inch); */
+ hdc = GetDC(hMainWnd);
+ width = width * GetDeviceCaps(hdc, LOGPIXELSX)/APMHeader.inch;
+ height = height * GetDeviceCaps(hdc,LOGPIXELSY)/APMHeader.inch;
+ ReleaseDC(hMainWnd, hdc);
+
+ deltax = 0;
+ deltay = 0 ;
+ return hmf;
+}
+
+static void DoOpenFile(LPCSTR filename)
+{
+ if (!filename) return;
+
+ isAldus = FileIsPlaceable(filename);
+ if (isAldus) {
+ hmf = GetPlaceableMetaFile(filename);
+ } else {
+ RECT r;
+ isEnhanced = FileIsEnhanced(filename);
+ if (isEnhanced)
+ enhmf = GetEnhMetaFile(filename);
+ else
+ hmf = GetMetaFile(filename);
+ GetClientRect(hMainWnd, &r);
+ width = r.right - r.left;
+ height = r.bottom - r.top;
+ }
+ InvalidateRect( hMainWnd, NULL, TRUE );
+}
+
+static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
+{
+ switch (uMessage)
+ {
+ case WM_PAINT:
+ {
+ PAINTSTRUCT ps;
+ BeginPaint(hwnd, &ps);
+ SetMapMode(ps.hdc, MM_ANISOTROPIC);
+ /* Set the window extent to a sane value in case the metafile doesn't */
+ SetWindowExtEx(ps.hdc, width, height, NULL);
+ SetViewportExtEx(ps.hdc, width, height, NULL);
+ SetViewportOrgEx(ps.hdc, deltax, deltay, NULL);
+ if (isEnhanced && enhmf)
+ {
+ RECT r;
+ GetClientRect(hwnd, &r);
+ PlayEnhMetaFile(ps.hdc, enhmf, &r);
+ }
+ else if (hmf)
+ PlayMetaFile(ps.hdc, hmf);
+ EndPaint(hwnd, &ps);
+ }
+ break;
+
+ case WM_COMMAND: /* message: command from application menu */
+ switch (GET_WM_COMMAND_ID(wparam,lparam))
+ {
+ case IDM_OPEN:
+ {
+ char filename[MAX_PATH];
+ if (FileOpen(hwnd, filename, sizeof(filename)))
+ DoOpenFile(filename);
+ }
+ break;
+
+ case IDM_SET_EXT_TO_WIN:
+ {
+ RECT r;
+ GetClientRect(hwnd, &r);
+ width = r.right - r.left;
+ height = r.bottom - r.top;
+ deltax = deltay = 0;
+ InvalidateRect( hwnd, NULL, TRUE );
+ }
+ break;
+
+
+ case IDM_LEFT:
+ deltax += 100;
+ InvalidateRect( hwnd, NULL, TRUE );
+ break;
+ case IDM_RIGHT:
+ deltax -= 100;
+ InvalidateRect( hwnd, NULL, TRUE );
+ break;
+ case IDM_UP:
+ deltay += 100;
+ InvalidateRect( hwnd, NULL, TRUE );
+ break;
+ case IDM_DOWN:
+ deltay -= 100;
+ InvalidateRect( hwnd, NULL, TRUE );
+ break;
+
+ case IDM_EXIT:
+ DestroyWindow(hwnd);
+ break;
+
+ default:
+ return DefWindowProc(hwnd, uMessage, wparam, lparam);
+ }
+ break;
+
+ case WM_DESTROY: /* message: window being destroyed */
+ PostQuitMessage(0);
+ break;
+
+ default: /* Passes it on if unprocessed */
+ return DefWindowProc(hwnd, uMessage, wparam, lparam);
+ }
+ return 0;
+}
+
+static BOOL InitApplication(HINSTANCE hInstance)
+{
+ WNDCLASSEX wc;
+
+ /* Load the application description strings */
+ LoadString(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle));
+
+ /* Fill in window class structure with parameters that describe the
+ main window */
+
+ wc.cbSize = sizeof(WNDCLASSEX);
+ wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s) */
+ wc.lpfnWndProc = WndProc; /* Window Procedure */
+ wc.cbClsExtra = 0; /* No per-class extra data */
+ wc.cbWndExtra = 0; /* No per-window extra data */
+ wc.hInstance = hInstance; /* Owner of this class */
+ wc.hIcon = NULL;
+ wc.hIconSm = NULL;
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW); /* Cursor */
+ wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); /* Default color */
+ wc.lpszMenuName = szAppName; /* Menu name from .rc */
+ wc.lpszClassName = szAppName; /* Name to register as */
+
+ /* Register the window class and return FALSE if unsuccessful */
+
+ if (!RegisterClassEx(&wc))
+ {
+ if (!RegisterClass((LPWNDCLASS)&wc.style))
+ return FALSE;
+ }
+
+ /* Call module specific initialization functions here */
+
+ return TRUE;
+}
+
+static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
+{
+ /* Save the instance handle in a global variable for later use */
+ hInst = hInstance;
+
+ /* Create main window */
+ hMainWnd = CreateWindow(szAppName, /* See RegisterClass() call */
+ szTitle, /* window title */
+ WS_OVERLAPPEDWINDOW, /* Window style */
+ CW_USEDEFAULT, 0, /* positioning */
+ CW_USEDEFAULT, 0, /* size */
+ NULL, /* Overlapped has no parent */
+ NULL, /* Use the window class menu */
+ hInstance,
+ NULL);
+
+ if (!hMainWnd)
+ return FALSE;
+
+ /* Call module specific instance initialization functions here */
+
+ /* show the window, and paint it for the first time */
+ ShowWindow(hMainWnd, nCmdShow);
+ UpdateWindow(hMainWnd);
+
+ return TRUE;
+}
+
+static void HandleCommandLine(LPSTR cmdline)
+{
+ CHAR delimiter;
+
+ /* skip white space */
+ while (*cmdline == ' ') cmdline++;
+
+ /* skip executable name */
+ delimiter = (*cmdline == '"' ? '"' : ' ');
+
+ if (*cmdline == delimiter) cmdline++;
+ while (*cmdline && *cmdline != delimiter) cmdline++;
+ if (*cmdline == delimiter) cmdline++;
+
+ if (*cmdline)
+ {
+ /* file name is passed on the command line */
+ if (cmdline[0] == '"')
+ {
+ cmdline++;
+ cmdline[lstrlen(cmdline) - 1] = 0;
+ }
+ DoOpenFile(cmdline);
+ }
+}
+
+int APIENTRY WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
+{
+ MSG msg;
+ HANDLE hAccelTable;
+
+ /* Other instances of app running? */
+ if (!hPrevInstance)
+ {
+ /* stuff to be done once */
+ if (!InitApplication(hInstance))
+ {
+ return FALSE; /* exit */
+ }
+ }
+
+ /* stuff to be done every time */
+ if (!InitInstance(hInstance, nCmdShow))
+ {
+ return FALSE;
+ }
+
+ HandleCommandLine(GetCommandLine());
+
+ hAccelTable = LoadAccelerators(hInstance, szAppName);
+
+ /* Main loop */
+ /* Acquire and dispatch messages until a WM_QUIT message is received */
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ /* Add other Translation functions (for modeless dialogs
+ and/or MDI windows) here. */
+
+ if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+
+ /* Add module specific instance free/delete functions here */
+
+ /* Returns the value from PostQuitMessage */
+ return msg.wParam;
+}
diff --git a/programs/wineview/view.rc b/programs/wineview/view.rc
new file mode 100644
index 0000000..073bd54
--- /dev/null
+++ b/programs/wineview/view.rc
@@ -0,0 +1,52 @@
+/*
+ * View resources
+ *
+ * Copyright 1998 Douglas Ridgway
+ * Copyright 2003 Marcelo Duarte
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "resource.h"
+
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
+WINEVIEW MENU
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Open...", IDM_OPEN
+ MENUITEM "E&xit", IDM_EXIT
+ END
+ POPUP "&Pan"
+ BEGIN
+ MENUITEM "&Scale to Window", IDM_SET_EXT_TO_WIN
+ MENUITEM SEPARATOR
+ MENUITEM "&Left", IDM_LEFT
+ MENUITEM "&Right", IDM_RIGHT
+ MENUITEM "&Up", IDM_UP
+ MENUITEM "&Down", IDM_DOWN
+ END
+END
+
+STRINGTABLE
+BEGIN
+ IDS_DESCRIPTION "Regular Metafile Viewer"
+END
+
+WINEVIEW ACCELERATORS
+BEGIN
+ "Q", IDM_EXIT, VIRTKEY, CONTROL
+END
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list