G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
#define GDK_DISPLAY_DEBUG(display,type,...) \
+ G_STMT_START { \
if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \
gdk_debug_message (__VA_ARGS__); \
+ } G_STMT_END
#else /* !G_ENABLE_DEBUG */
G_UNLIKELY ((gsk_renderer_get_debug_flags (renderer) & GSK_DEBUG_ ## type) != 0)
#define GSK_RENDERER_DEBUG(renderer,type,...) \
+ G_STMT_START { \
if (GSK_RENDERER_DEBUG_CHECK (renderer,type)) \
gdk_debug_message (__VA_ARGS__); \
+ } G_STMT_END
#define GSK_DEBUG(type,...) \
+ G_STMT_START { \
if (GSK_DEBUG_CHECK (type)) \
gdk_debug_message (__VA_ARGS__); \
+ } G_STMT_END
#else
#include "gtkatspirootprivate.h"
#include "gtkatspiutilsprivate.h"
#include "gtkdebug.h"
+#include "gtkprivate.h"
#include "a11y/atspi/atspi-accessible.h"
#include "a11y/atspi/atspi-application.h"
{
GtkAtSpiCache *self = user_data;
- GTK_NOTE (A11Y,
- g_message ("[Cache] Method '%s' on interface '%s' for object '%s' from '%s'\n",
- method_name, interface_name, object_path, sender));
+ GTK_DEBUG (A11Y, "[Cache] Method '%s' on interface '%s' for object '%s' from '%s'",
+ method_name, interface_name, object_path, sender);
if (g_strcmp0 (method_name, "GetItems") == 0)
self->in_get_items = FALSE;
- GTK_NOTE (A11Y,
- g_message ("Returning %lu items\n", g_variant_n_children (items)));
+ GTK_DEBUG (A11Y, "Returning %lu items", g_variant_n_children (items));
g_dbus_method_invocation_return_value (invocation, items);
}
NULL,
NULL);
- GTK_NOTE (A11Y, g_message ("Cache registered at %s", self->cache_path));
+ GTK_DEBUG (A11Y, "Cache registered at %s", self->cache_path);
G_OBJECT_CLASS (gtk_at_spi_cache_parent_class)->constructed (gobject);
}
g_hash_table_insert (self->contexts_by_path, path_key, context);
g_hash_table_insert (self->contexts_to_path, context, path_key);
- GTK_NOTE (A11Y, g_message ("Adding context '%s' to cache", path_key));
+ GTK_DEBUG (A11Y, "Adding context '%s' to cache", path_key);
/* GetItems is safe from re-entrancy, but we still don't want to
* emit an unnecessary signal while we're collecting ATContexts
g_hash_table_remove (self->contexts_to_path, context);
g_hash_table_remove (self->contexts_by_path, path);
- GTK_NOTE (A11Y, g_message ("Removing context '%s' from cache", path));
+ GTK_DEBUG (A11Y, "Removing context '%s' from cache", path);
}
#include "a11y/atspi/atspi-component.h"
#include "gtkdebug.h"
+#include "gtkprivate.h"
#include "gtkeditable.h"
#include "gtkentryprivate.h"
#include "gtkroot.h"
{
GtkAtSpiContext *self = user_data;
- GTK_NOTE (A11Y, g_message ("handling %s on %s", method_name, object_path));
+ GTK_DEBUG (A11Y, "handling %s on %s", method_name, object_path);
if (g_strcmp0 (method_name, "GetRole") == 0)
{
GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
- GTK_NOTE (A11Y, g_message ("handling GetProperty %s on %s", property_name, object_path));
+ GTK_DEBUG (A11Y, "handling GetProperty %s on %s", property_name, object_path);
if (g_strcmp0 (property_name, "Name") == 0)
{
self->interfaces = g_variant_ref_sink (g_variant_builder_end (&interfaces));
- GTK_NOTE (A11Y, g_message ("Registered %d interfaces on object path '%s'",
- self->n_registered_objects,
- self->context_path));
+ GTK_DEBUG (A11Y, "Registered %d interfaces on object path '%s'",
+ self->n_registered_objects,
+ self->context_path);
}
static void
GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (context);
GtkAccessible *accessible = gtk_at_context_get_accessible (context);
- GTK_NOTE (A11Y, g_message ("Unrealizing ATSPI context at '%s' for accessible '%s'",
- self->context_path,
- G_OBJECT_TYPE_NAME (accessible)));
+ GTK_DEBUG (A11Y, "Unrealizing ATSPI context at '%s' for accessible '%s'",
+ self->context_path,
+ G_OBJECT_TYPE_NAME (accessible));
/* Notify ATs that the accessible object is going away */
emit_defunct (self);
static char *
get_bus_address_x11 (GdkDisplay *display)
{
- GTK_NOTE (A11Y, g_message ("Acquiring a11y bus via X11..."));
+ GTK_DEBUG (A11Y, "Acquiring a11y bus via X11...");
Display *xdisplay = gdk_x11_display_get_xdisplay (display);
Atom type_return;
static char *
get_bus_address_dbus (GdkDisplay *display)
{
- GTK_NOTE (A11Y, g_message ("Acquiring a11y bus via DBus..."));
+ GTK_DEBUG (A11Y, "Acquiring a11y bus via DBus...");
GError *error = NULL;
GDBusConnection *connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
if (error != NULL)
{
- GTK_NOTE (A11Y, g_message ("Unable to acquire session bus: %s", error->message));
+ GTK_DEBUG (A11Y, "Unable to acquire session bus: %s", error->message);
g_error_free (error);
return NULL;
}
&error);
if (error != NULL)
{
- GTK_NOTE (A11Y, g_message ("Unable to acquire the address of the accessibility bus: %s",
- error->message));
+ GTK_DEBUG (A11Y, "Unable to acquire the address of the accessibility bus: %s",
+ error->message);
g_error_free (error);
}
bus_address = g_getenv ("AT_SPI_BUS_ADDRESS");
if (bus_address != NULL && *bus_address != '\0')
{
- GTK_NOTE (A11Y, g_message ("Using ATSPI bus address from environment: %s", bus_address));
+ GTK_DEBUG (A11Y, "Using ATSPI bus address from environment: %s", bus_address);
g_object_set_data_full (G_OBJECT (display), "-gtk-atspi-bus-address",
g_strdup (bus_address),
g_free);
{
char *addr = get_bus_address_dbus (display);
- GTK_NOTE (A11Y, g_message ("Using ATSPI bus address from D-Bus: %s", addr));
+ GTK_DEBUG (A11Y, "Using ATSPI bus address from D-Bus: %s", addr);
g_object_set_data_full (G_OBJECT (display), "-gtk-atspi-bus-address",
addr,
g_free);
if (addr == NULL)
{
addr = get_bus_address_x11 (display);
- GTK_NOTE (A11Y, g_message ("Using ATSPI bus address from X11: %s", addr));
+ GTK_DEBUG (A11Y, "Using ATSPI bus address from X11: %s", addr);
}
else
{
- GTK_NOTE (A11Y, g_message ("Using ATSPI bus address from D-Bus: %s", addr));
+ GTK_DEBUG (A11Y, "Using ATSPI bus address from D-Bus: %s", addr);
}
g_object_set_data_full (G_OBJECT (display), "-gtk-atspi-bus-address",
&self->desktop_path);
g_variant_unref (reply);
- GTK_NOTE (A11Y, g_message ("Connected to the a11y registry at (%s, %s)",
- self->desktop_name,
- self->desktop_path));
+ GTK_DEBUG (A11Y, "Connected to the a11y registry at (%s, %s)",
+ self->desktop_name,
+ self->desktop_path);
}
/* Register the cache object */
NULL,
NULL);
- GTK_NOTE (A11Y, g_message ("Registering (%s, %s) on the a11y bus",
- unique_name,
- self->root_path));
+ GTK_DEBUG (A11Y, "Registering (%s, %s) on the a11y bus",
+ unique_name,
+ self->root_path);
g_dbus_connection_call (self->connection,
"org.a11y.atspi.Registry",
#include "gtkdebug.h"
#include "gtktypebuiltins.h"
#include "gtkmodelbuttonprivate.h"
+#include "gtkprivate.h"
#include <string.h>
GVariant *state,
gboolean should_emit_signals)
{
- GTK_NOTE(ACTIONS, g_message("%s: action %s added", "actionhelper", helper->action_name));
+ GTK_DEBUG (ACTIONS, "%s: action %s added", "actionhelper", helper->action_name);
/* we can only activate if we have the correct type of parameter */
helper->can_activate = (helper->target == NULL && parameter_type == NULL) ||
return;
}
- GTK_NOTE(ACTIONS, g_message ("%s: %s can be activated", "actionhelper", helper->action_name));
+ GTK_DEBUG (ACTIONS, "%s: %s can be activated", "actionhelper", helper->action_name);
helper->enabled = enabled;
- GTK_NOTE(ACTIONS, g_message ("%s: action %s is %s", "actionhelper", helper->action_name, enabled ? "enabled" : "disabled"));
+ GTK_DEBUG (ACTIONS, "%s: action %s is %s", "actionhelper", helper->action_name, enabled ? "enabled" : "disabled");
if (helper->target != NULL && state != NULL)
{
gtk_action_helper_action_removed (GtkActionHelper *helper,
gboolean should_emit_signals)
{
- GTK_NOTE(ACTIONS, g_message ("%s: action %s was removed", "actionhelper", helper->action_name));
+ GTK_DEBUG (ACTIONS, "%s: action %s was removed", "actionhelper", helper->action_name);
if (!helper->can_activate)
return;
gtk_action_helper_action_enabled_changed (GtkActionHelper *helper,
gboolean enabled)
{
- GTK_NOTE(ACTIONS, g_message ("%s: action %s: enabled changed to %d", "actionhelper", helper->action_name, enabled));
+ GTK_DEBUG (ACTIONS, "%s: action %s: enabled changed to %d", "actionhelper", helper->action_name, enabled);
if (!helper->can_activate)
return;
{
gboolean was_active;
- GTK_NOTE(ACTIONS, g_message ("%s: %s state changed", "actionhelper", helper->action_name));
+ GTK_DEBUG (ACTIONS, "%s: %s state changed", "actionhelper", helper->action_name);
if (!helper->can_activate)
return;
if (g_strcmp0 (action_name, helper->action_name) == 0)
return;
- GTK_NOTE(ACTIONS,
- if (action_name == NULL || !strchr (action_name, '.'))
- g_message ("%s: action name %s doesn't look like 'app.' or 'win.'; "
- "it is unlikely to work",
- "actionhelper", action_name));
+#ifdef G_ENABLE_DEBUG
+ if (GTK_DEBUG_CHECK (ACTIONS))
+ {
+ if (action_name == NULL || !strchr (action_name, '.'))
+ gdk_debug_message ("%s: action name %s doesn't look like 'app.' or 'win.'; "
+ "it is unlikely to work",
+ "actionhelper", action_name);
+ }
+#endif
/* Start by recording the current state of our properties so we know
* what notify signals we will need to send.
&enabled, ¶meter_type,
NULL, NULL, &state))
{
- GTK_NOTE(ACTIONS, g_message ("%s: action %s existed from the start", "actionhelper", helper->action_name));
+ GTK_DEBUG (ACTIONS, "%s: action %s existed from the start", "actionhelper", helper->action_name);
gtk_action_helper_action_added (helper, enabled, parameter_type, state, FALSE);
}
else
{
- GTK_NOTE(ACTIONS, g_message ("%s: action %s missing from the start", "actionhelper", helper->action_name));
+ GTK_DEBUG (ACTIONS, "%s: action %s missing from the start", "actionhelper", helper->action_name);
helper->enabled = FALSE;
}
}
#include "gtkaccessiblevalueprivate.h"
#include "gtkaccessibleprivate.h"
#include "gtkdebug.h"
+#include "gtkprivate.h"
#include "gtktestatcontextprivate.h"
#include "gtktypebuiltins.h"
if (self->realized)
return;
- GTK_NOTE (A11Y, g_message ("Realizing AT context '%s'", G_OBJECT_TYPE_NAME (self)));
+ GTK_DEBUG (A11Y, "Realizing AT context '%s'", G_OBJECT_TYPE_NAME (self));
GTK_AT_CONTEXT_GET_CLASS (self)->realize (self);
self->realized = TRUE;
if (!self->realized)
return;
- GTK_NOTE (A11Y, g_message ("Unrealizing AT context '%s'", G_OBJECT_TYPE_NAME (self)));
+ GTK_DEBUG (A11Y, "Unrealizing AT context '%s'", G_OBJECT_TYPE_NAME (self));
GTK_AT_CONTEXT_GET_CLASS (self)->unrealize (self);
self->realized = FALSE;
if (!info)
break;
- GTK_NOTE (BUILDER,
- g_message ("Trying to get internal child %s from %s",
- childname, object_get_id (info->object)));
+ GTK_DEBUG (BUILDER, "Trying to get internal child %s from %s",
+ childname, object_get_id (info->object));
if (GTK_IS_BUILDABLE (info->object))
obj = gtk_buildable_get_internal_child (GTK_BUILDABLE (info->object),
if (G_IS_INITIALLY_UNOWNED (obj))
g_object_ref_sink (obj);
- GTK_NOTE (BUILDER,
- g_message ("created %s of type %s", info->id, g_type_name (info->type)));
+ GTK_DEBUG (BUILDER, "created %s of type %s", info->id, g_type_name (info->type));
}
object_properties_destroy (&construct_parameters);
parent = ((ObjectInfo*)child_info->parent)->object;
- GTK_NOTE (BUILDER,
- g_message ("adding %s to %s", object_get_id (object), object_get_id (parent)));
+ GTK_DEBUG (BUILDER, "adding %s to %s", object_get_id (object), object_get_id (parent));
if (G_IS_LIST_STORE (parent))
{
{
data->requested_object_level = data->cur_object_level;
- GTK_NOTE (BUILDER,
- g_message ("requested object \"%s\" found at level %d",
- object_id, data->requested_object_level));
+ GTK_DEBUG (BUILDER, "requested object \"%s\" found at level %d",
+ object_id, data->requested_object_level);
data->inside_requested_object = TRUE;
}
{
ParserData *data = (ParserData*)user_data;
- GTK_NOTE (BUILDER, g_message ("</%s>", element_name));
+ GTK_DEBUG (BUILDER, "</%s>", element_name);
if (data->subparser && data->subparser->start)
{
if (data->requested_objects && data->inside_requested_object &&
(data->cur_object_level == data->requested_object_level))
{
- GTK_NOTE (BUILDER,
- g_message ("requested object end found at level %d",
- data->requested_object_level));
+ GTK_DEBUG (BUILDER, "requested object end found at level %d",
+ data->requested_object_level);
data->inside_requested_object = FALSE;
}
gtk_constraint_solver_remove_edit_variable (solver, opposite_size);
gtk_constraint_solver_end_edit (solver);
- GTK_NOTE (LAYOUT,
- g_print ("layout %p %s size: min %d nat %d (for opposite size: %d)\n",
+ GTK_DEBUG (LAYOUT, "layout %p %s size: min %d nat %d (for opposite size: %d)",
self,
orientation == GTK_ORIENTATION_HORIZONTAL ? "horizontal" : "vertical",
min_value, nat_value,
- for_size));
+ for_size);
if (minimum != NULL)
*minimum = min_value;
stay_h = gtk_constraint_solver_add_stay_variable (solver,
layout_height,
GTK_CONSTRAINT_STRENGTH_REQUIRED);
- GTK_NOTE (LAYOUT,
- g_print ("Layout [%p]: { .x: %g, .y: %g, .w: %g, .h: %g }\n",
+ GTK_DEBUG (LAYOUT, "Layout [%p]: { .x: %g, .y: %g, .w: %g, .h: %g }",
self,
gtk_constraint_variable_get_value (layout_left),
gtk_constraint_variable_get_value (layout_top),
gtk_constraint_variable_get_value (layout_width),
- gtk_constraint_variable_get_value (layout_height)));
+ gtk_constraint_variable_get_value (layout_height));
for (child = _gtk_widget_get_first_child (widget);
child != NULL;
var_height = get_child_attribute (self, child, GTK_CONSTRAINT_ATTRIBUTE_HEIGHT);
var_baseline = get_child_attribute (self, child, GTK_CONSTRAINT_ATTRIBUTE_BASELINE);
- GTK_NOTE (LAYOUT,
- g_print ("Allocating child '%s'[%p] with { .x: %g, .y: %g, .w: %g, .h: %g, .b: %g }\n",
+ GTK_DEBUG (LAYOUT, "Allocating child '%s'[%p] with { .x: %g, .y: %g, .w: %g, .h: %g, .b: %g }",
gtk_widget_get_name (child), child,
gtk_constraint_variable_get_value (var_left),
gtk_constraint_variable_get_value (var_top),
gtk_constraint_variable_get_value (var_width),
gtk_constraint_variable_get_value (var_height),
- gtk_constraint_variable_get_value (var_baseline)));
+ gtk_constraint_variable_get_value (var_baseline));
child_alloc.x = floor (gtk_constraint_variable_get_value (var_left));
child_alloc.y = floor (gtk_constraint_variable_get_value (var_top));
#include "gtkconstraintexpressionprivate.h"
#include "gtkdebug.h"
+#include "gtkprivate.h"
#include <glib.h>
#include <string.h>
if (min_ratio == DBL_MAX)
{
- GTK_NOTE (CONSTRAINTS, g_message ("Unbounded objective variable during optimization"));
+ GTK_DEBUG (CONSTRAINTS, "Unbounded objective variable during optimization");
break;
}
gtk_constraint_solver_pivot (self, entry, exit);
}
- GTK_NOTE (CONSTRAINTS,
- g_message ("solver.optimize.time := %.3f ms (pass: %d)",
- (float) (g_get_monotonic_time () - start_time) / 1000.f,
- self->optimize_count));
+ GTK_DEBUG (CONSTRAINTS, "solver.optimize.time := %.3f ms (pass: %d)",
+ (float) (g_get_monotonic_time () - start_time) / 1000.f,
+ self->optimize_count);
}
/*< private >
gtk_constraint_solver_pivot (self, entry_var, exit_var);
}
- GTK_NOTE (CONSTRAINTS,
- g_message ("dual_optimize.time := %.3f ms",
- (float) (g_get_monotonic_time () - start_time) / 1000.f));
+ GTK_DEBUG (CONSTRAINTS, "dual_optimize.time := %.3f ms",
+ (float) (g_get_monotonic_time () - start_time) / 1000.f);
}
static void
if (!G_APPROX_VALUE (gtk_constraint_expression_get_constant (expression), 0.0, 0.001))
{
- GTK_NOTE (CONSTRAINTS,
- g_message ("Unable to satisfy required constraint (choose_subject)"));
+ GTK_DEBUG (CONSTRAINTS,
+ "Unable to satisfy required constraint (choose_subject)");
return NULL;
}
gtk_constraint_solver_reset_stay_constants (solver);
- GTK_NOTE (CONSTRAINTS,
- g_message ("resolve.time := %.3f ms",
- (float) (g_get_monotonic_time () - start_time) / 1000.f));
+ GTK_DEBUG (CONSTRAINTS, "resolve.time := %.3f ms",
+ (float) (g_get_monotonic_time () - start_time) / 1000.f);
solver->needs_solving = FALSE;
}
#include "gtkdebug.h"
#include "gtkiconcacheprivate.h"
#include "gtkiconcachevalidatorprivate.h"
+#include "gtkprivate.h"
#include <glib/gstdio.h>
#include <gdk-pixbuf/gdk-pixdata.h>
if (cache->ref_count == 0)
{
- GTK_NOTE (ICONTHEME, g_message ("unmapping icon cache"));
+ GTK_DEBUG (ICONTHEME, "unmapping icon cache");
if (cache->map)
g_mapped_file_unref (cache->map);
/* Check if we have a cache file */
cache_filename = g_build_filename (path, "icon-theme.cache", NULL);
- GTK_NOTE (ICONTHEME, g_message ("look for icon cache in %s", path));
+ GTK_DEBUG (ICONTHEME, "look for icon cache in %s", path);
if (g_stat (path, &path_st) < 0)
goto done;
/* Verify cache is up-to-date */
if (st.st_mtime < path_st.st_mtime)
{
- GTK_NOTE (ICONTHEME, g_message ("icon cache outdated"));
+ GTK_DEBUG (ICONTHEME, "icon cache outdated");
goto done;
}
}
#endif
- GTK_NOTE (ICONTHEME, g_message ("found icon cache for %s", path));
+ GTK_DEBUG (ICONTHEME, "found icon cache for %s", path);
cache = g_new0 (GtkIconCache, 1);
cache->ref_count = 1;
if (!self->themes_valid)
return;
- GTK_DISPLAY_NOTE (self->display, ICONTHEME,
- g_message ("change to icon theme \"%s\"", self->current_theme));
+ GTK_DISPLAY_DEBUG (self->display, ICONTHEME, "change to icon theme \"%s\"", self->current_theme);
blow_themes (self);
queue_theme_changed (self);
self->last_stat_time = g_get_monotonic_time ();
- GTK_DISPLAY_NOTE (self->display, ICONTHEME, {
- GList *l;
- GString *s;
- s = g_string_new ("Current icon themes ");
- for (l = self->themes; l; l = l->next)
- {
- IconTheme *theme = l->data;
- g_string_append (s, theme->name);
- g_string_append_c (s, ' ');
- }
- g_message ("%s", s->str);
- g_string_free (s, TRUE);
- });
+#ifdef G_ENABLE_DEBUG
+ if (GTK_DISPLAY_DEBUG_CHECK (self->display, ICONTHEME))
+ {
+ GList *l;
+ GString *s;
+ s = g_string_new ("Current icon themes ");
+ for (l = self->themes; l; l = l->next)
+ {
+ IconTheme *theme = l->data;
+ g_string_append (s, theme->name);
+ g_string_append_c (s, ' ');
+ }
+ gdk_debug_message ("%s", s->str);
+ g_string_free (s, TRUE);
+ }
+#endif
}
static gboolean
key.flags = flags;
/* This is used in the icontheme unit test */
- GTK_DISPLAY_NOTE (self->display, ICONTHEME,
- for (i = 0; icon_names[i]; i++)
- g_message ("\tlookup name: %s", icon_names[i]));
+#ifdef G_ENABLE_DEBUG
+ if (GTK_DISPLAY_DEBUG_CHECK (self->display, ICONTHEME))
+ {
+ for (i = 0; icon_names[i]; i++)
+ gdk_debug_message ("\tlookup name: %s", icon_names[i]);
+ }
+#endif
icon = icon_cache_lookup (self, &key);
if (icon)
/* Fall back to missing icon */
if (icon == NULL)
{
- GTK_NOTE(ICONFALLBACK, {
- char *s = g_strjoinv (", ", (char **)icon_names);
- g_message ("No icon found in %s (or fallbacks) for: %s", self->current_theme, s);
- g_free (s);
- });
+#ifdef G_ENABLE_DEBUG
+ if (GTK_DEBUG_CHECK (ICONFALLBACK))
+ {
+ char *s = g_strjoinv (", ", (char **)icon_names);
+ gdk_debug_message ("No icon found in %s (or fallbacks) for: %s", self->current_theme, s);
+ g_free (s);
+ }
+#endif
icon = icon_paintable_new ("image-missing", size, scale);
icon->filename = g_strdup (IMAGE_MISSING_RESOURCE_PATH);
icon->is_resource = TRUE;
g_return_val_if_fail (icon_name != NULL, NULL);
g_return_val_if_fail (scale >= 1, NULL);
- GTK_DISPLAY_NOTE (self->display, ICONTHEME,
- g_message ("looking up icon %s for scale %d", icon_name, scale));
+ GTK_DISPLAY_DEBUG (self->display, ICONTHEME, "looking up icon %s for scale %d", icon_name, scale);
gtk_icon_theme_lock (self);
const char *name;
GHashTable *icons = NULL;
- GTK_DISPLAY_NOTE (self->display, ICONTHEME,
- g_message ("scanning directory %s", full_dir));
+ GTK_DISPLAY_DEBUG (self->display, ICONTHEME, "scanning directory %s", full_dir);
gdir = g_dir_open (full_dir, 0, NULL);
char **children;
int i;
- GTK_DISPLAY_NOTE (self->display, ICONTHEME,
- g_message ("scanning resource directory %s", full_dir));
+ GTK_DISPLAY_DEBUG (self->display, ICONTHEME, "scanning resource directory %s", full_dir);
children = g_resources_enumerate_children (full_dir, 0, NULL);
{
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
- GTK_NOTE (MODULES, g_print ("quartz_get_preedit_string\n"));
+ GTK_DEBUG (MODULES, "quartz_get_preedit_string\n");
if (str)
*str = qc->preedit_str ? g_strdup (qc->preedit_str) : g_strdup ("");
marked_str = g_strdup (g_object_get_data (G_OBJECT (surface), TIC_MARKED_TEXT));
if (fixed_str)
{
- GTK_NOTE (MODULES, g_print ("tic-insert-text: %s\n", fixed_str));
+ GTK_DEBUG (MODULES, "tic-insert-text: %s", fixed_str);
g_free (qc->preedit_str);
qc->preedit_str = NULL;
g_object_set_data (G_OBJECT (surface), TIC_INSERT_TEXT, NULL);
unsigned int filtered =
GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (surface),
GIC_FILTER_KEY));
- GTK_NOTE (MODULES, g_print ("filtered, %d\n", filtered));
+ GTK_DEBUG (MODULES, "filtered, %d", filtered);
if (filtered)
retval = TRUE;
else
}
if (marked_str)
{
- GTK_NOTE (MODULES, g_print ("tic-marked-text: %s\n", marked_str));
+ GTK_DEBUG (MODULES, "tic-marked-text: %s", marked_str);
qc->cursor_index =
GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (surface),
TIC_SELECTED_POS));
guint keyval;
guint keycode;
- GTK_NOTE (MODULES, g_print ("quartz_filter_keypress\n"));
+ GTK_DEBUG (MODULES, "quartz_filter_keypress");
if (!GDK_IS_MACOS_SURFACE (qc->client_surface))
return FALSE;
g_object_set_data (G_OBJECT (qc->client_surface),
TIC_IN_KEY_DOWN,
GUINT_TO_POINTER (FALSE));
- GTK_NOTE (MODULES, g_print ("quartz_filter_keypress done\n"));
+ GTK_DEBUG (MODULES, "quartz_filter_keypress done");
return retval;
}
static void
quartz_reset (GtkIMContext *context)
{
- GTK_NOTE (MODULES, g_print ("quartz_reset\n"));
+ GTK_DEBUG (MODULES, "quartz_reset");
discard_preedit (context);
}
{
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
- GTK_NOTE (MODULES, g_print ("quartz_set_client_surface: %p\n", widget));
+ GTK_DEBUG (MODULES, "quartz_set_client_surface: %p", widget);
qc->client_widget = widget;
qc->client_surface = NULL;
static void
quartz_focus_in (GtkIMContext *context)
{
- GTK_NOTE (MODULES, g_print ("quartz_focus_in\n"));
+ GTK_DEBUG (MODULES, "quartz_focus_in");
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
qc->focused = TRUE;
static void
quartz_focus_out (GtkIMContext *context)
{
- GTK_NOTE (MODULES, g_print ("quartz_focus_out\n"));
+ GTK_DEBUG (MODULES, "quartz_focus_out");
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
qc->focused = FALSE;
int sx, sy;
double wx, wy;
- GTK_NOTE (MODULES, g_print ("quartz_set_cursor_location\n"));
+ GTK_DEBUG (MODULES, "quartz_set_cursor_location");
if (!qc->client_surface || !qc->client_widget)
return;
static void
quartz_set_use_preedit (GtkIMContext *context, gboolean use_preedit)
{
- GTK_NOTE (MODULES, g_print ("quartz_set_use_preedit: %d\n", use_preedit));
+ GTK_DEBUG (MODULES, "quartz_set_use_preedit: %d", use_preedit);
}
static void
static void
imquartz_finalize (GObject *obj)
{
- GTK_NOTE (MODULES, g_print ("imquartz_finalize\n"));
+ GTK_DEBUG (MODULES, "imquartz_finalize");
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (obj);
g_free (qc->preedit_str);
static void
gtk_im_context_quartz_class_init (GtkIMContextQuartzClass *class)
{
- GTK_NOTE (MODULES, g_print ("gtk_im_context_quartz_class_init\n"));
+ GTK_DEBUG (MODULES, "gtk_im_context_quartz_class_init");
GtkIMContextClass *klass = GTK_IM_CONTEXT_CLASS (class);
GObjectClass *object_class = G_OBJECT_CLASS (class);
static void
gtk_im_context_quartz_init (GtkIMContextQuartz *qc)
{
- GTK_NOTE (MODULES, g_print ("gtk_im_context_quartz_init\n"));
+ GTK_DEBUG (MODULES, "gtk_im_context_quartz_init");
qc->preedit_str = g_strdup ("");
qc->cursor_index = 0;
if (registered)
return;
- GTK_NOTE (MODULES,
- g_print ("Registering extension point %s\n", GTK_IM_MODULE_EXTENSION_POINT_NAME));
+ GTK_DEBUG (MODULES, "Registering extension point %s", GTK_IM_MODULE_EXTENSION_POINT_NAME);
ep = g_io_extension_point_register (GTK_IM_MODULE_EXTENSION_POINT_NAME);
g_io_extension_point_set_required_type (ep, GTK_TYPE_IM_CONTEXT);
paths = _gtk_get_module_path ("immodules");
for (i = 0; paths[i]; i++)
{
- GTK_NOTE (MODULES,
- g_print ("Scanning io modules in %s\n", paths[i]));
+ GTK_DEBUG (MODULES, "Scanning io modules in %s", paths[i]);
g_io_modules_scan_all_in_directory_with_scope (paths[i], scope);
}
g_strfreev (paths);
#include "gtkmediafileprivate.h"
#include "gtkdebug.h"
+#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmodulesprivate.h"
#include "gtknomediafileprivate.h"
GIOExtension *e;
GIOExtensionPoint *ep;
- GTK_NOTE (MODULES, g_print ("Looking up MediaFile extension\n"));
+ GTK_DEBUG (MODULES, "Looking up MediaFile extension");
ep = g_io_extension_point_lookup (GTK_MEDIA_FILE_EXTENSION_POINT_NAME);
e = NULL;
e = gtk_media_file_get_extension ();
impl_type = g_io_extension_get_type (e);
- GTK_NOTE (MODULES, g_print ("Using %s from \"%s\" extension\n", g_type_name (impl_type), g_io_extension_get_name (e)));
+ GTK_DEBUG (MODULES, "Using %s from \"%s\" extension",
+ g_type_name (impl_type), g_io_extension_get_name (e));
return impl_type;
}
char **paths;
int i;
- GTK_NOTE (MODULES,
- g_print ("Registering extension point %s\n", GTK_MEDIA_FILE_EXTENSION_POINT_NAME));
+ GTK_DEBUG (MODULES, "Registering extension point %s", GTK_MEDIA_FILE_EXTENSION_POINT_NAME);
ep = g_io_extension_point_register (GTK_MEDIA_FILE_EXTENSION_POINT_NAME);
g_io_extension_point_set_required_type (ep, GTK_TYPE_MEDIA_FILE);
paths = _gtk_get_module_path ("media");
for (i = 0; paths[i]; i++)
{
- GTK_NOTE (MODULES,
- g_print ("Scanning io modules in %s\n", paths[i]));
+ GTK_DEBUG (MODULES, "Scanning io modules in %s", paths[i]);
g_io_modules_scan_all_in_directory_with_scope (paths[i], scope);
}
g_strfreev (paths);
#include "gtkactionmuxerprivate.h"
#include "gtkdebug.h"
#include "gtkintl.h"
+#include "gtkprivate.h"
#include <string.h>
GtkMenuTrackerItemRole old_role;
guint n_changed;
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s added", action_name));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s added", action_name);
old_sensitive = self->sensitive;
old_toggled = self->toggled;
if (!self->can_activate)
{
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s can't be activated due to parameter type mismatch "
- "(parameter type %s, target type %s)",
- action_name,
- parameter_type ? g_variant_type_peek_string (parameter_type) : "NULL",
- action_target ? g_variant_get_type_string (action_target) : "NULL"));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s can't be activated due to parameter type mismatch "
+ "(parameter type %s, target type %s)",
+ action_name,
+ parameter_type ? g_variant_type_peek_string (parameter_type) : "NULL",
+ action_target ? g_variant_get_type_string (action_target) : "NULL");
if (action_target)
g_variant_unref (action_target);
return;
}
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s can be activated", action_name));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s can be activated", action_name);
self->sensitive = enabled;
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s is %s", action_name, enabled ? "enabled" : "disabled"));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s is %s", action_name, enabled ? "enabled" : "disabled");
if (action_target != NULL && state != NULL)
{
{
GtkMenuTrackerItem *self = GTK_MENU_TRACKER_ITEM (observer);
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s: enabled changed to %d", action_name, enabled));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s: enabled changed to %d", action_name, enabled);
if (!self->can_activate)
return;
GVariant *action_target;
gboolean was_toggled;
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s: state changed", action_name));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s: state changed", action_name);
if (!self->can_activate)
return;
gboolean was_sensitive, was_toggled;
GtkMenuTrackerItemRole old_role;
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s was removed", action_name));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s was removed", action_name);
if (!self->can_activate)
return;
action_name = strrchr (self->action_and_target, '|') + 1;
- GTK_NOTE(ACTIONS,
- if (!strchr (action_name, '.'))
- g_message ("menutracker: action name %s doesn't look like 'app.' or 'win.'; "
- "it is unlikely to work", action_name));
+#ifdef G_ENABLE_DEBUG
+ if (GTK_DEBUG_CHECK (ACTIONS))
+ {
+ if (!strchr (action_name, '.'))
+ gdk_debug_message ("menutracker: action name %s doesn't look like 'app.' or 'win.'; "
+ "it is unlikely to work", action_name);
+ }
+#endif
state = NULL;
if (found)
{
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s existed from the start", action_name));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s existed from the start", action_name);
gtk_menu_tracker_item_action_added (GTK_ACTION_OBSERVER (self), observable, action_name, parameter_type, enabled, state);
}
else
{
- GTK_NOTE(ACTIONS, g_message ("menutracker: action %s missing from the start", action_name));
+ GTK_DEBUG (ACTIONS, "menutracker: action %s missing from the start", action_name);
gtk_menu_tracker_item_update_visibility (self);
}
char **paths;
int i;
- GTK_NOTE (MODULES,
- g_print ("Registering extension point %s\n", GTK_PRINT_BACKEND_EXTENSION_POINT_NAME));
+ GTK_DEBUG (MODULES, "Registering extension point %s", GTK_PRINT_BACKEND_EXTENSION_POINT_NAME);
ep = g_io_extension_point_register (GTK_PRINT_BACKEND_EXTENSION_POINT_NAME);
g_io_extension_point_set_required_type (ep, GTK_TYPE_PRINT_BACKEND);
paths = _gtk_get_module_path ("printbackends");
for (i = 0; paths[i]; i++)
{
- GTK_NOTE (MODULES,
- g_print ("Scanning io modules in %s\n", paths[i]));
+ GTK_DEBUG (MODULES, "Scanning io modules in %s", paths[i]);
g_io_modules_scan_all_in_directory_with_scope (paths[i], scope);
}
g_strfreev (paths);
if (!ext)
continue;
- GTK_NOTE (PRINTING,
- g_print ("Found %s print backend\n", backends[i]));
+ GTK_DEBUG (PRINTING, "Found %s print backend", backends[i]);
type = g_io_extension_get_type (ext);
backend = g_object_new (type, NULL);
#include "gtkintl.h"
#include "gtkwidgetprivate.h"
#include "gtkdebug.h"
+#include "gtkprivate.h"
/* {{{ GtkShortcutAction */
g_return_val_if_fail (GTK_IS_SHORTCUT_ACTION (self), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- GTK_NOTE (KEYBINDINGS, {
- char *act = gtk_shortcut_action_to_string (self);
- g_print ("Shortcut action activate on %s: %s\n", G_OBJECT_TYPE_NAME (widget), act);
- g_free (act);
- });
+#ifdef G_ENABLE_DEBUG
+ if (GTK_DEBUG_CHECK (KEYBINDINGS))
+ {
+ char *act = gtk_shortcut_action_to_string (self);
+ gdk_debug_message ("Shortcut action activate on %s: %s", G_OBJECT_TYPE_NAME (widget), act);
+ g_free (act);
+ }
+#endif
return GTK_SHORTCUT_ACTION_GET_CLASS (self)->activate (self, flags, widget, args);
}
g_assert (min_size <= nat_size);
- GTK_DISPLAY_NOTE (_gtk_widget_get_display (widget), SIZE_REQUEST, {
- GString *s;
-
- s = g_string_new ("");
- g_string_append_printf (s, "[%p] %s\t%s: %d is minimum %d and natural: %d",
- widget, G_OBJECT_TYPE_NAME (widget),
- orientation == GTK_ORIENTATION_HORIZONTAL
- ? "width for height"
- : "height for width",
- for_size, min_size, nat_size);
- if (min_baseline != -1 || nat_baseline != -1)
- {
- g_string_append_printf (s, ", baseline %d/%d",
- min_baseline, nat_baseline);
- }
- g_string_append_printf (s, " (hit cache: %s)\n",
- found_in_cache ? "yes" : "no");
- g_printerr ("%s", s->str);
- g_string_free (s, TRUE);
- });
+#ifdef G_ENABLE_DEBUG
+ if (GTK_DISPLAY_DEBUG_CHECK (_gtk_widget_get_display (widget), SIZE_REQUEST))
+ {
+ GString *s;
+
+ s = g_string_new ("");
+ g_string_append_printf (s, "[%p] %s\t%s: %d is minimum %d and natural: %d",
+ widget, G_OBJECT_TYPE_NAME (widget),
+ orientation == GTK_ORIENTATION_HORIZONTAL
+ ? "width for height"
+ : "height for width",
+ for_size, min_size, nat_size);
+ if (min_baseline != -1 || nat_baseline != -1)
+ {
+ g_string_append_printf (s, ", baseline %d/%d",
+ min_baseline, nat_baseline);
+ }
+ g_string_append_printf (s, " (hit cache: %s)\n",
+ found_in_cache ? "yes" : "no");
+ g_printerr ("%s", s->str);
+ g_string_free (s, TRUE);
+ }
+#endif
}
/**
if (priv->in_destruction)
{
- GTK_NOTE (A11Y, g_message ("ATContext for widget “%s” [%p] accessed during destruction",
- G_OBJECT_TYPE_NAME (self),
- self));
+ GTK_DEBUG (A11Y, "ATContext for widget “%s” [%p] accessed during destruction",
+ G_OBJECT_TYPE_NAME (self),
+ self);
return NULL;
}
{
GtkWidgetClassPrivate *priv = widget_class->priv;
- GTK_NOTE(ACTIONS, g_message ("%sClass: Adding %s action\n",
- g_type_name (G_TYPE_FROM_CLASS (widget_class)),
- action->name));
+ GTK_DEBUG (ACTIONS, "%sClass: Adding %s action",
+ g_type_name (G_TYPE_FROM_CLASS (widget_class)),
+ action->name);
action->next = priv->actions;
priv->actions = action;
#include <string.h>
#include <gtk/gtk.h>
+#include "gtkprivate.h"
#include "gtkcupssecretsutils.h"
if (printer_uri == NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("create_attributes called with invalid parameters.\n"));
+ GTK_DEBUG (PRINTING, "create_attributes called with invalid parameters.");
return NULL;
}
"Attributes");
if (attributes == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Failed to lookup attributes.\n"));
+ GTK_DEBUG (PRINTING, "Failed to lookup attributes.");
g_variant_unref (output);
g_task_return_pointer (task, NULL, NULL);
return;
if (pw_field == -1)
{
/* should not happen... */
- GTK_NOTE (PRINTING, g_print ("No password required?.\n"));
+ GTK_DEBUG (PRINTING, "No password required?.");
g_variant_unref (output);
goto fail;
}
g_variant_unref (output);
if (secret == NULL || g_variant_n_children (secret) != 4)
{
- GTK_NOTE (PRINTING, g_print ("Get secret response invalid.\n"));
+ GTK_DEBUG (PRINTING, "Get secret response invalid.");
if (secret != NULL)
g_variant_unref (secret);
goto fail;
if (ba_passwd == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Invalid / no secret found.\n"));
+ GTK_DEBUG (PRINTING, "Invalid / no secret found.");
g_variant_unref (s_value);
goto fail;
}
if (auth_info[i] == NULL)
{
/* Error out if we did not find everything */
- GTK_NOTE (PRINTING, g_print ("Failed to lookup required attribute: %s.\n",
- task_data->auth_info_required[i]));
+ GTK_DEBUG (PRINTING, "Failed to lookup required attribute: %s.",
+ task_data->auth_info_required[i]);
goto fail;
}
}
fail:
/* Error out */
- GTK_NOTE (PRINTING, g_print ("Failed to lookup secret.\n"));
+ GTK_DEBUG (PRINTING, "Failed to lookup secret.");
required_len = g_strv_length (task_data->auth_info_required);
for (i = 0; i < required_len; i++)
{
g_variant_get (output, "(&o&o)", &item, NULL);
if (item != NULL && strlen (item) > 1)
{
- GTK_NOTE (PRINTING, g_print ("Successfully stored auth info.\n"));
+ GTK_DEBUG (PRINTING, "Successfully stored auth info.");
g_task_return_pointer (task, NULL, NULL);
return;
}
g_free (additional_attrs);
if (attributes == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Failed to create attributes.\n"));
+ GTK_DEBUG (PRINTING, "Failed to create attributes.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (password == NULL)
{
- GTK_NOTE (PRINTING, g_print ("No secret to store.\n"));
+ GTK_DEBUG (PRINTING, "No secret to store.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (dismissed == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Invalid prompt signal.\n"));
+ GTK_DEBUG (PRINTING, "Invalid prompt signal.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (is_dismissed)
{
- GTK_NOTE (PRINTING, g_print ("Collection unlock dismissed.\n"));
+ GTK_DEBUG (PRINTING, "Collection unlock dismissed.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (subresult == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Invalid ReadAlias response.\n"));
+ GTK_DEBUG (PRINTING, "Invalid ReadAlias response.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (locked == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Failed to look up \"Locked\" property on item.\n"));
+ GTK_DEBUG (PRINTING, "Failed to look up \"Locked\" property on item.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (item_paths == NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("SearchItems returned invalid result.\n"));
+ GTK_DEBUG (PRINTING, "SearchItems returned invalid result.");
continue;
}
if (!found_item)
{
- GTK_NOTE (PRINTING, g_print ("No match found in secrets service.\n"));
+ GTK_DEBUG (PRINTING, "No match found in secrets service.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (session_variant == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Invalid session path response.\n"));
+ GTK_DEBUG (PRINTING, "Invalid session path response.");
g_variant_unref (output);
g_task_return_pointer (task, NULL, NULL);
return;
if (task_data->session_path == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Invalid session path string value.\n"));
+ GTK_DEBUG (PRINTING, "Invalid session path string value.");
g_variant_unref (session_variant);
g_variant_unref (output);
g_task_return_pointer (task, NULL, NULL);
secrets_attrs = create_attributes (task_data->printer_uri, NULL, NULL);
if (secrets_attrs == NULL)
{
- GTK_NOTE (PRINTING, g_print ("Failed to create attributes.\n"));
+ GTK_DEBUG (PRINTING, "Failed to create attributes.");
g_task_return_pointer (task, NULL, NULL);
return;
}
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("Failed to store auth info: %s\n", error->message));
+ GTK_DEBUG (PRINTING, "Failed to store auth info: %s", error->message);
g_error_free (error);
}
g_object_unref (task);
- GTK_NOTE (PRINTING,
- g_print ("gtk_cups_secrets_service_store finished.\n"));
+ GTK_DEBUG (PRINTING, "gtk_cups_secrets_service_store finished.");
}
/**
if (auth_info == NULL || auth_info_labels == NULL || printer_uri == NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("Invalid call to gtk_cups_secrets_service_store.\n"));
+ GTK_DEBUG (PRINTING, "Invalid call to gtk_cups_secrets_service_store.");
return;
}
#include "config.h"
#include <gtk/gtk.h>
#include "gtkcupsutils.h"
+#include "gtkprivate.h"
#include <errno.h>
#include <unistd.h>
char length[255];
struct stat data_info;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
request->poll_state = GTK_CUPS_HTTP_WRITE;
{
ipp_state_t ipp_status;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
request->poll_state = GTK_CUPS_HTTP_WRITE;
char buffer[_GTK_CUPS_MAX_CHUNK_SIZE];
http_status_t http_status;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
request->poll_state = GTK_CUPS_HTTP_WRITE;
http_status = request->last_status;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s - status %i\n", G_STRFUNC, http_status));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s - status %i", G_STRFUNC, http_status);
request->poll_state = GTK_CUPS_HTTP_READ;
{
ipp_state_t ipp_status;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
request->poll_state = GTK_CUPS_HTTP_READ;
static void
_get_send (GtkCupsRequest *request)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
request->poll_state = GTK_CUPS_HTTP_WRITE;
{
http_status_t http_status;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
http_status = request->last_status;
GIOStatus io_status;
GError *error;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
error = NULL;
bytes = httpRead2 (request->http, buffer, sizeof (buffer));
request->bytes_received += bytes;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %"G_GSIZE_FORMAT" bytes read\n", bytes));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %"G_GSIZE_FORMAT" bytes read", bytes);
io_status =
g_io_channel_write_chars (request->data_io,
#include <gtk/gtkprintbackendprivate.h>
#include <gtk/gtkunixprint.h>
#include <gtk/gtkprinterprivate.h>
+#include <gtk/gtkprivate.h>
#include "gtkprintbackendcups.h"
#include "gtkprintercups.h"
GtkPrintBackend *
gtk_print_backend_cups_new (void)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Creating a new CUPS print backend object\n"));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Creating a new CUPS print backend object");
return g_object_new (GTK_TYPE_PRINT_BACKEND_CUPS, NULL);
}
error = NULL;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Writing %i byte chunk to temp file\n", length));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Writing %i byte chunk to temp file", length);
while (length > 0)
{
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Error writing to temp file, %s\n",
- error->message));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Error writing to temp file, %s",
+ error->message);
g_error_free (error);
return CAIRO_STATUS_WRITE_ERROR;
}
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Wrote %"G_GSIZE_FORMAT" bytes to temp file\n", written));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Wrote %"G_GSIZE_FORMAT" bytes to temp file",
+ written);
data += written;
length -= written;
static void
cups_free_print_stream_data (CupsPrintStreamData *data)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
if (data->dnotify)
data->dnotify (data->user_data);
GError *error = NULL;
CupsPrintStreamData *ps = user_data;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
if (gtk_cups_result_is_error (result))
error = g_error_new_literal (gtk_print_error_quark (),
char printer_absolute_uri[HTTP_MAX_URI];
http_t *http = NULL;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
cups_printer = GTK_PRINTER_CUPS (gtk_print_job_get_printer (job));
settings = gtk_print_job_get_settings (job);
{
GError *error = NULL;
- GTK_NOTE (PRINTING,
- g_warning ("CUPS Backend: Error connecting to %s:%d",
+ GTK_DEBUG (PRINTING, "CUPS Backend: Error connecting to %s:%d",
cups_printer->hostname,
- cups_printer->port));
+ cups_printer->port);
error = g_error_new (gtk_print_error_quark (),
GTK_CUPS_ERROR_GENERAL,
g_strv_length (cups_printer->auth_info_required) == 1 &&
g_strcmp0 (cups_printer->auth_info_required[0], "negotiate") == 0)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Ignoring auth-info-required \"%s\"\n",
- cups_printer->auth_info_required[0]));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Ignoring auth-info-required \"%s\"",
+ cups_printer->auth_info_required[0]);
}
else if (cups_printer->auth_info_required != NULL)
{
{
GtkPrintBackendCups *backend_cups;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: finalizing CUPS backend module\n"));
+ GTK_DEBUG (PRINTING, "CUPS Backend: finalizing CUPS backend module");
backend_cups = GTK_PRINT_BACKEND_CUPS (object);
GtkPrintBackendCups *backend_cups;
int i;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
backend_cups = GTK_PRINT_BACKEND_CUPS (object);
{
char *key = g_strconcat (username, "@", hostname, NULL);
g_hash_table_insert (cups_backend->auth, key, g_strdup (password));
- GTK_NOTE (PRINTING,
- g_print ("CUPS backend: caching password for %s\n", key));
+ GTK_DEBUG (PRINTING, "CUPS backend: caching password for %s", key);
}
g_free (cups_backend->username);
if (password && dispatch->request->password_state != GTK_CUPS_PASSWORD_NOT_VALID)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS backend: using stored password for %s\n", key));
+ GTK_DEBUG (PRINTING, "CUPS backend: using stored password for %s", key);
overwrite_and_free (dispatch->request->password);
dispatch->request->password = g_strdup (password);
{
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("Failed to look up auth info: %s\n", error->message));
+ GTK_DEBUG (PRINTING, "Failed to look up auth info: %s", error->message);
g_error_free (error);
}
else
{
/* Error note should have been shown by the function causing this */
- GTK_NOTE (PRINTING, g_print ("Failed to look up auth info.\n"));
+ GTK_DEBUG (PRINTING, "Failed to look up auth info.");
}
dispatch->backend->authentication_lock = FALSE;
g_object_unref (task);
GtkCupsPollState poll_state;
gboolean result;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s <source %p>\n", G_STRFUNC, source));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s <source %p>", G_STRFUNC, source);
dispatch = (GtkPrintCupsDispatchWatch *) source;
dispatch = (GtkPrintCupsDispatchWatch *) source;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s <source %p>\n", G_STRFUNC, source));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s <source %p>", G_STRFUNC, source);
*timeout_ = -1;
result = gtk_cups_request_get_result (dispatch->request);
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s <source %p>\n", G_STRFUNC, source));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s <source %p>", G_STRFUNC, source);
if (gtk_cups_result_is_error (result))
{
- GTK_NOTE (PRINTING,
- g_print("Error result: %s (type %i, status %i, code %i)\n",
- gtk_cups_result_get_error_string (result),
- gtk_cups_result_get_error_type (result),
- gtk_cups_result_get_error_status (result),
- gtk_cups_result_get_error_code (result)));
+ GTK_DEBUG (PRINTING, "Error result: %s (type %i, status %i, code %i)",
+ gtk_cups_result_get_error_string (result),
+ gtk_cups_result_get_error_type (result),
+ gtk_cups_result_get_error_status (result),
+ gtk_cups_result_get_error_code (result));
}
ep_callback (GTK_PRINT_BACKEND (dispatch->backend), result, user_data);
GtkPrintCupsDispatchWatch *dispatch;
GtkCupsResult *result;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s <source %p>\n", G_STRFUNC, source));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s <source %p>", G_STRFUNC, source);
dispatch = (GtkPrintCupsDispatchWatch *) source;
username = cupsUser ();
key = g_strconcat (username, "@", hostname, NULL);
- GTK_NOTE (PRINTING,
- g_print ("CUPS backend: removing stored password for %s\n", key));
+ GTK_DEBUG (PRINTING, "CUPS backend: removing stored password for %s", key);
g_hash_table_remove (dispatch->backend->auth, key);
g_free (key);
sizeof (GtkPrintCupsDispatchWatch));
g_source_set_static_name (&dispatch->source, "GTK CUPS backend");
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s <source %p> - Executing cups request on server '%s' and resource '%s'\n", G_STRFUNC, dispatch, request->server, request->resource));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s <source %p> - Executing cups request on server '%s' and resource '%s'",
+ G_STRFUNC, dispatch, request->server, request->resource);
dispatch->request = request;
dispatch->backend = g_object_ref (print_backend);
}
else
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Attribute %s ignored\n", ippGetName (attr)));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Attribute %s ignored", ippGetName (attr));
}
}
{
cups_printer->printer_uri = g_strdup (info->member_uris);
/* TODO if member_uris is a class we need to recursively find a printer */
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Found class with printer %s\n",
- info->member_uris));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Found class with printer %s",
+ info->member_uris);
}
else
{
cups_printer->printer_uri = g_strdup (info->printer_uri);
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Found printer %s\n",
- info->printer_uri));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Found printer %s",
+ info->printer_uri);
}
httpSeparateURI (HTTP_URI_CODING_ALL, cups_printer->printer_uri,
if (strncmp (resource, "/printers/", 10) == 0)
{
cups_printer->ppd_name = g_strdup (resource + 10);
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Setting ppd name '%s' for printer/class '%s'\n", cups_printer->ppd_name, info->printer_name));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Setting ppd name '%s' for printer/class '%s'",
+ cups_printer->ppd_name, info->printer_name);
}
gethostname (uri, sizeof (uri));
static void
request_printer_info_data_free (RequestPrinterInfoData *data)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
httpClose (data->http);
g_object_unref (data->printer);
g_free (data);
gboolean status_changed = FALSE;
ipp_t *response;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
if (gtk_cups_result_is_error (result))
{
- GTK_NOTE (PRINTING,
- g_warning ("CUPS Backend: Error getting printer info: %s %d %d",
+ GTK_DEBUG (PRINTING, "CUPS Backend: Error getting printer info: %s %d %d",
gtk_cups_result_get_error_string (result),
gtk_cups_result_get_error_type (result),
- gtk_cups_result_get_error_code (result)));
+ gtk_cups_result_get_error_code (result));
goto done;
}
printer_name = g_strdup (g_strrstr (ippGetString (attr, 0, NULL), "/") + 1);
}
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Created local printer %s\n", printer_name));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Created local printer %s", printer_name);
}
else
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Creating of local printer failed: %d\n", ippGetStatusCode (response)));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Creating of local printer failed: %d",
+ ippGetStatusCode (response));
}
iter = g_list_find_custom (print_backend->temporary_queues_in_construction, printer_name, (GCompareFunc) g_strcmp0);
if (iter != NULL)
return;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Creating local printer %s\n", printer_name));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Creating local printer %s", printer_name);
backend->temporary_queues_in_construction = g_list_prepend (backend->temporary_queues_in_construction, g_strdup (printer_name));
}
else
{
- GTK_NOTE (PRINTING,
- g_warning ("CUPS Backend: Can not connect to %s: %s\n",
+ GTK_DEBUG (PRINTING, "CUPS Backend: Can not connect to %s: %s",
data->address,
- error->message));
+ error->message);
g_error_free (error);
}
list_has_changed = FALSE;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
cups_backend->list_printers_pending = FALSE;
if (gtk_cups_result_is_error (result))
{
- GTK_NOTE (PRINTING,
- g_warning ("CUPS Backend: Error getting printer list: %s %d %d",
+ GTK_DEBUG (PRINTING, "CUPS Backend: Error getting printer list: %s %d %d",
gtk_cups_result_get_error_string (result),
gtk_cups_result_get_error_type (result),
- gtk_cups_result_get_error_code (result)));
+ gtk_cups_result_get_error_code (result));
if (gtk_cups_result_get_error_type (result) == GTK_CUPS_ERROR_AUTH &&
gtk_cups_result_get_error_code (result) == 1)
static void
get_ppd_data_free (GetPPDData *data)
{
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
httpClose (data->http);
g_io_channel_unref (data->ppd_io);
g_object_unref (data->printer);
GtkPrinter *printer;
struct stat data_info;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
printer = GTK_PRINTER (data->printer);
GTK_PRINTER_CUPS (printer)->reading_ppd = FALSE;
error = NULL;
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: %s\n", G_STRFUNC));
+ GTK_DEBUG (PRINTING, "CUPS Backend: %s", G_STRFUNC);
if (cups_printer->remote && !cups_printer->avahi_browsed)
{
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_warning ("CUPS Backend: Failed to create temp file, %s\n",
- error->message));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Failed to create temp file, %s",
+ error->message);
g_error_free (error);
httpClose (http);
g_free (ppd_filename);
cups_printer->ipp_version_major,
cups_printer->ipp_version_minor);
- GTK_NOTE (PRINTING,
- g_print ("CUPS Backend: Requesting resource %s to be written to temp file %s\n", resource, ppd_filename));
-
+ GTK_DEBUG (PRINTING, "CUPS Backend: Requesting resource %s to be written to temp file %s",
+ resource, ppd_filename);
cups_printer->reading_ppd = TRUE;
GTK_PRINT_BACKEND_CUPS (print_backend)->reading_ppds++;
if (res == NULL)
{
- GTK_NOTE (PRINTING,
- g_warning ("CUPS Backend: Unable to convert PPD text\n"));
+ GTK_DEBUG (PRINTING, "CUPS Backend: Unable to convert PPD text");
res = g_strdup ("???");
}
#include "gtk/gtk.h"
#include "gtk/gtkprinterprivate.h"
+#include "gtk/gtkprivate.h"
#include "gtkprintbackendfile.h"
error = NULL;
- GTK_NOTE (PRINTING,
- g_print ("FILE Backend: Writing %u byte chunk to temp file\n", length));
+ GTK_DEBUG (PRINTING, "FILE Backend: Writing %u byte chunk to temp file", length);
while (length > 0)
{
{
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("FILE Backend: Error writing to temp file, %s\n", error->message));
+ GTK_DEBUG (PRINTING, "FILE Backend: Error writing to temp file, %s", error->message);
g_error_free (error);
}
return CAIRO_STATUS_WRITE_ERROR;
}
- GTK_NOTE (PRINTING,
- g_print ("FILE Backend: Wrote %zd bytes to temp file\n", written));
+ GTK_DEBUG (PRINTING, "FILE Backend: Wrote %zd bytes to temp file", written);
data += written;
length -= written;
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("FILE Backend: %s\n", error->message));
+ GTK_DEBUG (PRINTING, "FILE Backend: %s", error->message);
g_error_free (error);
}
return FALSE;
}
- GTK_NOTE (PRINTING,
- g_print ("FILE Backend: Writing %"G_GSIZE_FORMAT" byte chunk to target file\n", bytes_read));
+ GTK_DEBUG (PRINTING, "FILE Backend: Writing %"G_GSIZE_FORMAT" byte chunk to target file", bytes_read);
return TRUE;
}
error = NULL;
- GTK_NOTE (PRINTING,
- g_print ("LPR Backend: Writing %i byte chunk to temp file\n", length));
+ GTK_DEBUG (PRINTING, "LPR Backend: Writing %i byte chunk to temp file", length);
while (length > 0)
{
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("LPR Backend: Error writing to temp file, %s\n", error->message));
+ GTK_DEBUG (PRINTING, "LPR Backend: Error writing to temp file, %s", error->message);
g_error_free (error);
return CAIRO_STATUS_WRITE_ERROR;
}
- GTK_NOTE (PRINTING,
- g_print ("LPR Backend: Wrote %" G_GSIZE_FORMAT " bytes to temp file\n", written));
+ GTK_DEBUG (PRINTING, "LPR Backend: Wrote %" G_GSIZE_FORMAT " bytes to temp file", written);
data += written;
length -= written;
if (error != NULL)
{
- GTK_NOTE (PRINTING,
- g_print ("LPR Backend: %s\n", error->message));
+ GTK_DEBUG (PRINTING, "LPR Backend: %s", error->message);
g_error_free (error);
}
return FALSE;
}
- GTK_NOTE (PRINTING,
- g_print ("LPR Backend: Writing %" G_GSIZE_FORMAT " byte chunk to lpr pipe\n", bytes_read));
-
+ GTK_DEBUG (PRINTING, "LPR Backend: Writing %" G_GSIZE_FORMAT " byte chunk to lpr pipe", bytes_read);
return TRUE;
}