annotate src/w32reg.c @ 53278:f830e67de7d8

Rebuild.
author Andreas Schwab <schwab@suse.de>
date Wed, 24 Dec 2003 10:46:12 +0000
parents 695cf19ef79e
children a8fa7c632ee4 375f2633d815
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1 /* Emulate the X Resource Manager through the registry.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2 Copyright (C) 1990, 1993, 1994 Free Software Foundation.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13434
diff changeset
4 This file is part of GNU Emacs.
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13434
diff changeset
5
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13434
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
9 any later version.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
10
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13434
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
14 GNU General Public License for more details.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
15
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13434
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13434
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13434
diff changeset
19 Boston, MA 02111-1307, USA. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
20
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
21 /* Written by Kevin Gallo */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
22
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
23 #include <config.h>
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
24 #include "lisp.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
25 #include "w32term.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
26 #include "blockinput.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
27
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
28 #include <stdio.h>
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
29 #include <string.h>
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
30
15149
685510b93c83 (REG_ROOT): Remove trailing backslash.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
31 #define REG_ROOT "SOFTWARE\\GNU\\Emacs"
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
32
51501
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
33 /* Default system colors from the Display Control Panel settings. */
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
34 #define SYSTEM_DEFAULT_RESOURCES \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
35 "emacs.foreground:SystemWindowText\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
36 "emacs.background:SystemWindow\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
37 "emacs.tooltip.attributeForeground:SystemInfoText\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
38 "emacs.tooltip.attributeBackground:SystemInfoWindow\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
39 "emacs.tool-bar.attributeForeground:SystemButtonText\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
40 "emacs.tool-bar.attributeBackground:SystemButtonFace\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
41 "emacs.menu.attributeForeground:SystemMenuText\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
42 "emacs.menu.attributeBackground:SystemMenu\0" \
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
43 "emacs.scroll-bar.attributeForeground:SystemScrollbar"
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
44
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
45 /* Other possibilities for default faces:
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
46
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
47 region: Could use SystemHilight, but interferes with our ability to
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
48 see most syntax highlighting through the region face.
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
49
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
50 modeline: Could use System(In)ActiveTitle, gradient versions (not
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
51 supported on 95 and NT), but modeline is more like a status bar
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
52 really (which don't appear to be configurable in Windows).
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
53
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
54 highlight: Could use SystemHotTrackingColor, but it is not supported
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
55 on Windows 95 or NT, and other apps only seem to use it for menus
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
56 anyway.
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
57
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
58 */
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
59
50040
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
60 static char *
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
61 w32_get_rdb_resource (rdb, resource)
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
62 char *rdb;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
63 char *resource;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
64 {
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
65 char *value = rdb;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
66 int len = strlen (resource);
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
67
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
68 while (*value)
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
69 {
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
70 /* Comparison is case-insensitive because registry searches are too. */
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
71 if ((strnicmp (value, resource, len) == 0) && (value[len] == ':'))
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
72 return xstrdup (&value[len + 1]);
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
73
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
74 value = strchr (value, '\0') + 1;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
75 }
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
76
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
77 return NULL;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
78 }
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
79
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
80 LPBYTE
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15149
diff changeset
81 w32_get_string_resource (name, class, dwexptype)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
82 char *name, *class;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
83 DWORD dwexptype;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
84 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
85 LPBYTE lpvalue = NULL;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
86 HKEY hrootkey = NULL;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
87 DWORD dwType;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
88 DWORD cbData;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
89 BOOL ok = FALSE;
24672
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
90 HKEY hive = HKEY_CURRENT_USER;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
91
24672
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
92 trykey:
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
93
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
94 BLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
95
24672
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
96 /* Check both the current user and the local machine to see if we have
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
97 any resources */
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
98
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
99 if (RegOpenKeyEx (hive, REG_ROOT, 0, KEY_READ, &hrootkey) == ERROR_SUCCESS)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
100 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
101 char *keyname;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
102
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
103 if (RegQueryValueEx (hrootkey, name, NULL, &dwType, NULL, &cbData) == ERROR_SUCCESS
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
104 && dwType == dwexptype)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
105 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
106 keyname = name;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
107 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
108 else if (RegQueryValueEx (hrootkey, class, NULL, &dwType, NULL, &cbData) == ERROR_SUCCESS
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
109 && dwType == dwexptype)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
110 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
111 keyname = class;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
112 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
113 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
114 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
115 keyname = NULL;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
116 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
117
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
118 ok = (keyname
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
119 && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
120 && RegQueryValueEx (hrootkey, keyname, NULL, NULL, lpvalue, &cbData) == ERROR_SUCCESS);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
121
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
122 RegCloseKey (hrootkey);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
123 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
124
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
125 UNBLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
126
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
127 if (!ok)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
128 {
24672
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
129 if (lpvalue)
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
130 {
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
131 xfree (lpvalue);
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
132 lpvalue = NULL;
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
133 }
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
134 if (hive == HKEY_CURRENT_USER)
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
135 {
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
136 hive = HKEY_LOCAL_MACHINE;
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
137 goto trykey;
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
138 }
51501
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
139
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
140 /* Check if there are Windows specific defaults defined. */
b79b842995c2 (SYSTEM_DEFAULT_RESOURCES): New constant.
Jason Rumney <jasonr@gnu.org>
parents: 50364
diff changeset
141 return w32_get_rdb_resource (SYSTEM_DEFAULT_RESOURCES, name);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24672
diff changeset
142 }
24672
8387918b52c6 (w32_get_string_resource): Check for name in current
Andrew Innes <andrewi@gnu.org>
parents: 16588
diff changeset
143 return (lpvalue);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
144 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
145
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
146 /* Retrieve the string resource specified by NAME with CLASS from
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
147 database RDB. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
148
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
149 char *
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
150 x_get_string_resource (rdb, name, class)
50364
fcf617f53ab1 (x_get_string_resource): Use XrmDatabase.
Kim F. Storm <storm@cua.dk>
parents: 50040
diff changeset
151 XrmDatabase rdb;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
152 char *name, *class;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
153 {
50040
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
154 if (rdb)
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
155 {
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
156 char *resource;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
157
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
158 if (resource = w32_get_rdb_resource (rdb, name))
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
159 return resource;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
160 if (resource = w32_get_rdb_resource (rdb, class))
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
161 return resource;
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
162 }
57e262ca5d0d (w32_get_rdb_resource): New function.
Juanma Barranquero <lekktu@gmail.com>
parents: 49600
diff changeset
163
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15149
diff changeset
164 return (w32_get_string_resource (name, class, REG_SZ));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
165 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51501
diff changeset
166
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51501
diff changeset
167 /* arch-tag: 755fce25-42d7-4acb-874f-2fb42336823d
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51501
diff changeset
168 (do not change this comment) */