tracker r1235 - trunk/src/tracker-applet
- From: asaleem svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1235 - trunk/src/tracker-applet
- Date: Sun, 23 Mar 2008 21:59:17 +0000 (GMT)
Author: asaleem
Date: Sun Mar 23 21:59:16 2008
New Revision: 1235
URL: http://svn.gnome.org/viewvc/tracker?rev=1235&view=rev
Log:
remove more forward declarations
Modified:
trunk/src/tracker-applet/tracker-applet.c
Modified: trunk/src/tracker-applet/tracker-applet.c
==============================================================================
--- trunk/src/tracker-applet/tracker-applet.c (original)
+++ trunk/src/tracker-applet/tracker-applet.c Sun Mar 23 21:59:16 2008
@@ -202,9 +202,6 @@
};
-static void refresh_stats (TrayIcon * icon);
-static inline void start_notice_events (Window window);
-
static gboolean
query_pointer_timeout (Window window)
{
@@ -315,7 +312,6 @@
}
-
static gboolean
can_auto_pause (TrayIcon * icon)
{
@@ -535,61 +531,6 @@
}
-
-static GdkFilterReturn
-filter_x_events (GdkXEvent * xevent, GdkEvent * event, gpointer data)
-{
- XEvent *ev;
-
- ev = xevent;
-
- TrayIcon *icon = data;
-
-
- switch (ev->xany.type) {
- case KeyPress:
- case KeyRelease:
- case ButtonPress:
- case ButtonRelease:
- start_auto_pause_timer (icon);
- break;
-
- case PropertyNotify:
- if (ev->xproperty.atom ==
- gdk_x11_get_xatom_by_name ("_NET_WM_USER_TIME")) {
- start_auto_pause_timer (icon);
- }
- break;
-
- case CreateNotify:
- {
- Window window = ev->xcreatewindow.window;
- start_notice_events (window);
- }
- break;
-
- case MotionNotify:
- if (ev->xmotion.is_hint) {
- /* need to respond to hints so we continue to get events */
- g_timeout_add (1000,
- (GSourceFunc) query_pointer_timeout,
- GINT_TO_POINTER (ev->xmotion.window));
- }
-
- start_auto_pause_timer (icon);
- break;
-
- default:
- break;
- }
-
-
- return GDK_FILTER_CONTINUE;
-
-
-}
-
-
static void
notice_events_inner (Window window, gboolean enable, gboolean top)
{
@@ -709,17 +650,69 @@
}
static inline void
-stop_notice_events (Window window)
+start_notice_events (Window window)
{
- notice_events (window, FALSE);
+ notice_events (window, TRUE);
}
-static inline void
-start_notice_events (Window window)
+static GdkFilterReturn
+filter_x_events (GdkXEvent * xevent, GdkEvent * event, gpointer data)
{
- notice_events (window, TRUE);
+ XEvent *ev;
+
+ ev = xevent;
+
+ TrayIcon *icon = data;
+
+
+ switch (ev->xany.type) {
+ case KeyPress:
+ case KeyRelease:
+ case ButtonPress:
+ case ButtonRelease:
+ start_auto_pause_timer (icon);
+ break;
+
+ case PropertyNotify:
+ if (ev->xproperty.atom ==
+ gdk_x11_get_xatom_by_name ("_NET_WM_USER_TIME")) {
+ start_auto_pause_timer (icon);
+ }
+ break;
+
+ case CreateNotify:
+ {
+ Window window = ev->xcreatewindow.window;
+ start_notice_events (window);
+ }
+ break;
+
+ case MotionNotify:
+ if (ev->xmotion.is_hint) {
+ /* need to respond to hints so we continue to get events */
+ g_timeout_add (1000,
+ (GSourceFunc) query_pointer_timeout,
+ GINT_TO_POINTER (ev->xmotion.window));
+ }
+
+ start_auto_pause_timer (icon);
+ break;
+
+ default:
+ break;
+ }
+
+
+ return GDK_FILTER_CONTINUE;
+
+
}
+static inline void
+stop_notice_events (Window window)
+{
+ notice_events (window, FALSE);
+}
static void
start_watching_events (TrayIcon * icon)
@@ -771,7 +764,6 @@
activate_icon (NULL, NULL);
}
-
static void
pause_menu_toggled (GtkCheckMenuItem * item, gpointer data)
{
@@ -782,8 +774,6 @@
(item)));
}
-
-
static inline void
set_auto_pause_setting (TrayIcon * icon, AutoPauseEnum auto_pause)
{
@@ -997,9 +987,6 @@
}
-
-
-
static void
restart_tracker (GtkDialog * dialog, gint response, TrayIcon * icon)
{
@@ -1024,7 +1011,6 @@
}
}
-
static void
reindex (GtkMenuItem * item, TrayIcon * icon)
{
@@ -1090,6 +1076,82 @@
gtk_widget_destroy (widget);
}
+static gchar *
+get_stat_value (gchar *** stat_array, const gchar * stat)
+{
+ gchar **array;
+ gint i = 0;
+
+ while (stat_array[i][0]) {
+
+ array = stat_array[i];
+
+ if (array[0] && strcasecmp (stat, array[0]) == 0) {
+ return array[1];
+ }
+
+ i++;
+ }
+
+ return NULL;
+}
+
+static void
+update_stats (GPtrArray * array, GError * error, gpointer data)
+{
+ TrayIcon *icon = TRAY_ICON (data);
+ TrayIconPrivate *priv = TRAY_ICON_GET_PRIVATE (icon);
+
+ if (error) {
+ g_warning ("an error has occured: %s", error->message);
+ g_error_free (error);
+ priv->stat_request_pending = FALSE;
+ return;
+ }
+
+ if (!array) {
+ return;
+ }
+
+ guint i = array->len;
+
+
+ if (i < 1 || !priv->stat_window_active) {
+ g_ptr_array_free (array, TRUE);
+ return;
+ }
+
+ gchar ***pdata = (gchar ***) array->pdata;
+
+ for (i = 0; i < 12; i++) {
+ gtk_label_set_text (GTK_LABEL (stat_info[i].stat_label),
+ get_stat_value (pdata,
+ stat_info[i].name));
+ }
+
+ g_ptr_array_free (array, TRUE);
+
+ priv->stat_request_pending = FALSE;
+
+}
+
+static void
+refresh_stats (TrayIcon * icon)
+{
+
+ TrayIconPrivate *priv = TRAY_ICON_GET_PRIVATE (icon);
+
+ if (!priv->stat_window_active || priv->stat_request_pending) {
+ return;
+ }
+
+ priv->stat_request_pending = TRUE;
+
+ tracker_get_stats_async (priv->tracker,
+ (TrackerGPtrArrayReply) update_stats, icon);
+
+}
+
static void
statistics_menu_activated (GtkMenuItem * item, gpointer data)
{
@@ -1380,13 +1442,6 @@
gtk_widget_show_all (GTK_WIDGET (priv->menu));
}
-
-
-
-
-
-
-
static void
index_finished (DBusGProxy * proxy, int time_taken, TrayIcon * icon)
{
@@ -1416,7 +1471,6 @@
}
-
static void
index_state_changed (DBusGProxy * proxy, const gchar * state,
gboolean initial_index, gboolean in_merge,
@@ -1547,7 +1601,6 @@
}
-
static void
init_settings (TrayIcon * icon)
{
@@ -1614,8 +1667,6 @@
}
}
-
-
static gboolean
setup_dbus_connection (TrayIcon * icon)
{
@@ -1743,8 +1794,6 @@
}
-
-
void
tray_icon_set_tooltip (TrayIcon * icon, const gchar * format, ...)
{
@@ -1762,8 +1811,6 @@
g_free (tooltip);
}
-
-
void
tray_icon_show_message (TrayIcon * icon, const char *message, ...)
{
@@ -1796,103 +1843,6 @@
}
-
-
-
-
-
-
-
-
-
-
-static gchar *
-get_stat_value (gchar *** stat_array, const gchar * stat)
-{
- gchar **array;
- gint i = 0;
-
- while (stat_array[i][0]) {
-
- array = stat_array[i];
-
- if (array[0] && strcasecmp (stat, array[0]) == 0) {
- return array[1];
- }
-
- i++;
- }
-
- return NULL;
-}
-
-
-
-static void
-update_stats (GPtrArray * array, GError * error, gpointer data)
-{
- TrayIcon *icon = TRAY_ICON (data);
- TrayIconPrivate *priv = TRAY_ICON_GET_PRIVATE (icon);
-
- if (error) {
- g_warning ("an error has occured: %s", error->message);
- g_error_free (error);
- priv->stat_request_pending = FALSE;
- return;
- }
-
- if (!array) {
- return;
- }
-
- guint i = array->len;
-
-
- if (i < 1 || !priv->stat_window_active) {
- g_ptr_array_free (array, TRUE);
- return;
- }
-
- gchar ***pdata = (gchar ***) array->pdata;
-
- for (i = 0; i < 12; i++) {
- gtk_label_set_text (GTK_LABEL (stat_info[i].stat_label),
- get_stat_value (pdata,
- stat_info[i].name));
- }
-
- g_ptr_array_free (array, TRUE);
-
- priv->stat_request_pending = FALSE;
-
-}
-
-
-
-static void
-refresh_stats (TrayIcon * icon)
-{
-
- TrayIconPrivate *priv = TRAY_ICON_GET_PRIVATE (icon);
-
- if (!priv->stat_window_active || priv->stat_request_pending) {
- return;
- }
-
- priv->stat_request_pending = TRUE;
-
- tracker_get_stats_async (priv->tracker,
- (TrackerGPtrArrayReply) update_stats, icon);
-
-}
-
-
-
-
-
-
-
-
GType
tray_icon_get_type (void)
{
@@ -1918,13 +1868,6 @@
return type;
}
-
-
-
-
-
-
-
static void
load_options (TrayIcon * icon)
{
@@ -2035,10 +1978,6 @@
}
-
-
-
-
int
main (int argc, char *argv[])
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]