]> Pileus Git - grits/blobdiff - src/aweather-view.c
* Road plan (HACKING)
[grits] / src / aweather-view.c
index 8857bc5128cf4343ce3cd50ac556c41189aab5bd..2f240a73d4bd0f059605b445d1b3c7d5d8c877bd 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
+ * 
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
 #include <glib.h>
 
 #include "aweather-view.h"
@@ -13,6 +30,7 @@ enum {
 enum {
        SIG_TIME_CHANGED,
        SIG_LOCATION_CHANGED,
+       SIG_REFRESH,
        NUM_SIGNALS,
 };
 
@@ -117,6 +135,16 @@ static void aweather_view_class_init(AWeatherViewClass *klass)
                        G_TYPE_NONE,
                        1,
                        G_TYPE_STRING);
+       signals[SIG_REFRESH] = g_signal_new(
+                       "refresh",
+                       G_TYPE_FROM_CLASS(gobject_class),
+                       G_SIGNAL_RUN_LAST,
+                       0,
+                       NULL,
+                       NULL,
+                       g_cclosure_marshal_VOID__VOID,
+                       G_TYPE_NONE,
+                       0);
 
 }
 
@@ -131,6 +159,7 @@ void aweather_view_set_time(AWeatherView *view, const char *time)
 {
        g_assert(AWEATHER_IS_VIEW(view));
        //g_message("aweather_view:set_time: setting time to %s", time);
+       g_free(view->time);
        view->time = g_strdup(time);
        g_signal_emit(view, signals[SIG_TIME_CHANGED], 0, time);
 }
@@ -157,3 +186,19 @@ gchar *aweather_view_get_location(AWeatherView *view)
        //g_message("aweather_view_get_location");
        return view->location;
 }
+
+void aweather_view_refresh(AWeatherView *view)
+{
+       g_message("aweather_view_refresh: ..");
+       g_signal_emit(view, signals[SIG_REFRESH], 0);
+}
+
+void aweather_view_zoomin(AWeatherView *view)
+{
+       g_message("aweather_view_zoomin: ..");
+}
+
+void aweather_view_zoomout(AWeatherView *view)
+{
+       g_message("aweather_view_zoomout: ..");
+}