# Path: mcomix/image_tools.py
# def fit_in_rectangle(src, width, height, scale_up=False, rotation=0):
# def fit_2_in_rectangle(src1, src2, width, height, scale_up=False,
#   rotation1=0, rotation2=0):
# def add_border(pixbuf, thickness, colour=0x000000FF):
# def get_most_common_edge_colour(pixbufs, edge=2):
#     def round_color(color, steps=10):
#         def round(color_value):
#     def get_edge_pixbuf(pixbuf, side, edge):
# def pil_to_pixbuf(image):
# def pixbuf_to_pil(pixbuf):
# def load_pixbuf(path):
# def load_pixbuf_size(path, width, height):
# def load_pixbuf_data(imgdata):
# def enhance(pixbuf, brightness=1.0, contrast=1.0, saturation=1.0,
#   sharpness=1.0, autocontrast=False):
# def get_implied_rotation(pixbuf):
# def combine_pixbufs( pixbuf1, pixbuf2, are_in_manga_mode ):
# def is_image_file(path):
#         IS_RGBA = image.mode == 'RGBA'
# 
# Path: mcomix/log.py
# def print_(*args, **options):
#     def print_generic(text):
#     def print_win32(text):
#     def __init__(self):
#     def emit(self, record):
#         INVALID_HANDLE_VALUE, STD_OUTPUT_HANDLE = -1, -11
# class PrintHandler(logging.Handler):


import gtk
from pkg_resources import resource_string
from mcomix import image_tools
from mcomix import log
              ('tango-add-bookmark.png',     'mcomix-add-bookmark'),
              ('tango-archive.png',          'mcomix-archive'),
              ('tango-image.png',            'mcomix-image'),
              ('library.png',                'mcomix-library'),
              ('comments.png',               'mcomix-comments'),
              ('zoom.png',                   'mcomix-zoom'),
              ('lens.png',                   'mcomix-lens'),
              ('double-page.png',            'mcomix-double-page'),
              ('manga.png',                  'mcomix-manga'),
              ('fitbest.png',                'mcomix-fitbest'),
              ('fitwidth.png',               'mcomix-fitwidth'),
              ('fitheight.png',              'mcomix-fitheight'),
              ('fitmanual.png',              'mcomix-fitmanual'),
              ('goto-first-page.png',        'mcomix-goto-first-page'),
              ('goto-last-page.png',         'mcomix-goto-last-page'),
              ('next-page.png',              'mcomix-next-page'),
              ('previous-page.png',          'mcomix-previous-page'),
              ('next-archive.png',           'mcomix-next-archive'),
              ('previous-archive.png',       'mcomix-previous-archive'),
              ('next-directory.png',         'mcomix-next-directory'),
              ('previous-directory.png',     'mcomix-previous-directory'))

    # Load window title icons.
    pixbufs = mcomix_icons()
    gtk.window_set_default_icon_list(*pixbufs)
    # Load application icons.
    factory = gtk.IconFactory()
    for filename, stockid in _icons:
        try:
            icon_data = resource_string('mcomix.images', filename)

# Path: mcomix/image_tools.py
# def fit_in_rectangle(src, width, height, scale_up=False, rotation=0):
# def fit_2_in_rectangle(src1, src2, width, height, scale_up=False,
#   rotation1=0, rotation2=0):
# def add_border(pixbuf, thickness, colour=0x000000FF):
# def get_most_common_edge_colour(pixbufs, edge=2):
#     def round_color(color, steps=10):
#         def round(color_value):
#     def get_edge_pixbuf(pixbuf, side, edge):
# def pil_to_pixbuf(image):
# def pixbuf_to_pil(pixbuf):
# def load_pixbuf(path):
# def load_pixbuf_size(path, width, height):
# def load_pixbuf_data(imgdata):
# def enhance(pixbuf, brightness=1.0, contrast=1.0, saturation=1.0,
#   sharpness=1.0, autocontrast=False):
# def get_implied_rotation(pixbuf):
# def combine_pixbufs( pixbuf1, pixbuf2, are_in_manga_mode ):
# def is_image_file(path):
#         IS_RGBA = image.mode == 'RGBA'
# 
# Path: mcomix/log.py
# def print_(*args, **options):
#     def print_generic(text):
#     def print_win32(text):
#     def __init__(self):
#     def emit(self, record):
#         INVALID_HANDLE_VALUE, STD_OUTPUT_HANDLE = -1, -11
# class PrintHandler(logging.Handler):


# Path: mcomix/icons.py
import gtk
from pkg_resources import resource_string
from mcomix import image_tools
from mcomix import log

              ('tango-add-bookmark.png',     'mcomix-add-bookmark'),
              ('tango-archive.png',          'mcomix-archive'),
              ('tango-image.png',            'mcomix-image'),
              ('library.png',                'mcomix-library'),
              ('comments.png',               'mcomix-comments'),
              ('zoom.png',                   'mcomix-zoom'),
              ('lens.png',                   'mcomix-lens'),
              ('double-page.png',            'mcomix-double-page'),
              ('manga.png',                  'mcomix-manga'),
              ('fitbest.png',                'mcomix-fitbest'),
              ('fitwidth.png',               'mcomix-fitwidth'),
              ('fitheight.png',              'mcomix-fitheight'),
              ('fitmanual.png',              'mcomix-fitmanual'),
              ('goto-first-page.png',        'mcomix-goto-first-page'),
              ('goto-last-page.png',         'mcomix-goto-last-page'),
              ('next-page.png',              'mcomix-next-page'),
              ('previous-page.png',          'mcomix-previous-page'),
              ('next-archive.png',           'mcomix-next-archive'),
              ('previous-archive.png',       'mcomix-previous-archive'),
              ('next-directory.png',         'mcomix-next-directory'),
              ('previous-directory.png',     'mcomix-previous-directory'))

    # Load window title icons.
    pixbufs = mcomix_icons()
    gtk.window_set_default_icon_list(*pixbufs)
    # Load application icons.
    factory = gtk.IconFactory()
    for filename, stockid in _icons:
        try:
            icon_data = resource_string('mcomix.images', filename)

            pixbuf = image_tools.load_pixbuf_data(icon_data)