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

Linux Cross Reference
Tina4/src/Xv/tw_sv_btn.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 char name[] = "Save";
 26 static void (*func) () = tw_close_call_file;
 27 
 28 static void button_call(Tw_callback * twc)
 29 {
 30     (*twc->func) (twc->data1);
 31 }
 32 
 33 /* ARGSUSED quieten lint */
 34 static void button_cmnd(Tw_callback * twc)
 35 {
 36 }
 37 
 38 /* ARGSUSED quieten lint */
 39 static void button_prnt(FILE * fp, Tw_callback * twc)
 40 {
 41 }
 42 
 43 /* Create a button labeled "save" which allows the user to "save" their
 44  * button presses (etc). The program MUST be called with the "-s"
 45  * (save) flag (eg my_tina -s).  Then the user's session (button
 46  * presses etc) are recorded) and are saved in a file when the user
 47  * presses the save button.  The file is named <program>.cls, eg
 48  * my_tina.cls. The save button only works ONCE. Next time the program
 49  * can be run with the "-r" (replay) flag (eg my_tina -r). This will
 50  * replay all the user's button presses etc, so the screen should look
 51  * like it did when the "save" button was pressed (except that some
 52  * windows may be covered up). You can use both (eg my_tina -r -s).
 53  * 
 54  * Tool positions (x,y of top left corner) are printed in the .cls file.
 55  * The initial positions of tools can be hard coded using these
 56  * co-ordinates. Eg to put StereoTool next to the top level tool: 1.
 57  * Bring up both tools 2. Position as desired 3. Hit save button 4.
 58  * Read postion of StereoTool in .cls file (say (307, 11, 349, 283, 0)
 59  * (349,283) is the tool's width & height, the 0 is a terminator) 5.
 60  * Edit call to StereoTool: stereo_tool(307,11); . */
 61 void    tw_save_button(void)
 62 {
 63     int     row;
 64     Tw_callback *twc;
 65     Panel_item button;
 66     Panel   panel = tw_get_panel();
 67     Bool    newrow = tw_get_newrow();
 68     char   *fullname = tw_extend_fullname(tw_get_toolname(), name);
 69 
 70     button = (Panel_item) xv_create(panel, PANEL_BUTTON,
 71                                     PANEL_LABEL_STRING, name,
 72                                     NULL);
 73     twc = tw_callback_make(fullname, button,
 74              button_call, button_cmnd, button_prnt, func, NULL, NULL);
 75     xv_set(button,
 76            PANEL_NOTIFY_PROC, tw_button_callback,
 77            PANEL_CLIENT_DATA, twc,
 78            NULL);
 79 
 80     if (newrow)
 81     {
 82         row = tw_get_row();
 83         xv_set(button,
 84                XV_X, xv_col(panel, 0),
 85                XV_Y, xv_row(panel, row),
 86                NULL);
 87         tw_set_newrow(false);
 88     }
 89 }
 90 

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