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

Linux Cross Reference
Tina4/src/tv/tv_activity.c

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

  1 /** @(#)mouse activity of a tv
  2  **/
  3 #include <tina/sys.h>
  4 #include <tina/sysfuncs.h>
  5 #include <tina/math.h>
  6 #include <tina/tv.h>
  7 #include <tina/tvfuncs.h>
  8 
  9 int tv_set_activity(Tv * tv, int activity)
 10 {
 11   extern void tv_screen_set_activity_cursor();
 12   int oldactivity = 0;
 13 
 14   if (tv)
 15   {
 16     oldactivity = tv->activity;
 17     tv->activity = activity;
 18     (void) tv_set_activity_message(tv);
 19     if (tv->tv_screen)
 20     {
 21       tv_screen_set_activity_cursor(tv->tv_screen, activity);
 22     }
 23   }
 24   return (oldactivity);
 25 }
 26 
 27 void tv_set_activity_message(Tv * tv)
 28 {
 29   if (tv == NULL)
 30     return;
 31 
 32   switch (tv->activity)
 33   {
 34   case ZOOM:
 35     switch (tv->zoomlevel)
 36     {
 37     case IMZOOM:
 38       tv_set_message(tv, "imzoom : shift / scale / roi");
 39       break;
 40     case ZOOM2:
 41       tv_set_message(tv, "zoom2D : shift / scale-rot2D / null");
 42       break;
 43     }
 44     break;
 45   case ROI:
 46     tv_set_message(tv, "rect : define / show / null");
 47     break;
 48   case POLYROI:
 49     tv_set_message(tv, "poly : next / end (show) / restart");
 50     break;
 51   case POINT:
 52     tv_set_message(tv, "point : move / delete / add");
 53     break;
 54   case GLOBAL:
 55     tv_set_message(tv, "global : trans / scale / rotate");
 56     break;
 57   case PICK:
 58     {
 59       char *name = tv->pick.name;
 60       char string[512];
 61 
 62       (void) string_append(string,
 63                            "pick : choose / ", name, " / cancel",
 64                            NULL);
 65       tv_set_message(tv, string);
 66     }
 67     break;
 68   case MOUSE:
 69     {
 70       Tv_mouse *mouse = &tv->mouse;
 71       char string[512];
 72 
 73       (void) string_append(string,
 74                            mouse->name, " : ",
 75                            mouse->left_name, " / ",
 76                            mouse->middle_name, " / ",
 77                            mouse->right_name, NULL);
 78       tv_set_message(tv, string);
 79     }
 80     break;
 81   case NULL:
 82   default:
 83     tv_set_message(tv, "null");
 84   }
 85 }
 86 
 87 /*
 88  * Handle mouse events (not keyboard) in screen.  Meaning of an event
 89  * * (eg mouse SELECT) depends on the tv->activity (zoom, roi, pick
 90  * * mouse). 
 91  */
 92 void tv_activity_proc(Tv * tv, int state, Ipos pos)
 93 {
 94   switch (tv->activity)
 95   {
 96   case NULL:
 97     return;
 98   case ZOOM:
 99     tv_zoom_proc(tv, state, pos);
100     break;
101   case ROI:
102     tv_roi_proc(tv, state, pos);
103     break;
104   case POLYROI:
105     tv_polyroi_proc(tv, state, pos);
106     break;
107   case POINT:
108     tv_roipnt_proc(tv, state, pos);
109     break;
110   case GLOBAL:
111     tv_roigbl_proc(tv, state, pos);
112     break;
113   case PICK:
114     tv_pick_proc(tv, state, pos);
115     break;
116   case MOUSE:
117     tv_mouse_proc(tv, state, pos);
118     break;
119   }
120 }
121 

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