00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef INCL_LOCATOR
00026 #define INCL_LOCATOR
00027
00028
00029
00030
00031 class Locator
00032 {
00033 GtkWidget *win;
00034 GtkWidget *draw;
00035 GdkGC *drawgc;
00036 GtkAdjustment *hadj, *vadj;
00037 int tx, ty, txs, tys, scale;
00038 GdkRectangle viewbox;
00039 bool dragging;
00040 int drag_relx, drag_rely;
00041 int send_location_timer;
00042 void send_location();
00043 void query_location();
00044 static gint delayed_send_location(gpointer data);
00045
00046 void goto_mouse(int mx, int my, bool delay_send = false);
00047 public:
00048 Locator();
00049 ~Locator();
00050 void show(bool tf);
00051
00052 void configure(GtkWidget *widget);
00053 void render(GdkRectangle *area = 0);
00054
00055 void view_changed(unsigned char *data, int datalen);
00056
00057 static void vscrolled(GtkAdjustment *adj, gpointer data);
00058 static void hscrolled(GtkAdjustment *adj, gpointer data);
00059
00060 gint mouse_press(GdkEventButton *event);
00061 gint mouse_release(GdkEventButton *event);
00062 gint mouse_motion(GdkEventMotion *event);
00063 };
00064
00065 #endif