gnome-power-manager r2912 - in trunk: . po src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r2912 - in trunk: . po src
- Date: Wed, 3 Sep 2008 15:53:49 +0000 (UTC)
Author: rhughes
Date: Wed Sep 3 15:53:48 2008
New Revision: 2912
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2912&view=rev
Log:
2008-09-03 Richard Hughes <richard hughsie com>
* src/gpm-common.c:
* src/gpm-common.h:
* src/egg-color.c:
* src/egg-color.h:
Move the color code to a shared file.
* src/gdb-efence.gdb:
* src/gdb-underfence.gdb:
Remove files I no longer use.
* src/egg-debug.c:
* src/egg-debug.h:
* po/POTFILES.in:
* src/Makefile.am:
* src/*.c:
Switch from using a homegrown gpm_debug to a shared egg_debug that
I use in all my other projects. Fix up all the build failures, as the
new egg_debug is much more strict on valid formatters.
No string changes.
Added:
trunk/src/egg-color.c
trunk/src/egg-color.h
trunk/src/egg-debug.c
trunk/src/egg-debug.h
Removed:
trunk/src/gdb-efence.gdb
trunk/src/gdb-underfence.gdb
trunk/src/gpm-debug.c
trunk/src/gpm-debug.h
Modified:
trunk/ChangeLog
trunk/po/POTFILES.in
trunk/src/Makefile.am
trunk/src/gpm-ac-adapter.c
trunk/src/gpm-array-float.c
trunk/src/gpm-array.c
trunk/src/gpm-backlight.c
trunk/src/gpm-brightness-hal.c
trunk/src/gpm-brightness-kbd.c
trunk/src/gpm-brightness-xrandr.c
trunk/src/gpm-brightness.c
trunk/src/gpm-button.c
trunk/src/gpm-cell-array.c
trunk/src/gpm-cell-unit.c
trunk/src/gpm-cell.c
trunk/src/gpm-common.c
trunk/src/gpm-common.h
trunk/src/gpm-conf.c
trunk/src/gpm-control.c
trunk/src/gpm-dpms.c
trunk/src/gpm-engine.c
trunk/src/gpm-feedback-widget.c
trunk/src/gpm-graph-widget.c
trunk/src/gpm-idle.c
trunk/src/gpm-info.c
trunk/src/gpm-inhibit.c
trunk/src/gpm-light-sensor.c
trunk/src/gpm-load.c
trunk/src/gpm-main.c
trunk/src/gpm-manager.c
trunk/src/gpm-networkmanager.c
trunk/src/gpm-notify.c
trunk/src/gpm-phone.c
trunk/src/gpm-prefs-core.c
trunk/src/gpm-prefs-server.c
trunk/src/gpm-prefs.c
trunk/src/gpm-profile.c
trunk/src/gpm-refcount.c
trunk/src/gpm-screensaver.c
trunk/src/gpm-self-test.c
trunk/src/gpm-sound.c
trunk/src/gpm-srv-brightness-kbd.c
trunk/src/gpm-srv-screensaver.c
trunk/src/gpm-statistics-core.c
trunk/src/gpm-statistics.c
trunk/src/gpm-tray-icon.c
trunk/src/gpm-warnings.c
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Wed Sep 3 15:53:48 2008
@@ -32,8 +32,6 @@
src/gpm-common.h
src/gpm-conf.c
src/gpm-conf.h
-src/gpm-debug.c
-src/gpm-debug.h
src/gpm-dpms.h
src/gpm-dpms.c
src/gpm-engine.c
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Wed Sep 3 15:53:48 2008
@@ -28,6 +28,7 @@
-DLIBDIR=\""$(libdir)"\" \
-DVERSION="\"$(VERSION)\"" \
-DGPM_DATA=\"$(pkgdatadir)\" \
+ -DEGG_LOG_FILE=\""$(PK_LOG_DIR)/gnome-power-manager"\" \
-I$(top_srcdir) \
-I$(top_srcdir)/libunique \
-I$(top_srcdir)/libhal-glib \
@@ -59,6 +60,10 @@
gnome-power-self-test
gnome_power_statistics_SOURCES = \
+ egg-color.c \
+ egg-color.h \
+ egg-debug.h \
+ egg-debug.c \
gpm-statistics.c \
gpm-statistics-core.h \
gpm-statistics-core.c \
@@ -74,8 +79,6 @@
gpm-conf.c \
gpm-common.h \
gpm-common.c \
- gpm-debug.h \
- gpm-debug.c \
$(NULL)
gnome_power_statistics_LDADD = \
@@ -92,12 +95,12 @@
endif
gnome_power_preferences_SOURCES = \
+ egg-debug.h \
+ egg-debug.c \
gpm-dpms.h \
gpm-dpms.c \
gpm-conf.h \
gpm-conf.c \
- gpm-debug.h \
- gpm-debug.c \
gpm-idle.h \
gpm-idle.c \
gpm-load.h \
@@ -132,10 +135,12 @@
endif
gnome_power_manager_SOURCES = \
+ egg-color.c \
+ egg-color.h \
+ egg-debug.h \
+ egg-debug.c \
gpm-dpms.h \
gpm-dpms.c \
- gpm-debug.h \
- gpm-debug.c \
gpm-notify.h \
gpm-notify.c \
gpm-engine.h \
@@ -234,6 +239,8 @@
endif
gnome_power_self_test_SOURCES = \
+ egg-color.c \
+ egg-color.h \
gpm-ac-adapter.h \
gpm-ac-adapter.c \
gpm-prefs-server.h \
@@ -248,8 +255,8 @@
gpm-dpms.c \
gpm-button.h \
gpm-button.c \
- gpm-debug.h \
- gpm-debug.c \
+ egg-debug.h \
+ egg-debug.c \
gpm-notify.h \
gpm-notify.c \
gpm-screensaver.h \
Added: trunk/src/egg-color.c
==============================================================================
--- (empty file)
+++ trunk/src/egg-color.c Wed Sep 3 15:53:48 2008
@@ -0,0 +1,153 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007-2008 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+
+/**
+ * egg_color_from_rgb:
+ * @red: The red value
+ * @green: The green value
+ * @blue: The blue value
+ **/
+guint32
+egg_color_from_rgb (guint8 red, guint8 green, guint8 blue)
+{
+ guint32 colour = 0;
+ colour += (guint32) red * 0x10000;
+ colour += (guint32) green * 0x100;
+ colour += (guint32) blue;
+ return colour;
+}
+
+/**
+ * egg_color_to_rgb:
+ * @red: The red value
+ * @green: The green value
+ * @blue: The blue value
+ **/
+void
+egg_color_to_rgb (guint32 colour, guint8 *red, guint8 *green, guint8 *blue)
+{
+ *red = (colour & 0xff0000) / 0x10000;
+ *green = (colour & 0x00ff00) / 0x100;
+ *blue = colour & 0x0000ff;
+}
+
+/***************************************************************************
+ *** MAKE CHECK TESTS ***
+ ***************************************************************************/
+#ifdef EGG_BUILD_TESTS
+#include "egg-self-test.h"
+
+void
+egg_st_color (EggSelfTest *test)
+{
+ guint8 r, g, b;
+ guint32 colour;
+
+ if (egg_st_start (test, "EggColor", CLASS_AUTO) == FALSE) {
+ return;
+ }
+
+ /************************************************************/
+ egg_st_title (test, "get red");
+ egg_color_to_rgb (0xff0000, &r, &g, &b);
+ if (r == 255 && g == 0 && b == 0) {
+ egg_st_success (test, "got red");
+ } else {
+ egg_st_failed (test, "could not get red (%i, %i, %i)", r, g, b);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "get green");
+ egg_color_to_rgb (0x00ff00, &r, &g, &b);
+ if (r == 0 && g == 255 && b == 0) {
+ egg_st_success (test, "got green");
+ } else {
+ egg_st_failed (test, "could not get green (%i, %i, %i)", r, g, b);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "get blue");
+ egg_color_to_rgb (0x0000ff, &r, &g, &b);
+ if (r == 0 && g == 0 && b == 255) {
+ egg_st_success (test, "got blue");
+ } else {
+ egg_st_failed (test, "could not get blue (%i, %i, %i)", r, g, b);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "get black");
+ egg_color_to_rgb (0x000000, &r, &g, &b);
+ if (r == 0 && g == 0 && b == 0) {
+ egg_st_success (test, "got black");
+ } else {
+ egg_st_failed (test, "could not get black (%i, %i, %i)", r, g, b);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "get white");
+ egg_color_to_rgb (0xffffff, &r, &g, &b);
+ if (r == 255 && g == 255 && b == 255) {
+ egg_st_success (test, "got white");
+ } else {
+ egg_st_failed (test, "could not get white (%i, %i, %i)", r, g, b);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "set red");
+ colour = egg_color_from_rgb (0xff, 0x00, 0x00);
+ if (colour == 0xff0000) {
+ egg_st_success (test, "set red");
+ } else {
+ egg_st_failed (test, "could not set red (%i)", colour);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "set green");
+ colour = egg_color_from_rgb (0x00, 0xff, 0x00);
+ if (colour == 0x00ff00) {
+ egg_st_success (test, "set green");
+ } else {
+ egg_st_failed (test, "could not set green (%i)", colour);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "set blue");
+ colour = egg_color_from_rgb (0x00, 0x00, 0xff);
+ if (colour == 0x0000ff) {
+ egg_st_success (test, "set blue");
+ } else {
+ egg_st_failed (test, "could not set blue (%i)", colour);
+ }
+
+ /************************************************************/
+ egg_st_title (test, "set white");
+ colour = egg_color_from_rgb (0xff, 0xff, 0xff);
+ if (colour == 0xffffff) {
+ egg_st_success (test, "set white");
+ } else {
+ egg_st_failed (test, "could not set white (%i)", colour);
+ }
+}
+
+#endif
+
Added: trunk/src/egg-color.h
==============================================================================
--- (empty file)
+++ trunk/src/egg-color.h Wed Sep 3 15:53:48 2008
@@ -0,0 +1,57 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007-2008 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __EGG_COLOR_H
+#define __EGG_COLOR_H
+
+#include <glib.h>
+
+
+#define EGG_COLOR_WHITE 0xffffff
+#define EGG_COLOR_BLACK 0x000000
+#define EGG_COLOR_RED 0xff0000
+#define EGG_COLOR_GREEN 0x00ff00
+#define EGG_COLOR_BLUE 0x0000ff
+#define EGG_COLOR_CYAN 0x00ffff
+#define EGG_COLOR_MAGENTA 0xff00ff
+#define EGG_COLOR_YELLOW 0xffff00
+#define EGG_COLOR_GREY 0xcccccc
+#define EGG_COLOR_DARK_RED 0x600000
+#define EGG_COLOR_DARK_GREEN 0x006000
+#define EGG_COLOR_DARK_BLUE 0x000060
+#define EGG_COLOR_DARK_CYAN 0x006060
+#define EGG_COLOR_DARK_MAGENTA 0x600060
+#define EGG_COLOR_DARK_YELLOW 0x606000
+#define EGG_COLOR_DARK_GREY 0x606060
+
+G_BEGIN_DECLS
+
+guint32 egg_color_from_rgb (guint8 red,
+ guint8 green,
+ guint8 blue);
+void egg_color_to_rgb (guint32 colour,
+ guint8 *red,
+ guint8 *green,
+ guint8 *blue);
+
+G_END_DECLS
+
+#endif /* __EGG_COLOR_H */
Added: trunk/src/egg-debug.c
==============================================================================
--- (empty file)
+++ trunk/src/egg-debug.c Wed Sep 3 15:53:48 2008
@@ -0,0 +1,283 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007-2008 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * SECTION:egg-debug
+ * @short_description: Debugging functions
+ *
+ * This file contains functions that can be used for debugging.
+ */
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gprintf.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <time.h>
+#include <execinfo.h>
+
+#include "egg-debug.h"
+
+#define CONSOLE_RESET 0
+#define CONSOLE_BLACK 30
+#define CONSOLE_RED 31
+#define CONSOLE_GREEN 32
+#define CONSOLE_YELLOW 33
+#define CONSOLE_BLUE 34
+#define CONSOLE_MAGENTA 35
+#define CONSOLE_CYAN 36
+#define CONSOLE_WHITE 37
+
+static gboolean do_verbose = FALSE; /* if we should print out debugging */
+static gboolean do_logging = FALSE; /* if we should write to a file */
+static gboolean is_console = FALSE;
+static gint fd = -1;
+
+/**
+ * egg_debug_set_logging:
+ **/
+void
+egg_debug_set_logging (gboolean enabled)
+{
+ do_logging = enabled;
+ if (enabled) {
+ egg_debug ("now logging to %s", EGG_LOG_FILE);
+ }
+}
+
+/**
+ * pk_set_console_mode:
+ **/
+static void
+pk_set_console_mode (guint console_code)
+{
+ gchar command[13];
+
+ /* don't put extra commands into logs */
+ if (!is_console) {
+ return;
+ }
+ /* Command is the control command to the terminal */
+ g_snprintf (command, 13, "%c[%dm", 0x1B, console_code);
+ printf ("%s", command);
+}
+
+/**
+ * egg_debug_backtrace:
+ **/
+void
+egg_debug_backtrace (void)
+{
+ void *call_stack[512];
+ int call_stack_size;
+ char **symbols;
+ int i = 1;
+
+ call_stack_size = backtrace (call_stack, G_N_ELEMENTS (call_stack));
+ symbols = backtrace_symbols (call_stack, call_stack_size);
+ if (symbols != NULL) {
+ pk_set_console_mode (CONSOLE_RED);
+ g_print ("Traceback:\n");
+ while (i < call_stack_size) {
+ g_print ("\t%s\n", symbols[i]);
+ i++;
+ }
+ pk_set_console_mode (CONSOLE_RESET);
+ free (symbols);
+ }
+}
+
+/**
+ * pk_log_line:
+ **/
+static void
+pk_log_line (const gchar *buffer)
+{
+ ssize_t count;
+ /* open a file */
+ if (fd == -1) {
+ /* ITS4: ignore, /var/log/foo is owned by root, and this is just debug text */
+ fd = open (EGG_LOG_FILE, O_WRONLY|O_APPEND|O_CREAT, 0777);
+ if (fd == -1) {
+ g_error ("could not open log: '%s'", EGG_LOG_FILE);
+ }
+ }
+
+ /* ITS4: ignore, debug text always NULL terminated */
+ count = write (fd, buffer, strlen (buffer));
+ if (count == -1) {
+ g_warning ("could not write %s", buffer);
+ }
+ /* newline */
+ count = write (fd, "\n", 1);
+ if (count == -1) {
+ g_warning ("could not write newline");
+ }
+}
+
+/**
+ * pk_print_line:
+ **/
+static void
+pk_print_line (const gchar *func, const gchar *file, const int line, const gchar *buffer, guint color)
+{
+ gchar *str_time;
+ gchar *header;
+ time_t the_time;
+ GThread *thread;
+
+ time (&the_time);
+ str_time = g_new0 (gchar, 255);
+ strftime (str_time, 254, "%H:%M:%S", localtime (&the_time));
+ thread = g_thread_self ();
+
+ /* generate header text */
+ header = g_strdup_printf ("TI:%s\tTH:%p\tFI:%s\tFN:%s,%d", str_time, thread, file, func, line);
+ g_free (str_time);
+
+ /* always in light green */
+ pk_set_console_mode (CONSOLE_GREEN);
+ printf ("%s\n", header);
+
+ /* different colours according to the severity */
+ pk_set_console_mode (color);
+ printf (" - %s\n", buffer);
+ pk_set_console_mode (CONSOLE_RESET);
+
+ /* log to a file */
+ if (do_logging) {
+ pk_log_line (header);
+ pk_log_line (buffer);
+ }
+
+ /* flush this output, as we need to debug */
+ fflush (stdout);
+
+ g_free (header);
+}
+
+/**
+ * egg_debug_real:
+ **/
+void
+egg_debug_real (const gchar *func, const gchar *file, const int line, const gchar *format, ...)
+{
+ va_list args;
+ gchar *buffer = NULL;
+
+ if (do_verbose == FALSE) {
+ return;
+ }
+
+ va_start (args, format);
+ g_vasprintf (&buffer, format, args);
+ va_end (args);
+
+ pk_print_line (func, file, line, buffer, CONSOLE_BLUE);
+
+ g_free(buffer);
+}
+
+/**
+ * egg_warning_real:
+ **/
+void
+egg_warning_real (const gchar *func, const gchar *file, const int line, const gchar *format, ...)
+{
+ va_list args;
+ gchar *buffer = NULL;
+
+ if (do_verbose == FALSE) {
+ return;
+ }
+
+ va_start (args, format);
+ g_vasprintf (&buffer, format, args);
+ va_end (args);
+
+ /* do extra stuff for a warning */
+ if (!is_console) {
+ printf ("*** WARNING ***\n");
+ }
+ pk_print_line (func, file, line, buffer, CONSOLE_RED);
+
+ g_free(buffer);
+}
+
+/**
+ * egg_error_real:
+ **/
+void
+egg_error_real (const gchar *func, const gchar *file, const int line, const gchar *format, ...)
+{
+ va_list args;
+ gchar *buffer = NULL;
+
+ va_start (args, format);
+ g_vasprintf (&buffer, format, args);
+ va_end (args);
+
+ /* do extra stuff for a warning */
+ if (!is_console) {
+ printf ("*** ERROR ***\n");
+ }
+ pk_print_line (func, file, line, buffer, CONSOLE_RED);
+ g_free(buffer);
+
+ /* we want to fix this! */
+ egg_debug_backtrace ();
+
+ exit (1);
+}
+
+/**
+ * egg_debug_enabled:
+ *
+ * Returns: TRUE if we have debugging enabled
+ **/
+gboolean
+egg_debug_enabled (void)
+{
+ return do_verbose;
+}
+
+/**
+ * egg_debug_init:
+ * @debug: If we should print out verbose logging
+ **/
+void
+egg_debug_init (gboolean debug)
+{
+ do_verbose = debug;
+ /* check if we are on console */
+ if (isatty (fileno (stdout)) == 1) {
+ is_console = TRUE;
+ }
+ egg_debug ("Verbose debugging %i (on console %i)", do_verbose, is_console);
+}
+
Added: trunk/src/egg-debug.h
==============================================================================
--- (empty file)
+++ trunk/src/egg-debug.h Wed Sep 3 15:53:48 2008
@@ -0,0 +1,81 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007-2008 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __EGG_DEBUG_H
+#define __EGG_DEBUG_H
+
+#include <stdarg.h>
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/**
+ * egg_debug:
+ *
+ * Non critical debugging
+ */
+#define egg_debug(...) egg_debug_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
+
+/**
+ * egg_warning:
+ *
+ * Important debugging
+ */
+#define egg_warning(...) egg_warning_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
+
+/**
+ * egg_error:
+ *
+ * Critical debugging, with exit
+ */
+#define egg_error(...) egg_error_real (__func__, __FILE__, __LINE__, __VA_ARGS__)
+
+#elif defined(__GNUC__) && __GNUC__ >= 3
+#define egg_debug(...) egg_debug_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
+#define egg_warning(...) egg_warning_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
+#define egg_error(...) egg_error_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
+#else
+#define egg_debug(...)
+#define egg_warning(...)
+#define egg_error(...)
+#endif
+
+void egg_debug_init (gboolean debug);
+void egg_debug_set_logging (gboolean enabled);
+gboolean egg_debug_enabled (void);
+void egg_debug_backtrace (void);
+void egg_debug_real (const gchar *func,
+ const gchar *file,
+ int line,
+ const gchar *format, ...) __attribute__((format (printf,4,5)));
+void egg_warning_real (const gchar *func,
+ const gchar *file,
+ int line,
+ const gchar *format, ...) __attribute__((format (printf,4,5)));
+void egg_error_real (const gchar *func,
+ const gchar *file,
+ int line,
+ const gchar *format, ...) __attribute__((format (printf,4,5)));
+
+G_END_DECLS
+
+#endif /* __EGG_DEBUG_H */
Modified: trunk/src/gpm-ac-adapter.c
==============================================================================
--- trunk/src/gpm-ac-adapter.c (original)
+++ trunk/src/gpm-ac-adapter.c Wed Sep 3 15:53:48 2008
@@ -42,7 +42,7 @@
#include <libhal-gmanager.h>
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-ac-adapter.h"
#define GPM_AC_ADAPTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_AC_ADAPTER, GpmAcAdapterPrivate))
@@ -87,7 +87,7 @@
hal_gdevice_get_bool (ac_adapter->priv->hal_device,
"ac_adapter.present", &is_on_ac, &error);
if (error != NULL) {
- gpm_warning ("could not read ac_adapter.present");
+ egg_warning ("could not read ac_adapter.present");
g_error_free (error);
}
@@ -189,7 +189,7 @@
error = NULL;
ret = hal_gmanager_find_capability (hal_manager, "ac_adapter", &device_names, &error);
if (!ret) {
- gpm_warning ("Couldn't obtain list of AC adapters: %s", error->message);
+ egg_warning ("Couldn't obtain list of AC adapters: %s", error->message);
g_error_free (error);
return;
}
@@ -197,7 +197,7 @@
/* we track this by hand as machines that have no ac_adapter object must
* return that they are on ac power */
ac_adapter->priv->has_hardware = TRUE;
- gpm_debug ("using %s", device_names[0]);
+ egg_debug ("using %s", device_names[0]);
/* We only want first ac_adapter object (should only be one) */
hal_gdevice_set_udi (ac_adapter->priv->hal_device, device_names[0]);
@@ -209,7 +209,7 @@
} else {
/* no ac-adapter class support */
ac_adapter->priv->has_hardware = FALSE;
- gpm_debug ("No devices of capability ac_adapter");
+ egg_debug ("No devices of capability ac_adapter");
}
hal_gmanager_free_capability (device_names);
g_object_unref (hal_manager);
Modified: trunk/src/gpm-array-float.c
==============================================================================
--- trunk/src/gpm-array-float.c (original)
+++ trunk/src/gpm-array-float.c Wed Sep 3 15:53:48 2008
@@ -29,7 +29,7 @@
#include <glib.h>
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-array.h"
#include "gpm-array-float.h"
@@ -301,7 +301,7 @@
length = array->len;
/* debug out */
for (i=0; i<length; i++) {
- gpm_debug ("[%i]\tval=%f", i, g_array_index (array, gfloat, i));
+ egg_debug ("[%i]\tval=%f", i, g_array_index (array, gfloat, i));
}
return TRUE;
}
Modified: trunk/src/gpm-array.c
==============================================================================
--- trunk/src/gpm-array.c (original)
+++ trunk/src/gpm-array.c Wed Sep 3 15:53:48 2008
@@ -31,7 +31,7 @@
#include <glib.h>
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-common.h"
#include "gpm-array.h"
@@ -69,7 +69,7 @@
length = array->priv->array->len;
if (i + 1 > length) {
- gpm_warning ("out of bounds %i of %i", i, length);
+ egg_warning ("out of bounds %i of %i", i, length);
return NULL;
}
point = g_ptr_array_index (array->priv->array, i);
@@ -138,7 +138,7 @@
point->y = y;
point->data = data;
g_ptr_array_add (array->priv->array, (gpointer) point);
- gpm_debug ("adding to %p, x=%i, y=%i, data=%i", array->priv->array, x, y, data);
+ egg_debug ("adding to %p, x=%i, y=%i, data=%i", array->priv->array, x, y, data);
return TRUE;
}
@@ -188,7 +188,7 @@
length = gpm_array_get_size (array);
for (i=0; i < length; i++) {
point = gpm_array_get (array, i);
- gpm_debug ("(%u) x=%u,\ty=%u,\tdata=%u", i, point->x, point->y, point->data);
+ egg_debug ("(%u) x=%u,\ty=%u,\tdata=%u", i, point->x, point->y, point->data);
}
return TRUE;
}
@@ -218,7 +218,7 @@
g_file_get_contents (filename, &contents, &length, NULL);
if (contents == NULL) {
- gpm_warning ("cannot open file %s", filename);
+ egg_warning ("cannot open file %s", filename);
return FALSE;
}
@@ -262,7 +262,7 @@
g_file_get_contents (filename, &contents, &length, NULL);
if (contents == NULL) {
- gpm_warning ("cannot open file %s", filename);
+ egg_warning ("cannot open file %s", filename);
return FALSE;
}
@@ -317,7 +317,7 @@
ret = g_file_set_contents (filename, contents, -1, NULL);
if (!ret) {
- gpm_warning ("cannot write file %s", filename);
+ egg_warning ("cannot write file %s", filename);
return FALSE;
}
g_free (contents);
@@ -452,7 +452,7 @@
/* check lengths are the same */
if (lengthfrom != lengthto) {
- gpm_debug ("arrays are not the same length");
+ egg_debug ("arrays are not the same length");
return FALSE;
}
@@ -673,18 +673,18 @@
g_return_val_if_fail (GPM_IS_ARRAY (array), FALSE);
length = gpm_array_get_size (array);
- gpm_debug ("length of array (before) %i", length);
+ egg_debug ("length of array (before) %i", length);
/* sanity check */
if (length < max_num) {
- gpm_debug ("no limit possible as under limit");
+ egg_debug ("no limit possible as under limit");
return FALSE;
}
/* last element */
point = gpm_array_get (array, length-1);
div = (gfloat) point->x / (gfloat) max_num;
- gpm_debug ("Using a x division of %f", div);
+ egg_debug ("Using a x division of %f", div);
/* Reduces the number of points to a pre-set level using a time
* division algorithm so we don't keep diluting the previous
@@ -693,11 +693,11 @@
point = gpm_array_get (array, a);
if (point->x >= running_count) {
running_count = running_count + div;
- gpm_debug ("keeping valid point %i", a);
+ egg_debug ("keeping valid point %i", a);
/* keep valid point */
} else {
/* remove point */
- gpm_debug ("removing invalid point %i", a);
+ egg_debug ("removing invalid point %i", a);
gpm_array_free_point (point);
g_ptr_array_remove_index (array->priv->array, a);
@@ -710,7 +710,7 @@
/* check length */
length = gpm_array_get_size (array);
- gpm_debug ("length of array (after) %i", length);
+ egg_debug ("length of array (after) %i", length);
return TRUE;
}
@@ -750,7 +750,7 @@
}
}
if (a > 0) {
- gpm_debug ("removing %i points from start of list", a);
+ egg_debug ("removing %i points from start of list", a);
g_ptr_array_remove_range (array->priv->array, 0, a);
}
return TRUE;
@@ -777,7 +777,7 @@
if (length > array->priv->max_points) {
/* We have too much data, simplify */
- gpm_debug ("Too many points (%i/%i)", length, array->priv->max_points);
+ egg_debug ("Too many points (%i/%i)", length, array->priv->max_points);
gpm_array_limit_x_size (array, array->priv->max_points / 2);
}
@@ -788,7 +788,7 @@
point2 = gpm_array_get (array, length-1);
diff_time = point2->x - point1->x;
if (diff_time > array->priv->max_width) {
- gpm_debug ("Too much time (%i/%i)", diff_time, array->priv->max_width);
+ egg_debug ("Too much time (%i/%i)", diff_time, array->priv->max_width);
gpm_array_limit_x_width (array, array->priv->max_width / 2);
}
}
Modified: trunk/src/gpm-backlight.c
==============================================================================
--- trunk/src/gpm-backlight.c (original)
+++ trunk/src/gpm-backlight.c Wed Sep 3 15:53:48 2008
@@ -49,7 +49,7 @@
#include "gpm-conf.h"
#include "gpm-control.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-feedback-widget.h"
#include "gpm-dpms.h"
#include "gpm-idle.h"
@@ -151,18 +151,18 @@
/* check if method is valid */
if (method == GPM_DPMS_METHOD_UNKNOWN) {
- gpm_warning ("BACKLIGHT method unknown. Possible schema problem!");
+ egg_warning ("BACKLIGHT method unknown. Possible schema problem!");
return;
}
/* choose a sensible default */
if (method == GPM_DPMS_METHOD_DEFAULT) {
- gpm_debug ("choosing sensible default");
+ egg_debug ("choosing sensible default");
if (backlight->priv->is_laptop) {
- gpm_debug ("laptop, so use GPM_DPMS_METHOD_OFF");
+ egg_debug ("laptop, so use GPM_DPMS_METHOD_OFF");
method = GPM_DPMS_METHOD_OFF;
} else {
- gpm_debug ("not laptop, so use GPM_BACKLIGHT_METHOD_STAGGER");
+ egg_debug ("not laptop, so use GPM_BACKLIGHT_METHOD_STAGGER");
method = GPM_DPMS_METHOD_STAGGER;
}
}
@@ -188,15 +188,15 @@
off = timeout;
} else {
/* wtf? */
- gpm_warning ("unknown backlight mode!");
+ egg_warning ("unknown backlight mode!");
}
- gpm_debug ("BACKLIGHT parameters %d %d %d, method '%i'", standby, suspend, off, method);
+ egg_debug ("BACKLIGHT parameters %d %d %d, method '%i'", standby, suspend, off, method);
error = NULL;
res = gpm_dpms_set_enabled (backlight->priv->dpms, TRUE, &error);
if (error) {
- gpm_warning ("Unable to enable BACKLIGHT: %s", error->message);
+ egg_warning ("Unable to enable BACKLIGHT: %s", error->message);
g_error_free (error);
return;
}
@@ -204,7 +204,7 @@
error = NULL;
res = gpm_dpms_set_timeouts (backlight->priv->dpms, standby, suspend, off, &error);
if (error) {
- gpm_warning ("Unable to get BACKLIGHT timeouts: %s", error->message);
+ egg_warning ("Unable to get BACKLIGHT timeouts: %s", error->message);
g_error_free (error);
return;
}
@@ -327,7 +327,7 @@
}
/* we emit a signal for the brightness applet */
if (ret && hw_changed) {
- gpm_debug ("emitting brightness-changed : %i", percentage);
+ egg_debug ("emitting brightness-changed : %i", percentage);
g_signal_emit (backlight, signals [BRIGHTNESS_CHANGED], 0, percentage);
}
return ret;
@@ -364,19 +364,19 @@
guint old_value;
if (backlight->priv->can_dim == FALSE) {
- gpm_warning ("no dimming hardware");
+ egg_warning ("no dimming hardware");
return FALSE;
}
gpm_conf_get_bool (backlight->priv->conf, GPM_CONF_BACKLIGHT_ENABLE, &do_laptop_lcd);
if (do_laptop_lcd == FALSE) {
- gpm_warning ("policy is no dimming");
+ egg_warning ("policy is no dimming");
return FALSE;
}
/* get the last set brightness */
brightness = backlight->priv->master_percentage / 100.0f;
- gpm_debug ("1. main brightness %f", brightness);
+ egg_debug ("1. main brightness %f", brightness);
/* get AC status */
on_ac = gpm_ac_adapter_is_present (backlight->priv->ac_adapter);
@@ -386,7 +386,7 @@
if (on_ac == FALSE && battery_reduce) {
gpm_conf_get_uint (backlight->priv->conf, GPM_CONF_BACKLIGHT_BRIGHTNESS_DIM_BATT, &value);
if (value > 100) {
- gpm_warning ("cannot use battery brightness value %i, correcting to 50", value);
+ egg_warning ("cannot use battery brightness value %i, correcting to 50", value);
value = 50;
}
scale = (100 - value) / 100.0f;
@@ -394,7 +394,7 @@
} else {
scale = 1.0f;
}
- gpm_debug ("2. battery scale %f, brightness %f", scale, brightness);
+ egg_debug ("2. battery scale %f, brightness %f", scale, brightness);
/* reduce if system is momentarily idle */
if (on_ac) {
@@ -405,7 +405,7 @@
if (enable_action && backlight->priv->system_is_idle == TRUE) {
gpm_conf_get_uint (backlight->priv->conf, GPM_CONF_BACKLIGHT_IDLE_BRIGHTNESS, &value);
if (value > 100) {
- gpm_warning ("cannot use idle brightness value %i, correcting to 50", value);
+ egg_warning ("cannot use idle brightness value %i, correcting to 50", value);
value = 50;
}
scale = value / 100.0f;
@@ -413,7 +413,7 @@
} else {
scale = 1.0f;
}
- gpm_debug ("3. idle scale %f, brightness %f", scale, brightness);
+ egg_debug ("3. idle scale %f, brightness %f", scale, brightness);
/* reduce if ambient is low */
gpm_conf_get_bool (backlight->priv->conf, GPM_CONF_AMBIENT_ENABLE, &enable_action);
@@ -433,7 +433,7 @@
} else {
scale = 1.0f;
}
- gpm_debug ("4. ambient scale %f, brightness %f", scale, brightness);
+ egg_debug ("4. ambient scale %f, brightness %f", scale, brightness);
/* convert to percentage */
value = (guint) ((brightness * 100.0f) + 0.5);
@@ -441,7 +441,7 @@
/* only do stuff if the brightness is different */
gpm_brightness_get (backlight->priv->brightness, &old_value);
if (old_value == value) {
- gpm_debug ("values are the same, no action");
+ egg_debug ("values are the same, no action");
return FALSE;
}
@@ -453,7 +453,7 @@
ret = gpm_brightness_set (backlight->priv->brightness, value, &hw_changed);
/* we emit a signal for the brightness applet */
if (ret && hw_changed) {
- gpm_debug ("emitting brightness-changed : %i", value);
+ egg_debug ("emitting brightness-changed : %i", value);
g_signal_emit (backlight, signals [BRIGHTNESS_CHANGED], 0, value);
}
return TRUE;
@@ -500,7 +500,7 @@
GPM_CONF_BACKLIGHT_IDLE_DIM_TIME,
&backlight->priv->idle_dim_timeout);
} else {
- gpm_debug ("unknown key %s", key);
+ egg_debug ("unknown key %s", key);
}
}
@@ -533,7 +533,7 @@
guint percentage;
gboolean ret;
gboolean hw_changed;
- gpm_debug ("Button press event type=%s", type);
+ egg_debug ("Button press event type=%s", type);
if (strcmp (type, GPM_BUTTON_BRIGHT_UP) == 0) {
/* go up one step */
@@ -548,7 +548,7 @@
}
/* we emit a signal for the brightness applet */
if (ret && hw_changed) {
- gpm_debug ("emitting brightness-changed : %i", percentage);
+ egg_debug ("emitting brightness-changed : %i", percentage);
g_signal_emit (backlight, signals [BRIGHTNESS_CHANGED], 0, percentage);
}
} else if (strcmp (type, GPM_BUTTON_BRIGHT_DOWN) == 0) {
@@ -564,7 +564,7 @@
}
/* we emit a signal for the brightness applet */
if (ret && hw_changed) {
- gpm_debug ("emitting brightness-changed : %i", percentage);
+ egg_debug ("emitting brightness-changed : %i", percentage);
g_signal_emit (backlight, signals [BRIGHTNESS_CHANGED], 0, percentage);
}
} else if (strcmp (type, GPM_BUTTON_LID_OPEN) == 0) {
@@ -584,7 +584,7 @@
/* no point continuing */
if (backlight->priv->system_is_idle == is_idle) {
- gpm_debug ("state not changed");
+ egg_debug ("state not changed");
return FALSE;
}
@@ -593,7 +593,7 @@
g_timer_reset (backlight->priv->idle_timer);
if (is_idle == FALSE) {
- gpm_debug ("we have just been idle for %lfs", elapsed);
+ egg_debug ("we have just been idle for %lfs", elapsed);
/* The user immediatly undimmed the screen!
* We should double the timeout to avoid this happening again */
@@ -603,7 +603,7 @@
gpm_conf_set_uint (backlight->priv->conf,
GPM_CONF_GNOME_SS_PM_DELAY,
backlight->priv->idle_dim_timeout);
- gpm_debug ("increasing idle dim time to %is",
+ egg_debug ("increasing idle dim time to %is",
backlight->priv->idle_dim_timeout);
}
@@ -617,14 +617,14 @@
gpm_conf_set_uint (backlight->priv->conf,
GPM_CONF_GNOME_SS_PM_DELAY,
backlight->priv->idle_dim_timeout);
- gpm_debug ("resetting idle dim time to %is",
+ egg_debug ("resetting idle dim time to %is",
backlight->priv->idle_dim_timeout);
}
} else {
- gpm_debug ("we were active for %lfs", elapsed);
+ egg_debug ("we were active for %lfs", elapsed);
}
- gpm_debug ("changing powersave idle status to %i", is_idle);
+ egg_debug ("changing powersave idle status to %i", is_idle);
backlight->priv->system_is_idle = is_idle;
return TRUE;
}
@@ -658,7 +658,7 @@
error = NULL;
gpm_dpms_set_active (backlight->priv->dpms, FALSE, &error);
if (error) {
- gpm_debug ("Unable to set DPMS not active: %s", error->message);
+ egg_debug ("Unable to set DPMS not active: %s", error->message);
g_error_free (error);
}
}
@@ -676,7 +676,7 @@
error = NULL;
gpm_dpms_set_active (backlight->priv->dpms, TRUE, &error);
if (error) {
- gpm_debug ("Unable to set DPMS active: %s", error->message);
+ egg_debug ("Unable to set DPMS active: %s", error->message);
g_error_free (error);
}
}
@@ -708,7 +708,7 @@
GpmDpmsMode mode,
GpmBacklight *backlight)
{
- gpm_debug ("emitting mode-changed : %s", gpm_dpms_mode_to_string (mode));
+ egg_debug ("emitting mode-changed : %s", gpm_dpms_mode_to_string (mode));
g_signal_emit (backlight, signals [MODE_CHANGED], 0, gpm_dpms_mode_to_string (mode));
}
@@ -724,14 +724,14 @@
brightness_changed_cb (GpmBrightness *brightness, guint percentage, GpmBacklight *backlight)
{
/* display the widget when something else changed the backlight */
- gpm_debug ("Need to display backlight feedback value %i", percentage);
+ egg_debug ("Need to display backlight feedback value %i", percentage);
gpm_feedback_display_value (backlight->priv->feedback, (float) percentage / 100.0f);
/* save the new percentage */
backlight->priv->master_percentage = percentage;
/* we emit a signal for the brightness applet */
- gpm_debug ("emitting brightness-changed : %i", percentage);
+ egg_debug ("emitting brightness-changed : %i", percentage);
g_signal_emit (backlight, signals [BRIGHTNESS_CHANGED], 0, percentage);
}
@@ -748,7 +748,7 @@
guint percentage,
GpmBacklight *backlight)
{
- gpm_debug ("sensor changed! %i", percentage);
+ egg_debug ("sensor changed! %i", percentage);
backlight->priv->ambient_sensor_value = percentage / 100.0f;
gpm_backlight_brightness_evaluate_and_set (backlight, FALSE);
}
Modified: trunk/src/gpm-brightness-hal.c
==============================================================================
--- trunk/src/gpm-brightness-hal.c (original)
+++ trunk/src/gpm-brightness-hal.c Wed Sep 3 15:53:48 2008
@@ -45,7 +45,7 @@
#include "gpm-brightness.h"
#include "gpm-brightness-hal.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-marshal.h"
#define GPM_BRIGHTNESS_HAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BRIGHTNESS_HAL, GpmBrightnessHalPrivate))
@@ -92,7 +92,7 @@
proxy = dbus_proxy_get_proxy (brightness->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected to HAL");
+ egg_warning ("not connected to HAL");
return FALSE;
}
@@ -106,15 +106,15 @@
}
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetBrightness failed!");
+ egg_warning ("GetBrightness failed!");
return FALSE;
}
- gpm_debug ("GetBrightness returned level: %i", level);
+ egg_debug ("GetBrightness returned level: %i", level);
return TRUE;
}
@@ -140,18 +140,18 @@
proxy = dbus_proxy_get_proxy (brightness->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected to HAL");
+ egg_warning ("not connected to HAL");
return FALSE;
}
if (value_hw < 0 ||
value_hw > brightness->priv->levels - 1) {
- gpm_warning ("set outside range (%i of %i)",
+ egg_warning ("set outside range (%i of %i)",
value_hw, brightness->priv->levels - 1);
return FALSE;
}
- gpm_debug ("Setting %i of %i", value_hw, brightness->priv->levels - 1);
+ egg_debug ("Setting %i of %i", value_hw, brightness->priv->levels - 1);
ret = dbus_g_proxy_call (proxy, "SetBrightness", &error,
G_TYPE_INT, (gint)value_hw,
@@ -161,12 +161,12 @@
/* retval is ignored, the HAL API is broken... */
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("SetBrightness failed!");
+ egg_warning ("SetBrightness failed!");
return FALSE;
}
@@ -196,7 +196,7 @@
g_return_val_if_fail (GPM_IS_BRIGHTNESS_HAL (brightness), FALSE);
last_set_hw = brightness->priv->last_set_hw;
- gpm_debug ("new_level_hw=%i, last_set_hw=%i", new_level_hw, last_set_hw);
+ egg_debug ("new_level_hw=%i, last_set_hw=%i", new_level_hw, last_set_hw);
/* we do the step interval as we can have insane levels of brightness */
if (new_level_hw == last_set_hw) {
@@ -239,7 +239,7 @@
g_return_val_if_fail (GPM_IS_BRIGHTNESS_HAL (brightness), FALSE);
- gpm_debug ("new_level_hw=%i", new_level_hw);
+ egg_debug ("new_level_hw=%i", new_level_hw);
/* macbook pro has a bazzillion brightness levels, be a bit clever */
step = gpm_brightness_get_step (brightness->priv->levels);
@@ -455,7 +455,7 @@
hal_gmanager_find_capability (manager, "laptop_panel", &names, NULL);
g_object_unref (manager);
if (names == NULL || names[0] == NULL) {
- gpm_warning ("No devices of capability laptop_panel");
+ egg_warning ("No devices of capability laptop_panel");
return;
}
@@ -469,9 +469,9 @@
/* get levels that the adapter supports -- this does not change ever */
hal_gdevice_get_uint (device, "laptop_panel.num_levels",
&brightness->priv->levels, NULL);
- gpm_debug ("Laptop panel levels: %i", brightness->priv->levels);
+ egg_debug ("Laptop panel levels: %i", brightness->priv->levels);
if (brightness->priv->levels == 0 || brightness->priv->levels > 256) {
- gpm_warning ("Laptop panel levels are invalid!");
+ egg_warning ("Laptop panel levels are invalid!");
}
/* Check if hardware handles brightness changes automatically */
@@ -481,13 +481,13 @@
if (!res) {
brightness->priv->does_own_updates = FALSE;
- gpm_debug ("laptop_panel.brightness_in_hardware not found. "
+ egg_debug ("laptop_panel.brightness_in_hardware not found. "
"Assuming false");
} else {
if (brightness->priv->does_own_updates) {
- gpm_debug ("laptop_panel.brightness_in_hardware: True");
+ egg_debug ("laptop_panel.brightness_in_hardware: True");
} else {
- gpm_debug ("laptop_panel.brightness_in_hardware: False");
+ egg_debug ("laptop_panel.brightness_in_hardware: False");
}
}
@@ -504,7 +504,7 @@
/* set to known value */
brightness->priv->level_std_hw = 0;
- gpm_debug ("Starting: (%i of %i)", brightness->priv->last_set_hw,
+ egg_debug ("Starting: (%i of %i)", brightness->priv->last_set_hw,
brightness->priv->levels - 1);
}
Modified: trunk/src/gpm-brightness-kbd.c
==============================================================================
--- trunk/src/gpm-brightness-kbd.c (original)
+++ trunk/src/gpm-brightness-kbd.c Wed Sep 3 15:53:48 2008
@@ -46,7 +46,7 @@
#include "gpm-brightness-kbd.h"
#include "gpm-conf.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-light-sensor.h"
#include "gpm-marshal.h"
@@ -100,7 +100,7 @@
proxy = dbus_proxy_get_proxy (brightness->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected to HAL");
+ egg_warning ("not connected to HAL");
return FALSE;
}
@@ -109,12 +109,12 @@
G_TYPE_INT, &brightness_level,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetBrightness failed!");
+ egg_warning ("GetBrightness failed!");
return FALSE;
}
@@ -144,30 +144,30 @@
proxy = dbus_proxy_get_proxy (brightness->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected to HAL");
+ egg_warning ("not connected to HAL");
return FALSE;
}
if (brightness_level_hw < 0 ||
brightness_level_hw > brightness->priv->levels - 1) {
- gpm_warning ("set outside range (%i of %i)",
+ egg_warning ("set outside range (%i of %i)",
brightness_level_hw, brightness->priv->levels - 1);
return FALSE;
}
- gpm_debug ("Setting %i of %i", brightness_level_hw, brightness->priv->levels - 1);
+ egg_debug ("Setting %i of %i", brightness_level_hw, brightness->priv->levels - 1);
ret = dbus_g_proxy_call (proxy, "SetBrightness", &error,
G_TYPE_INT, brightness_level_hw,
G_TYPE_INVALID,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("SetBrightness failed!");
+ egg_warning ("SetBrightness failed!");
return FALSE;
}
brightness->priv->current_hw = brightness_level_hw;
@@ -193,7 +193,7 @@
g_return_val_if_fail (GPM_IS_BRIGHTNESS_KBD (brightness), FALSE);
current_hw = brightness->priv->current_hw;
- gpm_debug ("new_level_hw=%i, current_hw=%i", new_level_hw, current_hw);
+ egg_debug ("new_level_hw=%i, current_hw=%i", new_level_hw, current_hw);
/* we do the step interval as we can have insane levels of brightness_kbd */
if (new_level_hw == current_hw) {
@@ -254,7 +254,7 @@
g_return_val_if_fail (brightness != NULL, FALSE);
g_return_val_if_fail (GPM_IS_BRIGHTNESS_KBD (brightness), FALSE);
- gpm_debug ("new_level_hw=%i", new_level_hw);
+ egg_debug ("new_level_hw=%i", new_level_hw);
/* some machines don't take kindly to auto-dimming */
if (brightness->priv->does_own_dimming) {
@@ -291,7 +291,7 @@
if (brightness->priv->level_std_hw > level_hw) {
brightness->priv->level_dim_hw = level_hw;
} else {
- gpm_warning ("Current brightness_kbd is %i, dim brightness_kbd is %i.",
+ egg_warning ("Current brightness_kbd is %i, dim brightness_kbd is %i.",
brightness->priv->level_std_hw, level_hw);
brightness->priv->level_dim_hw = brightness->priv->level_std_hw;
}
@@ -341,7 +341,7 @@
/* check to see if we are already dimmed */
if (brightness->priv->is_dimmed) {
- gpm_warning ("already dim'ed");
+ egg_warning ("already dim'ed");
return FALSE;
}
brightness->priv->is_dimmed = TRUE;
@@ -363,7 +363,7 @@
/* check to see if we are already dimmed */
if (brightness->priv->is_dimmed == FALSE) {
- gpm_warning ("already undim'ed");
+ egg_warning ("already undim'ed");
return FALSE;
}
brightness->priv->is_dimmed = FALSE;
@@ -424,7 +424,7 @@
percentage = gpm_discrete_to_percent (brightness->priv->current_hw,
brightness->priv->levels);
- gpm_debug ("emitting brightness-changed (%i)", percentage);
+ egg_debug ("emitting brightness-changed (%i)", percentage);
g_signal_emit (brightness, signals [BRIGHTNESS_CHANGED], 0, percentage);
return TRUE;
@@ -460,7 +460,7 @@
percentage = gpm_discrete_to_percent (brightness->priv->current_hw,
brightness->priv->levels);
- gpm_debug ("emitting brightness-changed (%i)", percentage);
+ egg_debug ("emitting brightness-changed (%i)", percentage);
g_signal_emit (brightness, signals [BRIGHTNESS_CHANGED], 0, percentage);
return TRUE;
@@ -563,7 +563,7 @@
state = STATE_FORCED_UNKNOWN;
}
- gpm_debug ("ambient light percent = %d", ambient_light);
+ egg_debug ("ambient light percent = %d", ambient_light);
if (state == STATE_FORCED_UNKNOWN) {
/* if this is the first time we're launched with ambient light data... */
@@ -692,7 +692,7 @@
hal_gmanager_find_capability (manager, "keyboard_backlight", &names, NULL);
g_object_unref (manager);
if (names == NULL || names[0] == NULL) {
- gpm_warning ("No devices of capability keyboard_backlight");
+ egg_warning ("No devices of capability keyboard_backlight");
return;
}
@@ -726,7 +726,7 @@
brightness->priv->level_dim_hw = 1;
brightness->priv->level_std_hw = 1;
- gpm_debug ("Starting: (%i of %i)",
+ egg_debug ("Starting: (%i of %i)",
brightness->priv->current_hw,
brightness->priv->levels - 1);
Modified: trunk/src/gpm-brightness-xrandr.c
==============================================================================
--- trunk/src/gpm-brightness-xrandr.c (original)
+++ trunk/src/gpm-brightness-xrandr.c Wed Sep 3 15:53:48 2008
@@ -46,7 +46,7 @@
#include "gpm-brightness.h"
#include "gpm-brightness-xrandr.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-marshal.h"
#define GPM_BRIGHTNESS_XRANDR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BRIGHTNESS_XRANDR, GpmBrightnessXRandRPrivate))
@@ -97,7 +97,7 @@
0, 4, False, False, None,
&actual_type, &actual_format,
&nitems, &bytes_after, &prop) != Success) {
- gpm_debug ("failed to get property");
+ egg_debug ("failed to get property");
return FALSE;
}
if (actual_type == XA_INTEGER && nitems == 1 && actual_format == 32) {
@@ -126,7 +126,7 @@
XFlush (brightness->priv->dpy);
gdk_flush ();
if (gdk_error_trap_pop ()) {
- gpm_warning ("failed to XRRChangeOutputProperty for brightness %i", value);
+ egg_warning ("failed to XRRChangeOutputProperty for brightness %i", value);
ret = FALSE;
}
/* we changed the hardware */
@@ -149,22 +149,22 @@
/* get the display */
brightness->priv->dpy = GDK_DISPLAY();
if (!brightness->priv->dpy) {
- gpm_error ("Cannot open display");
+ egg_error ("Cannot open display");
return FALSE;
}
/* is XRandR new enough? */
if (!XRRQueryVersion (brightness->priv->dpy, &major, &minor)) {
- gpm_debug ("RandR extension missing");
+ egg_debug ("RandR extension missing");
return FALSE;
}
if (major < 1 || (major == 1 && minor < 2)) {
- gpm_debug ("RandR version %d.%d too old", major, minor);
+ egg_debug ("RandR version %d.%d too old", major, minor);
return FALSE;
}
/* can we support BACKLIGHT */
brightness->priv->backlight = XInternAtom (brightness->priv->dpy, "BACKLIGHT", True);
if (brightness->priv->backlight == None) {
- gpm_debug ("No outputs have backlight property");
+ egg_debug ("No outputs have backlight property");
return FALSE;
}
return TRUE;
@@ -184,11 +184,11 @@
info = XRRQueryOutputProperty (brightness->priv->dpy, output, brightness->priv->backlight);
if (info == NULL) {
- gpm_debug ("could not get output property");
+ egg_debug ("could not get output property");
return FALSE;
}
if (!info->range || info->num_values != 2) {
- gpm_debug ("was not range");
+ egg_debug ("was not range");
ret = FALSE;
goto out;
}
@@ -220,9 +220,9 @@
if (!ret) {
return FALSE;
}
- gpm_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
+ egg_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
percentage = gpm_discrete_to_percent (cur, (max-min)+1);
- gpm_debug ("percentage %i", percentage);
+ egg_debug ("percentage %i", percentage);
brightness->priv->shared_value = percentage;
return TRUE;
}
@@ -247,14 +247,14 @@
if (!ret) {
return FALSE;
}
- gpm_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
+ egg_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
if (cur == min) {
- gpm_debug ("already min");
+ egg_debug ("already min");
return TRUE;
}
cur -= gpm_brightness_get_step ((max-min)+1);
if (cur < min) {
- gpm_debug ("truncating to %i", min);
+ egg_debug ("truncating to %i", min);
cur = min;
}
ret = gpm_brightness_xrandr_output_set_internal (brightness, output, cur);
@@ -281,14 +281,14 @@
if (!ret) {
return FALSE;
}
- gpm_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
+ egg_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
if (cur == max) {
- gpm_debug ("already max");
+ egg_debug ("already max");
return TRUE;
}
cur += gpm_brightness_get_step ((max-min)+1);
if (cur > max) {
- gpm_debug ("truncating to %i", max);
+ egg_debug ("truncating to %i", max);
cur = max;
}
ret = gpm_brightness_xrandr_output_set_internal (brightness, output, cur);
@@ -319,15 +319,15 @@
}
shared_value_abs = gpm_percent_to_discrete (brightness->priv->shared_value, (max-min)+1);
- gpm_debug ("percent=%i, absolute=%i", brightness->priv->shared_value, shared_value_abs);
+ egg_debug ("percent=%i, absolute=%i", brightness->priv->shared_value, shared_value_abs);
- gpm_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
+ egg_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
if (shared_value_abs > max)
shared_value_abs = max;
if (shared_value_abs < min)
shared_value_abs = min;
if (cur == shared_value_abs) {
- gpm_debug ("already set %i", cur);
+ egg_debug ("already set %i", cur);
return TRUE;
}
@@ -372,7 +372,7 @@
/* do for each output */
for (i=0; i<resources->noutput; i++) {
- gpm_debug ("resource %i of %i", i+1, resources->noutput);
+ egg_debug ("resource %i of %i", i+1, resources->noutput);
RROutput output = resources->outputs[i];
if (op==ACTION_BACKLIGHT_GET) {
ret = gpm_brightness_xrandr_output_get_percentage (brightness, output);
@@ -384,7 +384,7 @@
ret = gpm_brightness_xrandr_output_set (brightness, output);
} else {
ret = FALSE;
- gpm_warning ("op not known");
+ egg_warning ("op not known");
}
if (ret) {
success_any = TRUE;
@@ -411,7 +411,7 @@
length = brightness->priv->resources->len;
for (i=0; i<length; i++) {
resource = (XRRScreenResources *) g_ptr_array_index (brightness->priv->resources, i);
- gpm_debug ("using resource %p", resource);
+ egg_debug ("using resource %p", resource);
ret = gpm_brightness_xrandr_foreach_resource (brightness, op, resource);
if (ret) {
success_any = TRUE;
@@ -535,10 +535,10 @@
guint percentage;
ret = gpm_brightness_xrandr_get (brightness, &percentage);
if (!ret) {
- gpm_warning ("failed to get output");
+ egg_warning ("failed to get output");
return;
}
- gpm_debug ("emitting brightness-changed (%i)", percentage);
+ egg_debug ("emitting brightness-changed (%i)", percentage);
g_signal_emit (brightness, signals [BRIGHTNESS_CHANGED], 0, percentage);
}
@@ -549,7 +549,7 @@
gpm_brightness_xrandr_filter_xevents (GdkXEvent *xevent, GdkEvent *event, gpointer data)
{
GpmBrightnessXRandR *brightness = GPM_BRIGHTNESS_XRANDR (data);
- gpm_warning ("Event0 %p", brightness);
+ egg_warning ("Event0 %p", brightness);
if (FALSE) {
gpm_brightness_xrandr_may_have_changed (brightness);
}
@@ -589,7 +589,7 @@
length = brightness->priv->resources->len;
for (i=0; i<length; i++) {
resource = (XRRScreenResources *) g_ptr_array_index (brightness->priv->resources, i);
- gpm_debug ("freeing resource %p", resource);
+ egg_debug ("freeing resource %p", resource);
XRRFreeScreenResources (resource);
}
if (length > 0) {
@@ -600,12 +600,12 @@
display = gdk_display_get_default ();
length = ScreenCount (brightness->priv->dpy);
for (screen = 0; screen < length; screen++) {
- gpm_debug ("screen %i of %i", screen+1, length);
+ egg_debug ("screen %i of %i", screen+1, length);
gscreen = gdk_display_get_screen (display, screen);
/* if we have not setup the changed on the monitor, set it here */
if (g_object_get_data (G_OBJECT (gscreen), "gpk-set-monitors-changed") == NULL) {
- gpm_debug ("watching ::monitors_changed on %p", gscreen);
+ egg_debug ("watching ::monitors_changed on %p", gscreen);
g_object_set_data (G_OBJECT (gscreen), "gpk-set-monitors-changed", "true");
g_signal_connect (G_OBJECT (gscreen), "monitors_changed",
G_CALLBACK (gpm_brightness_monitors_changed), brightness);
@@ -615,7 +615,7 @@
root = RootWindow (brightness->priv->dpy, screen);
resource = XRRGetScreenResources (brightness->priv->dpy, root);
if (resource != NULL) {
- gpm_debug ("adding resource %p", resource);
+ egg_debug ("adding resource %p", resource);
g_ptr_array_add (brightness->priv->resources, resource);
}
}
@@ -685,7 +685,7 @@
/* as we a filtering by a window, we have to add an event type */
if (!XRRQueryExtension (GDK_DISPLAY(), &event_base, &ignore)) {
- gpm_error ("can't get event_base for XRR");
+ egg_error ("can't get event_base for XRR");
}
gdk_x11_register_standard_event_type (display, event_base, RRNotify + 1);
gdk_window_add_filter (window, gpm_brightness_xrandr_filter_xevents, (gpointer) brightness);
@@ -697,7 +697,7 @@
RROutputPropertyNotifyMask); /* <--- the only one we need, but see rh:345551 */
gdk_flush ();
if (gdk_error_trap_pop ()) {
- gpm_warning ("failed to select XRRSelectInput");
+ egg_warning ("failed to select XRRSelectInput");
}
/* create cache of XRRScreenResources as XRRGetScreenResources() is slow */
Modified: trunk/src/gpm-brightness.c
==============================================================================
--- trunk/src/gpm-brightness.c (original)
+++ trunk/src/gpm-brightness.c Wed Sep 3 15:53:48 2008
@@ -39,7 +39,7 @@
#include "gpm-brightness-hal.h"
#include "gpm-brightness-xrandr.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-marshal.h"
#define GPM_BRIGHTNESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BRIGHTNESS, GpmBrightnessPrivate))
@@ -91,7 +91,7 @@
g_return_val_if_fail (GPM_IS_BRIGHTNESS (brightness), FALSE);
/* only return the cached value if the cache is trusted and we have change events */
if (brightness->priv->cache_trusted && brightness->priv->has_changed_events) {
- gpm_debug ("using cache for value %u (okay)", brightness->priv->cache_percentage);
+ egg_debug ("using cache for value %u (okay)", brightness->priv->cache_percentage);
return TRUE;
}
@@ -99,7 +99,7 @@
* if we have multiple things setting policy on the workstation, e.g. fast user switching
* or kpowersave, then this will be invalid -- this logic may be insane */
if (GPM_SOLE_SETTER_USE_CACHE && brightness->priv->cache_trusted) {
- gpm_warning ("using cache for value %u (probably okay)", brightness->priv->cache_percentage);
+ egg_warning ("using cache for value %u (probably okay)", brightness->priv->cache_percentage);
return TRUE;
}
return FALSE;
@@ -124,7 +124,7 @@
/* can we check the new value with the cache? */
trust_cache = gpm_brightness_trust_cache (brightness);
if (trust_cache && percentage == brightness->priv->cache_percentage) {
- gpm_debug ("not setting the same value %i", percentage);
+ egg_debug ("not setting the same value %i", percentage);
return TRUE;
}
@@ -137,7 +137,7 @@
ret = gpm_brightness_hal_set (brightness->priv->hal, percentage, &hw_changed_local);
goto out;
}
- gpm_debug ("no hardware support");
+ egg_debug ("no hardware support");
return FALSE;
out:
/* we did something to the hardware, so untrusted */
@@ -185,12 +185,12 @@
ret = gpm_brightness_hal_get (brightness->priv->hal, &percentage_local);
goto out;
}
- gpm_debug ("no hardware support");
+ egg_debug ("no hardware support");
return FALSE;
out:
/* valid? */
if (percentage_local > 100) {
- gpm_warning ("percentage value of %i will be ignored", percentage_local);
+ egg_warning ("percentage value of %i will be ignored", percentage_local);
ret = FALSE;
}
/* a new value is always trusted if the method and checks succeed */
@@ -228,7 +228,7 @@
ret = gpm_brightness_hal_up (brightness->priv->hal, &hw_changed_local);
goto out;
}
- gpm_debug ("no hardware support");
+ egg_debug ("no hardware support");
return FALSE;
out:
/* we did something to the hardware, so untrusted */
@@ -266,7 +266,7 @@
ret = gpm_brightness_hal_down (brightness->priv->hal, &hw_changed_local);
goto out;
}
- gpm_debug ("no hardware support");
+ egg_debug ("no hardware support");
return FALSE;
out:
/* we did something to the hardware, so untrusted */
@@ -336,7 +336,7 @@
/* valid? */
if (percentage > 100) {
- gpm_warning ("percentage value of %i will be ignored", percentage);
+ egg_warning ("percentage value of %i will be ignored", percentage);
/* no longer trust the cache */
brightness->priv->has_changed_events = FALSE;
brightness->priv->cache_trusted = FALSE;
@@ -347,7 +347,7 @@
brightness->priv->cache_trusted = TRUE;
brightness->priv->cache_percentage = percentage;
/* ONLY EMIT THIS SIGNAL WHEN SOMETHING _ELSE_ HAS CHANGED THE BACKLIGHT */
- gpm_debug ("emitting brightness-changed (%i)", percentage);
+ egg_debug ("emitting brightness-changed (%i)", percentage);
g_signal_emit (brightness, signals [BRIGHTNESS_CHANGED], 0, percentage);
}
Modified: trunk/src/gpm-button.c
==============================================================================
--- trunk/src/gpm-button.c (original)
+++ trunk/src/gpm-button.c Wed Sep 3 15:53:48 2008
@@ -36,7 +36,7 @@
#include "gpm-common.h"
#include "gpm-button.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-marshal.h"
static void gpm_button_class_init (GpmButtonClass *klass);
@@ -89,12 +89,12 @@
/* found anything? */
if (key == NULL) {
- gpm_debug ("Key %p not found in hash", keycode);
+ egg_debug ("Key %i not found in hash", keycode);
/* pass normal keypresses on, which might help with accessibility access */
return GDK_FILTER_CONTINUE;
}
- gpm_debug ("Key %p mapped to HAL key %s", keycode, key);
+ egg_debug ("Key %i mapped to HAL key %s", keycode, key);
g_signal_emit (button, signals [BUTTON_PRESSED], 0, key);
return GDK_FILTER_REMOVE;
@@ -130,8 +130,8 @@
GDK_WINDOW_XID (button->priv->window), True,
GrabModeAsync, GrabModeAsync);
if (ret == BadAccess) {
- gpm_warning ("Failed to grab modmask=%u, keycode=%i",
- modmask, keycode);
+ egg_warning ("Failed to grab modmask=%u, keycode=%li",
+ modmask, (long int) keycode);
return FALSE;
}
@@ -140,8 +140,8 @@
GDK_WINDOW_XID (button->priv->window), True,
GrabModeAsync, GrabModeAsync);
if (ret == BadAccess) {
- gpm_warning ("Failed to grab modmask=%u, keycode=%i",
- LockMask | modmask, keycode);
+ egg_warning ("Failed to grab modmask=%u, keycode=%li",
+ LockMask | modmask, (long int) keycode);
return FALSE;
}
@@ -149,7 +149,7 @@
gdk_flush ();
gdk_error_trap_pop ();
- gpm_debug ("Grabbed modmask=%x, keycode=%p", modmask, keycode);
+ egg_debug ("Grabbed modmask=%x, keycode=%li", modmask, (long int) keycode);
return TRUE;
}
@@ -176,7 +176,7 @@
/* convert from keysym to keycode */
keycode = XKeysymToKeycode (GDK_DISPLAY (), keysym);
if (keycode == 0) {
- gpm_warning ("could not map keysym %x to keycode", keysym);
+ egg_warning ("could not map keysym %x to keycode", keysym);
return FALSE;
}
@@ -184,7 +184,7 @@
keycode_str = g_strdup_printf ("0x%x", keycode);
key = g_hash_table_lookup (button->priv->hash_to_hal, (gpointer) keycode_str);
if (key != NULL) {
- gpm_warning ("found in hash %p", keycode);
+ egg_warning ("found in hash %i", keycode);
g_free (keycode_str);
return FALSE;
}
@@ -192,7 +192,7 @@
/* try to register X event */
ret = gpm_button_grab_keystring (button, keycode);
if (!ret) {
- gpm_warning ("Failed to grab %p", keycode);
+ egg_warning ("Failed to grab %i", keycode);
g_free (keycode_str);
return FALSE;
}
@@ -271,7 +271,7 @@
hal_gdevice_get_string (device, "button.type", &type, NULL);
/* hal may no longer be there */
if (type == NULL) {
- gpm_warning ("cannot get button type for %s", hal_gdevice_get_udi (device));
+ egg_warning ("cannot get button type for %s", hal_gdevice_get_udi (device));
return;
}
} else {
@@ -296,14 +296,14 @@
/* filter out duplicate lid events */
if (strcmp (atype, GPM_BUTTON_LID_CLOSED) == 0) {
if (button->priv->lid_is_closed) {
- gpm_debug ("ignoring duplicate lid event");
+ egg_debug ("ignoring duplicate lid event");
return;
}
button->priv->lid_is_closed = TRUE;
}
if (strcmp (atype, GPM_BUTTON_LID_OPEN) == 0) {
if (button->priv->lid_is_closed == FALSE) {
- gpm_debug ("ignoring duplicate lid event");
+ egg_debug ("ignoring duplicate lid event");
return;
}
button->priv->lid_is_closed = FALSE;
@@ -317,7 +317,7 @@
}
/* we now emit all buttons, even the ones we don't know */
- gpm_debug ("emitting button-pressed : %s", atype);
+ egg_debug ("emitting button-pressed : %s", atype);
g_signal_emit (button, signals [BUTTON_PRESSED], 0, atype);
g_free (type);
@@ -342,7 +342,7 @@
gboolean finally,
GpmButton *button)
{
- gpm_debug ("key=%s, added=%i, removed=%i, finally=%i",
+ egg_debug ("key=%s, added=%i, removed=%i, finally=%i",
key, is_added, is_removed, finally);
/* do not process keys that have been removed */
@@ -352,7 +352,7 @@
/* only match button* values */
if (strncmp (key, "button", 6) == 0) {
- gpm_debug ("state of a button has changed : %s, %s", hal_gdevice_get_udi (device), key);
+ egg_debug ("state of a button has changed : %s, %s", hal_gdevice_get_udi (device), key);
emit_button_pressed (button, device, "");
}
}
@@ -373,7 +373,7 @@
const gchar *details,
GpmButton *button)
{
- gpm_debug ("condition=%s, details=%s", condition, details);
+ egg_debug ("condition=%s, details=%s", condition, details);
if (strcmp (condition, "ButtonPressed") == 0) {
emit_button_pressed (button, device, details);
@@ -420,7 +420,7 @@
error = NULL;
ret = hal_gmanager_find_capability (button->priv->hal_manager, "button", &device_names, &error);
if (!ret) {
- gpm_warning ("Couldn't obtain list of buttons: %s", error->message);
+ egg_warning ("Couldn't obtain list of buttons: %s", error->message);
g_error_free (error);
return;
}
@@ -428,10 +428,10 @@
/* we have found buttons */
for (i = 0; device_names[i]; i++) {
watch_add_button (button, device_names[i]);
- gpm_debug ("Watching %s", device_names[i]);
+ egg_debug ("Watching %s", device_names[i]);
}
} else {
- gpm_debug ("Couldn't obtain list of buttons");
+ egg_debug ("Couldn't obtain list of buttons");
}
hal_gmanager_free_capability (device_names);
Modified: trunk/src/gpm-cell-array.c
==============================================================================
--- trunk/src/gpm-cell-array.c (original)
+++ trunk/src/gpm-cell-array.c Wed Sep 3 15:53:48 2008
@@ -38,7 +38,7 @@
#include "gpm-cell.h"
#include "gpm-phone.h"
#include "gpm-control.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-warnings.h"
#include "gpm-profile.h"
@@ -153,7 +153,7 @@
g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), NULL);
if (id > cell_array->priv->array->len) {
- gpm_warning ("not valid cell id");
+ egg_warning ("not valid cell id");
return NULL;
}
@@ -207,7 +207,7 @@
/* if invalid, don't return junk */
if (difference < 0) {
- gpm_debug ("difference negative, now %i, action %i", unit->time_discharge, action_time);
+ egg_debug ("difference negative, now %i, action %i", unit->time_discharge, action_time);
return 0;
}
return difference;
@@ -224,7 +224,7 @@
/* only emit this once per startup */
if (cell_array->priv->done_recall == FALSE) {
/* just proxy it to the engine layer */
- gpm_debug ("** EMIT: perhaps-recall");
+ egg_debug ("** EMIT: perhaps-recall");
g_signal_emit (cell_array, signals [PERHAPS_RECALL], 0, oem_vendor, website);
cell_array->priv->done_recall = TRUE;
}
@@ -241,7 +241,7 @@
/* only emit this once per startup */
if (cell_array->priv->done_capacity == FALSE) {
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: low-capacity");
+ egg_debug ("** EMIT: low-capacity");
g_signal_emit (cell_array, signals [LOW_CAPACITY], 0, capacity);
cell_array->priv->done_capacity = TRUE;
}
@@ -277,7 +277,7 @@
/* if we have no devices, don't try to average */
if (length == 0) {
- gpm_debug ("no devices of type %i", unit->kind);
+ egg_debug ("no devices of type %i", unit->kind);
return FALSE;
}
@@ -289,7 +289,7 @@
unit_temp = gpm_cell_get_unit (cell);
if (unit_temp->is_present == FALSE) {
- gpm_debug ("ignoring device that is not present");
+ egg_debug ("ignoring device that is not present");
continue;
}
@@ -339,18 +339,18 @@
/* sanity check to less than 100W */
if (unit->rate > 100*1000) {
- gpm_warning ("sanity checking rate from %i to 0", unit->rate);
+ egg_warning ("sanity checking rate from %i to 0", unit->rate);
unit->rate = 0;
}
/* sanity check */
if (unit->is_discharging && unit->is_charging == TRUE) {
- gpm_warning ("Sanity check kicked in! "
+ egg_warning ("Sanity check kicked in! "
"Multiple device object cannot be charging and discharging simultaneously!");
unit->is_charging = FALSE;
}
- gpm_debug ("%i devices of type %s", num_present, gpm_cell_unit_get_kind_string (unit));
+ egg_debug ("%i devices of type %s", num_present, gpm_cell_unit_get_kind_string (unit));
/* Perform following calculations with floating point otherwise we might
* get an with batteries which have a very small charge unit and consequently
@@ -360,10 +360,10 @@
gfloat pc = 100.0f * ((gfloat)unit->charge_current /
(gfloat)unit->charge_last_full);
if (pc < 0.0f) {
- gpm_warning ("Corrected percentage charge (%i) and set to minimum", pc);
+ egg_warning ("Corrected percentage charge (%f) and set to minimum", pc);
pc = 0.0f;
} else if (pc > 100.0f) {
- gpm_warning ("Corrected percentage charge (%i) and set to maximum", pc);
+ egg_warning ("Corrected percentage charge (%f) and set to maximum", pc);
pc = 100.0f;
}
unit->percentage = pc;
@@ -382,7 +382,7 @@
/* get the ac state */
on_ac = gpm_ac_adapter_is_present (cell_array->priv->ac_adapter);
- gpm_debug ("Battery is neither charging nor discharging, "
+ egg_debug ("Battery is neither charging nor discharging, "
"using ac_adaptor value %i", on_ac);
if (on_ac) {
unit->is_charging = TRUE;
@@ -397,7 +397,7 @@
* Hopefully we can remove this in 2.19.x sometime. */
if (cell_array->priv->use_profile_calc &&
unit->kind == GPM_CELL_UNIT_KIND_PRIMARY) {
- gpm_debug ("unit->percentage = %.1f", unit->percentage);
+ egg_debug ("unit->percentage = %.1f", unit->percentage);
unit->time_discharge = gpm_profile_get_time (cell_array->priv->profile, unit->percentage, TRUE);
unit->time_charge = gpm_profile_get_time (cell_array->priv->profile, unit->percentage, FALSE);
} else {
@@ -416,12 +416,12 @@
/* Check the remaining time is under a set limit, to deal with broken
primary batteries rate. Fixes bug #328927 */
if (unit->time_charge > (100 * 60 * 60)) {
- gpm_warning ("Another sanity check kicked in! "
+ egg_warning ("Another sanity check kicked in! "
"Remaining time cannot be > 100 hours!");
unit->time_charge = 0;
}
if (unit->time_discharge > (100 * 60 * 60)) {
- gpm_warning ("Another sanity check kicked in! "
+ egg_warning ("Another sanity check kicked in! "
"Remaining time cannot be > 100 hours!");
unit->time_discharge = 0;
}
@@ -453,14 +453,14 @@
/* invalid if not primary */
if (unit->kind != GPM_CELL_UNIT_KIND_PRIMARY) {
- gpm_warning ("only valid for primary");
+ egg_warning ("only valid for primary");
return NULL;
}
length = cell_array->priv->array->len;
/* if we have no devices, don't try to get id */
if (length == 0) {
- gpm_debug ("no devices of type primary");
+ egg_debug ("no devices of type primary");
return NULL;
}
@@ -501,20 +501,20 @@
accuracy = gpm_profile_get_accuracy_average (cell_array->priv->profile,
unit->is_discharging);
if (accuracy < GPM_PROFILE_GOOD_TRUST) {
- gpm_debug ("profile is not accurate. Not doing policy action");
+ egg_debug ("profile is not accurate. Not doing policy action");
return FALSE;
}
}
/* we are not primary, or we are primary with a trusted profile */
if (warnings_state == GPM_WARNINGS_ACTION) {
- gpm_debug ("** EMIT: charge-action");
+ egg_debug ("** EMIT: charge-action");
g_signal_emit (cell_array, signals [CHARGE_ACTION], 0, unit->percentage);
} else if (warnings_state == GPM_WARNINGS_CRITICAL) {
- gpm_debug ("** EMIT: charge-critical");
+ egg_debug ("** EMIT: charge-critical");
g_signal_emit (cell_array, signals [CHARGE_CRITICAL], 0, unit->percentage);
} else if (warnings_state == GPM_WARNINGS_LOW) {
- gpm_debug ("** EMIT: charge-low");
+ egg_debug ("** EMIT: charge-low");
g_signal_emit (cell_array, signals [CHARGE_LOW], 0, unit->percentage);
}
return TRUE;
@@ -536,13 +536,13 @@
unit = &(cell_array->priv->unit);
- gpm_debug ("printing combined new device:");
+ egg_debug ("printing combined new device:");
gpm_cell_unit_print (unit);
/* only emit if all devices are fully charged */
if (cell_array->priv->done_fully_charged == FALSE &&
gpm_cell_unit_is_charged (unit)) {
- gpm_debug ("** EMIT: fully-charged");
+ egg_debug ("** EMIT: fully-charged");
g_signal_emit (cell_array, signals [FULLY_CHARGED], 0);
cell_array->priv->done_fully_charged = TRUE;
}
@@ -553,7 +553,7 @@
if (cell_array->priv->done_fully_charged &&
unit->percentage < GPM_CELL_UNIT_MIN_CHARGED_PERCENTAGE &&
gpm_cell_unit_is_charged (unit) == FALSE) {
- gpm_debug ("enabled fully charged");
+ egg_debug ("enabled fully charged");
cell_array->priv->done_fully_charged = FALSE;
}
@@ -566,20 +566,20 @@
/* see if we need to issue a warning */
if (warnings_state == GPM_WARNINGS_NONE) {
- gpm_debug ("No warning");
+ egg_debug ("No warning");
} else {
/* Always check if we already notified the user */
if (warnings_state <= cell_array->priv->warnings_state) {
- gpm_debug ("Already notified %i", warnings_state);
+ egg_debug ("Already notified %i", warnings_state);
} else {
/* As the level is more critical than the last warning, save it */
cell_array->priv->warnings_state = warnings_state;
- gpm_debug ("warning state = %i", warnings_state);
+ egg_debug ("warning state = %i", warnings_state);
if (warnings_state == GPM_WARNINGS_DISCHARGING) {
/* we emit this, even if the profile is crap */
- gpm_debug ("** EMIT: discharging");
+ egg_debug ("** EMIT: discharging");
g_signal_emit (cell_array, signals [DISCHARGING], 0, unit->percentage);
} else {
gpm_cell_array_emit_system_action (cell_array, warnings_state);
@@ -614,7 +614,7 @@
/* proxy to engine if different */
if (old_percent != unit->percentage) {
- gpm_debug ("** EMIT: percent-changed");
+ egg_debug ("** EMIT: percent-changed");
g_signal_emit (cell_array, signals [PERCENT_CHANGED], 0, unit->percentage);
gpm_cell_array_percent_changed (cell_array);
}
@@ -635,12 +635,12 @@
/* recalculate */
gpm_cell_array_update (cell_array);
- gpm_debug ("printing combined new device:");
+ egg_debug ("printing combined new device:");
gpm_cell_unit_print (unit);
/* invalidate warning */
if (unit->is_discharging == FALSE || unit->is_charging) {
- gpm_debug ("warning state invalidated");
+ egg_debug ("warning state invalidated");
cell_array->priv->warnings_state = GPM_WARNINGS_NONE;
}
@@ -650,7 +650,7 @@
}
/* proxy to engine */
- gpm_debug ("** EMIT: charging-changed");
+ egg_debug ("** EMIT: charging-changed");
g_signal_emit (cell_array, signals [CHARGING_CHANGED], 0, charging);
}
@@ -669,7 +669,7 @@
/* recalculate */
gpm_cell_array_update (cell_array);
- gpm_debug ("printing combined new device:");
+ egg_debug ("printing combined new device:");
gpm_cell_unit_print (unit);
/* invalidate warning */
@@ -678,7 +678,7 @@
}
/* proxy to engine */
- gpm_debug ("** EMIT: discharging-changed");
+ egg_debug ("** EMIT: discharging-changed");
g_signal_emit (cell_array, signals [DISCHARGING_CHANGED], 0, discharging);
}
@@ -702,7 +702,7 @@
cell = (GpmCell *) g_ptr_array_index (cell_array->priv->array, i);
cell_device_id = gpm_cell_get_device_id (cell);
if (cell_device_id != NULL && strcmp (cell_device_id, device_id) == 0) {
- gpm_debug ("Found %s with device id check", device_id);
+ egg_debug ("Found %s with device id check", device_id);
return i;
}
}
@@ -726,17 +726,17 @@
device = hal_gdevice_new ();
ret = hal_gdevice_set_udi (device, udi);
if (!ret) {
- gpm_warning ("failed to set UDI %s", udi);
+ egg_warning ("failed to set UDI %s", udi);
return FALSE;
}
/* check type */
ret = hal_gdevice_get_string (device, key, &rettype, NULL);
if (!ret || rettype == NULL) {
- gpm_warning ("failed to get %s", key);
+ egg_warning ("failed to get %s", key);
return FALSE;
}
- gpm_debug ("checking %s against %s", rettype, value);
+ egg_debug ("checking %s against %s", rettype, value);
if (strcmp (rettype, value) == 0) {
matches = TRUE;
}
@@ -762,7 +762,7 @@
length = cell_array->priv->array->len;
/* if we have no devices, don't try to get refresh anything */
if (length == 0) {
- gpm_debug ("no devices of type");
+ egg_debug ("no devices of type");
return FALSE;
}
@@ -780,7 +780,7 @@
gpm_cell_array_update (cell_array);
/* emit */
- gpm_debug ("** EMIT: collection-changed");
+ egg_debug ("** EMIT: collection-changed");
g_signal_emit (cell_array, signals [COLLECTION_CHANGED], 0, unit->percentage);
/* make sure */
@@ -808,7 +808,7 @@
kind_string = gpm_cell_unit_get_kind_string (unit);
ret = gpm_check_device_key (cell_array, device_id, "battery.type", kind_string);
if (!ret) {
- gpm_debug ("not adding %s for %s", device_id, kind_string);
+ egg_debug ("not adding %s for %s", device_id, kind_string);
return FALSE;
}
@@ -816,11 +816,11 @@
index = gpm_cell_array_index_device_id (cell_array, device_id);
if (index != -1) {
/* already added */
- gpm_debug ("already added %s", device_id);
+ egg_debug ("already added %s", device_id);
return FALSE;
}
- gpm_debug ("adding the right kind of battery: %s", kind_string);
+ egg_debug ("adding the right kind of battery: %s", kind_string);
cell = gpm_cell_new ();
g_signal_connect (cell, "perhaps-recall",
@@ -870,7 +870,7 @@
error = NULL;
ret = hal_gmanager_find_capability (cell_array->priv->hal_manager, "battery", &device_names, &error);
if (!ret) {
- gpm_warning ("Couldn't obtain list of batteries: %s", error->message);
+ egg_warning ("Couldn't obtain list of batteries: %s", error->message);
g_error_free (error);
return FALSE;
}
@@ -995,7 +995,7 @@
/* don't display the text if we are low in accuracy */
accuracy = gpm_profile_get_accuracy (cell_array->priv->profile, (guint) unit->percentage);
- gpm_debug ("accuracy = %i", accuracy);
+ egg_debug ("accuracy = %i", accuracy);
/* precalculate so we don't get Unknown time remaining */
charge_time_round = gpm_precision_round_down (unit->time_charge, GPM_UI_TIME_PRECISION);
@@ -1057,7 +1057,7 @@
}
} else {
- gpm_warning ("in an undefined state we are not charging or "
+ egg_warning ("in an undefined state we are not charging or "
"discharging and the batteries are also not charged");
description = g_strdup (_("Battery state could not be read at this time\n"));
}
@@ -1088,7 +1088,7 @@
return FALSE;
}
- gpm_debug ("Removing udi=%s", udi);
+ egg_debug ("Removing udi=%s", udi);
/* we unref as the device has gone away */
cell = (GpmCell *) g_ptr_array_index (cell_array->priv->array, index);
@@ -1117,7 +1117,7 @@
const gchar *capability,
GpmCellArray *cell_array)
{
- gpm_debug ("udi=%s, capability=%s", udi, capability);
+ egg_debug ("udi=%s, capability=%s", udi, capability);
if (strcmp (capability, "battery") == 0) {
gpm_cell_array_add_device_id (cell_array, udi);
@@ -1174,7 +1174,7 @@
gpm_cell_array_update (cell_array);
/* emit signal to get everything up from here to update */
- gpm_debug ("** EMIT: percent-changed");
+ egg_debug ("** EMIT: percent-changed");
unit = &(cell_array->priv->unit);
g_signal_emit (cell_array, signals [PERCENT_CHANGED], 0, unit->percentage);
}
@@ -1228,7 +1228,7 @@
unit = &(cell_array->priv->unit);
if (unit == NULL) {
- gpm_warning ("unit was NULL!");
+ egg_warning ("unit was NULL!");
return;
}
@@ -1240,7 +1240,7 @@
/* we unref as the device has gone away (only support one phone) */
cell = (GpmCell *) g_ptr_array_index (cell_array->priv->array, 0);
if (cell == NULL) {
- gpm_warning ("cell was NULL - gnome-phone-manager is playing with us!");
+ egg_warning ("cell was NULL - gnome-phone-manager is playing with us!");
return;
}
g_object_unref (cell);
Modified: trunk/src/gpm-cell-unit.c
==============================================================================
--- trunk/src/gpm-cell-unit.c (original)
+++ trunk/src/gpm-cell-unit.c Wed Sep 3 15:53:48 2008
@@ -26,7 +26,7 @@
#include <glib/gi18n.h>
#include "gpm-cell-unit.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
/**
* gpm_unit_init:
@@ -63,34 +63,34 @@
{
g_return_val_if_fail (unit != NULL, FALSE);
- gpm_debug ("device %s", gpm_cell_unit_get_kind_localised (unit, FALSE));
- gpm_debug ("present %i", unit->is_present);
- gpm_debug ("percent %.1f", unit->percentage);
- gpm_debug ("is charging %i", unit->is_charging);
- gpm_debug ("is discharging %i", unit->is_discharging);
+ egg_debug ("device %s", gpm_cell_unit_get_kind_localised (unit, FALSE));
+ egg_debug ("present %i", unit->is_present);
+ egg_debug ("percent %.1f", unit->percentage);
+ egg_debug ("is charging %i", unit->is_charging);
+ egg_debug ("is discharging %i", unit->is_discharging);
if (unit->charge_current > 0) {
- gpm_debug ("charge current %i", unit->charge_current);
+ egg_debug ("charge current %i", unit->charge_current);
}
if (unit->charge_last_full > 0) {
- gpm_debug ("charge last %i", unit->charge_last_full);
+ egg_debug ("charge last %i", unit->charge_last_full);
}
if (unit->charge_design > 0) {
- gpm_debug ("charge design %i", unit->charge_design);
+ egg_debug ("charge design %i", unit->charge_design);
}
if (unit->rate > 0) {
- gpm_debug ("rate %i", unit->rate);
+ egg_debug ("rate %i", unit->rate);
}
if (unit->time_charge > 0) {
- gpm_debug ("time charge %i", unit->time_charge);
+ egg_debug ("time charge %i", unit->time_charge);
}
if (unit->time_discharge > 0) {
- gpm_debug ("time discharge %i", unit->time_discharge);
+ egg_debug ("time discharge %i", unit->time_discharge);
}
if (unit->capacity > 0) {
- gpm_debug ("capacity %i", unit->capacity);
+ egg_debug ("capacity %i", unit->capacity);
}
if (unit->voltage > 0) {
- gpm_debug ("voltage %i", unit->voltage);
+ egg_debug ("voltage %i", unit->voltage);
}
return TRUE;
}
@@ -208,7 +208,7 @@
}
filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str);
}
- gpm_debug ("got filename: %s", filename);
+ egg_debug ("got filename: %s", filename);
return filename;
}
@@ -335,7 +335,7 @@
return TRUE;
}
- gpm_warning ("battery type %s unknown", kind);
+ egg_warning ("battery type %s unknown", kind);
return FALSE;
}
Modified: trunk/src/gpm-cell.c
==============================================================================
--- trunk/src/gpm-cell.c (original)
+++ trunk/src/gpm-cell.c Wed Sep 3 15:53:48 2008
@@ -31,7 +31,7 @@
#include "gpm-marshal.h"
#include "gpm-cell.h"
#include "gpm-cell-unit.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-phone.h"
static void gpm_cell_class_init (GpmCellClass *klass);
@@ -99,7 +99,7 @@
/* batteries might be missing */
hal_gdevice_get_bool (device, "battery.present", &unit->is_present, NULL);
if (unit->is_present == FALSE) {
- gpm_debug ("Battery not present, so not filling up values");
+ egg_debug ("Battery not present, so not filling up values");
return FALSE;
}
@@ -137,11 +137,11 @@
exists = hal_gdevice_get_uint (device, "battery.charge_level.rate",
&unit->rate, NULL);
if (exists == FALSE && (unit->is_discharging || unit->is_charging == TRUE)) {
- gpm_warning ("could not read your battery's charge rate");
+ egg_warning ("could not read your battery's charge rate");
}
/* sanity check to less than 100W */
if (unit->rate > 100*1000) {
- gpm_warning ("sanity checking rate from %i to 0", unit->rate);
+ egg_warning ("sanity checking rate from %i to 0", unit->rate);
unit->rate = 0;
}
/* The ACPI spec only allows this for primary cells, but in the real
@@ -160,7 +160,7 @@
exists = hal_gdevice_get_uint (device, "battery.charge_level.percentage", &percentage, NULL);
unit->percentage = (gfloat) percentage;
if (exists == FALSE) {
- gpm_warning ("could not read your battery's percentage charge.");
+ egg_warning ("could not read your battery's percentage charge.");
}
/* sanity check that remaining time exists (if it should) */
@@ -169,7 +169,7 @@
exists = hal_gdevice_get_uint (device,"battery.remaining_time",
&unit->time_charge, NULL);
if (exists == FALSE && (unit->is_discharging || unit->is_charging == TRUE)) {
- gpm_warning ("could not read your battery's remaining time");
+ egg_warning ("could not read your battery's remaining time");
}
}
@@ -181,18 +181,18 @@
capacity = 100.0f / (float) unit->charge_design;
unit->capacity = capacity * (float) unit->charge_last_full;
if (unit->capacity > 100) {
- gpm_debug ("rounding down capactity from "
+ egg_debug ("rounding down capactity from "
"%i to 100", unit->capacity);
unit->capacity = 100;
}
if (unit->capacity < 0) {
- gpm_debug ("rounding up capactity from "
+ egg_debug ("rounding up capactity from "
"%i to 0", unit->capacity);
unit->capacity = 0;
}
if (unit->capacity < 50 && !unit->reports_percentage) {
- gpm_warning ("battery has a low capacity");
- gpm_debug ("** EMIT: low-capacity");
+ egg_warning ("battery has a low capacity");
+ egg_debug ("** EMIT: low-capacity");
g_signal_emit (cell, signals [LOW_CAPACITY], 0, unit->capacity);
}
}
@@ -214,8 +214,8 @@
gchar *website;
hal_gdevice_get_string (device, "info.recall.vendor", &oem_vendor, NULL);
hal_gdevice_get_string (device, "info.recall.website_url", &website, NULL);
- gpm_warning ("battery is recalled");
- gpm_debug ("** EMIT: perhaps-recall");
+ egg_warning ("battery is recalled");
+ egg_debug ("** EMIT: perhaps-recall");
g_signal_emit (cell, signals [PERHAPS_RECALL], 0, oem_vendor, website);
g_free (oem_vendor);
g_free (website);
@@ -269,12 +269,12 @@
unit = gpm_cell_get_unit (cell);
- gpm_debug ("udi=%s, key=%s, added=%i, removed=%i, finally=%i",
+ egg_debug ("udi=%s, key=%s, added=%i, removed=%i, finally=%i",
udi, key, is_added, is_removed, finally);
/* only match battery* values */
if (strncmp (key, "battery", 7) != 0) {
- gpm_debug ("not battery key");
+ egg_debug ("not battery key");
return;
}
@@ -285,7 +285,7 @@
} else if (strcmp (key, "battery.rechargeable.is_charging") == 0) {
hal_gdevice_get_bool (device, key, &unit->is_charging, NULL);
- gpm_debug ("** EMIT: charging-changed: %i", unit->is_charging);
+ egg_debug ("** EMIT: charging-changed: %i", unit->is_charging);
g_signal_emit (cell, signals [CHARGING_CHANGED], 0, unit->is_charging);
/* reset the time, as we really can't guess this without profiling */
if (unit->is_charging) {
@@ -294,7 +294,7 @@
} else if (strcmp (key, "battery.rechargeable.is_discharging") == 0) {
hal_gdevice_get_bool (device, key, &unit->is_discharging, NULL);
- gpm_debug ("** EMIT: discharging-changed: %i", unit->is_discharging);
+ egg_debug ("** EMIT: discharging-changed: %i", unit->is_discharging);
g_signal_emit (cell, signals [DISCHARGING_CHANGED], 0, unit->is_discharging);
/* reset the time, as we really can't guess this without profiling */
if (unit->is_discharging) {
@@ -314,7 +314,7 @@
hal_gdevice_get_uint (device, key, &unit->rate, NULL);
/* sanity check to less than 100W */
if (unit->rate > 100*1000) {
- gpm_warning ("sanity checking rate from %i to 0", unit->rate);
+ egg_warning ("sanity checking rate from %i to 0", unit->rate);
unit->rate = 0;
}
@@ -322,7 +322,7 @@
guint percent;
hal_gdevice_get_uint (device, key, &percent, NULL);
unit->percentage = (gfloat) percent;
- gpm_debug ("** EMIT: percent-changed: %i", unit->percentage);
+ egg_debug ("** EMIT: percent-changed: %f", unit->percentage);
g_signal_emit (cell, signals [PERCENT_CHANGED], 0, unit->percentage);
} else if (strcmp (key, "battery.remaining_time") == 0) {
@@ -387,7 +387,7 @@
ret = hal_gdevice_set_udi (device, udi);
if (!ret) {
- gpm_warning ("cannot set udi");
+ egg_warning ("cannot set udi");
return FALSE;
}
@@ -398,13 +398,13 @@
hal_gdevice_get_string (device, "battery.type", &battery_kind_str, NULL);
if (battery_kind_str == NULL) {
- gpm_warning ("cannot obtain battery type");
+ egg_warning ("cannot obtain battery type");
return FALSE;
}
ret = gpm_cell_unit_set_kind (unit, battery_kind_str);
if (!ret) {
- gpm_warning ("battery type %s unknown", battery_kind_str);
+ egg_warning ("battery type %s unknown", battery_kind_str);
g_free (battery_kind_str);
return FALSE;
}
@@ -571,7 +571,7 @@
/* Translators: Unknown is related to the Technology of the battery */
technology = _("Unknown");
} else {
- gpm_warning ("Battery type %s not translated, please report!",
+ egg_warning ("Battery type %s not translated, please report!",
cell->priv->technology);
technology = cell->priv->technology;
}
@@ -674,13 +674,13 @@
if (unit->is_charging != is_charging) {
unit->is_charging = is_charging;
unit->is_discharging = !is_charging;
- gpm_debug ("** EMIT: charging-changed: %i", is_charging);
+ egg_debug ("** EMIT: charging-changed: %i", is_charging);
g_signal_emit (cell, signals [CHARGING_CHANGED], 0, is_charging);
}
if (percentage != unit->percentage) {
unit->percentage = (gfloat) percentage;
- gpm_debug ("** EMIT: percent-changed: %.1f", unit->percentage);
+ egg_debug ("** EMIT: percent-changed: %.1f", unit->percentage);
g_signal_emit (cell, signals [PERCENT_CHANGED], 0, unit->percentage);
}
}
Modified: trunk/src/gpm-common.c
==============================================================================
--- trunk/src/gpm-common.c (original)
+++ trunk/src/gpm-common.c Wed Sep 3 15:53:48 2008
@@ -27,7 +27,7 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-common.h"
/**
@@ -49,7 +49,7 @@
return smallest;
}
if (smallest == 0) {
- gpm_warning ("divisor zero");
+ egg_warning ("divisor zero");
return 0;
}
division = value / smallest;
@@ -80,7 +80,7 @@
return 0;
}
if (smallest == 0) {
- gpm_warning ("divisor zero");
+ egg_warning ("divisor zero");
return 0;
}
division = value / smallest;
@@ -89,36 +89,6 @@
}
/**
- * gpm_rgb_to_colour:
- * @red: The red value
- * @green: The green value
- * @blue: The blue value
- **/
-guint32
-gpm_rgb_to_colour (guint8 red, guint8 green, guint8 blue)
-{
- guint32 colour = 0;
- colour += (guint32) red * 0x10000;
- colour += (guint32) green * 0x100;
- colour += (guint32) blue;
- return colour;
-}
-
-/**
- * gpm_colour_to_rgb:
- * @red: The red value
- * @green: The green value
- * @blue: The blue value
- **/
-void
-gpm_colour_to_rgb (guint32 colour, guint8 *red, guint8 *green, guint8 *blue)
-{
- *red = (colour & 0xff0000) / 0x10000;
- *green = (colour & 0x00ff00) / 0x100;
- *blue = colour & 0x0000ff;
-}
-
-/**
* gpm_exponential_average:
* @previous: The old value
* @new: The new value
@@ -136,7 +106,7 @@
gfloat factor_inv = 1;
if (previous == 0 || slew == 0) {
/* startup, or re-initialization - we have no data */
- gpm_debug ("Quoting output with only one value...");
+ egg_debug ("Quoting output with only one value...");
result = new;
} else {
factor = (gfloat) slew / 100.0f;
@@ -164,7 +134,7 @@
return levels;
}
if (levels == 0) {
- gpm_warning ("levels is 0!");
+ egg_warning ("levels is 0!");
return 0;
}
return ((gfloat) percentage * (gfloat) (levels - 1)) / 100.0f;
@@ -187,10 +157,10 @@
return 100;
}
if (levels == 0) {
- gpm_warning ("levels is 0!");
+ egg_warning ("levels is 0!");
return 0;
}
- return (guint) ((float) discrete * (100.0f / (float) (levels - 1)));
+ return (guint) ((gfloat) discrete * (100.0f / (gfloat) (levels - 1)));
}
/**
@@ -211,10 +181,10 @@
return 1.0;
}
if (levels == 0) {
- gpm_warning ("levels is 0!");
+ egg_warning ("levels is 0!");
return 0.0;
}
- return (guint) ((float) discrete / ((float) (levels - 1)));
+ return (guint) ((gfloat) discrete / ((gfloat) (levels - 1)));
}
/**
@@ -372,8 +342,6 @@
void
gpm_st_common (GpmSelfTest *test)
{
- guint8 r, g, b;
- guint32 colour;
guint value;
gfloat fvalue;
@@ -382,87 +350,6 @@
}
/************************************************************/
- gpm_st_title (test, "get red");
- gpm_colour_to_rgb (0xff0000, &r, &g, &b);
- if (r == 255 && g == 0 && b == 0) {
- gpm_st_success (test, "got red");
- } else {
- gpm_st_failed (test, "could not get red (%i, %i, %i)", r, g, b);
- }
-
- /************************************************************/
- gpm_st_title (test, "get green");
- gpm_colour_to_rgb (0x00ff00, &r, &g, &b);
- if (r == 0 && g == 255 && b == 0) {
- gpm_st_success (test, "got green");
- } else {
- gpm_st_failed (test, "could not get green (%i, %i, %i)", r, g, b);
- }
-
- /************************************************************/
- gpm_st_title (test, "get blue");
- gpm_colour_to_rgb (0x0000ff, &r, &g, &b);
- if (r == 0 && g == 0 && b == 255) {
- gpm_st_success (test, "got blue");
- } else {
- gpm_st_failed (test, "could not get blue (%i, %i, %i)", r, g, b);
- }
-
- /************************************************************/
- gpm_st_title (test, "get black");
- gpm_colour_to_rgb (0x000000, &r, &g, &b);
- if (r == 0 && g == 0 && b == 0) {
- gpm_st_success (test, "got black");
- } else {
- gpm_st_failed (test, "could not get black (%i, %i, %i)", r, g, b);
- }
-
- /************************************************************/
- gpm_st_title (test, "get white");
- gpm_colour_to_rgb (0xffffff, &r, &g, &b);
- if (r == 255 && g == 255 && b == 255) {
- gpm_st_success (test, "got white");
- } else {
- gpm_st_failed (test, "could not get white (%i, %i, %i)", r, g, b);
- }
-
- /************************************************************/
- gpm_st_title (test, "set red");
- colour = gpm_rgb_to_colour (0xff, 0x00, 0x00);
- if (colour == 0xff0000) {
- gpm_st_success (test, "set red");
- } else {
- gpm_st_failed (test, "could not set red (%i)", colour);
- }
-
- /************************************************************/
- gpm_st_title (test, "set green");
- colour = gpm_rgb_to_colour (0x00, 0xff, 0x00);
- if (colour == 0x00ff00) {
- gpm_st_success (test, "set green");
- } else {
- gpm_st_failed (test, "could not set green (%i)", colour);
- }
-
- /************************************************************/
- gpm_st_title (test, "set blue");
- colour = gpm_rgb_to_colour (0x00, 0x00, 0xff);
- if (colour == 0x0000ff) {
- gpm_st_success (test, "set blue");
- } else {
- gpm_st_failed (test, "could not set blue (%i)", colour);
- }
-
- /************************************************************/
- gpm_st_title (test, "set white");
- colour = gpm_rgb_to_colour (0xff, 0xff, 0xff);
- if (colour == 0xffffff) {
- gpm_st_success (test, "set white");
- } else {
- gpm_st_failed (test, "could not set white (%i)", colour);
- }
-
- /************************************************************/
gpm_st_title (test, "limit precision down 0,10");
value = gpm_precision_round_down (0, 10);
if (value == 0) {
Modified: trunk/src/gpm-common.h
==============================================================================
--- trunk/src/gpm-common.h (original)
+++ trunk/src/gpm-common.h Wed Sep 3 15:53:48 2008
@@ -48,23 +48,6 @@
#define GPM_BUGZILLA_URL "http://bugzilla.gnome.org/buglist.cgi?product=gnome-power-manager"
#define GPM_FAQ_URL "http://live.gnome.org/GnomePowerManager/Faq"
-#define GPM_COLOUR_WHITE 0xffffff
-#define GPM_COLOUR_BLACK 0x000000
-#define GPM_COLOUR_RED 0xff0000
-#define GPM_COLOUR_GREEN 0x00ff00
-#define GPM_COLOUR_BLUE 0x0000ff
-#define GPM_COLOUR_CYAN 0x00ffff
-#define GPM_COLOUR_MAGENTA 0xff00ff
-#define GPM_COLOUR_YELLOW 0xffff00
-#define GPM_COLOUR_GREY 0xcccccc
-#define GPM_COLOUR_DARK_RED 0x600000
-#define GPM_COLOUR_DARK_GREEN 0x006000
-#define GPM_COLOUR_DARK_BLUE 0x000060
-#define GPM_COLOUR_DARK_CYAN 0x006060
-#define GPM_COLOUR_DARK_MAGENTA 0x600060
-#define GPM_COLOUR_DARK_YELLOW 0x606000
-#define GPM_COLOUR_DARK_GREY 0x606060
-
typedef enum {
GPM_ICON_POLICY_ALWAYS,
GPM_ICON_POLICY_PRESENT,
@@ -87,16 +70,9 @@
guint levels);
gfloat gpm_discrete_to_fraction (guint discrete,
guint levels);
-guint32 gpm_rgb_to_colour (guint8 red,
- guint8 green,
- guint8 blue);
-void gpm_colour_to_rgb (guint32 colour,
- guint8 *red,
- guint8 *green,
- guint8 *blue);
GpmIconPolicy gpm_tray_icon_mode_from_string (const gchar *mode);
const gchar *gpm_tray_icon_mode_to_string (GpmIconPolicy mode);
-void gpm_help_display (char *link_id);
+void gpm_help_display (char *link_id);
G_END_DECLS
Modified: trunk/src/gpm-conf.c
==============================================================================
--- trunk/src/gpm-conf.c (original)
+++ trunk/src/gpm-conf.c Wed Sep 3 15:53:48 2008
@@ -29,7 +29,7 @@
#include "gpm-marshal.h"
#include "gpm-conf.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
static void gpm_conf_class_init (GpmConfClass *klass);
static void gpm_conf_init (GpmConf *conf);
@@ -74,7 +74,7 @@
*value = gconf_client_get_bool (conf->priv->gconf_client, key, &error);
if (error) {
- gpm_debug ("Error: %s", error->message);
+ egg_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -106,7 +106,7 @@
*value = gconf_client_get_string (conf->priv->gconf_client, key, &error);
if (error) {
- gpm_debug ("Error: %s", error->message);
+ egg_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -136,7 +136,7 @@
*value = gconf_client_get_int (conf->priv->gconf_client, key, &error);
if (error) {
- gpm_debug ("Error: %s", error->message);
+ egg_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -191,12 +191,12 @@
ret = gconf_client_key_is_writable (conf->priv->gconf_client, key, NULL);
if (!ret) {
- gpm_debug ("%s not writable", key);
+ egg_debug ("%s not writable", key);
goto out;
}
gconf_client_set_bool (conf->priv->gconf_client, key, value, &error);
if (error) {
- gpm_debug ("Error: %s", error->message);
+ egg_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -228,12 +228,12 @@
ret = gconf_client_key_is_writable (conf->priv->gconf_client, key, NULL);
if (!ret) {
- gpm_debug ("%s not writable", key);
+ egg_debug ("%s not writable", key);
goto out;
}
gconf_client_set_string (conf->priv->gconf_client, key, value, &error);
if (error) {
- gpm_debug ("Error: %s", error->message);
+ egg_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -262,12 +262,12 @@
ret = gconf_client_key_is_writable (conf->priv->gconf_client, key, NULL);
if (!ret) {
- gpm_debug ("%s not writable", key);
+ egg_debug ("%s not writable", key);
goto out;
}
gconf_client_set_int (conf->priv->gconf_client, key, value, &error);
if (error) {
- gpm_debug ("Error: %s", error->message);
+ egg_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -320,7 +320,7 @@
*writable = gconf_client_key_is_writable (conf->priv->gconf_client, key, &error);
if (error) {
- gpm_debug ("Error: %s", error->message);
+ egg_debug ("Error: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -344,7 +344,7 @@
return;
}
- gpm_debug ("emitting value-changed : '%s'", entry->key);
+ egg_debug ("emitting value-changed : '%s'", entry->key);
g_signal_emit (conf, signals [VALUE_CHANGED], 0, entry->key);
}
Modified: trunk/src/gpm-control.c
==============================================================================
--- trunk/src/gpm-control.c (original)
+++ trunk/src/gpm-control.c Wed Sep 3 15:53:48 2008
@@ -52,7 +52,7 @@
#include "gpm-conf.h"
#include "gpm-screensaver.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-control.h"
#include "gpm-networkmanager.h"
@@ -107,7 +107,7 @@
pid = getpid ();
mask = polkit_check_auth (pid, privilege, NULL);
if (mask == 0) {
- gpm_warning ("failed to authorise for privilege %s", privilege);
+ egg_warning ("failed to authorise for privilege %s", privilege);
ret = FALSE;
}
#endif
@@ -138,10 +138,10 @@
NULL, NULL, &retcode, NULL) || ! WIFEXITED (retcode)) {
/* if check-foreground-console could not be executed,
* assume active console */
- gpm_debug ("could not execute check-foreground-console");
+ egg_debug ("could not execute check-foreground-console");
return TRUE;
}
- gpm_debug ("check-foreground-console returned with %i", WEXITSTATUS (retcode));
+ egg_debug ("check-foreground-console returned with %i", WEXITSTATUS (retcode));
return WEXITSTATUS (retcode) == 0;
#endif
/* no other checks failed, so return okay */
@@ -303,7 +303,7 @@
gpm_control_allowed_shutdown (control, &allowed, error);
if (allowed == FALSE) {
- gpm_warning ("Cannot shutdown");
+ egg_warning ("Cannot shutdown");
g_set_error (error,
GPM_CONTROL_ERROR,
GPM_CONTROL_ERROR_GENERAL,
@@ -343,7 +343,7 @@
gpm_control_allowed_reboot (control, &allowed, error);
if (allowed == FALSE) {
- gpm_warning ("Cannot reboot");
+ egg_warning ("Cannot reboot");
g_set_error (error,
GPM_CONTROL_ERROR,
GPM_CONTROL_ERROR_GENERAL,
@@ -386,10 +386,10 @@
gpm_conf_get_bool (control->priv->conf, GPM_CONF_LOCK_USE_SCREENSAVER, &use_ss_setting);
if (use_ss_setting) {
gpm_conf_get_bool (control->priv->conf, GS_PREF_LOCK_ENABLED, &do_lock);
- gpm_debug ("Using ScreenSaver settings (%i)", do_lock);
+ egg_debug ("Using ScreenSaver settings (%i)", do_lock);
} else {
gpm_conf_get_bool (control->priv->conf, policy, &do_lock);
- gpm_debug ("Using custom locking settings (%i)", do_lock);
+ egg_debug ("Using custom locking settings (%i)", do_lock);
}
return do_lock;
}
@@ -410,7 +410,7 @@
gpm_control_allowed_suspend (control, &allowed, error);
if (allowed == FALSE) {
- gpm_syslog ("cannot suspend as not allowed from policy");
+ egg_debug ("cannot suspend as not allowed from policy");
g_set_error (error,
GPM_CONTROL_ERROR,
GPM_CONTROL_ERROR_GENERAL,
@@ -424,7 +424,7 @@
if (lock_gnome_keyring) {
keyres = gnome_keyring_lock_all_sync ();
if (keyres != GNOME_KEYRING_RESULT_OK) {
- gpm_warning ("could not lock keyring");
+ egg_warning ("could not lock keyring");
}
}
@@ -439,7 +439,7 @@
}
/* Do the suspend */
- gpm_debug ("emitting sleep");
+ egg_debug ("emitting sleep");
g_signal_emit (control, signals [SLEEP], 0, GPM_CONTROL_ACTION_SUSPEND);
ret = hal_gpower_suspend (control->priv->hal_power, 0, error);
@@ -447,11 +447,11 @@
gpm_control_convert_hal_error (control, error);
}
- gpm_debug ("emitting resume");
+ egg_debug ("emitting resume");
g_signal_emit (control, signals [RESUME], 0, GPM_CONTROL_ACTION_SUSPEND);
if (!ret) {
- gpm_debug ("emitting sleep-failure");
+ egg_debug ("emitting sleep-failure");
g_signal_emit (control, signals [SLEEP_FAILURE], 0, GPM_CONTROL_ACTION_SUSPEND);
}
@@ -486,7 +486,7 @@
gpm_control_allowed_hibernate (control, &allowed, error);
if (allowed == FALSE) {
- gpm_syslog ("cannot hibernate as not allowed from policy");
+ egg_debug ("cannot hibernate as not allowed from policy");
g_set_error (error,
GPM_CONTROL_ERROR,
GPM_CONTROL_ERROR_GENERAL,
@@ -500,7 +500,7 @@
if (lock_gnome_keyring) {
keyres = gnome_keyring_lock_all_sync ();
if (keyres != GNOME_KEYRING_RESULT_OK) {
- gpm_warning ("could not lock keyring");
+ egg_warning ("could not lock keyring");
}
}
@@ -514,7 +514,7 @@
gpm_networkmanager_sleep ();
}
- gpm_debug ("emitting sleep");
+ egg_debug ("emitting sleep");
g_signal_emit (control, signals [SLEEP], 0, GPM_CONTROL_ACTION_HIBERNATE);
ret = hal_gpower_hibernate (control->priv->hal_power, error);
@@ -522,11 +522,11 @@
gpm_control_convert_hal_error (control, error);
}
- gpm_debug ("emitting resume");
+ egg_debug ("emitting resume");
g_signal_emit (control, signals [RESUME], 0, GPM_CONTROL_ACTION_HIBERNATE);
if (!ret) {
- gpm_debug ("emitting sleep-failure");
+ egg_debug ("emitting sleep-failure");
g_signal_emit (control, signals [SLEEP_FAILURE], 0, GPM_CONTROL_ACTION_HIBERNATE);
}
Modified: trunk/src/gpm-dpms.c
==============================================================================
--- trunk/src/gpm-dpms.c (original)
+++ trunk/src/gpm-dpms.c Wed Sep 3 15:53:48 2008
@@ -43,7 +43,7 @@
#endif
#include "gpm-conf.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-dpms.h"
static void gpm_dpms_class_init (GpmDpmsClass *klass);
@@ -126,11 +126,11 @@
CARD16 o_suspend = 0;
CARD16 o_off = 0;
- gpm_debug ("Syncing DPMS settings enabled=%d timeouts=%d %d %d",
+ egg_debug ("Syncing DPMS settings enabled=%d timeouts=%d %d %d",
enabled, standby_secs, suspend_secs, off_secs);
if (! DPMSInfo (dpy, &o_power, &o_enabled)) {
- gpm_debug ("unable to get DPMS state.");
+ egg_debug ("unable to get DPMS state.");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -149,7 +149,7 @@
}
if (! res) {
- gpm_debug ("unable to set DPMS state.");
+ egg_debug ("unable to set DPMS state.");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -157,12 +157,12 @@
return FALSE;
} else {
- gpm_debug ("turned DPMS %s", enabled ? "ON" : "OFF");
+ egg_debug ("turned DPMS %s", enabled ? "ON" : "OFF");
}
}
if (! DPMSGetTimeouts (dpy, &o_standby, &o_suspend, &o_off)) {
- gpm_debug ("unable to get DPMS timeouts.");
+ egg_debug ("unable to get DPMS timeouts.");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -175,7 +175,7 @@
o_suspend != suspend_secs ||
o_off != off_secs) {
if (! DPMSSetTimeouts (dpy, standby_secs, suspend_secs, off_secs)) {
- gpm_debug ("unable to set DPMS timeouts.");
+ egg_debug ("unable to set DPMS timeouts.");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -183,7 +183,7 @@
return FALSE;
} else {
- gpm_debug ("set DPMS timeouts: %d %d %d.",
+ egg_debug ("set DPMS timeouts: %d %d %d.",
standby_secs, suspend_secs, off_secs);
}
}
@@ -191,7 +191,7 @@
return TRUE;
# else /* !HAVE_DPMS_EXTENSION */
- gpm_debug ("DPMS support not compiled in.");
+ egg_debug ("DPMS support not compiled in.");
return FALSE;
# endif /* HAVE_DPMS_EXTENSION */
}
@@ -254,7 +254,7 @@
BOOL current_enabled;
if (dpms->priv->dpms_capable == FALSE) {
- gpm_debug ("not DPMS capable");
+ egg_debug ("not DPMS capable");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -263,7 +263,7 @@
}
if (! DPMSInfo (GDK_DISPLAY (), ¤t_state, ¤t_enabled)) {
- gpm_debug ("couldn't get DPMS info");
+ egg_debug ("couldn't get DPMS info");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -272,7 +272,7 @@
}
if (! current_enabled) {
- gpm_debug ("DPMS not enabled");
+ egg_debug ("DPMS not enabled");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -358,7 +358,7 @@
}
if (dpms->priv->dpms_capable == FALSE) {
- gpm_debug ("Display is not DPMS capable");
+ egg_debug ("Display is not DPMS capable");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
@@ -405,7 +405,7 @@
ret = FALSE;
if (dpms->priv->enabled != enabled) {
- gpm_debug ("setting DPMS enabled: %d", enabled);
+ egg_debug ("setting DPMS enabled: %d", enabled);
dpms->priv->enabled = enabled;
@@ -440,7 +440,7 @@
ret = FALSE;
if (dpms->priv->active != active) {
- gpm_debug ("setting DPMS active: %d", active);
+ egg_debug ("setting DPMS active: %d", active);
dpms->priv->active = active;
@@ -500,7 +500,7 @@
} else if (strcmp (dpms_method, "off") == 0) {
method = GPM_DPMS_METHOD_OFF;
} else {
- gpm_warning ("dpms_method '%s' not recognised", dpms_method);
+ egg_warning ("dpms_method '%s' not recognised", dpms_method);
}
return method;
@@ -562,7 +562,7 @@
g_return_val_if_fail (GPM_IS_DPMS (dpms), FALSE);
if (mode == GPM_DPMS_MODE_UNKNOWN) {
- gpm_debug ("mode unknown");
+ egg_debug ("mode unknown");
g_set_error (error,
GPM_DPMS_ERROR,
GPM_DPMS_ERROR_GENERAL,
Modified: trunk/src/gpm-engine.c
==============================================================================
--- trunk/src/gpm-engine.c (original)
+++ trunk/src/gpm-engine.c Wed Sep 3 15:53:48 2008
@@ -38,7 +38,7 @@
#include "gpm-cell-unit.h"
#include "gpm-cell-array.h"
#include "gpm-cell.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-stock-icons.h"
#include "gpm-warnings.h"
#include "gpm-prefs-server.h"
@@ -346,7 +346,7 @@
/* remove the last \n */
g_string_truncate (tooltip, tooltip->len-1);
- gpm_debug ("tooltip: %s", tooltip->str);
+ egg_debug ("tooltip: %s", tooltip->str);
return g_string_free (tooltip, FALSE);
}
@@ -375,7 +375,7 @@
g_return_val_if_fail (GPM_IS_ENGINE (engine), NULL);
if (engine->priv->icon_policy == GPM_ICON_POLICY_NEVER) {
- gpm_debug ("no icon allowed, so no icon will be displayed.");
+ egg_debug ("no icon allowed, so no icon will be displayed.");
return NULL;
}
@@ -388,7 +388,7 @@
unit_phone = gpm_cell_array_get_unit (collection->phone);
/* we try CRITICAL: PRIMARY, UPS, MOUSE, KEYBOARD */
- gpm_debug ("Trying CRITICAL icon: primary, ups, mouse, keyboard");
+ egg_debug ("Trying CRITICAL icon: primary, ups, mouse, keyboard");
if (unit_primary->is_present) {
state = gpm_warnings_get_state (engine->priv->warnings, unit_primary);
if (state == GPM_WARNINGS_CRITICAL) {
@@ -427,12 +427,12 @@
}
if (engine->priv->icon_policy == GPM_ICON_POLICY_CRITICAL) {
- gpm_debug ("no devices critical, so no icon will be displayed.");
+ egg_debug ("no devices critical, so no icon will be displayed.");
return NULL;
}
/* we try (DIS)CHARGING: PRIMARY, UPS */
- gpm_debug ("Trying CHARGING icon: primary, ups");
+ egg_debug ("Trying CHARGING icon: primary, ups");
if (unit_primary->is_present &&
(unit_primary->is_charging || unit_primary->is_discharging == TRUE)) {
return gpm_cell_array_get_icon (collection->primary);
@@ -444,12 +444,12 @@
/* Check if we should just show the icon all the time */
if (engine->priv->icon_policy == GPM_ICON_POLICY_CHARGE) {
- gpm_debug ("no devices (dis)charging, so no icon will be displayed.");
+ egg_debug ("no devices (dis)charging, so no icon will be displayed.");
return NULL;
}
/* we try PRESENT: PRIMARY, UPS */
- gpm_debug ("Trying PRESENT icon: primary, ups");
+ egg_debug ("Trying PRESENT icon: primary, ups");
if (unit_primary->is_present) {
return gpm_cell_array_get_icon (collection->primary);
@@ -459,12 +459,12 @@
/* Check if we should just fallback to the ac icon */
if (engine->priv->icon_policy == GPM_ICON_POLICY_PRESENT) {
- gpm_debug ("no devices present, so no icon will be displayed.");
+ egg_debug ("no devices present, so no icon will be displayed.");
return NULL;
}
/* we fallback to the ac_adapter icon */
- gpm_debug ("Using fallback");
+ egg_debug ("Using fallback");
return g_strdup_printf (GPM_STOCK_AC_ADAPTER);
}
@@ -488,7 +488,7 @@
if (show_recall) {
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: perhaps-recall");
+ egg_debug ("** EMIT: perhaps-recall");
g_signal_emit (engine, signals [PERHAPS_RECALL], 0, kind, oem_vendor, website);
}
}
@@ -514,7 +514,7 @@
/* only emit this once per startup */
if (show_capacity) {
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: low-capacity");
+ egg_debug ("** EMIT: low-capacity");
g_signal_emit (engine, signals [LOW_CAPACITY], 0, kind, capacity);
}
}
@@ -560,7 +560,7 @@
return FALSE;
}
/* icon before, now none */
- gpm_debug ("** EMIT: icon-changed: none");
+ egg_debug ("** EMIT: icon-changed: none");
/* we let the icon stick around for a couple of seconds */
g_timeout_add (1000*2, (GSourceFunc) gpm_engine_icon_clear_delay, engine);
@@ -572,7 +572,7 @@
/* no icon before, now icon */
if (engine->priv->previous_icon == NULL) {
- gpm_debug ("** EMIT: icon-changed: %s", icon);
+ egg_debug ("** EMIT: icon-changed: %s", icon);
g_signal_emit (engine, signals [ICON_CHANGED], 0, icon);
engine->priv->previous_icon = icon;
return TRUE;
@@ -582,12 +582,12 @@
if (strcmp (engine->priv->previous_icon, icon) != 0) {
g_free (engine->priv->previous_icon);
engine->priv->previous_icon = icon;
- gpm_debug ("** EMIT: icon-changed: %s", icon);
+ egg_debug ("** EMIT: icon-changed: %s", icon);
g_signal_emit (engine, signals [ICON_CHANGED], 0, icon);
return TRUE;
}
- gpm_debug ("no change");
+ egg_debug ("no change");
/* nothing to do... */
g_free (icon);
return FALSE;
@@ -612,7 +612,7 @@
if (engine->priv->previous_summary == NULL) {
engine->priv->previous_summary = summary;
- gpm_debug ("** EMIT: summary-changed(1): %s", summary);
+ egg_debug ("** EMIT: summary-changed(1): %s", summary);
g_signal_emit (engine, signals [SUMMARY_CHANGED], 0, summary);
return TRUE;
}
@@ -620,11 +620,11 @@
if (strcmp (engine->priv->previous_summary, summary) != 0) {
g_free (engine->priv->previous_summary);
engine->priv->previous_summary = summary;
- gpm_debug ("** EMIT: summary-changed(2): %s", summary);
+ egg_debug ("** EMIT: summary-changed(2): %s", summary);
g_signal_emit (engine, signals [SUMMARY_CHANGED], 0, summary);
return TRUE;
}
- gpm_debug ("no change");
+ egg_debug ("no change");
/* nothing to do... */
g_free (summary);
return FALSE;
@@ -641,7 +641,7 @@
/* we want to make this quicker */
if (engine->priv->during_coldplug) {
- gpm_debug ("ignoring due to coldplug");
+ egg_debug ("ignoring due to coldplug");
return;
}
@@ -720,7 +720,7 @@
kind = gpm_cell_array_get_kind (cell_array);
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: discharging");
+ egg_debug ("** EMIT: discharging");
g_signal_emit (engine, signals [DISCHARGING], 0, kind);
}
}
@@ -779,7 +779,7 @@
kind = gpm_cell_array_get_kind (cell_array);
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: fully-charged");
+ egg_debug ("** EMIT: fully-charged");
g_signal_emit (engine, signals [FULLY_CHARGED], 0, kind);
}
}
@@ -806,7 +806,7 @@
unit = gpm_cell_array_get_unit (cell_array);
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: charge-low");
+ egg_debug ("** EMIT: charge-low");
g_signal_emit (engine, signals [CHARGE_LOW], 0, kind, unit);
}
@@ -832,7 +832,7 @@
unit = gpm_cell_array_get_unit (cell_array);
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: charge-critical");
+ egg_debug ("** EMIT: charge-critical");
g_signal_emit (engine, signals [CHARGE_CRITICAL], 0, kind, unit);
}
@@ -858,7 +858,7 @@
unit = gpm_cell_array_get_unit (cell_array);
/* just proxy it to the GUI layer */
- gpm_debug ("** EMIT: charge-action");
+ egg_debug ("** EMIT: charge-action");
g_signal_emit (engine, signals [CHARGE_ACTION], 0, kind, unit);
}
Modified: trunk/src/gpm-feedback-widget.c
==============================================================================
--- trunk/src/gpm-feedback-widget.c (original)
+++ trunk/src/gpm-feedback-widget.c Wed Sep 3 15:53:48 2008
@@ -30,7 +30,7 @@
#include "gpm-feedback-widget.h"
#include "gpm-stock-icons.h"
#include "gpm-refcount.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
static void gpm_feedback_class_init (GpmFeedbackClass *klass);
static void gpm_feedback_init (GpmFeedback *feedback);
@@ -70,7 +70,6 @@
static void
gpm_feedback_show (GtkWidget *widget)
{
-
int orig_w, orig_h;
int screen_w, screen_h;
int x, y;
@@ -90,12 +89,10 @@
gtk_window_get_default_size (GTK_WINDOW (widget), &orig_w, &orig_h);
gtk_widget_size_request (widget, &win_req);
- if (win_req.width > orig_w) {
+ if (win_req.width > orig_w)
orig_w = win_req.width;
- }
- if (win_req.height > orig_h) {
+ if (win_req.height > orig_h)
orig_h = win_req.height;
- }
pointer_screen = NULL;
gdk_display_get_pointer (gdk_screen_get_display (current_screen),
@@ -105,8 +102,7 @@
* assume the default monitor */
monitor = 0;
} else {
- monitor = gdk_screen_get_monitor_at_point (current_screen,
- pointer_x, pointer_y);
+ monitor = gdk_screen_get_monitor_at_point (current_screen, pointer_x, pointer_y);
}
gdk_screen_get_monitor_geometry (current_screen, monitor, &geometry);
@@ -131,7 +127,7 @@
gpm_feedback_close_window (GpmRefcount *refcount,
GpmFeedback *feedback)
{
- gpm_debug ("Closing feedback widget");
+ egg_debug ("Closing feedback widget");
gtk_widget_hide (feedback->priv->main_window);
}
@@ -141,7 +137,7 @@
g_return_val_if_fail (feedback != NULL, FALSE);
g_return_val_if_fail (GPM_IS_FEEDBACK (feedback), FALSE);
- gpm_debug ("Displaying %f on feedback widget", value);
+ egg_debug ("Displaying %f on feedback widget", value);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (feedback->priv->progress), value);
gpm_feedback_show (feedback->priv->main_window);
@@ -165,7 +161,7 @@
g_free (feedback->priv->icon_name);
}
- gpm_debug ("Using icon name '%s'", icon_name);
+ egg_debug ("Using icon name '%s'", icon_name);
feedback->priv->icon_name = g_strdup (icon_name);
image = glade_xml_get_widget (feedback->priv->xml, "image");
@@ -194,9 +190,8 @@
/* initialise the window */
feedback->priv->xml = glade_xml_new (GPM_DATA "/gpm-feedback-widget.glade", NULL, NULL);
- if (feedback->priv->xml == NULL) {
- gpm_error ("Can't find gpm-feedback-widget.glade");
- }
+ if (feedback->priv->xml == NULL)
+ egg_error ("Can't find gpm-feedback-widget.glade");
feedback->priv->main_window = glade_xml_get_widget (feedback->priv->xml, "main_window");
feedback->priv->progress = glade_xml_get_widget (feedback->priv->xml, "progressbar");
@@ -221,14 +216,9 @@
feedback = GPM_FEEDBACK (object);
feedback->priv = GPM_FEEDBACK_GET_PRIVATE (feedback);
- if (feedback->priv->icon_name != NULL) {
- g_free (feedback->priv->icon_name);
- }
- if (feedback->priv->refcount != NULL) {
+ g_free (feedback->priv->icon_name);
+ if (feedback->priv->refcount != NULL)
g_object_unref (feedback->priv->refcount);
- }
-
- /* FIXME: we should unref some stuff */
G_OBJECT_CLASS (gpm_feedback_parent_class)->finalize (object);
}
@@ -244,3 +234,4 @@
feedback = g_object_new (GPM_TYPE_FEEDBACK, NULL);
return GPM_FEEDBACK (feedback);
}
+
Modified: trunk/src/gpm-graph-widget.c
==============================================================================
--- trunk/src/gpm-graph-widget.c (original)
+++ trunk/src/gpm-graph-widget.c Wed Sep 3 15:53:48 2008
@@ -27,10 +27,11 @@
#include <stdlib.h>
#include <string.h>
+#include "egg-color.h"
#include "gpm-common.h"
#include "gpm-graph-widget.h"
#include "gpm-array.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
G_DEFINE_TYPE (GpmGraphWidget, gpm_graph_widget, GTK_TYPE_DRAWING_AREA);
#define GPM_GRAPH_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_GRAPH_WIDGET, GpmGraphWidgetPrivate))
@@ -121,11 +122,11 @@
keyitem = gpm_graph_widget_key_find_id (graph, id);
if (keyitem != NULL) {
- gpm_warning ("keyitem %i already in use", id);
+ egg_warning ("keyitem %i already in use", id);
return FALSE;
}
- gpm_debug ("add to hashtable '%s'", desc);
+ egg_debug ("add to hashtable '%s'", desc);
keyitem = g_new0 (GpmGraphWidgetKeyItem, 1);
keyitem->id = id;
keyitem->desc = g_strdup (desc);
@@ -195,7 +196,7 @@
g_return_val_if_fail (graph != NULL, FALSE);
g_return_val_if_fail (GPM_IS_GRAPH_WIDGET (graph), FALSE);
- gpm_debug ("add to list %s", desc);
+ egg_debug ("add to list %s", desc);
keyitem = g_new0 (GpmGraphWidgetKeyData, 1);
keyitem->colour = colour;
@@ -387,7 +388,7 @@
/* check size is not zero */
length = gpm_array_get_size (array);
if (length == 0) {
- gpm_warning ("Trying to assign a zero length array");
+ egg_warning ("Trying to assign a zero length array");
return FALSE;
}
@@ -423,7 +424,7 @@
/* remove all in list */
length = graph->priv->data_list->len;
for (i=0; i < length; i++) {
- gpm_debug ("Removing dataset %i", i);
+ egg_debug ("Removing dataset %i", i);
g_ptr_array_remove_index_fast (graph->priv->data_list, 0);
}
}
@@ -686,7 +687,7 @@
guint length;
if (graph->priv->data_list->len == 0) {
- gpm_debug ("no data");
+ egg_debug ("no data");
graph->priv->start_x = 0;
graph->priv->start_y = 0;
graph->priv->stop_x = 10;
@@ -714,7 +715,7 @@
}
}
}
- gpm_debug ("Data range is %i<x<%i, %i<y<%i", smallest_x, biggest_x, smallest_y, biggest_y);
+ egg_debug ("Data range is %i<x<%i, %i<y<%i", smallest_x, biggest_x, smallest_y, biggest_y);
if (graph->priv->axis_type_x == GPM_GRAPH_WIDGET_TYPE_PERCENTAGE) {
rounding_x = 10;
@@ -778,7 +779,7 @@
}
}
- gpm_debug ("Processed range is %i<x<%i, %i<y<%i",
+ egg_debug ("Processed range is %i<x<%i, %i<y<%i",
graph->priv->start_x, graph->priv->stop_x,
graph->priv->start_y, graph->priv->stop_y);
}
@@ -792,7 +793,7 @@
gpm_graph_widget_set_colour (cairo_t *cr, guint32 colour)
{
guint8 r, g, b;
- gpm_colour_to_rgb (colour, &r, &g, &b);
+ egg_color_to_rgb (colour, &r, &g, &b);
cairo_set_source_rgb (cr, ((gdouble) r)/256.0f, ((gdouble) g)/256.0f, ((gdouble) b)/256.0f);
}
@@ -872,7 +873,7 @@
cairo_set_line_width (cr, 1);
cairo_stroke (cr);
} else {
- gpm_warning ("shape %i not recognised!", shape);
+ egg_warning ("shape %i not recognised!", shape);
}
}
@@ -936,14 +937,14 @@
guint i;
if (graph->priv->data_list->len == 0) {
- gpm_debug ("no data");
+ egg_debug ("no data");
return;
}
cairo_save (cr);
/* do all the lines on the graphs */
for (i=0; i<graph->priv->data_list->len; i++) {
- gpm_debug ("drawing line %i", i);
+ egg_debug ("drawing line %i", i);
array = g_ptr_array_index (graph->priv->data_list, i);
/* we have no data */
@@ -1016,7 +1017,7 @@
point = gpm_array_get (graph->priv->events, i);
if (point == NULL) {
/* this shouldn't ever happen */
- gpm_warning ("point NULL!");
+ egg_warning ("point NULL!");
break;
}
/* try to position the point on the line, or at zero if there is no line */
@@ -1039,7 +1040,7 @@
if (point->x > graph->priv->start_x && newy > graph->priv->box_y) {
keyitem = gpm_graph_widget_key_find_id (graph, point->y);
if (keyitem == NULL) {
- gpm_warning ("did not find id %i", point->y);
+ egg_warning ("did not find id %i", point->y);
} else {
gpm_graph_widget_draw_dot (cr, newx, newy, keyitem->colour, keyitem->shape);
}
@@ -1105,7 +1106,7 @@
keydataitem = (GpmGraphWidgetKeyData *) g_slist_nth_data (graph->priv->key_data, a);
if (keydataitem == NULL) {
/* this shouldn't ever happen */
- gpm_warning ("keydataitem NULL!");
+ egg_warning ("keydataitem NULL!");
break;
}
gpm_graph_widget_draw_legend_line (cr, x + 8, y_count, keydataitem->colour);
@@ -1121,7 +1122,7 @@
keyeventitem = (GpmGraphWidgetKeyItem *) g_slist_nth_data (graph->priv->key_event, a);
if (keyeventitem == NULL) {
/* this shouldn't ever happen */
- gpm_warning ("keyeventitem NULL!");
+ egg_warning ("keyeventitem NULL!");
break;
}
gpm_graph_widget_draw_dot (cr, x + 8, y_count,
@@ -1416,9 +1417,9 @@
wait_for_input (test);
/********** KEY DATA *************/
- gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), GPM_COLOUR_RED, "red data");
- gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), GPM_COLOUR_GREEN, "green data");
- gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), GPM_COLOUR_BLUE, "blue data");
+ gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), EGG_COLOR_RED, "red data");
+ gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), EGG_COLOR_GREEN, "green data");
+ gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), EGG_COLOR_BLUE, "blue data");
gpm_st_title_graph (test, "red green blue key data added");
wait_for_input (test);
@@ -1430,19 +1431,19 @@
/********** KEY EVENT *************/
gpm_graph_widget_key_event_add (GPM_GRAPH_WIDGET (graph), 0,
- GPM_COLOUR_RED,
+ EGG_COLOR_RED,
GPM_GRAPH_WIDGET_SHAPE_CIRCLE,
"red circle");
gpm_graph_widget_key_event_add (GPM_GRAPH_WIDGET (graph), 1,
- GPM_COLOUR_GREEN,
+ EGG_COLOR_GREEN,
GPM_GRAPH_WIDGET_SHAPE_SQUARE,
"green square");
gpm_graph_widget_key_event_add (GPM_GRAPH_WIDGET (graph), 2,
- GPM_COLOUR_BLUE,
+ EGG_COLOR_BLUE,
GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
"blue triangle");
gpm_graph_widget_key_event_add (GPM_GRAPH_WIDGET (graph), 3,
- GPM_COLOUR_WHITE,
+ EGG_COLOR_WHITE,
GPM_GRAPH_WIDGET_SHAPE_DIAMOND,
"white diamond");
@@ -1453,7 +1454,7 @@
/********** KEY EVENT duplicate test *************/
gpm_st_title (test, "duplicate key event test");
ret = gpm_graph_widget_key_event_add (GPM_GRAPH_WIDGET (graph), 3,
- GPM_COLOUR_WHITE,
+ EGG_COLOR_WHITE,
GPM_GRAPH_WIDGET_SHAPE_DIAMOND,
"white diamond");
if (!ret) {
@@ -1473,14 +1474,14 @@
gpm_graph_widget_key_data_clear (GPM_GRAPH_WIDGET (graph));
gpm_graph_widget_key_event_clear (GPM_GRAPH_WIDGET (graph));
- gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), GPM_COLOUR_RED, "red data");
- gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), GPM_COLOUR_BLUE, "blue data");
- gpm_graph_widget_key_event_add (GPM_GRAPH_WIDGET (graph), 0, GPM_COLOUR_GREEN, GPM_GRAPH_WIDGET_SHAPE_SQUARE, "green square");
+ gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), EGG_COLOR_RED, "red data");
+ gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), EGG_COLOR_BLUE, "blue data");
+ gpm_graph_widget_key_event_add (GPM_GRAPH_WIDGET (graph), 0, EGG_COLOR_GREEN, GPM_GRAPH_WIDGET_SHAPE_SQUARE, "green square");
/********** ADD INVALID DATA *************/
data = gpm_array_new ();
- gpm_array_append (data, 50, 0, GPM_COLOUR_RED);
- gpm_array_append (data, 40, 100, GPM_COLOUR_RED);
+ gpm_array_append (data, 50, 0, EGG_COLOR_RED);
+ gpm_array_append (data, 40, 100, EGG_COLOR_RED);
gpm_graph_widget_data_clear (GPM_GRAPH_WIDGET (graph));
gpm_st_title (test, "add invalid data");
ret = gpm_graph_widget_data_add (GPM_GRAPH_WIDGET (graph), data);
@@ -1505,8 +1506,8 @@
/********** ADD VALID DATA *************/
data = gpm_array_new ();
- gpm_array_append (data, 0, 0, GPM_COLOUR_RED);
- gpm_array_append (data, 100, 100, GPM_COLOUR_RED);
+ gpm_array_append (data, 0, 0, EGG_COLOR_RED);
+ gpm_array_append (data, 100, 100, EGG_COLOR_RED);
gpm_st_title (test, "add valid data");
ret = gpm_graph_widget_data_add (GPM_GRAPH_WIDGET (graph), data);
if (ret) {
@@ -1521,8 +1522,8 @@
/*********** second line **************/
data_more = gpm_array_new ();
- gpm_array_append (data_more, 0, 100, GPM_COLOUR_BLUE);
- gpm_array_append (data_more, 100, 0, GPM_COLOUR_BLUE);
+ gpm_array_append (data_more, 0, 100, EGG_COLOR_BLUE);
+ gpm_array_append (data_more, 100, 0, EGG_COLOR_BLUE);
gpm_graph_widget_data_add (GPM_GRAPH_WIDGET (graph), data_more);
gpm_st_title_graph (test, "red line shown gradient up, blue gradient down");
@@ -1564,14 +1565,14 @@
gpm_graph_widget_set_axis_type_x (GPM_GRAPH_WIDGET (graph), GPM_GRAPH_WIDGET_TYPE_PERCENTAGE);
gpm_graph_widget_key_event_clear (GPM_GRAPH_WIDGET (graph));
gpm_graph_widget_key_data_clear (GPM_GRAPH_WIDGET (graph));
- gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), GPM_COLOUR_RED, "red data");
+ gpm_graph_widget_key_data_add (GPM_GRAPH_WIDGET (graph), EGG_COLOR_RED, "red data");
data = gpm_array_new ();
- gpm_array_append (data, 0, 75, GPM_COLOUR_RED);
- gpm_array_append (data, 20, 78, GPM_COLOUR_RED);
- gpm_array_append (data, 40, 74, GPM_COLOUR_RED);
- gpm_array_append (data, 60, 72, GPM_COLOUR_RED);
- gpm_array_append (data, 80, 78, GPM_COLOUR_RED);
- gpm_array_append (data, 100, 79, GPM_COLOUR_RED);
+ gpm_array_append (data, 0, 75, EGG_COLOR_RED);
+ gpm_array_append (data, 20, 78, EGG_COLOR_RED);
+ gpm_array_append (data, 40, 74, EGG_COLOR_RED);
+ gpm_array_append (data, 60, 72, EGG_COLOR_RED);
+ gpm_array_append (data, 80, 78, EGG_COLOR_RED);
+ gpm_array_append (data, 100, 79, EGG_COLOR_RED);
gpm_graph_widget_data_add (GPM_GRAPH_WIDGET (graph), data);
gpm_st_title_graph (test, "autorange y axis between 70 and 80");
wait_for_input (test);
@@ -1579,8 +1580,8 @@
/********** AUTORANGING PERCENT (extremes) *************/
data = gpm_array_new ();
- gpm_array_append (data, 0, 6, GPM_COLOUR_RED);
- gpm_array_append (data, 100, 85, GPM_COLOUR_RED);
+ gpm_array_append (data, 0, 6, EGG_COLOR_RED);
+ gpm_array_append (data, 100, 85, EGG_COLOR_RED);
gpm_graph_widget_data_clear (GPM_GRAPH_WIDGET (graph));
gpm_graph_widget_data_add (GPM_GRAPH_WIDGET (graph), data);
gpm_st_title_graph (test, "autorange y axis between 0 and 100");
Modified: trunk/src/gpm-idle.c
==============================================================================
--- trunk/src/gpm-idle.c (original)
+++ trunk/src/gpm-idle.c Wed Sep 3 15:53:48 2008
@@ -38,7 +38,7 @@
#include "gpm-idle.h"
#include "gpm-load.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-screensaver.h"
static void gpm_idle_reset (GpmIdle *idle);
@@ -95,7 +95,7 @@
gpm_idle_reset (idle);
- gpm_debug ("Doing a state transition: %d", mode);
+ egg_debug ("Doing a state transition: %d", mode);
g_signal_emit (idle,
signals [IDLE_CHANGED],
0,
@@ -122,7 +122,7 @@
/* FIXME: should this stay below this level for a certain time? */
if (load > IDLE_LIMIT) {
/* check if system is "idle" enough */
- gpm_debug ("Detected that the CPU is busy");
+ egg_debug ("Detected that the CPU is busy");
do_action = FALSE;
}
}
@@ -168,7 +168,7 @@
static gboolean
system_timer (GpmIdle *idle)
{
- gpm_debug ("System idle timeout");
+ egg_debug ("System idle timeout");
gpm_idle_remove_gpm_idle_poll_system_timer (idle);
gpm_idle_add_gpm_idle_poll_system_timer (idle, POLL_FREQUENCY * 1000);
@@ -218,7 +218,7 @@
idle->priv->system_timer_id = g_timeout_add (msecs,
(GSourceFunc)system_timer, idle);
} else {
- gpm_debug ("System idle disabled");
+ egg_debug ("System idle disabled");
}
}
@@ -233,7 +233,7 @@
gboolean check_type_cpu)
{
g_return_if_fail (GPM_IS_IDLE (idle));
- gpm_debug ("Setting the CPU load check to %i", check_type_cpu);
+ egg_debug ("Setting the CPU load check to %i", check_type_cpu);
idle->priv->check_type_cpu = check_type_cpu;
}
@@ -284,7 +284,7 @@
{
g_return_if_fail (GPM_IS_IDLE (idle));
- gpm_debug ("Setting system idle timeout: %d", timeout);
+ egg_debug ("Setting system idle timeout: %d", timeout);
if (idle->priv->system_timeout != timeout) {
idle->priv->system_timeout = timeout;
@@ -307,7 +307,7 @@
{
GpmIdleMode mode;
- gpm_debug ("Received GS session idle changed: %d", is_idle);
+ egg_debug ("Received GS session idle changed: %d", is_idle);
if (is_idle) {
mode = GPM_IDLE_MODE_SESSION;
@@ -332,7 +332,7 @@
{
GpmIdleMode mode;
- gpm_debug ("Received GS powesave idle changed: %d", is_idle);
+ egg_debug ("Received GS powesave idle changed: %d", is_idle);
if (is_idle) {
mode = GPM_IDLE_MODE_POWERSAVE;
Modified: trunk/src/gpm-info.c
==============================================================================
--- trunk/src/gpm-info.c (original)
+++ trunk/src/gpm-info.c Wed Sep 3 15:53:48 2008
@@ -30,12 +30,13 @@
#include <libhal-gmanager.h>
+#include "egg-color.h"
#include "gpm-ac-adapter.h"
#include "gpm-button.h"
#include "gpm-conf.h"
#include "gpm-control.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-dpms.h"
#include "gpm-info.h"
#include "gpm-profile.h"
@@ -52,9 +53,9 @@
#define GPM_INFO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_INFO, GpmInfoPrivate))
#define GPM_INFO_DATA_POLL 5 /* seconds */
-#define GPM_COLOUR_CHARGING GPM_COLOUR_BLUE
-#define GPM_COLOUR_DISCHARGING GPM_COLOUR_DARK_RED
-#define GPM_COLOUR_CHARGED GPM_COLOUR_GREEN
+#define EGG_COLOR_CHARGING EGG_COLOR_BLUE
+#define EGG_COLOR_DISCHARGING EGG_COLOR_DARK_RED
+#define EGG_COLOR_CHARGED EGG_COLOR_GREEN
#define GPM_DBUS_STRUCT_INT_INT (dbus_g_type_get_struct ("GValueArray", \
G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID))
@@ -125,7 +126,7 @@
} else {
message = g_strdup (pre);
}
- gpm_syslog (message);
+ egg_debug ("%s", message);
gpm_info_event_log (info, event, message);
g_free (message);
}
@@ -197,67 +198,67 @@
{
/* add the general key items, TODO specify which ones make sense */
gpm_statistics_add_event_type (array, GPM_EVENT_ON_AC,
- GPM_COLOUR_BLUE,
+ EGG_COLOR_BLUE,
GPM_GRAPH_WIDGET_SHAPE_CIRCLE,
_("On AC"));
gpm_statistics_add_event_type (array, GPM_EVENT_ON_BATTERY,
- GPM_COLOUR_RED,
+ EGG_COLOR_RED,
GPM_GRAPH_WIDGET_SHAPE_CIRCLE,
_("On battery"));
gpm_statistics_add_event_type (array, GPM_EVENT_SESSION_POWERSAVE,
- GPM_COLOUR_WHITE,
+ EGG_COLOR_WHITE,
GPM_GRAPH_WIDGET_SHAPE_SQUARE,
_("Session powersave"));
gpm_statistics_add_event_type (array, GPM_EVENT_SESSION_IDLE,
- GPM_COLOUR_YELLOW,
+ EGG_COLOR_YELLOW,
GPM_GRAPH_WIDGET_SHAPE_SQUARE,
_("Session idle"));
gpm_statistics_add_event_type (array, GPM_EVENT_SESSION_ACTIVE,
- GPM_COLOUR_DARK_YELLOW,
+ EGG_COLOR_DARK_YELLOW,
GPM_GRAPH_WIDGET_SHAPE_SQUARE,
_("Session active"));
gpm_statistics_add_event_type (array, GPM_EVENT_SUSPEND,
- GPM_COLOUR_RED,
+ EGG_COLOR_RED,
GPM_GRAPH_WIDGET_SHAPE_DIAMOND,
/* Translators: translate ONLY the string part after the |*/
Q_("label shown on graph|Suspend"));
gpm_statistics_add_event_type (array, GPM_EVENT_RESUME,
- GPM_COLOUR_DARK_RED,
+ EGG_COLOR_DARK_RED,
GPM_GRAPH_WIDGET_SHAPE_DIAMOND,
/* Translators: translate ONLY the string part after the |*/
Q_("label shown on graph|Resume"));
gpm_statistics_add_event_type (array, GPM_EVENT_HIBERNATE,
- GPM_COLOUR_MAGENTA,
+ EGG_COLOR_MAGENTA,
GPM_GRAPH_WIDGET_SHAPE_DIAMOND,
/* Translators: translate ONLY the string part after the |*/
Q_("label shown on graph|Hibernate"));
gpm_statistics_add_event_type (array, GPM_EVENT_LID_CLOSED,
- GPM_COLOUR_GREEN,
+ EGG_COLOR_GREEN,
GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
_("Lid closed"));
gpm_statistics_add_event_type (array, GPM_EVENT_LID_OPENED,
- GPM_COLOUR_DARK_GREEN,
+ EGG_COLOR_DARK_GREEN,
GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
_("Lid opened"));
gpm_statistics_add_event_type (array, GPM_EVENT_NOTIFICATION,
- GPM_COLOUR_GREY,
+ EGG_COLOR_GREY,
GPM_GRAPH_WIDGET_SHAPE_CIRCLE,
_("Notification"));
#ifdef HAVE_DPMS_EXTENSION
gpm_statistics_add_event_type (array, GPM_EVENT_DPMS_ON,
- GPM_COLOUR_CYAN,
+ EGG_COLOR_CYAN,
GPM_GRAPH_WIDGET_SHAPE_CIRCLE,
_("DPMS On"));
gpm_statistics_add_event_type (array, GPM_EVENT_DPMS_STANDBY,
- GPM_COLOUR_CYAN,
+ EGG_COLOR_CYAN,
GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
_("DPMS Standby"));
gpm_statistics_add_event_type (array, GPM_EVENT_DPMS_SUSPEND,
- GPM_COLOUR_CYAN,
+ EGG_COLOR_CYAN,
GPM_GRAPH_WIDGET_SHAPE_SQUARE,
_("DPMS Suspend"));
gpm_statistics_add_event_type (array, GPM_EVENT_DPMS_OFF,
- GPM_COLOUR_CYAN,
+ EGG_COLOR_CYAN,
GPM_GRAPH_WIDGET_SHAPE_DIAMOND,
_("DPMS Off"));
#endif
@@ -295,7 +296,7 @@
*axis_type_y = g_strdup ("power");
*axis_desc_x = g_strdup (_("Time since startup"));
*axis_desc_y = g_strdup (_("Power"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Power"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_GREEN, _("Power"));
gpm_statistics_add_events_typical (*key_event);
return TRUE;
}
@@ -304,7 +305,7 @@
*axis_type_y = g_strdup ("time");
*axis_desc_x = g_strdup (_("Time since startup"));
*axis_desc_y = g_strdup (_("Estimated time"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Time"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_GREEN, _("Time"));
gpm_statistics_add_events_typical (*key_event);
return TRUE;
}
@@ -313,7 +314,7 @@
*axis_type_y = g_strdup ("percentage");
*axis_desc_x = g_strdup (_("Time since startup"));
*axis_desc_y = g_strdup (_("Battery percentage"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Percentage"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_GREEN, _("Percentage"));
gpm_statistics_add_events_typical (*key_event);
return TRUE;
}
@@ -322,7 +323,7 @@
*axis_type_y = g_strdup ("voltage");
*axis_desc_x = g_strdup (_("Time since startup"));
*axis_desc_y = g_strdup (_("Battery Voltage"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Voltage"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_GREEN, _("Voltage"));
gpm_statistics_add_events_typical (*key_event);
return TRUE;
}
@@ -331,8 +332,8 @@
*axis_type_y = g_strdup ("percentage");
*axis_desc_x = g_strdup (_("Battery percentage"));
*axis_desc_y = g_strdup (_("Accuracy of reading"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_RED, _("Trusted"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("Untrusted"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_RED, _("Trusted"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_DARK_RED, _("Untrusted"));
return TRUE;
}
if (strcmp (type, "profile-discharge-accuracy") == 0) {
@@ -340,8 +341,8 @@
*axis_type_y = g_strdup ("percentage");
*axis_desc_x = g_strdup (_("Battery percentage"));
*axis_desc_y = g_strdup (_("Accuracy of reading"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("Trusted"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_BLUE, _("Untrusted"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_BLUE, _("Trusted"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_DARK_BLUE, _("Untrusted"));
return TRUE;
}
if (strcmp (type, "profile-charge-time") == 0) {
@@ -349,15 +350,15 @@
*axis_type_y = g_strdup ("time");
*axis_desc_x = g_strdup (_("Battery percentage"));
*axis_desc_y = g_strdup (_("Average time elapsed"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_RED, _("Valid data"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_GREY, _("Extrapolated data"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("No data"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_RED, _("Valid data"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_DARK_GREY, _("Extrapolated data"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_BLUE, _("No data"));
gpm_statistics_add_event_type (*key_event, GPM_EVENT_HIBERNATE,
- GPM_COLOUR_CYAN,
+ EGG_COLOR_CYAN,
GPM_GRAPH_WIDGET_SHAPE_SQUARE,
_("Start point"));
gpm_statistics_add_event_type (*key_event, GPM_EVENT_SUSPEND,
- GPM_COLOUR_YELLOW,
+ EGG_COLOR_YELLOW,
GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
_("Stop point"));
return TRUE;
@@ -367,15 +368,15 @@
*axis_type_y = g_strdup ("time");
*axis_desc_x = g_strdup (_("Battery percentage"));
*axis_desc_y = g_strdup (_("Average time elapsed"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_RED, _("Valid data"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_GREY, _("Extrapolated data"));
- gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("No data"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_RED, _("Valid data"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_DARK_GREY, _("Extrapolated data"));
+ gpm_statistics_add_data_type (*key_data, EGG_COLOR_BLUE, _("No data"));
gpm_statistics_add_event_type (*key_event, GPM_EVENT_HIBERNATE,
- GPM_COLOUR_CYAN,
+ EGG_COLOR_CYAN,
GPM_GRAPH_WIDGET_SHAPE_SQUARE,
_("Start point"));
gpm_statistics_add_event_type (*key_event, GPM_EVENT_SUSPEND,
- GPM_COLOUR_YELLOW,
+ EGG_COLOR_YELLOW,
GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
_("Stop point"));
return TRUE;
@@ -507,7 +508,7 @@
g_return_val_if_fail (type != NULL, FALSE);
if (info->priv->is_laptop == FALSE) {
- gpm_warning ("Data not available as not a laptop");
+ egg_warning ("Data not available as not a laptop");
*error = g_error_new (gpm_info_error_quark (),
GPM_INFO_ERROR_DATA_NOT_AVAILABLE,
"Data not available as not a laptop");
@@ -531,7 +532,7 @@
} else if (strcmp (type, "profile-discharge-time") == 0) {
events = gpm_profile_get_data_time_percent (info->priv->profile, TRUE);
} else {
- gpm_warning ("Data type %s not known!", type);
+ egg_warning ("Data type %s not known!", type);
*error = g_error_new (gpm_info_error_quark (),
GPM_INFO_ERROR_INVALID_TYPE,
"Data type %s not known!", type);
@@ -539,7 +540,7 @@
}
if (events == NULL) {
- gpm_warning ("Data not available");
+ egg_warning ("Data not available");
*error = g_error_new (gpm_info_error_quark (),
GPM_INFO_ERROR_DATA_NOT_AVAILABLE,
"Data not available");
@@ -575,7 +576,7 @@
{
g_return_if_fail (info != NULL);
g_return_if_fail (GPM_IS_INFO (info));
- gpm_debug ("Adding %i to the event log", event);
+ egg_debug ("Adding %i to the event log", event);
gpm_array_append (info->priv->events,
g_timer_elapsed (info->priv->timer, NULL), event, 0);
@@ -622,11 +623,11 @@
/* set the correct colours */
if (unit->is_discharging) {
- colour = GPM_COLOUR_DISCHARGING;
+ colour = EGG_COLOR_DISCHARGING;
} else if (unit->is_charging) {
- colour = GPM_COLOUR_CHARGING;
+ colour = EGG_COLOR_CHARGING;
} else {
- colour = GPM_COLOUR_CHARGED;
+ colour = EGG_COLOR_CHARGED;
}
if (unit->percentage > 0) {
@@ -675,19 +676,19 @@
const gchar *type,
GpmInfo *info)
{
- gpm_debug ("Button press event type=%s", type);
+ egg_debug ("Button press event type=%s", type);
if (strcmp (type, GPM_BUTTON_LID_CLOSED) == 0) {
gpm_info_event_log (info,
GPM_EVENT_LID_CLOSED,
_("The laptop lid has been closed"));
- gpm_debug ("lid button CLOSED");
+ egg_debug ("lid button CLOSED");
} else if (strcmp (type, GPM_BUTTON_LID_OPEN) == 0) {
gpm_info_event_log (info,
GPM_EVENT_LID_OPENED,
_("The laptop lid has been re-opened"));
- gpm_debug ("lid button OPENED");
+ egg_debug ("lid button OPENED");
}
}
@@ -728,7 +729,7 @@
GpmDpmsMode mode,
GpmInfo *info)
{
- gpm_debug ("DPMS mode changed: %d", mode);
+ egg_debug ("DPMS mode changed: %d", mode);
if (mode == GPM_DPMS_MODE_ON) {
gpm_info_event_log (info, GPM_EVENT_DPMS_ON, _("dpms on"));
Modified: trunk/src/gpm-inhibit.c
==============================================================================
--- trunk/src/gpm-inhibit.c (original)
+++ trunk/src/gpm-inhibit.c Wed Sep 3 15:53:48 2008
@@ -29,7 +29,7 @@
#include <libdbus-monitor-session.h>
#include "gpm-inhibit.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-conf.h"
static void gpm_inhibit_class_init (GpmInhibitClass *klass);
@@ -172,7 +172,7 @@
if (connection == NULL ||
application == NULL ||
reason == NULL) {
- gpm_warning ("Recieved Inhibit, but application "
+ egg_warning ("Recieved Inhibit, but application "
"did not set the parameters correctly");
dbus_g_method_return (context, -1);
return;
@@ -187,7 +187,7 @@
inhibit->priv->list = g_slist_append (inhibit->priv->list, (gpointer) data);
- gpm_debug ("Recieved Inhibit from '%s' (%s) because '%s' saving as #%i",
+ egg_debug ("Recieved Inhibit from '%s' (%s) because '%s' saving as #%i",
data->application, data->connection, data->reason, data->cookie);
/* only emit event on the first one */
@@ -231,7 +231,7 @@
"cannot do UnInhibit!", cookie);
return FALSE;
}
- gpm_debug ("UnInhibit okay #%i", cookie);
+ egg_debug ("UnInhibit okay #%i", cookie);
gpm_inhibit_free_data_object (data);
/* remove it from the list */
@@ -255,7 +255,7 @@
gchar ***requests,
GError **error)
{
- gpm_warning ("Not implimented");
+ egg_warning ("Not implimented");
return FALSE;
}
@@ -278,7 +278,7 @@
for (a=0; a<g_slist_length (inhibit->priv->list); a++) {
data = (GpmInhibitData *) g_slist_nth_data (inhibit->priv->list, a);
if (strcmp (data->connection, connection) == 0) {
- gpm_debug ("Auto-revoked idle inhibit on '%s'.",
+ egg_debug ("Auto-revoked idle inhibit on '%s'.",
data->application);
gpm_inhibit_free_data_object (data);
/* remove it from the list */
@@ -327,17 +327,17 @@
length = g_slist_length (inhibit->priv->list);
if (inhibit->priv->ignore_inhibits) {
- gpm_debug ("Inhibit ignored through gconf policy!");
+ egg_debug ("Inhibit ignored through gconf policy!");
*has_inihibit = FALSE;
}
/* An inhibit can stop the action */
if (length == 0) {
- gpm_debug ("Valid as no inhibitors");
+ egg_debug ("Valid as no inhibitors");
*has_inihibit = FALSE;
} else {
/* we have at least one application blocking the action */
- gpm_debug ("We have %i valid inhibitors", length);
+ egg_debug ("We have %i valid inhibitors", length);
*has_inihibit = TRUE;
}
@@ -580,7 +580,7 @@
G_TYPE_INVALID,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
return ret;
Modified: trunk/src/gpm-light-sensor.c
==============================================================================
--- trunk/src/gpm-light-sensor.c (original)
+++ trunk/src/gpm-light-sensor.c Wed Sep 3 15:53:48 2008
@@ -43,7 +43,7 @@
#include <libdbus-proxy.h>
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-light-sensor.h"
#include "gpm-conf.h"
#include "gpm-marshal.h"
@@ -94,7 +94,7 @@
proxy = dbus_proxy_get_proxy (sensor->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected to HAL");
+ egg_warning ("not connected to HAL");
return FALSE;
}
@@ -103,12 +103,12 @@
DBUS_TYPE_G_INT_ARRAY, &levels,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetBrightness failed!");
+ egg_warning ("GetBrightness failed!");
return FALSE;
}
@@ -143,7 +143,7 @@
g_return_val_if_fail (GPM_IS_LIGHT_SENSOR (sensor), FALSE);
if (sensor->priv->has_sensor == FALSE) {
- gpm_warning ("no hardware!");
+ egg_warning ("no hardware!");
return FALSE;
}
@@ -167,14 +167,14 @@
g_return_val_if_fail (GPM_IS_LIGHT_SENSOR (sensor), FALSE);
if (sensor->priv->has_sensor == FALSE) {
- gpm_warning ("no hardware!");
+ egg_warning ("no hardware!");
return FALSE;
}
fraction = gpm_discrete_to_fraction (sensor->priv->current_hw,
sensor->priv->levels);
sensor->priv->calibration_abs = fraction;
- gpm_debug ("calibrating to %f", fraction);
+ egg_debug ("calibrating to %f", fraction);
return TRUE;
}
@@ -193,11 +193,11 @@
g_return_val_if_fail (GPM_IS_LIGHT_SENSOR (sensor), FALSE);
if (sensor->priv->has_sensor == FALSE) {
- gpm_warning ("no hardware!");
+ egg_warning ("no hardware!");
return FALSE;
}
if (sensor->priv->calibration_abs < 0.01 && sensor->priv->calibration_abs > -0.01) {
- gpm_warning ("not calibrated!");
+ egg_warning ("not calibrated!");
return FALSE;
}
@@ -294,7 +294,7 @@
/* this could fail if hal refuses us */
if (ret) {
gpm_light_sensor_get_absolute (sensor, &new);
- gpm_debug ("brightness = %i, %i", sensor->priv->current_hw, new);
+ egg_debug ("brightness = %i, %i", sensor->priv->current_hw, new);
g_signal_emit (sensor, signals [SENSOR_CHANGED], 0, new);
}
}
@@ -356,7 +356,7 @@
/* connect to the devices */
if (sensor->priv->has_sensor) {
- gpm_debug ("Using proper brightness sensor");
+ egg_debug ("Using proper brightness sensor");
/* get a managed proxy */
sensor->priv->gproxy = dbus_proxy_new ();
dbus_proxy_assign (sensor->priv->gproxy,
@@ -378,7 +378,7 @@
/* do we have a info source? */
if (sensor->priv->has_sensor) {
- gpm_debug ("current brightness is %i%%", sensor->priv->current_hw);
+ egg_debug ("current brightness is %i%%", sensor->priv->current_hw);
/* get poll timeout */
gpm_conf_get_uint (sensor->priv->conf, GPM_CONF_AMBIENT_POLL, &timeout);
Modified: trunk/src/gpm-load.c
==============================================================================
--- trunk/src/gpm-load.c (original)
+++ trunk/src/gpm-load.c Wed Sep 3 15:53:48 2008
@@ -47,7 +47,7 @@
#include "gpm-common.h"
#include "gpm-prefs.h"
#include "gpm-marshal.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-load.h"
@@ -102,18 +102,18 @@
kc = kstat_open();
if (!kc){
- gpm_warning ("Cannot open kstat!\n");
+ egg_warning ("Cannot open kstat!\n");
return FALSE;
}
ks = kstat_lookup(kc, "unix", 0, "system_misc");
if (kstat_read(kc, ks, NULL) == -1) {
- gpm_warning ("Cannot read kstat on module unix!\n");
+ egg_warning ("Cannot read kstat on module unix!\n");
goto out;
}
kn = kstat_data_lookup (ks, "ncpus");
if (!kn) {
- gpm_warning ("Cannot get number of cpus in current system!\n");
+ egg_warning ("Cannot get number of cpus in current system!\n");
goto out;
}
ncpus = kn->value.ui32;
@@ -126,16 +126,16 @@
ks = kstat_lookup(kc, "cpu_stat", count, NULL);
if (ks == NULL) {
- gpm_warning ("Null output for kstat on cpu%d\n", count);
+ egg_warning ("Null output for kstat on cpu%d\n", count);
goto out;
}
if (kstat_read(kc, ks, &data) == -1) {
- gpm_warning ("Cannot read kstat entry on cpu%d\n", count);
+ egg_warning ("Cannot read kstat entry on cpu%d\n", count);
goto out;
}
- gpm_debug ("cpu%d:\t%lu\t%lu\t%lu\t%lu\n", count,
+ egg_debug ("cpu%d:\t%lu\t%lu\t%lu\t%lu\n", count,
data.cpu_sysinfo.cpu[CPU_IDLE],
data.cpu_sysinfo.cpu[CPU_USER],
data.cpu_sysinfo.cpu[CPU_KERNEL],
Modified: trunk/src/gpm-main.c
==============================================================================
--- trunk/src/gpm-main.c (original)
+++ trunk/src/gpm-main.c Wed Sep 3 15:53:48 2008
@@ -37,7 +37,7 @@
#include "gpm-stock-icons.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-manager.h"
#include "dbus/xdg-power-management-core.h"
@@ -75,12 +75,12 @@
G_TYPE_UINT, &request_name_result,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("RequestName failed!");
+ egg_warning ("RequestName failed!");
return FALSE;
}
@@ -106,7 +106,6 @@
static void
gpm_exit (GpmManager *manager)
{
- gpm_debug_shutdown ();
exit (0);
}
@@ -197,21 +196,21 @@
g_thread_init (NULL);
dbus_g_thread_init ();
- gpm_debug_init (verbose);
+ egg_debug_init (verbose);
/* we need to daemonize before we get a system connection to fix #366057 */
if (no_daemon == FALSE && daemon (0, 0)) {
- gpm_error ("Could not daemonize: %s", g_strerror (errno));
+ egg_error ("Could not daemonize: %s", g_strerror (errno));
}
- gpm_debug ("GNOME %s %s", GPM_NAME, VERSION);
+ egg_debug ("GNOME %s %s", GPM_NAME, VERSION);
/* check dbus connections, exit if not valid */
system_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (error) {
- gpm_warning ("%s", error->message);
+ egg_warning ("%s", error->message);
g_error_free (error);
- gpm_error ("This program cannot start until you start "
+ egg_error ("This program cannot start until you start "
"the dbus system service.\n"
"It is <b>strongly recommended</b> you reboot "
"your computer after starting this service.");
@@ -219,9 +218,9 @@
session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (error) {
- gpm_warning ("%s", error->message);
+ egg_warning ("%s", error->message);
g_error_free (error);
- gpm_error ("This program cannot start until you start the "
+ egg_error ("This program cannot start until you start the "
"dbus session service.\n\n"
"This is usually started automatically in X "
"or gnome startup when you start a new session.");
@@ -238,7 +237,7 @@
manager = gpm_manager_new ();
if (!gpm_object_register (session_connection, G_OBJECT (manager))) {
- gpm_error ("%s is already running in this session.", GPM_NAME);
+ egg_error ("%s is already running in this session.", GPM_NAME);
return 0;
}
@@ -255,7 +254,6 @@
}
g_main_loop_unref (loop);
- gpm_debug_shutdown ();
/* rip down gstreamer */
gst_deinit ();
Modified: trunk/src/gpm-manager.c
==============================================================================
--- trunk/src/gpm-manager.c (original)
+++ trunk/src/gpm-manager.c Wed Sep 3 15:53:48 2008
@@ -48,7 +48,7 @@
#include "gpm-conf.h"
#include "gpm-control.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-dpms.h"
#include "gpm-idle.h"
#include "gpm-info.h"
@@ -272,11 +272,11 @@
GPM_CONF_LOCK_ON_BLANK_SCREEN);
if (do_lock) {
if (!gpm_screensaver_lock (manager->priv->screensaver))
- gpm_debug ("Could not lock screen via gnome-screensaver");
+ egg_debug ("Could not lock screen via gnome-screensaver");
}
gpm_dpms_set_mode_enum (manager->priv->dpms, GPM_DPMS_MODE_OFF, &error);
if (error) {
- gpm_debug ("Unable to set DPMS mode: %s", error->message);
+ egg_debug ("Unable to set DPMS mode: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -302,7 +302,7 @@
error = NULL;
gpm_dpms_set_mode_enum (manager->priv->dpms, GPM_DPMS_MODE_ON, &error);
if (error) {
- gpm_debug ("Unable to set DPMS mode: %s", error->message);
+ egg_debug ("Unable to set DPMS mode: %s", error->message);
g_error_free (error);
ret = FALSE;
}
@@ -432,7 +432,7 @@
return FALSE;
}
- gpm_debug ("policy: %s", policy);
+ egg_debug ("policy: %s", policy);
gpm_conf_get_string (manager->priv->conf, policy, &action);
if (action == NULL) {
@@ -464,7 +464,7 @@
GNOME_SAVE_GLOBAL,
TRUE, GNOME_INTERACT_ANY, FALSE, TRUE);
} else {
- gpm_warning ("unknown action %s", action);
+ egg_warning ("unknown action %s", action);
}
g_free (action);
@@ -743,24 +743,24 @@
}
if (action == NULL) {
- gpm_warning ("action NULL, gconf error");
+ egg_warning ("action NULL, gconf error");
return;
}
if (strcmp (action, ACTION_NOTHING) == 0) {
- gpm_debug ("doing nothing as system idle action");
+ egg_debug ("doing nothing as system idle action");
} else if (strcmp (action, ACTION_SUSPEND) == 0) {
gpm_info_explain_reason (manager->priv->info, GPM_EVENT_SUSPEND,
_("Suspending computer."), _("System idle."));
ret = gpm_control_suspend (manager->priv->control, &error);
if (!ret) {
- gpm_warning ("cannot suspend (error: %s), so trying hibernate", error->message);
+ egg_warning ("cannot suspend (error: %s), so trying hibernate", error->message);
g_error_free (error);
error = NULL;
ret = gpm_control_hibernate (manager->priv->control, &error);
if (!ret) {
- gpm_warning ("cannot suspend or hibernate: %s", error->message);
+ egg_warning ("cannot suspend or hibernate: %s", error->message);
g_error_free (error);
}
}
@@ -770,12 +770,12 @@
_("Hibernating computer."), _("System idle."));
ret = gpm_control_hibernate (manager->priv->control, &error);
if (!ret) {
- gpm_warning ("cannot hibernate (error: %s), so trying suspend", error->message);
+ egg_warning ("cannot hibernate (error: %s), so trying suspend", error->message);
g_error_free (error);
error = NULL;
ret = gpm_control_suspend (manager->priv->control, &error);
if (!ret) {
- gpm_warning ("cannot suspend or hibernate: %s", error->message);
+ egg_warning ("cannot suspend or hibernate: %s", error->message);
g_error_free (error);
}
}
@@ -805,20 +805,20 @@
* support hardware blanking.
* Details are here: https://launchpad.net/malone/bugs/22522 */
if (gpm_button_is_lid_closed (manager->priv->button)) {
- gpm_debug ("lid is closed, so we are ignoring idle state changes");
+ egg_debug ("lid is closed, so we are ignoring idle state changes");
return;
}
if (mode == GPM_IDLE_MODE_NORMAL) {
- gpm_debug ("Idle state changed: NORMAL");
+ egg_debug ("Idle state changed: NORMAL");
} else if (mode == GPM_IDLE_MODE_SESSION) {
- gpm_debug ("Idle state changed: SESSION");
+ egg_debug ("Idle state changed: SESSION");
} else if (mode == GPM_IDLE_MODE_SYSTEM) {
- gpm_debug ("Idle state changed: SYSTEM");
+ egg_debug ("Idle state changed: SYSTEM");
if (gpm_manager_is_inhibit_valid (manager, FALSE, "timeout action") == FALSE) {
return;
@@ -911,7 +911,7 @@
}
if (on_ac) {
- gpm_debug ("Performing AC policy");
+ egg_debug ("Performing AC policy");
manager_policy_do (manager, GPM_CONF_BUTTON_LID_AC,
_("The lid has been closed on ac power."));
return;
@@ -937,11 +937,11 @@
}
if (do_policy == FALSE) {
- gpm_debug ("Not doing lid policy action as inhibited as set to sleep");
+ egg_debug ("Not doing lid policy action as inhibited as set to sleep");
return;
}
- gpm_debug ("Performing battery policy");
+ egg_debug ("Performing battery policy");
manager_policy_do (manager, GPM_CONF_BUTTON_LID_BATT,
_("The lid has been closed on battery power."));
}
@@ -958,7 +958,7 @@
const gchar *type,
GpmManager *manager)
{
- gpm_debug ("Button press event type=%s", type);
+ egg_debug ("Button press event type=%s", type);
if (strcmp (type, GPM_BUTTON_POWER) == 0) {
power_button_pressed (manager);
@@ -999,11 +999,11 @@
gboolean event_when_closed;
gboolean power_save;
- gpm_debug ("Setting on-ac: %d", on_ac);
+ egg_debug ("Setting on-ac: %d", on_ac);
gpm_manager_sync_policy_sleep (manager);
- gpm_debug ("emitting on-ac-changed : %i", on_ac);
+ egg_debug ("emitting on-ac-changed : %i", on_ac);
if (on_ac) {
g_signal_emit (manager, signals [ON_BATTERY_CHANGED], 0, FALSE);
} else {
@@ -1201,13 +1201,13 @@
error = NULL;
ret = hal_gpower_clear_suspend_error (manager->priv->hal_power, &error);
if (!ret) {
- gpm_debug ("Failed to clear suspend error; %s", error->message);
+ egg_debug ("Failed to clear suspend error; %s", error->message);
g_error_free (error);
}
error = NULL;
ret = hal_gpower_clear_hibernate_error (manager->priv->hal_power, &error);
if (!ret) {
- gpm_debug ("Failed to clear hibernate error; %s", error->message);
+ egg_debug ("Failed to clear hibernate error; %s", error->message);
g_error_free (error);
}
}
@@ -1342,10 +1342,10 @@
/* only emit if in GConf */
if (show_sleep_failed) {
if (action == GPM_CONTROL_ACTION_SUSPEND) {
- gpm_syslog ("suspend failed");
+ egg_debug ("suspend failed");
gpm_notify_sleep_failed (manager->priv->notify, FALSE);
} else {
- gpm_syslog ("hibernate failed");
+ egg_debug ("hibernate failed");
gpm_notify_sleep_failed (manager->priv->notify, TRUE);
}
}
@@ -1443,7 +1443,7 @@
/* we have to do different warnings depending on the policy */
gpm_conf_get_string (manager->priv->conf, GPM_CONF_ACTIONS_CRITICAL_BATT, &action);
if (action == NULL) {
- gpm_warning ("schema invalid!");
+ egg_warning ("schema invalid!");
action = g_strdup (ACTION_NOTHING);
}
@@ -1682,7 +1682,7 @@
GPM_NOTIFY_TIMEOUT_LONG,
GTK_STOCK_DIALOG_WARNING,
GPM_NOTIFY_URGENCY_NORMAL);
- gpm_error ("no gconf schema installed!");
+ egg_error ("no gconf schema installed!");
}
/* we use ac_adapter so we can poke the screensaver and throttle */
@@ -1734,7 +1734,7 @@
manager->priv->dpms = gpm_dpms_new ();
/* use a class to handle the complex stuff */
- gpm_debug ("creating new inhibit instance");
+ egg_debug ("creating new inhibit instance");
manager->priv->inhibit = gpm_inhibit_new ();
g_signal_connect (manager->priv->inhibit, "has-inhibit-changed",
G_CALLBACK (has_inhibit_changed_cb), manager);
@@ -1744,12 +1744,12 @@
G_OBJECT (manager->priv->inhibit));
/* use the control object */
- gpm_debug ("creating new control instance");
+ egg_debug ("creating new control instance");
manager->priv->control = gpm_control_new ();
g_signal_connect (manager->priv->control, "sleep-failure",
G_CALLBACK (control_sleep_failure_cb), manager);
- gpm_debug ("creating new tray icon");
+ egg_debug ("creating new tray icon");
manager->priv->tray_icon = gpm_tray_icon_new ();
g_signal_connect_object (G_OBJECT (manager->priv->tray_icon),
"suspend", G_CALLBACK (gpm_manager_tray_icon_suspend),
@@ -1758,7 +1758,7 @@
"hibernate", G_CALLBACK (gpm_manager_tray_icon_hibernate),
manager, G_CONNECT_SWAPPED);
- gpm_debug ("initialising info infrastructure");
+ egg_debug ("initialising info infrastructure");
manager->priv->info = gpm_info_new ();
/* add the new statistics DBUS interface */
Modified: trunk/src/gpm-networkmanager.c
==============================================================================
--- trunk/src/gpm-networkmanager.c (original)
+++ trunk/src/gpm-networkmanager.c Wed Sep 3 15:53:48 2008
@@ -27,7 +27,7 @@
#include <dbus/dbus-glib.h>
#include "gpm-networkmanager.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#define NM_LISTENER_SERVICE "org.freedesktop.NetworkManager"
#define NM_LISTENER_PATH "/org/freedesktop/NetworkManager"
@@ -49,7 +49,7 @@
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (error) {
- gpm_warning ("%s", error->message);
+ egg_warning ("%s", error->message);
g_error_free (error);
return FALSE;
}
@@ -59,7 +59,7 @@
NM_LISTENER_PATH,
NM_LISTENER_INTERFACE);
if (!nm_proxy) {
- gpm_warning ("Failed to get name owner");
+ egg_warning ("Failed to get name owner");
return FALSE;
}
dbus_g_proxy_call_no_reply (nm_proxy, "sleep", G_TYPE_INVALID);
@@ -83,7 +83,7 @@
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (error) {
- gpm_warning ("%s", error->message);
+ egg_warning ("%s", error->message);
g_error_free (error);
return FALSE;
}
@@ -93,7 +93,7 @@
NM_LISTENER_PATH,
NM_LISTENER_INTERFACE);
if (!nm_proxy) {
- gpm_warning ("Failed to get name owner");
+ egg_warning ("Failed to get name owner");
return FALSE;
}
dbus_g_proxy_call_no_reply (nm_proxy, "wake", G_TYPE_INVALID);
Modified: trunk/src/gpm-notify.c
==============================================================================
--- trunk/src/gpm-notify.c (original)
+++ trunk/src/gpm-notify.c Wed Sep 3 15:53:48 2008
@@ -42,7 +42,7 @@
#include "gpm-ac-adapter.h"
#include "gpm-common.h"
#include "gpm-conf.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-notify.h"
#include "gpm-stock-icons.h"
@@ -86,7 +86,7 @@
GpmNotify *notify)
{
/* just invalidate the pointer */
- gpm_debug ("caught notification closed signal");
+ egg_debug ("caught notification closed signal");
// notify->priv->libnotify = NULL;
}
@@ -121,9 +121,9 @@
}
if (urgency == GPM_NOTIFY_URGENCY_CRITICAL) {
- gpm_warning ("libnotify: %s : %s", GPM_NAME, content);
+ egg_warning ("libnotify: %s : %s", GPM_NAME, content);
} else {
- gpm_debug ("libnotify: %s : %s", GPM_NAME, content);
+ egg_debug ("libnotify: %s : %s", GPM_NAME, content);
}
g_signal_connect (notify->priv->libnotify, "closed", G_CALLBACK (notify_closed_cb), notify);
@@ -136,7 +136,7 @@
gboolean ret;
ret = notify_notification_show (notify->priv->libnotify, NULL);
if (!ret) {
- gpm_warning ("failed to send notification");
+ egg_warning ("failed to send notification");
}
return ret;
}
@@ -281,7 +281,7 @@
/* for where we add back the ac_adapter before the "AC Power unplugged"
* message times out. */
if (on_ac) {
- gpm_debug ("clearing notify due ac being present");
+ egg_debug ("clearing notify due ac being present");
gpm_notify_cancel (notify);
}
}
@@ -311,13 +311,13 @@
gscreen = gdk_screen_get_default();
if (strcmp (action, "dont-show-again") == 0) {
- gpm_debug ("not showing warning anymore for %s!", notify->priv->do_not_show_gconf);
+ egg_debug ("not showing warning anymore for %s!", notify->priv->do_not_show_gconf);
gpm_conf_set_bool (notify->priv->conf, notify->priv->do_not_show_gconf, FALSE);
notify->priv->do_not_show_gconf = NULL;
return;
}
if (strcmp (action, "visit-website") == 0) {
- gpm_debug ("autovisit website %s", notify->priv->internet_url);
+ egg_debug ("autovisit website %s", notify->priv->internet_url);
error = NULL;
cmdline = g_strconcat ("gnome-open ", notify->priv->internet_url, NULL);
@@ -345,7 +345,7 @@
notify->priv->internet_url = NULL;
return;
}
- gpm_debug ("action %s unknown", action);
+ egg_debug ("action %s unknown", action);
}
#endif
@@ -362,7 +362,7 @@
/* don't show when running under GDM */
if (g_getenv ("RUNNING_UNDER_GDM") != NULL) {
- gpm_debug ("running under gdm, so no notification");
+ egg_debug ("running under gdm, so no notification");
return FALSE;
}
@@ -411,7 +411,7 @@
/* don't show when running under GDM */
if (g_getenv ("RUNNING_UNDER_GDM") != NULL) {
- gpm_debug ("running under gdm, so no notification");
+ egg_debug ("running under gdm, so no notification");
return FALSE;
}
@@ -450,7 +450,7 @@
/* don't show when running under GDM */
if (g_getenv ("RUNNING_UNDER_GDM") != NULL) {
- gpm_debug ("running under gdm, so no notification");
+ egg_debug ("running under gdm, so no notification");
return FALSE;
}
Modified: trunk/src/gpm-phone.c
==============================================================================
--- trunk/src/gpm-phone.c (original)
+++ trunk/src/gpm-phone.c Wed Sep 3 15:53:48 2008
@@ -28,7 +28,7 @@
#include "gpm-conf.h"
#include "gpm-phone.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-marshal.h"
#include <libdbus-watch.h>
@@ -76,14 +76,14 @@
g_return_val_if_fail (GPM_IS_PHONE (phone), FALSE);
if (phone->priv->proxy == NULL) {
- gpm_warning ("not connected\n");
+ egg_warning ("not connected\n");
return FALSE;
}
ret = dbus_g_proxy_call (phone->priv->proxy, "Coldplug", &error,
G_TYPE_INVALID, G_TYPE_INVALID);
if (error != NULL) {
- gpm_warning ("DEBUG: ERROR: %s", error->message);
+ egg_warning ("DEBUG: ERROR: %s", error->message);
g_error_free (error);
}
@@ -153,11 +153,11 @@
g_return_if_fail (phone != NULL);
g_return_if_fail (GPM_IS_PHONE (phone));
- gpm_debug ("got BatteryStateChanged %i = %i (%i)", index, percentage, on_ac);
+ egg_debug ("got BatteryStateChanged %i = %i (%i)", index, percentage, on_ac);
phone->priv->percentage = percentage;
phone->priv->onac = on_ac;
phone->priv->present = TRUE;
- gpm_debug ("emitting device-refresh : (%i)", index);
+ egg_debug ("emitting device-refresh : (%i)", index);
g_signal_emit (phone, signals [DEVICE_REFRESH], 0, index);
}
@@ -171,9 +171,9 @@
g_return_if_fail (phone != NULL);
g_return_if_fail (GPM_IS_PHONE (phone));
- gpm_debug ("got NumberBatteriesChanged %i", number);
+ egg_debug ("got NumberBatteriesChanged %i", number);
if (number > 1) {
- gpm_warning ("number not 0 or 1, not valid!");
+ egg_warning ("number not 0 or 1, not valid!");
return;
}
@@ -182,13 +182,13 @@
phone->priv->present = FALSE;
phone->priv->percentage = 0;
phone->priv->onac = FALSE;
- gpm_debug ("emitting device-removed : (%i)", 0);
+ egg_debug ("emitting device-removed : (%i)", 0);
g_signal_emit (phone, signals [DEVICE_REMOVED], 0, 0);
return;
}
if (phone->priv->present) {
- gpm_warning ("duplicate NumberBatteriesChanged with no change");
+ egg_warning ("duplicate NumberBatteriesChanged with no change");
return;
}
@@ -196,7 +196,7 @@
phone->priv->present = TRUE;
phone->priv->percentage = 0;
phone->priv->onac = FALSE;
- gpm_debug ("emitting device-added : (%i)", 0);
+ egg_debug ("emitting device-added : (%i)", 0);
g_signal_emit (phone, signals [DEVICE_ADDED], 0, 0);
}
@@ -264,18 +264,18 @@
g_return_val_if_fail (GPM_IS_PHONE (phone), FALSE);
if (phone->priv->connection == NULL) {
- gpm_debug ("get connection\n");
+ egg_debug ("get connection\n");
g_clear_error (&error);
phone->priv->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (error != NULL) {
- gpm_warning ("Could not connect to DBUS daemon: %s", error->message);
+ egg_warning ("Could not connect to DBUS daemon: %s", error->message);
g_error_free (error);
phone->priv->connection = NULL;
return FALSE;
}
}
if (phone->priv->proxy == NULL) {
- gpm_debug ("get proxy\n");
+ egg_debug ("get proxy\n");
g_clear_error (&error);
phone->priv->proxy = dbus_g_proxy_new_for_name_owner (phone->priv->connection,
GNOME_PHONE_MANAGER_DBUS_SERVICE,
@@ -283,7 +283,7 @@
GNOME_PHONE_MANAGER_DBUS_INTERFACE,
&error);
if (error != NULL) {
- gpm_warning ("Cannot connect, maybe the daemon is not running: %s\n", error->message);
+ egg_warning ("Cannot connect, maybe the daemon is not running: %s\n", error->message);
g_error_free (error);
phone->priv->proxy = NULL;
return FALSE;
@@ -322,13 +322,13 @@
g_return_val_if_fail (GPM_IS_PHONE (phone), FALSE);
if (phone->priv->proxy != NULL) {
- gpm_debug ("removing proxy\n");
+ egg_debug ("removing proxy\n");
g_object_unref (phone->priv->proxy);
phone->priv->proxy = NULL;
if (phone->priv->present) {
phone->priv->present = FALSE;
phone->priv->percentage = 0;
- gpm_debug ("emitting device-removed : (%i)", 0);
+ egg_debug ("emitting device-removed : (%i)", 0);
g_signal_emit (phone, signals [DEVICE_REMOVED], 0, 0);
}
}
Modified: trunk/src/gpm-prefs-core.c
==============================================================================
--- trunk/src/gpm-prefs-core.c (original)
+++ trunk/src/gpm-prefs-core.c Wed Sep 3 15:53:48 2008
@@ -40,7 +40,7 @@
#include "gpm-prefs.h"
#include "gpm-conf.h"
#include "gpm-prefs-core.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-stock-icons.h"
#include "gpm-screensaver.h"
#include "gpm-prefs-server.h"
@@ -156,7 +156,7 @@
connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (connection == NULL) {
if (error) {
- gpm_warning ("Couldn't connect to PowerManager %s",
+ egg_warning ("Couldn't connect to PowerManager %s",
error->message);
g_error_free (error);
}
@@ -172,12 +172,12 @@
G_TYPE_BOOLEAN, &value,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("%s failed!", method);
+ egg_warning ("%s failed!", method);
return FALSE;
}
g_object_unref (proxy);
@@ -200,7 +200,7 @@
connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (connection == NULL) {
if (error) {
- gpm_warning ("Couldn't connect to PowerManager %s",
+ egg_warning ("Couldn't connect to PowerManager %s",
error->message);
g_error_free (error);
}
@@ -216,12 +216,12 @@
G_TYPE_INT, &value,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("%s failed!", method);
+ egg_warning ("%s failed!", method);
return FALSE;
}
g_object_unref (proxy);
@@ -237,7 +237,7 @@
gpm_prefs_help_cb (GtkWidget *widget,
GpmPrefs *prefs)
{
- gpm_debug ("emitting action-help");
+ egg_debug ("emitting action-help");
g_signal_emit (prefs, signals [ACTION_HELP], 0);
}
@@ -254,7 +254,7 @@
policy = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "policy"));
str = gpm_tray_icon_mode_to_string (policy);
- gpm_debug ("Changing %s to %s", GPM_CONF_UI_ICON_POLICY, str);
+ egg_debug ("Changing %s to %s", GPM_CONF_UI_ICON_POLICY, str);
gpm_conf_set_string (prefs->priv->conf, GPM_CONF_UI_ICON_POLICY, str);
}
@@ -320,7 +320,7 @@
}
gpm_pref_key = (char *) g_object_get_data (G_OBJECT (range), "conf_key");
- gpm_debug ("Changing %s to %i", gpm_pref_key, value);
+ egg_debug ("Changing %s to %i", gpm_pref_key, value);
gpm_conf_set_int (prefs->priv->conf, gpm_pref_key, value);
}
@@ -385,7 +385,7 @@
gpm_pref_key = (char *) g_object_get_data (G_OBJECT (range), "conf_key");
g_object_set_data (G_OBJECT (range), "conf_key", (gpointer) gpm_pref_key);
- gpm_debug ("Changing %s to %i", gpm_pref_key, (int) value);
+ egg_debug ("Changing %s to %i", gpm_pref_key, (int) value);
gpm_conf_set_int (prefs->priv->conf, gpm_pref_key, (gint) value);
}
@@ -458,7 +458,7 @@
g_free (value);
gpm_pref_key = (char *) g_object_get_data (G_OBJECT (widget), "conf_key");
- gpm_debug ("Changing %s to %s", gpm_pref_key, action);
+ egg_debug ("Changing %s to %s", gpm_pref_key, action);
gpm_conf_set_string (prefs->priv->conf, gpm_pref_key, action);
}
@@ -494,21 +494,21 @@
G_CALLBACK (gpm_prefs_action_combo_changed_cb), prefs);
if (value == NULL) {
- gpm_warning ("invalid schema, please re-install");
+ egg_warning ("invalid schema, please re-install");
value = g_strdup ("nothing");
}
while (actions[i] != NULL) {
if ((strcmp (actions[i], ACTION_SHUTDOWN) == 0) && !prefs->priv->can_shutdown) {
- gpm_debug ("Cannot add option, as cannot shutdown.");
+ egg_debug ("Cannot add option, as cannot shutdown.");
} else if (strcmp (actions[i], ACTION_SHUTDOWN) == 0 && prefs->priv->can_shutdown) {
gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
ACTION_SHUTDOWN_TEXT);
n_added++;
} else if ((strcmp (actions[i], ACTION_SUSPEND) == 0) && !prefs->priv->can_suspend) {
- gpm_debug ("Cannot add option, as cannot suspend.");
+ egg_debug ("Cannot add option, as cannot suspend.");
} else if ((strcmp (actions[i], ACTION_HIBERNATE) == 0) && !prefs->priv->can_hibernate) {
- gpm_debug ("Cannot add option, as cannot hibernate.");
+ egg_debug ("Cannot add option, as cannot hibernate.");
} else if ((strcmp (actions[i], ACTION_SUSPEND) == 0) && prefs->priv->can_suspend) {
gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
ACTION_SUSPEND_TEXT);
@@ -530,7 +530,7 @@
ACTION_NOTHING_TEXT);
n_added++;
} else {
- gpm_error ("Unknown action read from conf: %s", actions[i]);
+ egg_error ("Unknown action read from conf: %s", actions[i]);
}
if (strcmp (value, actions[i]) == 0)
@@ -558,7 +558,7 @@
widget_name = gtk_widget_get_name (widget);
gpm_pref_key = (char *) g_object_get_data (G_OBJECT (widget), "conf_key");
- gpm_debug ("Changing %s to %i", gpm_pref_key, checked);
+ egg_debug ("Changing %s to %i", gpm_pref_key, checked);
gpm_conf_set_bool (prefs->priv->conf, gpm_pref_key, checked);
}
@@ -578,7 +578,7 @@
gboolean checked;
GtkWidget *widget;
- gpm_debug ("Setting up %s", gpm_pref_key);
+ egg_debug ("Setting up %s", gpm_pref_key);
widget = glade_xml_get_widget (xml, widget_name);
@@ -604,7 +604,7 @@
gpm_prefs_close_cb (GtkWidget *widget,
GpmPrefs *prefs)
{
- gpm_debug ("emitting action-close");
+ egg_debug ("emitting action-close");
g_signal_emit (prefs, signals [ACTION_CLOSE], 0);
}
@@ -639,7 +639,7 @@
GtkWidget *widget;
widget = glade_xml_get_widget (prefs->priv->glade_xml, widget_name);
if (gs_idle_time + 1 > NEVER_TIME_ON_SLIDER) {
- gpm_warning ("gnome-screensaver timeout is really big. "
+ egg_warning ("gnome-screensaver timeout is really big. "
"Not sure what to do");
return;
}
@@ -685,15 +685,15 @@
if (strcmp (key, GPM_CONF_LOWPOWER_AC) == 0) {
gpm_conf_get_bool (prefs->priv->conf, GPM_CONF_LOWPOWER_AC, &enabled);
- gpm_debug ("need to enable checkbox");
+ egg_debug ("need to enable checkbox");
} else if (strcmp (key, GPM_CONF_LOWPOWER_UPS) == 0) {
gpm_conf_get_bool (prefs->priv->conf, GPM_CONF_LOWPOWER_UPS, &enabled);
- gpm_debug ("need to enable checkbox");
+ egg_debug ("need to enable checkbox");
} else if (strcmp (key, GPM_CONF_LOWPOWER_BATT) == 0) {
gpm_conf_get_bool (prefs->priv->conf, GPM_CONF_LOWPOWER_BATT, &enabled);
- gpm_debug ("need to enable checkbox");
+ egg_debug ("need to enable checkbox");
}
}
@@ -1024,7 +1024,7 @@
if (strcmp (name, "button_default") == 0) {
return polkit_gnome_action_create_button (prefs->priv->default_action);
}
- gpm_warning ("name unknown=%s", name);
+ egg_warning ("name unknown=%s", name);
return NULL;
}
@@ -1086,7 +1086,7 @@
prefs->priv->can_shutdown = gpm_dbus_method_bool ("CanShutdown");
prefs->priv->can_suspend = gpm_dbus_method_bool ("CanSuspend");
prefs->priv->can_hibernate = gpm_dbus_method_bool ("CanHibernate");
- gpm_debug ("caps=%i", caps);
+ egg_debug ("caps=%i", caps);
#ifdef HAVE_GCONF_DEFAULTS
/* use custom widgets */
Modified: trunk/src/gpm-prefs-server.c
==============================================================================
--- trunk/src/gpm-prefs-server.c (original)
+++ trunk/src/gpm-prefs-server.c Wed Sep 3 15:53:48 2008
@@ -39,7 +39,7 @@
#include <dbus/dbus-glib.h>
#include "gpm-prefs-server.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#define GPM_PREFS_SERVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_PREFS_SERVER, GpmPrefsServerPrivate))
@@ -81,7 +81,7 @@
g_return_val_if_fail (server != NULL, FALSE);
g_return_val_if_fail (GPM_IS_PREFS_SERVER (server), FALSE);
server->priv->capability = server->priv->capability + capability;
- gpm_debug ("capability now %i", server->priv->capability);
+ egg_debug ("capability now %i", server->priv->capability);
return TRUE;
}
Modified: trunk/src/gpm-prefs.c
==============================================================================
--- trunk/src/gpm-prefs.c (original)
+++ trunk/src/gpm-prefs.c Wed Sep 3 15:53:48 2008
@@ -35,7 +35,7 @@
#include "gpm-common.h"
#include "gpm-prefs.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-prefs-core.h"
/**
@@ -104,7 +104,7 @@
g_option_context_parse (context, &argc, &argv, NULL);
gtk_init (&argc, &argv);
- gpm_debug_init (verbose);
+ egg_debug_init (verbose);
/* are we already activated? */
libunique = libunique_new ();
@@ -125,7 +125,6 @@
g_object_unref (prefs);
unique_out:
- gpm_debug_shutdown ();
g_object_unref (libunique);
/* seems to not work...
Modified: trunk/src/gpm-profile.c
==============================================================================
--- trunk/src/gpm-profile.c (original)
+++ trunk/src/gpm-profile.c Wed Sep 3 15:53:48 2008
@@ -37,13 +37,14 @@
#include <glib/gstdio.h>
#include <libdbus-proxy.h>
+#include "egg-color.h"
#include "gpm-common.h"
#include "gpm-ac-adapter.h"
#include "gpm-array.h"
#include "gpm-array-float.h"
#include "gpm-dpms.h"
#include "gpm-load.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-control.h"
#include "gpm-profile.h"
@@ -117,7 +118,7 @@
/* check we have a profile loaded */
if (profile->priv->config_id == NULL) {
- gpm_warning ("no config id set!");
+ egg_warning ("no config id set!");
return NULL;
}
@@ -198,11 +199,11 @@
value_accuracy = gpm_array_float_get (array_accuracy, i);
/* only set points that are not zero */
if (value_data == 0) {
- gpm_array_set (profile->priv->present_array_data, i, i, value_data, GPM_COLOUR_DARK_GREY);
+ gpm_array_set (profile->priv->present_array_data, i, i, value_data, EGG_COLOR_DARK_GREY);
} else if (value_accuracy == 0) {
- gpm_array_set (profile->priv->present_array_data, i, i, value_data, GPM_COLOUR_BLUE);
+ gpm_array_set (profile->priv->present_array_data, i, i, value_data, EGG_COLOR_BLUE);
} else if (value_data > 0) {
- gpm_array_set (profile->priv->present_array_data, i, i, value_data, GPM_COLOUR_RED);
+ gpm_array_set (profile->priv->present_array_data, i, i, value_data, EGG_COLOR_RED);
}
}
@@ -255,11 +256,11 @@
g_return_val_if_fail (GPM_IS_PROFILE (profile), NULL);
if (discharge) {
- colour_active = GPM_COLOUR_BLUE;
- colour_nonactive = GPM_COLOUR_DARK_BLUE;
+ colour_active = EGG_COLOR_BLUE;
+ colour_nonactive = EGG_COLOR_DARK_BLUE;
} else {
- colour_active = GPM_COLOUR_RED;
- colour_nonactive = GPM_COLOUR_DARK_RED;
+ colour_active = EGG_COLOR_RED;
+ colour_nonactive = EGG_COLOR_DARK_RED;
}
/* get the correct data */
@@ -301,13 +302,13 @@
/* check we have a profile loaded */
if (profile->priv->config_id == NULL) {
- gpm_warning ("no config id set!");
+ egg_warning ("no config id set!");
return 0;
}
/* check we can give a decent reading */
if (percentage > 99) {
- gpm_debug ("percentage = %i, correcting to 99%", percentage);
+ egg_debug ("percentage = %i, correcting to 99%%", percentage);
percentage = 99;
}
@@ -346,10 +347,10 @@
length_average++;
}
}
- gpm_debug ("average=%f, length_average=%i", average, length_average);
+ egg_debug ("average=%f, length_average=%i", average, length_average);
if (average == 0 || length_average == 0) {
/* no data with accuracy */
- gpm_warning ("no data");
+ egg_warning ("no data");
return 0;
}
return average / (gfloat) length_average;
@@ -415,7 +416,7 @@
/* find the data average of the non zero accuracy points */
average = gpm_profile_get_nonzero_accuracy_percent (array_data, array_accuracy);
- gpm_debug ("estimated average = %f", average);
+ egg_debug ("estimated average = %f", average);
/* set the zero accuracy data to the average */
gpm_profile_set_zero_accuracy_average (array_data, array_accuracy, average, 5, 95);
@@ -527,22 +528,22 @@
/* reset timer for next time */
g_timer_start (profile->priv->timer);
- gpm_debug ("elapsed is %f for %i at load %f (accuracy:%i)", elapsed, percentage, load, accuracy);
+ egg_debug ("elapsed is %f for %i at load %f (accuracy:%i)", elapsed, percentage, load, accuracy);
/* don't process the first point, we maybe in between percentage points */
if (profile->priv->data_valid == FALSE) {
- gpm_debug ("data is not valid, will process next");
+ egg_debug ("data is not valid, will process next");
profile->priv->data_valid = TRUE;
return FALSE;
}
if (accuracy < 20) {
- gpm_debug ("not accurate enough");
+ egg_debug ("not accurate enough");
return FALSE;
}
if (profile->priv->lcd_on == FALSE) {
- gpm_debug ("screen blanked, so not representative - ignoring");
+ egg_debug ("screen blanked, so not representative - ignoring");
return FALSE;
}
@@ -552,7 +553,7 @@
array_percentage = percentage;
} else {
if (percentage == 0) {
- gpm_debug ("ignoring percentage zero when charging");
+ egg_debug ("ignoring percentage zero when charging");
return FALSE;
}
array_percentage = percentage - 1;
@@ -607,7 +608,7 @@
for (i=profile->priv->last_percentage; i<100; i++) {
/* set percentage i to zero with accuracy 100 */
gpm_profile_save_percentage (profile, i, 0, 100);
- gpm_debug ("set percentage %i to zero", i);
+ egg_debug ("set percentage %i to zero", i);
}
}
return TRUE;
@@ -628,10 +629,10 @@
/* check AC state */
if (on_ac) {
- gpm_debug ("on AC");
+ egg_debug ("on AC");
profile->priv->discharging = FALSE;
} else {
- gpm_debug ("on battery");
+ egg_debug ("on battery");
profile->priv->discharging = TRUE;
}
@@ -651,7 +652,7 @@
GpmDpmsMode mode,
GpmProfile *profile)
{
- gpm_debug ("DPMS mode changed: %d", mode);
+ egg_debug ("DPMS mode changed: %d", mode);
/* We have to monitor the screen as it's one of the biggest energy
* users. If this goes off, then out battery usage is non-proportional
@@ -678,7 +679,7 @@
/* check we have a profile loaded */
if (profile->priv->config_id == NULL) {
- gpm_warning ("no config id set!");
+ egg_warning ("no config id set!");
goto out;
}
@@ -692,7 +693,7 @@
/* try to delete file */
if (g_unlink (filename) != 0) {
- gpm_warning ("could not delete '%s'", filename);
+ egg_warning ("could not delete '%s'", filename);
goto out;
}
ret = TRUE;
@@ -730,7 +731,7 @@
/* read in data profile from disk */
filename = gpm_profile_get_data_file (profile, discharge);
- gpm_debug ("loading battery data from '%s'", filename);
+ egg_debug ("loading battery data from '%s'", filename);
ret = gpm_array_load_from_file (array, filename);
/* if not found, then generate a new one with a low propability */
@@ -741,7 +742,7 @@
g_mkdir_with_parents (path, 0770);
g_free (path);
- gpm_debug ("no data found, generating initial (poor) data");
+ egg_debug ("no data found, generating initial (poor) data");
for (i=0;i<100;i++) {
/* just set data to zero as we have _no_ idea */
gpm_array_set (array, i, i, 0, 0);
@@ -749,7 +750,7 @@
ret = gpm_array_save_to_file (array, filename);
if (!ret) {
- gpm_warning ("saving state failed. You will not get accurate time remaining calculations");
+ egg_warning ("saving state failed. You will not get accurate time remaining calculations");
}
}
@@ -779,7 +780,7 @@
g_return_val_if_fail (GPM_IS_PROFILE (profile), FALSE);
g_return_val_if_fail (config_id != NULL, FALSE);
- gpm_debug ("config_id = %s", config_id);
+ egg_debug ("config_id = %s", config_id);
if (profile->priv->config_id == NULL) {
/* if new */
profile->priv->config_id = g_strdup (config_id);
@@ -797,17 +798,17 @@
}
/* do debugging self tests only if verbose */
- if (gpm_debug_is_verbose ()) {
- gpm_debug ("Reference times");
+ if (egg_debug_enabled ()) {
+ egg_debug ("Reference times");
time = gpm_profile_get_time (profile, 99, TRUE);
- gpm_debug ("99-0\t%i minutes", time / 60);
+ egg_debug ("99-0\t%i minutes", time / 60);
time = gpm_profile_get_time (profile, 50, TRUE);
- gpm_debug ("50-0\t%i minutes", time / 60);
+ egg_debug ("50-0\t%i minutes", time / 60);
time = gpm_profile_get_time (profile, 0, FALSE);
- gpm_debug ("0-99\t%i minutes", time / 60);
+ egg_debug ("0-99\t%i minutes", time / 60);
time = gpm_profile_get_time (profile, 50, FALSE);
- gpm_debug ("50-99\t%i minutes", time / 60);
+ egg_debug ("50-99\t%i minutes", time / 60);
}
return TRUE;
@@ -838,13 +839,13 @@
/* check we have a profile loaded */
if (profile->priv->config_id == NULL) {
- gpm_warning ("no config id set!");
+ egg_warning ("no config id set!");
return 0;
}
if (percentage > 99) {
percentage = 99;
- gpm_debug ("corrected percentage...");
+ egg_debug ("corrected percentage...");
}
/* get the correct data */
@@ -906,7 +907,7 @@
/* use the control object so we don't save new percentage points
* after suspend or hibernate */
- gpm_debug ("creating new control instance");
+ egg_debug ("creating new control instance");
profile->priv->control = gpm_control_new ();
g_signal_connect (profile->priv->control, "sleep",
G_CALLBACK (control_sleep_action_cb), profile);
@@ -927,10 +928,10 @@
/* check AC state */
if (on_ac) {
- gpm_debug ("on AC");
+ egg_debug ("on AC");
profile->priv->discharging = FALSE;
} else {
- gpm_debug ("on battery");
+ egg_debug ("on battery");
profile->priv->discharging = TRUE;
}
}
Modified: trunk/src/gpm-refcount.c
==============================================================================
--- trunk/src/gpm-refcount.c (original)
+++ trunk/src/gpm-refcount.c Wed Sep 3 15:53:48 2008
@@ -26,7 +26,7 @@
#include <glib/gi18n.h>
#include "gpm-refcount.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
static void gpm_refcount_class_init (GpmRefcountClass *klass);
static void gpm_refcount_init (GpmRefcount *refcount);
@@ -64,17 +64,17 @@
GpmRefcount *refcount = (GpmRefcount*) data;
if (refcount->priv->refcount == 0) {
- gpm_warning ("no refcount to remove");
+ egg_warning ("no refcount to remove");
return FALSE;
}
refcount->priv->refcount--;
if (refcount->priv->refcount == 0) {
- gpm_debug ("zero, so sending REFCOUNT_ZERO");
+ egg_debug ("zero, so sending REFCOUNT_ZERO");
g_signal_emit (refcount, signals [REFCOUNT_ZERO], 0);
} else {
- gpm_debug ("refcount now: %i", refcount->priv->refcount);
+ egg_debug ("refcount now: %i", refcount->priv->refcount);
}
return FALSE;
@@ -92,13 +92,13 @@
g_return_val_if_fail (GPM_IS_REFCOUNT (refcount), FALSE);
if (refcount->priv->timeout == 0) {
- gpm_warning ("no timeout has been set");
+ egg_warning ("no timeout has been set");
return FALSE;
}
refcount->priv->refcount++;
- gpm_debug ("refcount now: %i", refcount->priv->refcount);
- gpm_debug ("non zero, so sending REFCOUNT_ADDED");
+ egg_debug ("refcount now: %i", refcount->priv->refcount);
+ egg_debug ("non zero, so sending REFCOUNT_ADDED");
g_signal_emit (refcount, signals [REFCOUNT_ADDED], 0);
/* remove the last timeout */
@@ -124,7 +124,7 @@
g_return_val_if_fail (GPM_IS_REFCOUNT (refcount), FALSE);
if (refcount->priv->refcount == 0) {
- gpm_warning ("no refcount to remove");
+ egg_warning ("no refcount to remove");
return FALSE;
}
@@ -144,11 +144,11 @@
g_return_val_if_fail (GPM_IS_REFCOUNT (refcount), FALSE);
if (timeout > 100000) {
- gpm_warning ("refcount is not designed for long timeouts");
+ egg_warning ("refcount is not designed for long timeouts");
return FALSE;
}
if (timeout == 0) {
- gpm_warning ("refcount cannot be zero");
+ egg_warning ("refcount cannot be zero");
timeout = 1000;
}
Modified: trunk/src/gpm-screensaver.c
==============================================================================
--- trunk/src/gpm-screensaver.c (original)
+++ trunk/src/gpm-screensaver.c Wed Sep 3 15:53:48 2008
@@ -28,7 +28,7 @@
#include "gpm-conf.h"
#include "gpm-screensaver.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include <libdbus-proxy.h>
static void gpm_screensaver_class_init (GpmScreensaverClass *klass);
@@ -65,7 +65,7 @@
gpm_screensaver_auth_begin (DBusGProxy *proxy,
GpmScreensaver *screensaver)
{
- gpm_debug ("emitting auth-request : (%i)", TRUE);
+ egg_debug ("emitting auth-request : (%i)", TRUE);
g_signal_emit (screensaver, signals [AUTH_REQUEST], 0, TRUE);
}
@@ -76,7 +76,7 @@
gpm_screensaver_auth_end (DBusGProxy *proxy,
GpmScreensaver *screensaver)
{
- gpm_debug ("emitting auth-request : (%i)", FALSE);
+ egg_debug ("emitting auth-request : (%i)", FALSE);
g_signal_emit (screensaver, signals [AUTH_REQUEST], 0, FALSE);
}
@@ -88,7 +88,7 @@
gboolean is_idle,
GpmScreensaver *screensaver)
{
- gpm_debug ("emitting session-idle-changed : (%i)", is_idle);
+ egg_debug ("emitting session-idle-changed : (%i)", is_idle);
g_signal_emit (screensaver, signals [SESSION_IDLE_CHANGED], 0, is_idle);
}
@@ -99,7 +99,7 @@
gboolean is_idle,
GpmScreensaver *screensaver)
{
- gpm_debug ("emitting powersave-idle-changed : (%i)", is_idle);
+ egg_debug ("emitting powersave-idle-changed : (%i)", is_idle);
g_signal_emit (screensaver, signals [POWERSAVE_IDLE_CHANGED], 0, is_idle);
}
@@ -116,7 +116,7 @@
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
@@ -163,7 +163,7 @@
g_return_val_if_fail (GPM_IS_SCREENSAVER (screensaver), FALSE);
g_signal_emit (screensaver, signals [CONNECTION_CHANGED], 0, FALSE);
- gpm_debug ("gnome-screensaver disconnected from the session DBUS");
+ egg_debug ("gnome-screensaver disconnected from the session DBUS");
return TRUE;
}
@@ -178,11 +178,11 @@
GpmScreensaver *screensaver)
{
g_return_if_fail (GPM_IS_SCREENSAVER (screensaver));
- gpm_debug ("key : %s", key);
+ egg_debug ("key : %s", key);
if (strcmp (key, GS_PREF_IDLE_DELAY) == 0) {
gpm_conf_get_uint (screensaver->priv->conf, key, &screensaver->priv->idle_delay);
- gpm_debug ("emitting gs-delay-changed : %i", screensaver->priv->idle_delay);
+ egg_debug ("emitting gs-delay-changed : %i", screensaver->priv->idle_delay);
g_signal_emit (screensaver, signals [GS_DELAY_CHANGED], 0, screensaver->priv->idle_delay);
}
}
@@ -243,11 +243,11 @@
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
- gpm_debug ("doing gnome-screensaver lock");
+ egg_debug ("doing gnome-screensaver lock");
dbus_g_proxy_call_no_reply (proxy, "Lock", G_TYPE_INVALID);
/* When we send the Lock signal to g-ss it takes maybe a second
@@ -289,13 +289,13 @@
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return 0;
}
/* shouldn't be, but make sure proxy valid */
if (proxy == NULL) {
- gpm_warning ("g-s proxy is NULL!");
+ egg_warning ("g-s proxy is NULL!");
return 0;
}
@@ -306,16 +306,16 @@
G_TYPE_UINT, &cookie,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("Throttle failed!");
+ egg_warning ("Throttle failed!");
return 0;
}
- gpm_debug ("adding throttle reason: '%s': id %u", reason, cookie);
+ egg_debug ("adding throttle reason: '%s': id %u", reason, cookie);
return cookie;
}
@@ -331,22 +331,22 @@
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
- gpm_debug ("removing throttle: id %u", cookie);
+ egg_debug ("removing throttle: id %u", cookie);
ret = dbus_g_proxy_call (proxy, "UnThrottle", &error,
G_TYPE_UINT, cookie,
G_TYPE_INVALID,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("UnThrottle failed!");
+ egg_warning ("UnThrottle failed!");
return FALSE;
}
@@ -370,7 +370,7 @@
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
@@ -379,7 +379,7 @@
G_TYPE_BOOLEAN, &temp,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
@@ -403,11 +403,11 @@
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
- gpm_debug ("poke");
+ egg_debug ("poke");
dbus_g_proxy_call_no_reply (proxy,
"SimulateUserActivity",
G_TYPE_INVALID);
@@ -432,7 +432,7 @@
proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
@@ -441,12 +441,12 @@
G_TYPE_UINT, time_secs,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetActiveTime failed!");
+ egg_warning ("GetActiveTime failed!");
return FALSE;
}
Modified: trunk/src/gpm-self-test.c
==============================================================================
--- trunk/src/gpm-self-test.c (original)
+++ trunk/src/gpm-self-test.c Wed Sep 3 15:53:48 2008
@@ -26,7 +26,7 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-self-test.h"
gboolean
@@ -171,7 +171,7 @@
g_option_context_parse (context, &argc, &argv, NULL);
gtk_init (&argc, &argv);
- gpm_debug_init (verbose);
+ egg_debug_init (verbose);
GpmSelfTest ttest;
GpmSelfTest *test = &ttest;
Modified: trunk/src/gpm-sound.c
==============================================================================
--- trunk/src/gpm-sound.c (original)
+++ trunk/src/gpm-sound.c Wed Sep 3 15:53:48 2008
@@ -42,7 +42,7 @@
#include "gpm-ac-adapter.h"
#include "gpm-common.h"
#include "gpm-control.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-conf.h"
#include "gpm-sound.h"
@@ -223,7 +223,7 @@
gst_element_set_state (sound->priv->playbin, GST_STATE_NULL);
gst_message_parse_error (message, &error, &debug);
- gpm_warning ("%s (%s)", error->message, debug);
+ egg_warning ("%s (%s)", error->message, debug);
g_error_free (error);
g_free (debug);
Modified: trunk/src/gpm-srv-brightness-kbd.c
==============================================================================
--- trunk/src/gpm-srv-brightness-kbd.c (original)
+++ trunk/src/gpm-srv-brightness-kbd.c Wed Sep 3 15:53:48 2008
@@ -45,7 +45,7 @@
#include "gpm-srv-brightness-kbd.h"
#include "gpm-conf.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-feedback-widget.h"
#include "gpm-idle.h"
#include "gpm-light-sensor.h"
@@ -136,7 +136,7 @@
const gchar *type,
GpmSrvBrightnessKbd *srv_brightness)
{
- gpm_debug ("Button press event type=%s", type);
+ egg_debug ("Button press event type=%s", type);
if ((strcmp (type, GPM_BUTTON_KBD_BRIGHT_UP) == 0)) {
gpm_brightness_kbd_up (srv_brightness->priv->brightness);
@@ -238,7 +238,7 @@
gint percentage,
GpmSrvBrightnessKbd *srv_brightness)
{
- gpm_debug ("Need to display backlight feedback value %i", percentage);
+ egg_debug ("Need to display backlight feedback value %i", percentage);
gpm_feedback_display_value (srv_brightness->priv->feedback, (float) percentage / 100.0f);
}
Modified: trunk/src/gpm-srv-screensaver.c
==============================================================================
--- trunk/src/gpm-srv-screensaver.c (original)
+++ trunk/src/gpm-srv-screensaver.c Wed Sep 3 15:53:48 2008
@@ -29,7 +29,7 @@
#include "gpm-conf.h"
#include "gpm-screensaver.h"
#include "gpm-srv-screensaver.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-button.h"
#include "gpm-dpms.h"
#include "gpm-ac-adapter.h"
@@ -75,7 +75,7 @@
/* TODO: This may be a bid of a bodge, as we will have multiple
resume requests -- maybe this need a logic cleanup */
if (srv_screensaver->priv->brightness) {
- gpm_debug ("undimming lcd due to auth begin");
+ egg_debug ("undimming lcd due to auth begin");
// gpm_brightness_undim (srv_screensaver->priv->brightness);
}
@@ -85,7 +85,7 @@
error = NULL;
gpm_dpms_set_mode_enum (srv_screensaver->priv->dpms, GPM_DPMS_MODE_ON, &error);
if (error != NULL) {
- gpm_warning ("Failed to turn on DPMS: %s", error->message);
+ egg_warning ("Failed to turn on DPMS: %s", error->message);
g_error_free (error);
}
}
@@ -164,7 +164,7 @@
const gchar *type,
GpmSrvScreensaver *srv_screensaver)
{
- gpm_debug ("Button press event type=%s", type);
+ egg_debug ("Button press event type=%s", type);
/* really belongs in gnome-srv_screensaver */
if (strcmp (type, GPM_BUTTON_LOCK) == 0) {
@@ -193,7 +193,7 @@
GpmDpmsMode mode,
GpmSrvScreensaver *srv_screensaver)
{
- gpm_debug ("DPMS mode changed: %d", mode);
+ egg_debug ("DPMS mode changed: %d", mode);
update_dpms_throttle (srv_screensaver);
}
Modified: trunk/src/gpm-statistics-core.c
==============================================================================
--- trunk/src/gpm-statistics-core.c (original)
+++ trunk/src/gpm-statistics-core.c Wed Sep 3 15:53:48 2008
@@ -36,7 +36,7 @@
#include "gpm-prefs.h"
#include "gpm-conf.h"
#include "gpm-statistics-core.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-stock-icons.h"
#include "gpm-info.h"
#include <libdbus-proxy.h>
@@ -139,7 +139,7 @@
gpm_statistics_help_cb (GtkWidget *widget,
GpmStatistics *statistics)
{
- gpm_debug ("emitting action-help");
+ egg_debug ("emitting action-help");
g_signal_emit (statistics, signals [ACTION_HELP], 0);
}
@@ -152,7 +152,7 @@
gpm_statistics_close_cb (GtkWidget *widget,
GpmStatistics *statistics)
{
- gpm_debug ("emitting action-close");
+ egg_debug ("emitting action-close");
g_signal_emit (statistics, signals [ACTION_CLOSE], 0);
}
@@ -185,7 +185,7 @@
if (strcmp (key, GPM_CONF_LOWPOWER_AC) == 0) {
gpm_conf_get_bool (statistics->priv->conf, GPM_CONF_LOWPOWER_AC, &enabled);
- gpm_debug ("need to enable checkbox");
+ egg_debug ("need to enable checkbox");
}
}
@@ -232,7 +232,7 @@
proxy = dbus_proxy_get_proxy (statistics->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
@@ -247,16 +247,16 @@
g_type_ptrarray, &ptrarray,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetEventLog failed!");
+ egg_warning ("GetEventLog failed!");
return FALSE;
}
- gpm_debug ("events size=%i", ptrarray->len);
+ egg_debug ("events size=%i", ptrarray->len);
/* clear current events */
gpm_array_clear (statistics->priv->events);
@@ -296,7 +296,7 @@
gboolean checked;
checked = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
- gpm_debug ("Events enable %i", checked);
+ egg_debug ("Events enable %i", checked);
/* save to gconf so we open next time with the correct setting */
gpm_conf_set_bool (statistics->priv->conf, GPM_CONF_STATS_SHOW_EVENTS, checked);
@@ -375,7 +375,7 @@
proxy = dbus_proxy_get_proxy (statistics->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
@@ -384,12 +384,12 @@
G_TYPE_STRV, &strlist,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetTypes failed!");
+ egg_warning ("GetTypes failed!");
return FALSE;
}
@@ -437,7 +437,7 @@
proxy = dbus_proxy_get_proxy (statistics->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
@@ -454,16 +454,16 @@
g_type_ptrarray, &ptrarray,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetData failed!");
+ egg_warning ("GetData failed!");
return FALSE;
}
- gpm_debug ("size=%i", ptrarray->len);
+ egg_debug ("size=%i", ptrarray->len);
/* clear current events */
gpm_array_clear (statistics->priv->data);
@@ -521,7 +521,7 @@
proxy = dbus_proxy_get_proxy (statistics->priv->gproxy);
if (proxy == NULL) {
- gpm_warning ("not connected");
+ egg_warning ("not connected");
return FALSE;
}
@@ -536,12 +536,12 @@
g_type_ptr_event_array, &ptr_event_array,
G_TYPE_INVALID);
if (error) {
- gpm_debug ("ERROR: %s", error->message);
+ egg_debug ("ERROR: %s", error->message);
g_error_free (error);
}
if (!ret) {
/* abort as the DBUS method failed */
- gpm_warning ("GetAxisTypes failed!");
+ egg_warning ("GetAxisTypes failed!");
return FALSE;
}
@@ -594,8 +594,8 @@
}
g_ptr_array_free (ptr_event_array, TRUE);
- gpm_debug ("graph type '%s' mapped to x-axis '%s'", type, axis_type_x_text);
- gpm_debug ("graph type '%s' mapped to y-axis '%s'", type, axis_type_y_text);
+ egg_debug ("graph type '%s' mapped to x-axis '%s'", type, axis_type_x_text);
+ egg_debug ("graph type '%s' mapped to y-axis '%s'", type, axis_type_y_text);
/* convert the string types to enumerated values */
axis_type_x = gpm_graph_widget_string_to_axis_type (axis_type_x_text);
@@ -622,7 +622,7 @@
GArray *arrayfloat;
GArray *kernel;
GArray *result;
- gpm_debug ("smoothing data, slooooooow....");
+ egg_debug ("smoothing data, slooooooow....");
arrayfloat = gpm_array_float_new (gpm_array_get_size (statistics->priv->data));
gpm_array_float_from_array_y (arrayfloat, statistics->priv->data);
@@ -652,7 +652,7 @@
value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
if (value == NULL) {
- gpm_debug ("no graph types available");
+ egg_debug ("no graph types available");
return;
}
if (strcmp (value, ACTION_CHARGE_TEXT) == 0) {
@@ -759,7 +759,7 @@
{
GpmStatistics *statistics = GPM_STATISTICS (data);
- gpm_debug ("refreshing graph type '%s'", statistics->priv->graph_type);
+ egg_debug ("refreshing graph type '%s'", statistics->priv->graph_type);
gpm_statistics_refresh_data (statistics);
gpm_statistics_refresh_events (statistics);
return TRUE;
@@ -810,7 +810,7 @@
/* would happen if not using g-p-m or using an old version of g-p-m */
if (dbus_proxy_is_connected (statistics->priv->gproxy) == FALSE) {
- gpm_error (_("Could not connect to GNOME Power Manager."));
+ egg_error (_("Could not connect to GNOME Power Manager."));
}
statistics->priv->graph_type = NULL;
Modified: trunk/src/gpm-statistics.c
==============================================================================
--- trunk/src/gpm-statistics.c (original)
+++ trunk/src/gpm-statistics.c Wed Sep 3 15:53:48 2008
@@ -35,7 +35,7 @@
#include "gpm-common.h"
#include "gpm-conf.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-statistics-core.h"
/**
@@ -104,7 +104,7 @@
g_option_context_parse (context, &argc, &argv, NULL);
gtk_init (&argc, &argv);
- gpm_debug_init (verbose);
+ egg_debug_init (verbose);
/* are we already activated? */
libunique = libunique_new ();
@@ -124,7 +124,6 @@
g_object_unref (statistics);
unique_out:
- gpm_debug_shutdown ();
g_object_unref (libunique);
/* seems to not work...
Modified: trunk/src/gpm-tray-icon.c
==============================================================================
--- trunk/src/gpm-tray-icon.c (original)
+++ trunk/src/gpm-tray-icon.c Wed Sep 3 15:53:48 2008
@@ -43,7 +43,7 @@
#include "gpm-conf.h"
#include "gpm-control.h"
#include "gpm-common.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-notify.h"
#include "gpm-cell-array.h"
#include "gpm-cell.h"
@@ -179,14 +179,14 @@
g_return_val_if_fail (GPM_IS_TRAY_ICON (icon), FALSE);
if (filename != NULL) {
- gpm_debug ("Setting icon to %s", filename);
+ egg_debug ("Setting icon to %s", filename);
gtk_status_icon_set_from_icon_name (GTK_STATUS_ICON (icon->priv->status_icon), filename);
/* make sure that we are visible */
gpm_tray_icon_show (icon, TRUE);
} else {
/* remove icon */
- gpm_debug ("no icon will be displayed");
+ egg_debug ("no icon will be displayed");
/* make sure that we are hidden */
gpm_tray_icon_show (icon, FALSE);
@@ -241,7 +241,7 @@
gpm_tray_icon_hibernate_cb (GtkMenuItem *item, gpointer data)
{
GpmTrayIcon *icon = GPM_TRAY_ICON (data);
- gpm_debug ("emitting hibernate");
+ egg_debug ("emitting hibernate");
g_signal_emit (icon, signals [HIBERNATE], 0);
}
@@ -254,7 +254,7 @@
gpm_tray_icon_suspend_cb (GtkMenuItem *item, gpointer data)
{
GpmTrayIcon *icon = GPM_TRAY_ICON (data);
- gpm_debug ("emitting suspend");
+ egg_debug ("emitting suspend");
g_signal_emit (icon, signals [SUSPEND], 0);
}
@@ -269,7 +269,7 @@
const gchar *command = "gnome-power-statistics";
if (g_spawn_command_line_async (command, NULL) == FALSE) {
- gpm_warning ("Couldn't execute command: %s", command);
+ egg_warning ("Couldn't execute command: %s", command);
}
}
@@ -284,7 +284,7 @@
const gchar *command = "gnome-power-preferences";
if (g_spawn_command_line_async (command, NULL) == FALSE) {
- gpm_warning ("Couldn't execute command: %s", command);
+ egg_warning ("Couldn't execute command: %s", command);
}
}
@@ -374,7 +374,7 @@
GpmTrayIcon *icon)
{
g_return_if_fail (GPM_IS_TRAY_ICON (icon));
- gpm_debug ("clear tray (icon = %p)", icon);
+ egg_debug ("clear tray (icon = %p)", icon);
}
/**
@@ -426,7 +426,7 @@
GtkWidget *item;
GtkWidget *image;
- gpm_debug ("icon right clicked");
+ egg_debug ("icon right clicked");
if (!icon->priv->show_context_menu)
return;
@@ -510,7 +510,7 @@
cell = gpm_cell_array_get_cell (array, i);
unit = gpm_cell_get_unit (cell);
- gpm_debug ("adding device '%i'", i);
+ egg_debug ("adding device '%i'", i);
/* generate the label */
desc = gpm_cell_unit_get_kind_localised (unit, FALSE);
@@ -549,7 +549,7 @@
GtkWidget *image;
guint dev_cnt = 0;
- gpm_debug ("icon left clicked");
+ egg_debug ("icon left clicked");
/* add all device types to the drop down menu */
dev_cnt += gpm_tray_icon_add_device (icon, menu, icon->priv->collection->primary);
Modified: trunk/src/gpm-warnings.c
==============================================================================
--- trunk/src/gpm-warnings.c (original)
+++ trunk/src/gpm-warnings.c Wed Sep 3 15:53:48 2008
@@ -40,7 +40,7 @@
#include "gpm-common.h"
#include "gpm-conf.h"
-#include "gpm-debug.h"
+#include "egg-debug.h"
#include "gpm-cell-unit.h"
#include "gpm-warnings.h"
@@ -82,7 +82,7 @@
{
if (unit->time_discharge == 0) {
/* this is probably an error condition */
- gpm_warning ("time zero, something's gone wrong");
+ egg_warning ("time zero, something's gone wrong");
return GPM_WARNINGS_NONE;
}
if (unit->time_discharge <= warnings->priv->action_time) {
@@ -101,7 +101,7 @@
{
if (unit->percentage == 0) {
/* this is probably an error condition */
- gpm_warning ("percentage zero, something's gone wrong");
+ egg_warning ("percentage zero, something's gone wrong");
return GPM_WARNINGS_NONE;
}
if (unit->percentage <= warnings->priv->action_percentage) {
@@ -246,9 +246,9 @@
time_remaining is therefore inaccurate or just plain wrong. */
gpm_conf_get_bool (warnings->priv->conf, GPM_CONF_USE_TIME_POLICY, &warnings->priv->use_time_primary);
if (warnings->priv->use_time_primary) {
- gpm_debug ("Using per-time notification policy");
+ egg_debug ("Using per-time notification policy");
} else {
- gpm_debug ("Using percentage notification policy");
+ egg_debug ("Using percentage notification policy");
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]