/*-
 * Copyright (c) 2003 Seth Kingsley.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgment:
 *    This product includes software developed by Seth Kingsley and
 *    contributors.
 * 4. Neither the author's name, nor any of the contributors names may be
 *    used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/* $Id: portsman.h,v 1.15 2004/05/13 21:00:16 sethk Exp $ */

#ifndef PORTSMAN_H
#define PORTSMAN_H

#include    <gtk/gtkdialog.h>

#include    "descview.h"
#include    "install.h"

#define PM_TYPE_PORT_STATE  (pm_port_state_type_get_type())

enum port_state
{
    PSTATE_INST,
    PSTATE_STALE,
    PSTATE_UNINST,
    PSTATE_ORPHAN,
    PSTATE_NSTATE
};

enum port_field
{
    PFIELD_NAME,
    PFIELD_ORIGIN,
    PFIELD_PREFIX,
    PFIELD_COMM,
    PFIELD_DESCFN,
    PFIELD_MAINT,
    PFIELD_CATS,
    PFIELD_RDEPS,
    PFIELD_LDEPS,
    PFIELD_WEBSITE,
    PFIELD_NFIELD
};

struct port_desc
{
    enum port_state	pd_state;
    gchar		*pd_name,
			*pd_version,
			*pd_origin,
			*pd_prefix,
			*pd_comm,
			*pd_descpath,
			*pd_maint;
    guint		pd_ncat;
    struct cat_desc	**pd_cats;
    guint		pd_nrundep;
    struct port_desc	*pd_rundeps;
    guint		pd_nblddep;
    struct port_desc	*pd_blddeps;
    gchar		*pd_website;
};

struct cat_desc
{
    gchar		*cd_name;
    gboolean		cd_real,
			cd_dynamic;
    GTree		*cd_pdtree;
};

#define PM_TYPE_PORT_STATE  (pm_port_state_type_get_type())

GType pm_port_state_type_get_type(void);
struct portsman_data *portsman_init(void);
void portsman_fini(struct portsman_data *_pdp);
const gchar *portsman_state_desc(enum port_state _ps);
void portsman_about(struct portsman_data *pdp);

#endif /* !PORTSMAN_H */
