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

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

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

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <math.h>
  5 #include <tina/sys.h>
  6 #include <tina/math.h>
  7 #include <tina/tw.h>
  8 #include <tina/tv.h>
  9 #include <tina/tvfuncs.h>
 10 #include <tina/tv_screen.h>
 11 #include <xview/xview.h>
 12 #include <xview/frame.h>
 13 #include <xview/panel.h>
 14 #include <xview/textsw.h>
 15 #include <xview/font.h>
 16 #include <xview/canvas.h>
 17 #include <xview/cms.h>
 18 #include <xview/xv_xrect.h>
 19 #include <xview/openmenu.h>
 20 #include <tina/Xvfuncs.h>
 21 #include <tina/X11funcs.h>
 22 
 23 
 24 
 25 static void sglobal_call(Tw_callback * twc)
 26 {
 27     char   *ptr = (char *) twc->data1;
 28     char   *string = (char *) xv_get(twc->window, PANEL_VALUE);
 29 
 30     (void) strcpy(ptr, string);
 31 }
 32 
 33 static void sglobal_cmnd(Tw_callback * twc, char *args)
 34 {
 35     char   *ptr = (char *) twc->data1;
 36 
 37     (void) sscanf(args, "%*s %s", ptr);
 38     xv_set(twc->window, PANEL_VALUE, ptr, NULL);
 39 }
 40 
 41 static void sglobal_prnt(FILE * fp, Tw_callback * twc)
 42 {
 43     char   *ptr = (char *) twc->data1;
 44 
 45     (void) fprintf(fp, "%s %s\n", twc->name, ptr);
 46 }
 47 
 48 Tw_callback *tw_sglobal(char *name, char *ptr, int nchars)
 49 {
 50     Panel_item text;
 51     Panel   panel = tw_get_panel();
 52     Bool    newrow = tw_get_newrow();
 53     int     row;
 54     Tw_callback *twc;
 55     char   *fullname = tw_extend_fullname(tw_get_toolname(), name);
 56 
 57     text = xv_create(panel, PANEL_TEXT,
 58                      PANEL_LABEL_STRING, name,
 59                      PANEL_VALUE_DISPLAY_LENGTH, nchars,
 60                      PANEL_VALUE, ptr,
 61                      PANEL_NOTIFY_LEVEL, PANEL_ALL,
 62                      NULL);
 63 
 64     twc = tw_callback_make(fullname, text,
 65                            sglobal_call, sglobal_cmnd, sglobal_prnt, (void (*) ()) NULL, (void *) ptr,
 66                            NULL);
 67 
 68     xv_set(text,
 69            PANEL_NOTIFY_PROC, tw_text_callback,
 70            PANEL_CLIENT_DATA, twc,
 71            NULL);
 72 
 73     if (newrow)
 74     {
 75         row = tw_get_row();
 76         xv_set(text,
 77                XV_X, xv_col(panel, 0),
 78                XV_Y, xv_row(panel, row),
 79                NULL);
 80         tw_set_newrow(false);
 81     }
 82     return (twc);
 83 }
 84 
 85 void    tw_sglobal_reset(Tw_callback * twc)
 86 {
 87     char   *string;
 88 
 89     if (twc == NULL)
 90         return;
 91     string = (char *) twc->data1;
 92     xv_set(twc->window, PANEL_VALUE, string, NULL);
 93 }
 94 

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