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

Linux Cross Reference
Tina4/src/Xv/tw_textsw.c

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

  1 /**@(#)
  2 **/
  3 /**
  4 Tina windows text subwindow:
  5 Only one - belongs to parent tool (a bit like highlander!).
  6 **/
  7 
  8 #include <stdio.h>
  9 #include <math.h>
 10 #include <tina/sys.h>
 11 #include <tina/math.h>
 12 #include <tina/tw.h>
 13 #include <tina/tv.h>
 14 #include <tina/tvfuncs.h>
 15 #include <tina/tv_screen.h>
 16 #include <xview/xview.h>
 17 #include <xview/frame.h>
 18 #include <xview/panel.h>
 19 #include <xview/textsw.h>
 20 #include <xview/font.h>
 21 #include <xview/canvas.h>
 22 #include <xview/cms.h>
 23 #include <xview/xv_xrect.h>
 24 #include <xview/openmenu.h>
 25 #include <tina/Xvfuncs.h>
 26 #include <tina/X11funcs.h>
 27 
 28 
 29 
 30 static Textsw textsw;
 31 
 32 void    textsw_print(char *string)
 33 {
 34     textsw_insert(textsw, string, strlen(string));
 35 }
 36 
 37 void    textsw_print_sw(void* text_subwin, char *string)
 38 {
 39     textsw_insert((Textsw)text_subwin, string, strlen(string));
 40 }
 41 void    tw_textsw_print(void* text_subwin, char *string)
 42 {
 43     textsw_print_sw(text_subwin, string);
 44 }
 45 
 46 /* Create Text subwindow (but don't redirect format's (etc) output to it) */
 47 Textsw  tw_textsubwin(int rows, int cols)
 48 {
 49     Frame   tool = tw_get_tool();
 50     Window  lowest = tw_get_lowest();
 51     Window  panel = (Window) tw_get_panel();
 52 
 53     Textsw textsubwin;
 54 
 55     if (lowest == panel)
 56         window_fit_height(panel);
 57 
 58     textsubwin= xv_create(tool, TEXTSW,
 59                        WIN_BELOW, lowest,
 60                        XV_X, 0,
 61                        XV_HEIGHT, xv_row(tool, rows),
 62                        XV_WIDTH, xv_col(tool, cols),
 63                        XV_FONT, (Xv_font) xv_get(tool, XV_FONT),
 64                        NULL);
 65 
 66     tw_set_width(MAX(tw_get_width(), xv_col(tool, cols)));
 67     tw_set_lowest(textsubwin);
 68 
 69     return (textsubwin);
 70 }
 71 
 72 /* Create Text subwindow AND redirect format's (etc) output to it */
 73 Textsw  tw_textsw(int rows, int cols)
 74 {
 75     textsw = tw_textsubwin(rows, cols);
 76 
 77     message_set_print(textsw_print);
 78     error_set_print(textsw_print);
 79     format_set_print(textsw_print);
 80 
 81     return (textsw);
 82 }
 83 void tw_textsw_clear(void *sw)
 84 {
 85   textsw_reset((int)sw,0,0);
 86 }
 87 

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