00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #include "drawTv_activity.h"
00048
00049 #if HAVE_CONFIG_H
00050 #include <config.h>
00051 #endif
00052
00053 #include <tina/sys/sysDef.h>
00054 #include <tina/sys/sysPro.h>
00055 #include <tina/math/mathDef.h>
00056 #include <tinatool/draw/draw_TvDef.h>
00057 #include <tinatool/draw/draw_TvPro.h>
00058
00059 int tv_set_activity(Tv * tv, int activity)
00060 {
00061 extern void tv_screen_set_activity_cursor();
00062 int oldactivity = 0;
00063
00064 if (tv)
00065 {
00066 oldactivity = tv->activity;
00067 tv->activity = activity;
00068 (void) tv_set_activity_message(tv);
00069 if (tv->tv_screen)
00070 {
00071 tv_screen_set_activity_cursor(tv->tv_screen, activity);
00072 }
00073 }
00074 return (oldactivity);
00075 }
00076
00077 void tv_set_activity_message(Tv * tv)
00078 {
00079 if (tv == NULL)
00080 return;
00081
00082 switch (tv->activity)
00083 {
00084 case ZOOM:
00085 switch (tv->zoomlevel)
00086 {
00087 case IMZOOM:
00088 tv_set_message(tv, "imzoom : shift / scale / roi");
00089 break;
00090 case ZOOM2:
00091 tv_set_message(tv, "zoom2D : shift / scale-rot2D / null");
00092 break;
00093 }
00094 break;
00095 case ROI:
00096 tv_set_message(tv, "rect : define / show / null");
00097 break;
00098 case POLYROI:
00099 tv_set_message(tv, "poly : next / end (show) / restart");
00100 break;
00101 case POINT:
00102 tv_set_message(tv, "point : move / delete / add");
00103 break;
00104 case GLOBAL:
00105 tv_set_message(tv, "global : trans / scale / rotate");
00106 break;
00107 case PICK:
00108 {
00109 char *name = tv->pick.name;
00110 char string[512];
00111
00112 (void) string_append(string,
00113 "pick : choose / ", name, " / cancel",
00114 NULL);
00115 tv_set_message(tv, string);
00116 }
00117 break;
00118 case MOUSE:
00119 {
00120 Tv_mouse *mouse = &tv->mouse;
00121 char string[512];
00122
00123 (void) string_append(string,
00124 mouse->name, " : ",
00125 mouse->left_name, " / ",
00126 mouse->middle_name, " / ",
00127 mouse->right_name, NULL);
00128 tv_set_message(tv, string);
00129 }
00130 break;
00131 case 0:
00132 default:
00133 tv_set_message(tv, "null");
00134 }
00135 }
00136
00137
00138
00139
00140
00141
00142 void tv_activity_proc(Tv * tv, int state, Ipos pos)
00143 {
00144 switch (tv->activity)
00145 {
00146 case 0:
00147 return;
00148 case ZOOM:
00149 tv_zoom_proc(tv, state, pos);
00150 break;
00151 case ROI:
00152 tv_roi_proc(tv, state, pos);
00153 break;
00154 case POLYROI:
00155 tv_polyroi_proc(tv, state, pos);
00156 break;
00157 case POINT:
00158 tv_roipnt_proc(tv, state, pos);
00159 break;
00160 case GLOBAL:
00161 tv_roigbl_proc(tv, state, pos);
00162 break;
00163 case PICK:
00164 tv_pick_proc(tv, state, pos);
00165 break;
00166 case MOUSE:
00167 tv_mouse_proc(tv, state, pos);
00168 break;
00169 }
00170 }