summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xpawhelloworld/xpawhelloworld.c11
-rw-r--r--xphelloworld/xphelloworld.c2
-rw-r--r--xpsimplehelloworld/xpsimplehelloworld.c7
-rw-r--r--xpxmhelloworld/xpxmhelloworld.c11
-rw-r--r--xpxthelloworld/xpxthelloworld.c9
5 files changed, 22 insertions, 18 deletions
diff --git a/xpawhelloworld/xpawhelloworld.c b/xpawhelloworld/xpawhelloworld.c
index 281c310..a480255 100644
--- a/xpawhelloworld/xpawhelloworld.c
+++ b/xpawhelloworld/xpawhelloworld.c
@@ -246,7 +246,8 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
shell,
print_shell,
hello;
- long dpi;
+ long dpi_x = 0L,
+ dpi_y = 0L;
char fontname[256]; /* BUG: is this really big enougth ? */
XFontStruct *textFont;
XmFontList textFontList;
@@ -270,7 +271,7 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
XpSetContext(pdpy, pcontext);
/* Get default printer resolution */
- if( XpuGetResolution(pdpy, pcontext, &dpi) != 1 )
+ if( XpuGetResolution(pdpy, pcontext, &dpi_x, &dpi_y) != 1 )
{
fprintf(stderr, "No default resolution for printer '%s'\n", printername);
XpuClosePrinterDisplay(pdpy, pcontext);
@@ -285,7 +286,7 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
if( !pdpy )
Error(("XOpenDisplay failure.\n"));
- dpi = 0;
+ dpi_x = dpi_y = 0L;
pscreen = XDefaultScreenOfDisplay(pdpy);
}
@@ -321,11 +322,11 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
shell = toplevel;
}
- sprintf(fontname, "-adobe-courier-medium-r-normal--40-*-%ld-%ld-*-*-iso8859-1", dpi, dpi);
+ sprintf(fontname, "-adobe-courier-medium-r-normal--40-*-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y);
textFont = XLoadQueryFont(pdpy, fontname);
if( !textFont )
{
- sprintf(fontname, "-*-*-*-*-*-*-*-160-%ld-%ld-*-*-iso8859-1", dpi, dpi);
+ sprintf(fontname, "-*-*-*-*-*-*-*-160-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y);
textFont = XLoadQueryFont(pdpy, fontname);
}
if( !textFont )
diff --git a/xphelloworld/xphelloworld.c b/xphelloworld/xphelloworld.c
index 066ceb4..c796d29 100644
--- a/xphelloworld/xphelloworld.c
+++ b/xphelloworld/xphelloworld.c
@@ -165,7 +165,7 @@ int do_hello_world( const char *printername, const char *printerargs, const char
/* usual rendering stuff..... */
- sprintf(fontname, "-*-*-*-*-*-*-*-180-%ld-%ld-*-*-iso8859-1", context->document_dpi, context->document_dpi);
+ sprintf(fontname, "-*-*-*-*-*-*-*-180-%ld-%ld-*-*-iso8859-1", context->document_dpi_x, context->document_dpi_y);
font = XLoadQueryFont(context->pdpy, fontname);
XSetFont(context->pdpy, pgc, font->fid);
if (!hello_world_message)
diff --git a/xpsimplehelloworld/xpsimplehelloworld.c b/xpsimplehelloworld/xpsimplehelloworld.c
index 064894c..79bdb48 100644
--- a/xpsimplehelloworld/xpsimplehelloworld.c
+++ b/xpsimplehelloworld/xpsimplehelloworld.c
@@ -87,7 +87,8 @@ int do_hello_world(const char *printername, const char *printerfile, const char
void *printtofile_handle; /* "context" when printing to file */
int xp_event_base, /* XpExtension even base */
xp_error_base; /* XpExtension error base */
- long dpi;
+ long dpi_x = 0L,
+ dpi_y = 0L;
Screen *pscreen;
int pscreennumber;
Window pwin;
@@ -131,7 +132,7 @@ int do_hello_world(const char *printername, const char *printerfile, const char
XpSetContext(pdpy, pcontext);
/* Get default printer reolution */
- if( XpuGetResolution(pdpy, pcontext, &dpi) != 1 )
+ if( XpuGetResolution(pdpy, pcontext, &dpi_x, &dpi_y) != 1 )
{
fprintf(stderr, "No default resolution for printer '%s'.\n", printername);
XpuClosePrinterDisplay(pdpy, pcontext);
@@ -199,7 +200,7 @@ int do_hello_world(const char *printername, const char *printerfile, const char
/* usual rendering stuff..... */
- sprintf(fontname, "-*-*-*-*-*-*-*-180-%ld-%ld-*-*-iso8859-1", dpi, dpi);
+ sprintf(fontname, "-*-*-*-*-*-*-*-180-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y);
font = XLoadQueryFont(pdpy, fontname);
XSetFont(pdpy, pgc, font->fid);
XDrawString(pdpy, pwin, pgc, 100, 100, "hello world from X11 print system", 33);
diff --git a/xpxmhelloworld/xpxmhelloworld.c b/xpxmhelloworld/xpxmhelloworld.c
index 608c385..e142fc1 100644
--- a/xpxmhelloworld/xpxmhelloworld.c
+++ b/xpxmhelloworld/xpxmhelloworld.c
@@ -269,7 +269,8 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
shell,
print_shell,
hello;
- long dpi;
+ long dpi_x = 0L,
+ dpi_y = 0L;
char fontname[256]; /* BUG: is this really big enougth ? */
XFontStruct *textFont;
XmFontList textFontList;
@@ -293,7 +294,7 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
XpSetContext(pdpy, pcontext);
/* Get default printer resolution */
- if( XpuGetResolution(pdpy, pcontext, &dpi) != 1 )
+ if( XpuGetResolution(pdpy, pcontext, &dpi_x, &dpi_y) != 1 )
{
fprintf(stderr, "No default resolution for printer '%s'\n", printername);
XpuClosePrinterDisplay(pdpy, pcontext);
@@ -308,7 +309,7 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
if( !pdpy )
Error(("XOpenDisplay failure.\n"));
- dpi = 0;
+ dpi_x = dpi_y = 0L;
pscreen = XDefaultScreenOfDisplay(pdpy);
}
@@ -339,11 +340,11 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
shell = toplevel;
}
- sprintf(fontname, "-adobe-courier-medium-r-normal--40-*-%ld-%ld-*-*-iso8859-1", dpi, dpi);
+ sprintf(fontname, "-adobe-courier-medium-r-normal--40-*-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y);
textFont = XLoadQueryFont(pdpy, fontname);
if( !textFont )
{
- sprintf(fontname, "-*-*-*-*-*-*-*-160-%ld-%ld-*-*-iso8859-1", dpi, dpi);
+ sprintf(fontname, "-*-*-*-*-*-*-*-160-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y);
textFont = XLoadQueryFont(pdpy, fontname);
}
if( !textFont )
diff --git a/xpxthelloworld/xpxthelloworld.c b/xpxthelloworld/xpxthelloworld.c
index 7eeaed2..e631e8a 100644
--- a/xpxthelloworld/xpxthelloworld.c
+++ b/xpxthelloworld/xpxthelloworld.c
@@ -275,7 +275,8 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
XtAppContext app;
Widget toplevel,
hello;
- long dpi;
+ long dpi_x = 0L,
+ dpi_y = 0L;
char fontname[256]; /* BUG: is this really big enougth ? */
XFontStruct *labelFont;
Cardinal n;
@@ -302,7 +303,7 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
XpSetContext(pdpy, pcontext);
/* Get default printer resolution */
- if( XpuGetResolution(pdpy, pcontext, &dpi) != 1 )
+ if( XpuGetResolution(pdpy, pcontext, &dpi_x, &dpi_y) != 1 )
{
fprintf(stderr, "No default resolution for printer '%s'\n", printername);
XpuClosePrinterDisplay(pdpy, pcontext);
@@ -317,7 +318,7 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
if( !pdpy )
Error(("XOpenDisplay failure.\n"));
- dpi = 0;
+ dpi_x = dpi_y = 0L;
pscreen = XDefaultScreenOfDisplay(pdpy);
}
@@ -331,7 +332,7 @@ int do_hello_world( int argc, char *argv[], const char *printername, const char
if( !toplevel )
Error(("xt_xp_openapplication failure.\n"));
- sprintf(fontname, "-*-*-*-*-*-*-*-180-%ld-%ld-*-*-iso8859-1", dpi, dpi);
+ sprintf(fontname, "-*-*-*-*-*-*-*-180-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y);
labelFont = XLoadQueryFont(pdpy, fontname);
if( !labelFont )
Error(("XLoadQueryFont failure.\n"));