void winblitsearch() { if (gapp.isediting) { char buf[sizeof(gapp.search) + 50]; sprintf(buf, "Search: %s", gapp.search); windrawrect(&gapp, 0, 0, gapp.winw, 30); windrawstring(&gapp, 10, 20, buf); } }
static void windrawpageno(pdfapp_t *app) { char s[100]; int ret = snprintf(s, 100, "Page %d/%d", gapp.pageno, gapp.pagecount); if (ret >= 0) { isshowingpage = 1; windrawstring(&gapp, s, 10, 20); } }
static void winblitsearch(pdfapp_t *app) { if (gapp.isediting) { char buf[sizeof(gapp.search) + 50]; sprintf(buf, "Search: %s", gapp.search); XSetForeground(xdpy, xgc, WhitePixel(xdpy, xscr)); fillrect(0, 0, gapp.winw, 30); windrawstring(&gapp, 10, 20, buf); } }
static void winblitstatusbar(pdfapp_t *app) { if (gapp.issearching) { char buf[sizeof(gapp.search) + 50]; sprintf(buf, "Search: %s", gapp.search); XSetForeground(xdpy, xgc, WhitePixel(xdpy, xscr)); fillrect(0, 0, gapp.winw, 30); windrawstring(&gapp, 10, 20, buf); } else if (showingmessage) { XSetForeground(xdpy, xgc, WhitePixel(xdpy, xscr)); fillrect(0, 0, gapp.winw, 30); windrawstring(&gapp, 10, 20, message); } else if (showingpage) { char buf[42]; snprintf(buf, sizeof buf, "Page %d/%d", gapp.pageno, gapp.pagecount); windrawstringxor(&gapp, 10, 20, buf); } }