Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
043f6402
Commit
043f6402
authored
Jul 02, 2001
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 02, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace PROFILE_* functions by Reg*.
parent
6ae29d6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
16 deletions
+70
-16
afm.c
dlls/wineps/afm.c
+40
-6
init.c
dlls/wineps/init.c
+11
-5
truetype.c
dlls/wineps/truetype.c
+19
-5
No files found.
dlls/wineps/afm.c
View file @
043f6402
...
...
@@ -17,8 +17,8 @@
# include <float.h>
/* FLT_MAX */
#endif
#include "winnt.h"
/* HEAP_ZERO_MEMORY */
#include "winreg.h"
#include "psdrv.h"
#include "options.h"
#include "debugtools.h"
#include "heap.h"
...
...
@@ -977,15 +977,23 @@ static BOOL PSDRV_ReadAFMDir(const char* afmdir) {
BOOL
PSDRV_GetFontMetrics
(
void
)
{
int
idx
=
0
;
int
idx
;
char
key
[
256
];
char
value
[
256
];
HKEY
hkey
;
DWORD
type
,
key_len
,
value_len
;
if
(
PSDRV_GlyphListInit
()
!=
0
)
return
FALSE
;
while
(
PROFILE_EnumWineIniString
(
"afmfiles"
,
idx
++
,
key
,
sizeof
(
key
),
value
,
sizeof
(
value
)))
if
(
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
afmfiles"
,
0
,
KEY_READ
,
&
hkey
))
goto
no_afmfiles
;
idx
=
0
;
key_len
=
sizeof
(
key
);
value_len
=
sizeof
(
value
);
while
(
!
RegEnumValueA
(
hkey
,
idx
++
,
key
,
&
key_len
,
NULL
,
&
type
,
value
,
&
value_len
))
{
AFM
*
afm
=
PSDRV_AFMParse
(
value
);
...
...
@@ -995,18 +1003,44 @@ BOOL PSDRV_GetFontMetrics(void)
PSDRV_ReencodeCharWidths
(
afm
);
}
if
(
PSDRV_AddAFMtoList
(
&
PSDRV_AFMFontList
,
afm
)
==
FALSE
)
{
RegCloseKey
(
hkey
);
return
FALSE
;
}
}
else
{
WARN
(
"Error parsing %s
\n
"
,
value
);
}
/* initialize lengths for new iteration */
key_len
=
sizeof
(
key
);
value_len
=
sizeof
(
value
);
}
RegCloseKey
(
hkey
);
no_afmfiles:
for
(
idx
=
0
;
PROFILE_EnumWineIniString
(
"afmdirs"
,
idx
,
key
,
sizeof
(
key
),
value
,
sizeof
(
value
));
++
idx
)
if
(
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
afmdirs"
,
0
,
KEY_READ
,
&
hkey
))
goto
no_afmdirs
;
idx
=
0
;
key_len
=
sizeof
(
key
);
value_len
=
sizeof
(
value
);
while
(
!
RegEnumValueA
(
hkey
,
idx
++
,
key
,
&
key_len
,
NULL
,
&
type
,
value
,
&
value_len
))
{
if
(
PSDRV_ReadAFMDir
(
value
)
==
FALSE
)
{
RegCloseKey
(
hkey
);
return
FALSE
;
}
/* initialize lengths for new iteration */
key_len
=
sizeof
(
key
);
value_len
=
sizeof
(
value
);
}
RegCloseKey
(
hkey
);
no_afmdirs:
PSDRV_IndexGlyphList
();
/* So SortFontMetrics will work */
if
(
SortFontMetrics
()
==
FALSE
)
...
...
dlls/wineps/init.c
View file @
043f6402
...
...
@@ -18,7 +18,6 @@
#include "winreg.h"
#include "winspool.h"
#include "winerror.h"
#include "options.h"
#ifdef HAVE_CUPS
# include <cups/cups.h>
...
...
@@ -468,6 +467,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
HANDLE
hPrinter
;
const
char
*
ppd
=
NULL
;
char
ppdFileName
[
256
];
HKEY
hkey
;
TRACE
(
"'%s'
\n
"
,
name
);
...
...
@@ -538,10 +538,16 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
/* Look for a ppd file for this printer in the config file.
* First look for the names of the printer, then for 'generic'
*/
if
((
res
!=
ERROR_SUCCESS
)
&&
!
PROFILE_GetWineIniString
(
"ppd"
,
name
,
""
,
ppdFileName
,
sizeof
(
ppdFileName
))
&&
!
PROFILE_GetWineIniString
(
"ppd"
,
"generic"
,
""
,
ppdFileName
,
sizeof
(
ppdFileName
))
)
if
((
res
!=
ERROR_SUCCESS
)
&&
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
ppd"
,
&
hkey
))
{
DWORD
count
=
sizeof
(
ppdFileName
);
ppdFileName
[
0
]
=
0
;
if
(
RegQueryValueExA
(
hkey
,
name
,
0
,
&
type
,
ppdFileName
,
&
count
)
!=
ERROR_SUCCESS
)
RegQueryValueExA
(
hkey
,
"generic"
,
0
,
&
type
,
ppdFileName
,
&
count
);
RegCloseKey
(
hkey
);
}
if
(
!
ppdFileName
[
0
])
res
=
ERROR_FILE_NOT_FOUND
;
else
res
=
ERROR_SUCCESS
;
...
...
dlls/wineps/truetype.c
View file @
043f6402
...
...
@@ -39,7 +39,7 @@
#include <stdio.h>
#include "winnt.h"
#include "
options
.h"
#include "
winreg
.h"
#include "psdrv.h"
#include "debugtools.h"
#include "heap.h"
...
...
@@ -558,11 +558,13 @@ static BOOL ReadTrueTypeFile(LPCSTR filename)
* that event.
*
*/
BOOL
PSDRV_GetTrueTypeMetrics
()
BOOL
PSDRV_GetTrueTypeMetrics
(
void
)
{
CHAR
keybuf
[
256
],
namebuf
[
256
];
INT
i
=
0
;
FT_Error
error
;
HKEY
hkey
;
DWORD
type
,
key_len
,
name_len
;
error
=
FT_Init_FreeType
(
&
library
);
if
(
error
!=
FT_Err_Ok
)
...
...
@@ -571,8 +573,13 @@ BOOL PSDRV_GetTrueTypeMetrics()
return
FALSE
;
}
while
(
PROFILE_EnumWineIniString
(
"TrueType Font Directories"
,
i
++
,
keybuf
,
sizeof
(
keybuf
),
namebuf
,
sizeof
(
namebuf
)))
if
(
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
TrueType Font Directories"
,
0
,
KEY_READ
,
&
hkey
))
goto
no_metrics
;
key_len
=
sizeof
(
keybuf
);
name_len
=
sizeof
(
namebuf
);
while
(
!
RegEnumValueA
(
hkey
,
i
++
,
keybuf
,
&
key_len
,
NULL
,
&
type
,
namebuf
,
&
name_len
))
{
struct
dirent
*
dent
;
DIR
*
dir
;
...
...
@@ -614,14 +621,21 @@ BOOL PSDRV_GetTrueTypeMetrics()
{
ERR
(
"Error reading '%s'
\n
"
,
namebuf
);
closedir
(
dir
);
RegCloseKey
(
hkey
);
FT_Done_FreeType
(
library
);
return
FALSE
;
}
}
closedir
(
dir
);
/* initialize lengths for new iteration */
key_len
=
sizeof
(
keybuf
);
name_len
=
sizeof
(
namebuf
);
}
RegCloseKey
(
hkey
);
no_metrics:
FT_Done_FreeType
(
library
);
return
TRUE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment