~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/X11/size.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #include <tina/sys.h>
  4 #include <tina/sysfuncs.h>
  5 #include <tina/math.h>
  6 #include <tina/tv.h>
  7 #include <tina/tv_screen.h>
  8 
  9 extern int tv_screen_check_width(Tv_screen * tv_screen);
 10 extern int tv_screen_check_height(Tv_screen * tv_screen);
 11 
 12 /** size Tv_screen thinks it is **/
 13 
 14 int     tv_screen_get_width(Tv_screen * tv_screen)
 15 {
 16     return (tv_screen->width);
 17 }
 18 
 19 void    tv_screen_set_width(Tv_screen * tv_screen, int width)
 20 {
 21     tv_screen->width = width;
 22 }
 23 
 24 int     tv_screen_get_height(Tv_screen * tv_screen)
 25 {
 26     return (tv_screen->height);
 27 }
 28 
 29 void    tv_screen_set_height(Tv_screen * tv_screen, int height)
 30 {
 31     tv_screen->height = height;
 32 }
 33 
 34 int     tv_screen_get_depth(Tv_screen * tv_screen)
 35 {
 36     return (tv_screen->depth);
 37 }
 38 
 39 int     tv_screen_check_depth(Tv_screen * tv_screen)
 40 {
 41     Dimension depth;
 42 
 43     depth = DefaultDepth(tv_screen->display, DefaultScreen(tv_screen->display));
 44     return ((int) depth);
 45 }
 46 
 47 /**  make sizes agree **/
 48 
 49 void    tv_screen_save_size(Tv_screen * tv_screen)
 50 {
 51     if (tv_screen == NULL)
 52         return;
 53 
 54     tv_screen->width = tv_screen_check_width(tv_screen);
 55     tv_screen->height = tv_screen_check_height(tv_screen);
 56     tv_screen->depth = tv_screen_check_depth(tv_screen);
 57 }
 58 
 59 /** debugging aid **/
 60 
 61 void    size_format(Tv_screen * tv_screen)
 62 {
 63     int     width, height, depth;
 64 
 65     width = tv_screen->width;
 66     height = tv_screen->height;
 67     depth = tv_screen->depth;
 68     format("tv_screen get size   :  %d x %d x %d\n", width, height, depth);
 69 
 70     width = tv_screen_check_width(tv_screen);
 71     height = tv_screen_check_height(tv_screen);
 72     depth = tv_screen_check_depth(tv_screen);
 73     format("tv_screen check size :  %d x %d x %d\n", width, height, depth);
 74 }
 75 
 76 
 77 /* Get the height of a tv_screen (X window) */
 78 int     tv_screen_check_height(Tv_screen * tv_screen)
 79 {
 80     XWindowAttributes attribs;
 81 
 82     if (tv_screen)
 83         XGetWindowAttributes(tv_screen->display, tv_screen->window, &attribs);
 84 
 85     return attribs.height;
 86 }
 87 
 88 
 89 /* Get the width of a tv_screen (X window) */
 90 int     tv_screen_check_width(Tv_screen * tv_screen)
 91 {
 92     XWindowAttributes attribs;
 93 
 94     if (tv_screen)
 95         XGetWindowAttributes(tv_screen->display, tv_screen->window, &attribs);
 96 
 97     return attribs.width;
 98 }
 99 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.