Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / lisp / term / w32-win.el
index cd000ea..abfaafd 100644 (file)
@@ -1,7 +1,6 @@
 ;;; w32-win.el --- parse switches controlling interface with W32 window system
 
-;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2012  Free Software Foundation, Inc.
 
 ;; Author: Kevin Gallo
 ;; Keywords: terminals
 ;; Keep an obsolete alias for w32-focus-frame and w32-select-font in case
 ;; they are used by code outside Emacs.
 (define-obsolete-function-alias 'w32-focus-frame 'x-focus-frame "23.1")
+(declare-function x-select-font "w32font.c"
+                  (&optional frame exclude-proportional))
 (define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1")
 
-(defvar xlfd-regexp-registry-subnum)
 (defvar w32-color-map) ;; defined in w32fns.c
+(make-obsolete 'w32-default-color-map nil "24.1")
 
 (declare-function w32-send-sys-command "w32fns.c")
 (declare-function set-message-beep "w32console.c")
 ;; The following definition is used for debugging scroll bar events.
 ;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event))
 
-(defun w32-drag-n-drop-debug (event)
-  "Print the drag-n-drop EVENT in a readable form."
-  (interactive "e")
-  (princ event))
+;; (defun w32-drag-n-drop-debug (event)
+;;   "Print the drag-n-drop EVENT in a readable form."
+;;   (interactive "e")
+;;   (princ event))
 
 (defun w32-drag-n-drop (event)
   "Edit the files listed in the drag-n-drop EVENT.
@@ -147,29 +148,19 @@ the last file dropped is selected."
 (global-set-key [language-change] 'ignore)
 
 (defvar x-resource-name)
-(defvar x-colors)
 
 \f
-(defun xw-defined-colors (&optional frame)
-  "Internal function called by `defined-colors', which see."
-  (or frame (setq frame (selected-frame)))
-  (let ((defined-colors nil))
-    (dolist (this-color (or (mapcar 'car w32-color-map) x-colors))
-      (and (color-supported-p this-color frame t)
-          (setq defined-colors (cons this-color defined-colors))))
-    defined-colors))
-\f
 ;;;; Function keys
 
  ;;; make f10 activate the real menubar rather than the mini-buffer menu
  ;;; navigation feature.
  (defun w32-menu-bar-open (&optional frame)
    "Start key navigation of the menu bar in FRAME.
+
 This initially activates the first menu-bar item, and you can then navigate
 with the arrow keys, select a menu entry with the Return key or cancel with
 the Escape key.  If FRAME has no menu bar, this function does nothing.
+
 If FRAME is nil or not given, use the selected frame.
 If FRAME does not have the menu bar enabled, display a text menu using
 `tmm-menubar'."
@@ -195,20 +186,31 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
   "Report an error when a suspend is attempted."
   (error "Suspending an Emacs running under W32 makes no sense"))
 
-(defvar image-library-alist)
-
-;;; Set default known names for image libraries
-(setq image-library-alist
-      '((xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll")
-        (png "libpng12d.dll" "libpng12.dll" "libpng.dll"
-        ;; these are libpng 1.2.8 from GTK+
-        "libpng13d.dll" "libpng13.dll")
-        (jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll")
-        (tiff "libtiff3.dll" "libtiff.dll")
-        (gif "giflib4.dll" "libungif4.dll" "libungif.dll")
-        (svg "librsvg-2-2.dll")
-        (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
-        (glib "libglib-2.0-0.dll")))
+(defvar dynamic-library-alist)
+(defvar libpng-version)                 ; image.c #ifdef HAVE_NTGUI
+
+;;; Set default known names for external libraries
+(setq dynamic-library-alist
+      (list
+       '(xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll")
+       ;; Versions of libpng 1.4.x and later are incompatible with
+       ;; earlier versions.  Set up the list of libraries according to
+       ;; the version we were compiled against.  (If we were compiled
+       ;; without PNG support, libpng-version's value is -1.)
+       (if (>= libpng-version 10400)
+          ;; libpng14-14.dll is libpng 1.4.3 from GTK+
+          '(png "libpng14-14.dll" "libpng14.dll")
+        '(png "libpng12d.dll" "libpng12.dll" "libpng3.dll" "libpng.dll"
+              ;; these are libpng 1.2.8 from GTK+
+              "libpng13d.dll" "libpng13.dll"))
+       '(jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll")
+       '(tiff "libtiff3.dll" "libtiff.dll")
+       '(gif "giflib4.dll" "libungif4.dll" "libungif.dll")
+       '(svg "librsvg-2-2.dll")
+       '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
+       '(glib "libglib-2.0-0.dll")
+       '(gobject "libgobject-2.0-0.dll")
+       '(gnutls "libgnutls-28.dll" "libgnutls-26.dll")))
 
 ;;; multi-tty support
 (defvar w32-initialized nil
@@ -216,11 +218,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
 
 (declare-function x-open-connection "w32fns.c"
                   (display &optional xrm-string must-succeed))
-
-(declare-function setup-default-fontset "fontset" ())
-(declare-function set-fontset-font "fontset.c"
-                  (name target font-spec &optional frame add))
-(declare-function setup-default-fontset "fontset" ())
 (declare-function create-fontset-from-fontset-spec "fontset"
                   (fontset-spec &optional style-variant noerror))
 (declare-function create-fontset-from-x-resource "fontset" ())
@@ -250,21 +247,15 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
                      ;; are the initial display
                      (eq initial-window-system 'w32))
 
-  ;; Setup the default fontset.
-  (setup-default-fontset)
-
-  ;; Enable Japanese fonts on Windows to be used by default.
-  (set-fontset-font t (make-char 'katakana-jisx0201)
-                   '("*" . "JISX0208-SJIS"))
-  (set-fontset-font t (make-char 'latin-jisx0201)
-                   '("*" . "JISX0208-SJIS"))
-  (set-fontset-font t (make-char 'japanese-jisx0208)
-                   '("*" . "JISX0208-SJIS"))
-  (set-fontset-font t (make-char 'japanese-jisx0208-1978)
-                   '("*" . "JISX0208-SJIS"))
-
+  ;; Create the default fontset.
+  (create-default-fontset)
   ;; Create the standard fontset.
-  (create-fontset-from-fontset-spec w32-standard-fontset-spec t)
+  (condition-case err
+      (create-fontset-from-fontset-spec w32-standard-fontset-spec t)
+    (error (display-warning
+           'initialization
+           (format "Creation of the standard fontset failed: %s" err)
+           :error)))
   ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...).
   (create-fontset-from-x-resource)
 
@@ -309,9 +300,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
   ;; that this is only annoying.
   (setq split-window-keep-point t)
 
-  ;; Turn on support for mouse wheels
-  (mouse-wheel-mode 1)
-
   ;; W32 expects the menu bar cut and paste commands to use the clipboard.
   (menu-bar-enable-clipboard)
 
@@ -328,5 +316,4 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
 
 (provide 'w32-win)
 
-;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166
 ;;; w32-win.el ends here