From f6dfc9c6c80ba6b65e18edc858b37c9a670e2dde Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Sat, 21 Oct 2006 19:29:43 +0000 Subject: 2006-10-22 Akira TAGOH * hieroglyph/Makefile.am (libhieroglyph_la_SOURCES): added hglog.c. * hieroglyph/hglog.[ch]: new files for logger. --- devices/cairo/cairo-ps-main.c | 7 ++++--- devices/cairo/cairo-xlib-main.c | 7 ++++--- devices/cairo/hgdevice-cairo.c | 27 ++++++++++++++------------- 3 files changed, 22 insertions(+), 19 deletions(-) (limited to 'devices') diff --git a/devices/cairo/cairo-ps-main.c b/devices/cairo/cairo-ps-main.c index 0c75071..32412d2 100644 --- a/devices/cairo/cairo-ps-main.c +++ b/devices/cairo/cairo-ps-main.c @@ -1,7 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * cairo-ps-main.c - * Copyright (C) 2005 Akira TAGOH + * Copyright (C) 2005,2006 Akira TAGOH * * Authors: * Akira TAGOH @@ -29,6 +29,7 @@ #include #include #include +#include #include "hgdevice-cairo.h" @@ -62,7 +63,7 @@ device_open(HgPageInfo *info) fd = g_file_open_tmp("ps-embedded-XXXXXX", &filename, NULL); if (fd == -1) { - g_warning("Failed to open a file descriptor."); + hg_log_warning("Failed to open a file descriptor."); if (filename) g_free(filename); @@ -80,7 +81,7 @@ device_open(HgPageInfo *info) cdev->u.ps.fd = fd; if (cairo_status(cdev->reference) != CAIRO_STATUS_SUCCESS) { - g_warning("Failed to create an reference of cairo."); + hg_log_warning("Failed to create an reference of cairo."); } TRACE_LEAVE; diff --git a/devices/cairo/cairo-xlib-main.c b/devices/cairo/cairo-xlib-main.c index 29dfe5a..c08e4a4 100644 --- a/devices/cairo/cairo-xlib-main.c +++ b/devices/cairo/cairo-xlib-main.c @@ -26,6 +26,7 @@ #endif #include +#include #include "hgdevice-cairo.h" @@ -44,7 +45,7 @@ _cairo_xlib_real_set_page_size(HgCairoDevice *device, width, height); cairo_xlib_surface_set_size(device->surface, width, height); XFlush(device->u.xlib.dpy); - g_warning("%s: FIXME: implement me", __FUNCTION__); + hg_log_warning("%s: FIXME: implement me", __FUNCTION__); return TRUE; } @@ -68,7 +69,7 @@ device_open(void) cdev->u.type = HG_DEVICE_CAIRO_XLIB_SURFACE; cdev->u.xlib.dpy = XOpenDisplay(NULL); if (cdev->u.xlib.dpy == NULL) { - g_warning("Failed to open a display."); + hg_log_warning("Failed to open a display."); hg_device_destroy(dev); return NULL; } @@ -89,7 +90,7 @@ device_open(void) 400, 400); cdev->reference = cairo_create(cdev->surface); if (cairo_status(cdev->reference) != CAIRO_STATUS_SUCCESS) { - g_warning("Failed to create an reference of cairo."); + hg_log_warning("Failed to create an reference of cairo."); hg_device_destroy(dev); return NULL; } diff --git a/devices/cairo/hgdevice-cairo.c b/devices/cairo/hgdevice-cairo.c index 0761761..c8fbcee 100644 --- a/devices/cairo/hgdevice-cairo.c +++ b/devices/cairo/hgdevice-cairo.c @@ -26,6 +26,7 @@ #endif #include +#include #include #include "hgdevice-cairo.h" @@ -85,7 +86,7 @@ _hg_cairo_device_print_path(HgPathNode *node) g_print("%f %f %f %f %f %f curveto\n", node->x, node->y, node->next->x, node->next->y, node->next->next->x, node->next->next->y); node = node->next->next; } else { - g_warning("[BUG] Invalid path for curve."); + hg_log_warning("[BUG] Invalid path for curve."); } break; case HG_PATH_ARC: @@ -93,7 +94,7 @@ _hg_cairo_device_print_path(HgPathNode *node) g_print("%f %f %f %f %f arc\n", node->x, node->y, node->next->x, node->next->next->x, node->next->next->y); node = node->next->next; } else { - g_warning("[BUG] Invalid path for arc."); + hg_log_warning("[BUG] Invalid path for arc."); } break; case HG_PATH_MATRIX: @@ -101,11 +102,11 @@ _hg_cairo_device_print_path(HgPathNode *node) g_print("[%f %f %f %f %f %f] matrix\n", node->x, node->y, node->next->x, node->next->y, node->next->next->x, node->next->next->y); node = node->next->next; } else { - g_warning("[BUG] Invalid matrix was given."); + hg_log_warning("[BUG] Invalid matrix was given."); } break; default: - g_warning("[BUG] Unknown path type %d was given.", node->type); + hg_log_warning("[BUG] Unknown path type %d was given.", node->type); break; } node = node->next; @@ -244,7 +245,7 @@ _hg_cairo_device_real_finalize(HgDevice *device) { HgCairoDevice *cdev = (HgCairoDevice *)device; - g_warning("%s: FIXME: implement me.", __FUNCTION__); + hg_log_warning("%s: FIXME: implement me.", __FUNCTION__); cairo_show_page(cdev->reference); XFlush(cdev->u.xlib.dpy); @@ -361,8 +362,8 @@ _hg_cairo_device_real_stroke(HgDevice *device, } else if (HG_IS_VALUE_REAL (node)) { d = HG_VALUE_GET_REAL (node); } else { - g_warning("[BUG] Invalid object type %d was given for dashline pattern.", - HG_VALUE_GET_VALUE_TYPE (node)); + hg_log_warning("[BUG] Invalid object type %d was given for dashline pattern.", + HG_VALUE_GET_VALUE_TYPE (node)); d = 0.0; } dashes[i] = d; @@ -421,7 +422,7 @@ _hg_cairo_device_set_path(HgCairoDevice *device, node->next->next->x, node->next->next->y); node = node->next->next; } else { - g_warning("[BUG] Invalid path for curve."); + hg_log_warning("[BUG] Invalid path for curve."); retval = FALSE; } break; @@ -432,7 +433,7 @@ _hg_cairo_device_set_path(HgCairoDevice *device, node->next->next->x, node->next->next->y); node = node->next->next; } else { - g_warning("[BUG] Invalid path for arc."); + hg_log_warning("[BUG] Invalid path for arc."); retval = FALSE; } break; @@ -449,12 +450,12 @@ _hg_cairo_device_set_path(HgCairoDevice *device, cairo_set_matrix(device->reference, &trans); node = node->next->next; } else { - g_warning("[BUG] Invalid matrix was given."); + hg_log_warning("[BUG] Invalid matrix was given."); retval = FALSE; } break; default: - g_warning("[BUG] Unknown path type %d was given.", node->type); + hg_log_warning("[BUG] Unknown path type %d was given.", node->type); retval = FALSE; break; } @@ -481,7 +482,7 @@ _hg_cairo_device_set_line_cap(HgCairoDevice *device, cap = CAIRO_LINE_CAP_SQUARE; break; default: - g_warning("[BUG] Invalid linecap type %d", line_cap); + hg_log_warning("[BUG] Invalid linecap type %d", line_cap); cap = CAIRO_LINE_CAP_BUTT; break; } @@ -505,7 +506,7 @@ _hg_cairo_device_set_line_join(HgCairoDevice *device, join = CAIRO_LINE_JOIN_BEVEL; break; default: - g_warning("[BUG] Invalid linejoin type %d", line_join); + hg_log_warning("[BUG] Invalid linejoin type %d", line_join); join = CAIRO_LINE_JOIN_MITER; break; } -- cgit v1.2.3