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

Linux Cross Reference
Tina4/src/tools/display/display.c

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

  1 /**@(#)Simple display tv_screen (ie a tv_screen in a window).
  2   **/
  3 
  4 #include <stdio.h>
  5 #include <math.h>
  6 #include <tina/sys.h>
  7 #include <tina/math.h>
  8 #include <tina/tv.h>
  9 
 10 /* EXTERNS */
 11 /* Tv_screen *tv_screen_struct_create (window system specific) */
 12 extern void *tv_screen_struct_create();
 13 extern void tv_screen_set_size();
 14 extern void *tw_tool();
 15 
 16 /* Create a cut down tv_tool whose tv_screen can be installed on a tv
 17  * in the same way as a tv_tool's tv_screen is. Ie a canvas in a window
 18  * frame, in which images can be displayed. Arguments x & y are the
 19  * initial position of the tool on screen. */
 20 void   *display_tool(int x, int y, int width, int height)
 21 {
 22 
 23     static int label = 1;
 24     int     canvas;
 25     int     owner;
 26     void    canvas_upgrade();
 27     void   *tv_screen = tv_screen_struct_create();
 28     char name[64];
 29 
 30     sprintf(name, "Display Tool %d", label++);
 31     owner = (int) tw_tool(name, x, y);
 32     tw_no_panel();
 33     canvas = (int) tw_canvas(width, height);
 34     tw_end_tool();
 35 
 36     canvas_upgrade(canvas, owner, tv_screen);   /* sets screen & visual */
 37 
 38     tv_screen_set_size(tv_screen, width, height);
 39     return (tv_screen);
 40 }
 41 
 42 /*
 43 Create a display and install a tv
 44 */
 45 Tv *display_create(char *label, int xpos, int ypos, int width, int
 46                     height)
 47 {
 48     Tv *tv = NULL;
 49     void *display;
 50  
 51     display = (void *) display_tool(xpos, ypos, width, height);
 52     tv = (Tv *) tv_create(label);
 53     tv_install(tv, display);
 54     tv_reset_color(tv, bkgrnd, 0, 0, 0);
 55     return (tv);
 56 }
 57 

~ [ 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.