Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(985)

Unified Diff: src/cmd/devdraw/devdraw.c

Issue 6856091: code review 6856091: devdraw, libdraw: add display->dpi (Closed)
Patch Set: diff -r b317fb6e7e19 https://code.google.com/p/plan9port Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/devdraw/devdraw.h ('k') | src/libdraw/init.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/devdraw/devdraw.c
===================================================================
--- a/src/cmd/devdraw/devdraw.c
+++ b/src/cmd/devdraw/devdraw.c
@@ -11,6 +11,7 @@
#include "devdraw.h"
extern void _flushmemscreen(Rectangle);
+int displaydpi = 100;
#define NHASH (1<<5)
#define HASHMASK (NHASH-1)
@@ -776,6 +777,7 @@
DName *dn;
DScreen *dscrn;
FChar *fc;
+ Fmt fmt;
Memimage *dst, *i, *l, **lp, *mask, *src;
Memscreen *scrn;
Point p, *pp, q, sp;
@@ -1083,7 +1085,31 @@
memmove(client->readdata, ibuf, ni);
client->nreaddata = ni;
client->infoid = -1;
- continue;
+ continue;
+
+ /* query: 'Q' n[1] queryspec[n] */
+ case 'q':
+ if(n < 2)
+ goto Eshortdraw;
+ m = 1+1+a[1];
+ if(n < m)
+ goto Eshortdraw;
+ fmtstrinit(&fmt);
+ for(c=0; c<a[1]; c++) {
+ switch(a[2+c]) {
+ default:
+ err = "unknown query";
+ goto error;
+ case 'd': /* dpi */
+ fmtprint(&fmt, "%11d ", displaydpi);
+ break;
+ }
+ }
+ client->readdata = (uchar*)fmtstrflush(&fmt);
+ if(client->readdata == nil)
+ goto Enomem;
+ client->nreaddata = strlen((char*)client->readdata);
+ continue;
/* load character: 'l' fontid[4] srcid[4] index[2] R[4*4] P[2*4] left[1] width[1] */
case 'l':
« no previous file with comments | « src/cmd/devdraw/devdraw.h ('k') | src/libdraw/init.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b