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

Linux Cross Reference
Tina4/src/tools/dump/dump_tool.c

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

  1 /**@(#)Tool to create Encapsulated PostScript Files
  2  */
  3 #include <tina/sys.h>
  4 #include <tina/math.h>
  5 #include <tina/vision.h>
  6 #include <tina/tv.h>
  7 #include <tina/tvfuncs.h>
  8 #include <tina/toolsfuncs.h>
  9 #include <tina/tw_Xfuncs.h>
 10 
 11 extern void set_epsf_dump_type(Dump_type type);
 12 extern void set_tiff_dump_type(Dump_type type);
 13 extern void tv_screen_epsf_dump(Dump_type type, void *tv_screen, char *filename);
 14 extern void tv_screen_tiff_dump(Dump_type type, void *tv_screen, char *filename);
 15 
 16 static char dump_file[256] = "dump_file";
 17 static Dump_type type = DT_COLOR;
 18 
 19 static void file_choice_proc(int val)
 20 {
 21     switch (val)
 22     {
 23         case 0:
 24         type = DT_BW;
 25         break;
 26     case 1:
 27         type = DT_COLOR;
 28         break;
 29     case 2:
 30         type = DT_ONE_BIT_PER_PIXEL;
 31         break;
 32     default:
 33         error("funny epsf dump type!", warning);
 34         break;
 35     }
 36 }
 37 
 38 static void epsf_dump_proc(void)
 39 {
 40     Tv     *tv = tv_get_next();
 41     char    pathname[256];
 42 
 43     if (tv)
 44     {
 45         (void) string_append(pathname, dump_file, ".eps", NULL);
 46         tv_screen_epsf_dump(type, tv->tv_screen, pathname);
 47     }
 48 }
 49 
 50 static void tiff_dump_proc(void)
 51 {
 52     Tv     *tv = tv_get_next();
 53     char    pathname[256];
 54 
 55 
 56     if (tv)
 57     {
 58         (void) string_append(pathname, dump_file, ".tiff", NULL);
 59         tv_screen_tiff_dump(type, tv->tv_screen, pathname);
 60     }
 61 }
 62 
 63 void    dump_tool(void)
 64 {
 65     static void *tool=NULL;
 66     if (tool) {
 67         tw_show_tool(tool);
 68         return;
 69     }
 70     tool = tw_tool("dump tool", 350, 0);
 71     tw_button("eps", epsf_dump_proc, NULL);
 72     tw_button("tiff", tiff_dump_proc, NULL);
 73     tw_newrow();
 74     tw_sglobal("Filename:", dump_file, 20);
 75     tw_newrow();
 76     tw_choice("Dump Type:", file_choice_proc, 0, "B&W", "colour", "1bpp", NULL);
 77     tw_end_tool();
 78 }
 79 

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