Changeset 354
- Timestamp:
- Jan 18, 2004, 5:17:35 AM (19 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/examples/cacaview.c
r352 r354 112 112 while(!quit) 113 113 { 114 int ww = caca_get_width(); 115 int wh = caca_get_height(); 116 114 int ww, wh; 117 115 unsigned int event, new_status = 0, new_help = 0; 118 116 117 ww = caca_get_width(); 118 wh = caca_get_height(); 119 119 120 if(update) 120 event = caca_get_event(CACA_EVENT_KEY_PRESS );121 event = caca_get_event(CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE); 121 122 else 122 event = caca_wait_event(CACA_EVENT_KEY_PRESS );123 event = caca_wait_event(CACA_EVENT_KEY_PRESS | CACA_EVENT_RESIZE); 123 124 124 125 while(event) … … 126 127 unsigned int key = event & 0x00ffffff; 127 128 128 switch(key)129 if(key) switch(key) 129 130 { 130 131 case 'n': … … 232 233 } 233 234 235 if(event == CACA_EVENT_RESIZE) 236 { 237 caca_refresh(); 238 ww = caca_get_width(); 239 wh = caca_get_height(); 240 update = 1; 241 } 242 234 243 if(status || new_status) 235 244 status = new_status; … … 259 268 caca_putstr((ww - strlen(buffer)) / 2, wh / 2, buffer); 260 269 caca_refresh(); 270 ww = caca_get_width(); 271 wh = caca_get_height(); 261 272 262 273 unload_image(); -
libcaca/trunk/src/event.c
r353 r354 274 274 unsigned int w, h; 275 275 276 w = (xevent.xconfigure.width + x11_font_width / 3) 277 / x11_font_width; 276 278 h = (xevent.xconfigure.height + x11_font_height / 3) 277 279 / x11_font_height; 278 w = (xevent.xconfigure.width + x11_font_width / 3)279 / x11_font_width;280 280 281 281 if(w == _caca_width && h == _caca_height) -
libcaca/trunk/src/graphics.c
r353 r354 1321 1321 if(_caca_driver == CACA_DRIVER_X11) 1322 1322 { 1323 Pixmap new_pixmap; 1324 1323 1325 _caca_width = x11_new_width; 1324 1326 _caca_height = x11_new_height; 1325 1327 1326 XFreePixmap(x11_dpy, x11_pixmap);1327 1328 free(x11_char); 1328 1329 free(x11_attr); 1329 1330 1330 x11_pixmap = XCreatePixmap(x11_dpy, x11_window,1331 new_pixmap = XCreatePixmap(x11_dpy, x11_window, 1331 1332 _caca_width * x11_font_width, 1332 1333 _caca_height * x11_font_height, 1333 1334 DefaultDepth(x11_dpy, 1334 1335 DefaultScreen(x11_dpy))); 1336 XCopyArea(x11_dpy, x11_pixmap, new_pixmap, x11_gc, 0, 0, 1337 old_width * x11_font_width, old_height * x11_font_height, 1338 0, 0); 1339 XFreePixmap(x11_dpy, x11_pixmap); 1340 x11_pixmap = new_pixmap; 1341 1335 1342 x11_char = malloc(_caca_width * _caca_height * sizeof(int)); 1336 1343 memset(x11_char, 0, _caca_width * _caca_height * sizeof(int));
Note: See TracChangeset
for help on using the changeset viewer.