/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-

   plugin.h for the Openbox window manager
   Copyright (c) 2003-2007   Dana Jansens

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   See the COPYING file for a copy of the GNU General Public License.
*/
#ifndef FRAME_PLUGIN_H_
#define FRAME_PLUGIN_H_
/* Thanks to BMP, XMMS, Audacious and glib project to enable plugin */
#include "geom.h"
#include "render/render.h"
#include "render/theme.h"
#include "frame.h"

#include <gmodule.h>

struct _ObFramePlugin
  {
    gpointer handler; // Currently not used.

    gchar * filename;
    gchar * name;

    // Function to init module
    gint (*init)(Display * display, gint screen);

    gpointer (*frame_new)(struct _ObClient *c);
    void (*frame_free)(gpointer self);
    void (*frame_show)(gpointer self);
    void (*frame_hide)(gpointer self);
    void (*frame_adjust_theme)(gpointer self);
    void (*frame_adjust_shape)(gpointer self);
    void (*frame_adjust_area)(gpointer self, gboolean moved, gboolean resized,
        gboolean fake);
    void (*frame_adjust_client_area)(gpointer self);
    void (*frame_adjust_state)(gpointer self);
    void (*frame_adjust_focus)(gpointer self, gboolean hilite);
    void (*frame_adjust_title)(gpointer self);
    void (*frame_adjust_icon)(gpointer self);
    void (*frame_grab_client)(gpointer self);
    void (*frame_release_client)(gpointer self);
    ObFrameContext (*frame_context_from_string)(const gchar *name);
    ObFrameContext (*frame_context)(struct _ObClient *self, Window win, gint x,
        gint y);
    void (*frame_client_gravity)(gpointer self, gint *x, gint *y);
    void (*frame_frame_gravity)(gpointer self, gint *x, gint *y);
    void (*frame_rect_to_frame)(gpointer self, Rect *r);
    void (*frame_rect_to_client)(gpointer self, Rect *r);
    void (*frame_flash_start)(gpointer self);
    void (*frame_flash_stop)(gpointer self);
    void (*frame_begin_iconify_animation)(gpointer self, gboolean iconifying);
    void (*frame_end_iconify_animation)(gpointer self);
    gboolean (*frame_iconify_animating)(gpointer p);

    /* Filled by openbox-core */
    Display * ob_display;
    gint ob_screen;
    RrInstance *ob_rr_inst;
    RrTheme *ob_rr_theme;
    gboolean config_theme_keepborder;
    struct _ObClient *focus_cycle_target;
    gchar *config_title_layout;
    gboolean moveresize_in_progress;
    struct _ObMainLoop *ob_main_loop;
  };
/* Define how to draw the current windows */
enum _ObStyle {
  OBSTYLE_DECOR,
  OBSTYLE_NODECOR,
  OBSTYLE_SHADE,
  OBSTYLE_ICON,
  OBSTYLE_MAXVERT,
  OBSTYLE_MAXHORIZ,
  OBSTYLE_MAX,
};

typedef enum _ObStyle ObStyle;
typedef struct _ObFramePlugin ObFramePlugin;
typedef ObFramePlugin * (*ObFramePluginFunc)(void);

#define OBFRAME(x) (ObFrame *) (x);

ObFramePlugin * init_render(const gchar * filename);

#endif /*FRAME_PLUGIN_H_*/
