Cleanup rt_overlay_get_position() and use in rt_draw_cb()
[geeqie.git] / src / bar-gps.cc
index b17e006..bce37f2 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
+#include "bar-gps.h"
 
-#ifdef HAVE_LIBCHAMPLAIN
-#ifdef HAVE_LIBCHAMPLAIN_GTK
+#include <cstring>
 
-#include "bar-gps.h"
+#include <cairo.h>
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#include <champlain-gtk/champlain-gtk.h>
+G_GNUC_END_IGNORE_DEPRECATIONS
+#include <champlain/champlain.h>
+#include <clutter-gtk/clutter-gtk.h>
+#include <clutter/clutter.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <pango/pango.h>
+
+#include <config.h>
 
 #include "bar.h"
 #include "compat.h"
 #include "intl.h"
 #include "layout.h"
 #include "main-defines.h"
-#include "menu.h"
 #include "metadata.h"
 #include "misc.h"
 #include "rcfile.h"
 #include "thumb.h"
+#include "typedefs.h"
 #include "ui-menu.h"
 #include "ui-utildlg.h"
 #include "uri-utils.h"
 
-#include <champlain-gtk/champlain-gtk.h>
-#include <champlain/champlain.h>
-#include <clutter-gtk/clutter-gtk.h>
+namespace
+{
+
+constexpr gint THUMB_SIZE = 100;
+constexpr int DIRECTION_SIZE = 300;
+
+} // namespace
 
 #define MARKER_COLOUR 0x00, 0x00, 0xff, 0xff
 #define TEXT_COLOUR 0x00, 0x00, 0x00, 0xff
 #define THUMB_COLOUR 0xff, 0xff, 0xff, 0xff
-#define THUMB_SIZE 100
-
-#define DIRECTION_SIZE 300
 
 /*
  *-------------------------------------------------------------------
@@ -130,7 +142,7 @@ static void bar_pane_gps_close_save_cb(GenericDialog *, gpointer data)
        g_list_free(pgd->geocode_list);
 }
 
- static void bar_pane_gps_dnd_receive(GtkWidget *pane, GdkDragContext *,
+static void bar_pane_gps_dnd_receive(GtkWidget *pane, GdkDragContext *,
                                                                          gint x, gint y,
                                                                          GtkSelectionData *selection_data, guint info,
                                                                          guint, gpointer)
@@ -464,7 +476,7 @@ static gboolean bar_pane_gps_create_markers_cb(gpointer data)
                longitude = metadata_read_GPS_coord(fd, "Xmp.exif.GPSLongitude", 0);
                compass = metadata_read_GPS_direction(fd, "Xmp.exif.GPSImgDirection", 1000);
 
-               if (!(latitude == 0 && longitude == 0))
+               if (latitude != 0 || longitude != 0)
                        {
                        pgd->num_added++;
 
@@ -857,8 +869,7 @@ static void bar_pane_gps_map_centreing(PaneGPSData *pgd)
 
        gd = generic_dialog_new(_("Map centering"),
                                "map_centering", nullptr, TRUE, nullptr, pgd);
-       generic_dialog_add_message(gd, GQ_ICON_DIALOG_INFO,
-                               "Map Centering", message->str, TRUE);
+       generic_dialog_add_message(gd, GQ_ICON_DIALOG_INFO, _("Map Centering"), message->str, TRUE);
        generic_dialog_add_button(gd, GQ_ICON_OK, "OK", nullptr, TRUE);
 
        gtk_widget_show(gd->dialog);
@@ -866,7 +877,7 @@ static void bar_pane_gps_map_centreing(PaneGPSData *pgd)
        g_string_free(message, TRUE);
 }
 
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
 static gboolean bar_pane_gps_map_keypress_cb(GtkWidget *, GdkEventButton *bevent, gpointer data)
 {
 /* @FIXME GTK4 stub */
@@ -971,7 +982,7 @@ GtkWidget *bar_pane_gps_new(const gchar *id, const gchar *title, const gchar *ma
        gtk_container_add(GTK_CONTAINER(frame), vbox);
 
        status = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
-#ifdef HAVE_GTK4
+#if HAVE_GTK4
        slider = gtk_scale_button_new(1, 17, 1, slider_icons);
 #else
        slider = gtk_scale_button_new(GTK_ICON_SIZE_SMALL_TOOLBAR, 1, 17, 1, slider_icons);
@@ -1152,7 +1163,4 @@ void bar_pane_gps_update_from_config(GtkWidget *pane, const gchar **attribute_na
        bar_update_expander(pane);
 }
 
-#endif
-#endif
-
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */