return FALSE;
}
+GtkWidget *hildon_note_new_confirmation(GtkWidget *widget, const gchar *text)
+{
+return gtk_message_dialog_new(widget,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK_CANCEL, text);
+}
+
void hildon_banner_show_information(GtkWidget *w, void *t, gchar *text)
{
gtk_statusbar_pop(GTK_STATUSBAR(_status_bar), 0);
_sb_sid=g_timeout_add(6000, status_bar_clear, NULL);
}
-GtkWidget *hildon_banner_show_progress(GtkWidget * widget, GtkProgressBar *bar,
- const gchar * text)
+GtkWidget *hildon_banner_show_progress(GtkWidget * widget, GtkProgressBar *bar, const gchar * text)
{
gtk_widget_show(_progress_item);
gtk_progress_bar_set_text(_progress_item, text);
return NULL;
}
-GtkWidget *hildon_note_new_confirmation(GtkWidget *widget, const gchar *text)
-{
-return gtk_message_dialog_new(widget,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK_CANCEL, text);
-}
-
void hildon_banner_set_fraction(GtkWidget * widget, gdouble fraction)
{
gtk_progress_bar_set_fraction(_progress_item, fraction);
gtk_widget_show(_progress_item);
}
-GtkWidget *hildon_banner_show_animation(GtkWidget *widget,
- const gchar *animation_name,
- const gchar *text)
+GtkWidget *hildon_banner_show_animation(GtkWidget *widget, const gchar *animation_name, const gchar *text)
{
hildon_banner_show_information(_status_bar, NULL, text);
gtk_widget_show(_progress_item);
void
map_force_redraw()
{
- guint new_x, new_y;
- printf("%s()\n", __PRETTY_FUNCTION__);
-
- for (new_y = 0; new_y < BUF_HEIGHT_TILES; ++new_y)
- for (new_x = 0; new_x < BUF_WIDTH_TILES; ++new_x) {
- map_render_tile(_base_tilex + new_x,
- _base_tiley + new_y,
- new_x * TILE_SIZE_PIXELS,
- new_y * TILE_SIZE_PIXELS, FALSE);
- }
- map_render_data();
- MACRO_QUEUE_DRAW_AREA();
+guint new_x, new_y;
- vprintf("%s(): return\n", __PRETTY_FUNCTION__);
+for (new_y = 0; new_y < BUF_HEIGHT_TILES; ++new_y)
+ for (new_x = 0; new_x < BUF_WIDTH_TILES; ++new_x) {
+ map_render_tile(_base_tilex + new_x,
+ _base_tiley + new_y,
+ new_x * TILE_SIZE_PIXELS,
+ new_y * TILE_SIZE_PIXELS, FALSE);
+ }
+map_render_data();
+MACRO_QUEUE_DRAW_AREA();
}
/**
void
map_set_zoom(guint new_zoom)
{
- printf("%s(%d)\n", __PRETTY_FUNCTION__, _zoom);
-
- /* Note that, since new_zoom is a guint and MIN_ZOOM is 0, this if
- * condition also checks for new_zoom >= MIN_ZOOM. */
- if (new_zoom > (MAX_ZOOM - 1))
- return;
- if (new_zoom == _zoom)
- return;
-
- _zoom = new_zoom / _curr_repo->view_zoom_steps
- * _curr_repo->view_zoom_steps;
- _world_size_tiles = unit2tile(WORLD_SIZE_UNITS);
-
- /* If we're leading, update the center to reflect new zoom level. */
- MACRO_RECALC_CENTER(_center.unitx, _center.unity);
+/* Note that, since new_zoom is a guint and MIN_ZOOM is 0, this if
+ * condition also checks for new_zoom >= MIN_ZOOM. */
+if (new_zoom > (MAX_ZOOM - 1))
+ return;
+if (new_zoom == _zoom)
+ return;
- /* Update center bounds to reflect new zoom level. */
- _min_center.unitx = pixel2unit(grid2pixel(_screen_grids_halfwidth));
- _min_center.unity = pixel2unit(grid2pixel(_screen_grids_halfheight));
- _max_center.unitx = WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfwidth) - 1;
- _max_center.unity = WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfheight) - 1;
+_zoom = new_zoom / _curr_repo->view_zoom_steps * _curr_repo->view_zoom_steps;
+_world_size_tiles = unit2tile(WORLD_SIZE_UNITS);
- BOUND(_center.unitx, _min_center.unitx, _max_center.unitx);
- BOUND(_center.unity, _min_center.unity, _max_center.unity);
+/* If we're leading, update the center to reflect new zoom level. */
+MACRO_RECALC_CENTER(_center.unitx, _center.unity);
- _base_tilex = grid2tile((gint) pixel2grid((gint) unit2pixel((gint) _center.unitx))
- - (gint) _screen_grids_halfwidth);
- _base_tiley = grid2tile(pixel2grid(unit2pixel(_center.unity))
- - _screen_grids_halfheight);
+/* Update center bounds to reflect new zoom level. */
+_min_center.unitx = pixel2unit(grid2pixel(_screen_grids_halfwidth));
+_min_center.unity = pixel2unit(grid2pixel(_screen_grids_halfheight));
+_max_center.unitx = WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfwidth) - 1;
+_max_center.unity = WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfheight) - 1;
- /* New zoom level, so we can't reuse the old buffer's pixels. */
+BOUND(_center.unitx, _min_center.unitx, _max_center.unitx);
+BOUND(_center.unity, _min_center.unity, _max_center.unity);
- /* Update state variables. */
- MACRO_RECALC_OFFSET();
- MACRO_RECALC_FOCUS_BASE();
- MACRO_RECALC_FOCUS_SIZE();
+_base_tilex = grid2tile((gint) pixel2grid((gint) unit2pixel((gint) _center.unitx))
+ - (gint) _screen_grids_halfwidth);
+_base_tiley = grid2tile(pixel2grid(unit2pixel(_center.unity))
+ - _screen_grids_halfheight);
- map_set_mark();
- map_force_redraw();
+/* New zoom level, so we can't reuse the old buffer's pixels. */
+/* Update state variables. */
+MACRO_RECALC_OFFSET();
+MACRO_RECALC_FOCUS_BASE();
+MACRO_RECALC_FOCUS_SIZE();
- vprintf("%s(): return\n", __PRETTY_FUNCTION__);
+map_set_mark();
+map_force_redraw();
}
/**
gint new_base_tilex, new_base_tiley;
guint new_x, new_y;
guint j, k, base_new_x, base_old_x, old_x, old_y, iox, ioy;
-g_printf("%s(%d, %d)\n", __PRETTY_FUNCTION__, new_center_unitx, new_center_unity);
/* Assure that _center.unitx/y are bounded. */
BOUND(new_center_unitx, _min_center.unitx, _max_center.unitx);