[maemo-developers] Fwd: a patch of maemo-mapper(move map)
From: jin lv lvjin237 at gmail.comDate: Fri Mar 30 11:05:59 EEST 2007
- Previous message: Tags based todo application - a call for participation
- Next message: Fwd: a patch of maemo-mapper(support usb gps)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hello!
I write a patch to change the way of moving map . You can use mouse to
drag the map from one point to another point by this patch .
This patch base on maemo-mapper-1.3.1,but you can change it to
appropriate other versions.
I hope you like it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20070330/4502221c/attachment.htm
-------------- next part --------------
--- maemo-mapper.c 2006-12-08 10:48:11.810481424 +0800
+++ ../maemo-mapper.c 2006-12-07 15:28:55.000000000 +0800
@@ -762,10 +762,6 @@
static guint _offsetx = -1;
static guint _offsety = -1;
-static guint press[2]={0,0};
-static guint release[2]={0,0};
-static guint before[2]={0,0};
-
/** CACHED SCREEN INFORMATION THAT IS DEPENDENT ON THE CURRENT VIEW. */
static guint _screen_grids_halfwidth = 0;
@@ -947,8 +943,6 @@
static guint _poi_zoom = 6;
static gboolean _dbconn = FALSE;
-static guint _id=0;
-
/** The singleton auto-route-download data. */
static AutoRouteDownloadData _autoroute_data;
@@ -7122,11 +7116,7 @@
gtk_widget_add_events(_map_widget,
GDK_EXPOSURE_MASK
| GDK_BUTTON_PRESS_MASK
- | GDK_BUTTON_RELEASE_MASK
- | GDK_LEAVE_NOTIFY_MASK
- | GDK_POINTER_MOTION_MASK
- | GDK_POINTER_MOTION_HINT_MASK
- );
+ | GDK_BUTTON_RELEASE_MASK);
osso_hw_set_event_cb(_osso, NULL, osso_cb_hw_state, NULL);
@@ -7787,40 +7777,6 @@
}
static gboolean
-map_follow_move(GtkWidget * widget, GdkEventMotion * event)
-{
- gint xx, yy;
- GdkModifierType state;
-
- if (event->is_hint)
- {
- gdk_window_get_pointer(event->window, &xx, &yy, &state);
- state=event->state;
- }
- else
- {
- xx = event->x;
- yy = event->y;
- state = event->state;
- }
-
- guint unitx,unity;
- guint cx,cy;
- unitx = x2unit((gint)(xx-before[0]));
- unity = y2unit((gint)(yy-before[1]));
- cx=unit2x(_center.unitx);
- cy=unit2y(_center.unity);
-
- map_center_unit(
- x2unit((gint)(cx-(xx-before[0]) )),
- y2unit((gint)(cy-(yy-before[1]) ))
- );
-
- before[0]=xx;
- before[1]=yy;
-}
-
-static gboolean
map_cb_button_press(GtkWidget *widget, GdkEventButton *event)
{
printf("%s()\n", __PRETTY_FUNCTION__);
@@ -7828,21 +7784,6 @@
_cmenu_position_x = event->x + 0.5;
_cmenu_position_y = event->y + 0.5;
- if(event->button==1)
- {
- press[0]=event->x;
- press[1]=event->y;
- before[0]=press[0];
- before[1]=press[1];
-
- if(event->type==GDK_2BUTTON_PRESS||event->type==GDK_3BUTTON_PRESS)
- return FALSE;
-
- _id=g_signal_connect(G_OBJECT(_map_widget), "motion_notify_event",
- G_CALLBACK(map_follow_move), NULL);
- }
-
-
/* Return FALSE to allow context menu to work. */
vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__);
return FALSE;
@@ -7852,11 +7793,6 @@
map_cb_button_release(GtkWidget *widget, GdkEventButton *event)
{
printf("%s()\n", __PRETTY_FUNCTION__);
-
- release[0]=event->x;
- release[1]=event->y;
-
- g_signal_handler_disconnect(G_OBJECT(_map_widget),_id);
#ifdef DEBUG
if(event->button != 1)
@@ -7875,14 +7811,10 @@
if(_center_mode > 0)
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
_menu_ac_none_item), TRUE);
+ map_center_unit(
+ x2unit((gint)(event->x + 0.5)),
+ y2unit((gint)(event->y + 0.5)));
}
-
- press[0]=0;
- press[1]=0;
- release[0]=0;
- release[1]=0;
- before[0]=0;
- before[1]=0;
/* Return FALSE to avoid context menu (if it hasn't popped up already). */
vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__);
- Previous message: Tags based todo application - a call for participation
- Next message: Fwd: a patch of maemo-mapper(support usb gps)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
