# 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
"""icons.py - Load MComix specific icons."""



def mcomix_icons():
    """ Returns a list of differently sized pixbufs for the
    application icon. """

    sizes = ('16x16', '32x32', '48x48')
    pixbufs = [
        image_tools.load_pixbuf_data(
            resource_string('mcomix.images', size + '/mcomix.png')
        ) for size in sizes
    ]

    return pixbufs

def load_icons():
    _icons = (('gimp-flip-horizontal.png',   'mcomix-flip-horizontal'),
              ('gimp-flip-vertical.png',     'mcomix-flip-vertical'),
              ('gimp-rotate-180.png',        'mcomix-rotate-180'),
              ('gimp-rotate-270.png',        'mcomix-rotate-270'),
              ('gimp-rotate-90.png',         'mcomix-rotate-90'),
              ('gimp-thumbnails.png',        'mcomix-thumbnails'),
              ('gimp-transform.png',         'mcomix-transform'),
              ('tango-enhance-image.png',    'mcomix-enhance-image'),

# 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

"""icons.py - Load MComix specific icons."""



def mcomix_icons():
    """ Returns a list of differently sized pixbufs for the
    application icon. """

    sizes = ('16x16', '32x32', '48x48')
    pixbufs = [
        image_tools.load_pixbuf_data(
            resource_string('mcomix.images', size + '/mcomix.png')
        ) for size in sizes
    ]

    return pixbufs

def load_icons():
    _icons = (('gimp-flip-horizontal.png',   'mcomix-flip-horizontal'),
              ('gimp-flip-vertical.png',     'mcomix-flip-vertical'),
              ('gimp-rotate-180.png',        'mcomix-rotate-180'),
              ('gimp-rotate-270.png',        'mcomix-rotate-270'),
              ('gimp-rotate-90.png',         'mcomix-rotate-90'),
              ('gimp-thumbnails.png',        'mcomix-thumbnails'),
              ('gimp-transform.png',         'mcomix-transform'),
              ('tango-enhance-image.png',    'mcomix-enhance-image'),

              ('tango-add-bookmark.png',     'mcomix-add-bookmark'),