12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- /*
- Copyright (C) 2014 Olivier Marty <olivier.marty.m at gmail.com>
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
- #ifndef H_PRINTER
- #define H_PRINTER
- #include "rich_text.h"
- #include "events.h"
- #include <X11/Xlib.h>
- struct printerEnv
- {
- Display *d;
- int d_fd;
- int s;
- Window w;
- Window w_focused;
- GC gc;
- XFontStruct *fontinfo; // regular
- XFontStruct *fontinfo_i; // italic
- XFontStruct *fontinfo_b; // bold
- XFontStruct *fontinfo_bi; // both
- int maxascent, maxdescent;
- int width, height;
- int padding, gap;
- int root_width, root_height;
- int margin_bottom;
- unsigned long color_background, color_text;
- };
- struct printerEnv printerOpenWindow(char *font, char *font_i, char *font_b,
- char *font_bi);
- void printerCloseWindow(struct printerEnv env);
- // the id are not implemented now
- void printerShow(struct printerEnv *env, struct richText *rt, int id);
- void printerHide(struct printerEnv *env, int id);
- // read next event
- t_event manageEvent(struct printerEnv *env);
- #endif
|