mappix/mappix.h

133 lines
3.2 KiB
C

/*
* mappix
*
* Copyright (C) 2006 Nils Faerber <nils.faerber@kernelconcepts.de>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _MAPPIX_H
#define _MAPPIX_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <glib.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <libintl.h>
#include <locale.h>
#include <math.h>
#ifdef HILDON
#include <hildon-widgets/hildon-app.h>
#include <hildon-widgets/hildon-appview.h>
#include <hildon-widgets/gtk-infoprint.h>
#include <libosso.h>
#define APP_NAME "mappix"
#define APP_VER "0.1-1"
#define OSSO_SERVICE_NAME "mappix"
#endif
#include "trackdata.h"
/* what are we doing right now? */
typedef enum {
MAPPIX_TOOL_NONE,
MAPPIX_TOOL_ZOOM_REGION,
MAPPIX_TOOL_SELECT_REGION,
MAPPIX_TOOL_MOVE,
MAPPIX_TOOL_SELECT_TRACKPOINT,
MAPPIX_TOOL_MOVE_TRACKPOINT
} MappixToolmode;
typedef enum {
MARKER_TYPE_NONE,
MARKER_TYPE_FILLED_SQUARE,
MARKER_TYPE_SQUARE,
MARKER_TYPE_CROSS,
MARKER_SELECTED = 0x80
} MappixMarkerType;
// to avoid globals we pass around a monster-struct
typedef struct {
GtkWidget *mainwin;
#ifdef HILDON
HildonApp *hildon_app;
HildonAppView *hildon_mainview;
#endif
GdkCursor *cursor_normal, *cursor_mover, *cursor_crosshair, *cursor_hand, *cursor_select;
GtkWidget *track_treeview;
GtkWidget *drawarea;
GdkGC *red_gc;
GdkGC *blue_gc;
GdkGC *select_gc;
GdkPixmap *mappix;
GdkPixmap *mappix_blank;
GtkWidget *statbar;
GtkRadioToolButton *zoom_area_toggle_button, *move_toggle_button;
gint linewidth;
MappixMarkerType marker_type; // 0=no marker, 1=filled square, 2=non-filled square, 3=cross
gint marker_size;
gboolean show_marker;
guint lstatid; // ID of last statusbar message
gint canvas_x;
gint canvas_y;
double xscale;
double yscale;
double scale;
gint xoffset;
gint yoffset;
guint pointer_x, pointer_y; // scaled coordinates
guint mouse_x, mouse_y; // unscaled coordinates
guint mouse_px, mouse_py; // unscaled coordinates of last mouse button press
gint xmin, xmax;
gint ymin, ymax;
MappixToolmode toolmode;
gboolean modified;
gboolean use_idledraw;
gboolean draw_idle_active; // we redraw the tracks in idle loop
// gboolean use_ellipse_projection;
gboolean draw_selection;
gboolean move_selection;
GList *tracklist;
GList *waypoints;
GList *cities;
gboolean show_waypoints;
gboolean show_cities;
gboolean show_scale;
} mapwin;
#include "mappix-ui.h"
#include "mappix-trackdraw.h"
#include "mappix-trackedit.h"
#include "mappix-gpxreader.h"
#include "mappix-trackrecord.h"
#include "mappix-fileio.h"
#include "mappix-waypoints.h"
#ifdef __cplusplus
}
#endif
#endif /* _MAPPIX_H */