moved input_methods to QEmacsState

qe_register_binding takes ModeDef* and returns status
cosmetic changes in QEDisplay API
added int dpy_init(QEditScreen *s, QEDisplay *dpy, int w, int h);
  copies *dpy (or dummy_dpy if NULL) to QEditScreen and calls method
simplified dpy_init methods and calls
inlined 5 more methods
moved dummy_dpy to display.c and simplified
simplified to_hex
simplified qe_colors array handling
This commit is contained in:
Charlie Gordon 2008-01-11 11:29:28 +00:00
commit 28397f424f
14 changed files with 256 additions and 304 deletions

View file

@ -111,7 +111,6 @@ static QEDisplay ppm_dpy = {
NULL,
ppm_init,
ppm_close,
NULL, /* dpy_cursor_at */
NULL, /* dpy_flush */
NULL, /* dpy_is_user_input_pending */
NULL, /* dpy_fill_rectangle */
@ -123,6 +122,7 @@ static QEDisplay ppm_dpy = {
NULL, /* dpy_selection_activate */
NULL, /* dpy_selection_request */
NULL, /* dpy_invalidate */
NULL, /* dpy_cursor_at */
NULL, /* dpy_bmp_alloc */
NULL, /* dpy_bmp_free */
NULL, /* dpy_bmp_draw */
@ -156,8 +156,6 @@ static int ppm_init(QEditScreen *s, int w, int h)
{
CFBContext *cfb;
memcpy(&s->dpy, &ppm_dpy, sizeof(QEDisplay));
cfb = qe_malloc(CFBContext);
if (!cfb)
return -1;
@ -430,7 +428,6 @@ static void help(void)
int main(int argc, char **argv)
{
QEDisplay *dpy;
QEditScreen screen1, *screen = &screen1;
int page_width, c, strict_xml, flags;
const char *outfilename, *infilename;
@ -485,8 +482,7 @@ int main(int argc, char **argv)
infilename = argv[optind];
/* init display driver with dummy height */
dpy = &ppm_dpy;
if (dpy->dpy_init(screen, page_width, 1) < 0) {
if (dpy_init(screen, &ppm_dpy, page_width, 1) < 0) {
fprintf(stderr, "Could not init display driver\n");
exit(1);
}
@ -508,6 +504,6 @@ int main(int argc, char **argv)
#endif
/* close screen */
screen->dpy.dpy_close(screen);
dpy_close(screen);
return 0;
}