<commit_before>/*
 * Copyright (C) 2008, 2009 Collabora Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Authors: <NAME> <<EMAIL>>
 */

#include <config.h>

#include <sys/stat.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>

#include <champlain/champlain.h>
#include <champlain-gtk/champlain-gtk.h>
#include <clutter-gtk/gtk-clutter-embed.h>
#if HAVE_GEOCLUE
#include <geoclue/geoclue-geocode.h>
#endif
#include <telepathy-glib/util.h>

#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-location.h>

#include <libempathy-gtk/empathy-contact-list-store.h>
#include <libempathy-gtk/empathy-contact-list-view.h>
#include <libempathy-gtk/empathy-presence-chooser.h>
#include <libempathy-gtk/empathy-ui-utils.h>

#include "empathy-map-view.h"

#define DEBUG_FLAG EMPATHY_DEBUG_LOCATION
#include <libempathy/empathy-debug.h>

typedef struct {
  EmpathyContactListStore *list_store;

  GtkWidget *window;
  GtkWidget *zoom_in;
  GtkWidget *zoom_out;
  ChamplainView *map_view;
  ChamplainLayer *layer;
#if HAVE_GEOCLUE
  GeoclueGeocode *geocode;
#endif
} EmpathyMapView;

static void map_view_destroy_cb (GtkWidget *widget,
    EmpathyMapView *window);
static gboolean map_view_contacts_foreach (GtkTreeModel *model,
    GtkTreePath *path,
    GtkTreeIter *iter,
    gpointer user_data);
static void map_view_zoom_in_cb (GtkWidget *widget,
    EmpathyMapView *window);
static void map_view_zoom_out_cb (GtkWidget *widget,
    EmpathyMapView *window);
static void map_view_contact_location_notify (GObject *gobject,
    GParamSpec *arg1,
    gpointer user_data);
static gchar * get_dup_string (GHashTable *location,
    gchar *key);

GtkWidget *
empathy_map_view_show ()
{
  static EmpathyMapView *window = NULL;
  GtkBuilder *gui;
  GtkWidget *sw;
  GtkWidget *embed;
  gchar *filename;
  GtkTreeModel *model;
  EmpathyContactList *list_iface;
  EmpathyContactListStore *list_store;

  if (window)
    {
      empathy_window_present (GTK_WINDOW (window->window), TRUE);
      return window->window;
    }<commit_msg>Fix possible compilation error<commit_after>/*
 * Copyright (C) 2008, 2009 Collabora Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Authors: <NAME> <<EMAIL>>
 */

#include <config.h>

#include <sys/stat.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>

#include <champlain/champlain.h>
#include <champlain-gtk/champlain-gtk.h>
#include <clutter-gtk/gtk-clutter-embed.h>
#if HAVE_GEOCLUE
#include <geoclue/geoclue-geocode.h>
#endif
#include <telepathy-glib/util.h>

#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-location.h>

#include <libempathy-gtk/empathy-contact-list-store.h>
#include <libempathy-gtk/empathy-contact-list-view.h>
#include <libempathy-gtk/empathy-presence-chooser.h>
#include <libempathy-gtk/empathy-ui-utils.h>

#include "empathy-map-view.h"

#define DEBUG_FLAG EMPATHY_DEBUG_LOCATION
#include <libempathy/empathy-debug.h>

typedef struct {
  EmpathyContactListStore *list_store;

  GtkWidget *window;
  GtkWidget *zoom_in;
  GtkWidget *zoom_out;
  ChamplainView *map_view;
  ChamplainLayer *layer;
#if HAVE_GEOCLUE
  GeoclueGeocode *geocode;
#endif
} EmpathyMapView;

static void map_view_destroy_cb (GtkWidget *widget,
    EmpathyMapView *window);
static gboolean map_view_contacts_foreach (GtkTreeModel *model,
    GtkTreePath *path,
    GtkTreeIter *iter,
    gpointer user_data);
static void map_view_zoom_in_cb (GtkWidget *widget,
    EmpathyMapView *window);
static void map_view_zoom_out_cb (GtkWidget *widget,
    EmpathyMapView *window);
static void map_view_contact_location_notify (GObject *gobject,
    GParamSpec *arg1,
    gpointer user_data);
static gchar * get_dup_string (GHashTable *location,
    gchar *key);

GtkWidget *
empathy_map_view_show (void)
{
  static EmpathyMapView *window = NULL;
  GtkBuilder *gui;
  GtkWidget *sw;
  GtkWidget *embed;
  gchar *filename;
  GtkTreeModel *model;
  EmpathyContactList *list_iface;
  EmpathyContactListStore *list_store;

  if (window)
    {
      empathy_window_present (GTK_WINDOW (window->window), TRUE);
      return window->window;
    }
{'fraction_non_alphanumeric': 0.09800106138333628, 'fraction_numerical': 0.008491066690252963, 'mean_word_length': 4.745934959349594, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7184113', 'n_tokens_mistral': 2006, 'n_tokens_neox': 1918, 'n_words': 536}