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

Linux Cross Reference
Tina6/tina-tools/tinatool/tlbase/tlbaseMcr_tool.c

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

  1 /**********
  2  * 
  3  * Copyright (c) 2003, Division of Imaging Science and Biomedical Engineering,
  4  * University of Manchester, UK.  All rights reserved.
  5  * 
  6  * Redistribution and use in source and binary forms, with or without modification, 
  7  * are permitted provided that the following conditions are met:
  8  * 
  9  *   . Redistributions of source code must retain the above copyright notice, 
 10  *     this list of conditions and the following disclaimer.
 11  *    
 12  *   . Redistributions in binary form must reproduce the above copyright notice,
 13  *     this list of conditions and the following disclaimer in the documentation 
 14  *     and/or other materials provided with the distribution.
 15  * 
 16  *   . Neither the name of the University of Manchester nor the names of its
 17  *     contributors may be used to endorse or promote products derived from this 
 18  *     software without specific prior written permission.
 19  * 
 20  * 
 21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  * POSSIBILITY OF SUCH DAMAGE.
 32  *
 33  **********
 34  * 
 35  * Program :    TINA
 36  * File    :  $Source: /home/tina/cvs/tina-tools/tinatool/tlbase/tlbaseMcr_tool.c,v $
 37  * Date    :  $Date: 2005/02/07 23:29:19 $
 38  * Version :  $Revision: 1.3 $
 39  * CVS Id  :  $Id: tlbaseMcr_tool.c,v 1.3 2005/02/07 23:29:19 paul Exp $
 40  *
 41  * Author  :  Legacy TINA
 42  *
 43  * Notes :
 44  *
 45  *********
 46 */
 47 
 48 #include "tlbaseMcr_tool.h"
 49 
 50 #if HAVE_CONFIG_H
 51 #include <config.h>
 52 #endif
 53 
 54 #include <stdio.h>
 55 #include <tina/sys/sysDef.h>
 56 #include <tina/sys/sysPro.h>
 57 #include <tinatool/wdgts/wdgtsDef.h>
 58 #include <tinatool/wdgts/wdgtsPro.h>
 59 #include <tinatool/tlbase/tlbaseMcr_funcs.h>
 60 
 61 static void *pline = NULL;
 62 static void *ploop_start = NULL;
 63 static void *ploop_end = NULL;
 64 static void *ploop_current = NULL;
 65 static int loop_start=1,loop_current=1,loop_end=10;
 66 
 67 
 68 static void macro_loop_proc()
 69 {
 70      int i;
 71 
 72      tw_iglobal_reset(ploop_start);
 73      tw_iglobal_reset(ploop_end);
 74      for(i = loop_start; i <= loop_end && i >= 0; i++)
 75      {   
 76          loop_current = i;
 77          tw_iglobal_reset(ploop_current);
 78          if(process_macro_proc() == 0) break;
 79      }   
 80 }
 81 
 82 void *get_line_ptr()
 83 {
 84    return(pline);
 85 }
 86 
 87 static void start_line_proc()
 88 {
 89    start_macro_line();
 90    next_macro_line();
 91 }
 92 
 93 static void next_line_proc()
 94 {
 95    next_macro_line();
 96 }
 97 
 98 static void execute_proc()
 99 {
100    execute_macro_line();
101    next_macro_line();
102 }
103 
104 static void process_macro_proc_wrap(void)
105 {
106     /* Addition by PAB: button procs must be of type void 2/2/2005*/
107 
108     process_macro_proc();
109 }
110 
111 void  macro_tool(int x, int y)
112 {
113    static void *tool = NULL;
114 
115    if (tool)
116    {
117       tw_show_tool(tool);
118       return;
119    }
120 
121    tool = tw_tool("Macro Tool", x, y);
122    tw_sglobal("Macro File:", get_macro_file(), 32);
123    tw_help_button("macrotool");
124    tw_newrow();
125    tw_button("append", init_macro_proc,NULL);
126    tw_button("close", save_macro_proc,NULL);
127    tw_button("run", process_macro_proc_wrap, NULL);
128    tw_newrow();
129    pline = (void *)tw_sglobal("line->",get_macro_line(),48);
130    tw_newrow();
131    tw_button("start", start_line_proc,NULL);
132    tw_button("next", next_line_proc,NULL);
133    tw_button("execute", execute_proc,NULL);
134    tw_newrow();
135    ploop_start   = (void *)tw_iglobal("Start :", &loop_start, 5);
136    ploop_end     = (void *)tw_iglobal("End :", &loop_end, 5);
137    tw_button("loop", macro_loop_proc,NULL);
138    ploop_current = (void *)tw_iglobal("Current:", &loop_current,5);
139    tw_newrow();
140    tw_end_tool(); 
141 }
142 

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