Logo Search packages:      
Sourcecode: yiff version File versions  Download package

guiutils.h

#ifndef GUIUTILS_H
#define GUIUTILS_H

#include <sys/types.h>
#include <gtk/gtk.h>
#include "../include/os.h"

#ifndef gbool
# define gbool    gboolean
#endif


/*
 *    Menu item default height:
 */
#define GUI_MENU_ITEM_DEF_HEIGHT    20

/*
 *    Menu item type codes:
 */
#define GUI_MENU_ITEM_TYPE_LABEL    0
#define GUI_MENU_ITEM_TYPE_CHECK    1
#define GUI_MENU_ITEM_TYPE_SEPARATOR      2
#define GUI_MENU_ITEM_TYPE_SUBMENU  3

/*
 *    Menu bar item alignments:
 */
#define GUI_MENU_BAR_ALIGN_LEFT           0
#define GUI_MENU_BAR_ALIGN_RIGHT    1
#define GUI_MENU_BAR_ALIGN_CENTER   2


#ifndef gtk_widget_show_raise
# define gtk_widget_show_raise(w)   \
{ \
 if(w != NULL) \
 { \
  gtk_widget_show(w); \
  if(GTK_IS_WINDOW(w)) \
   gdk_window_raise(w->window); \
 } \
}
#endif

extern void GUIBlockInput(GtkWidget *w, gbool block);

extern void GUIResizeBuffer(
      gint bpp,
      const gpointer src,
      gint src_width, gint src_height, gint src_bpl,
      gpointer tar,
      gint tar_width, gint tar_height, gint tar_bpl
);

extern void GUIStyleDeallocUnref(GtkStyle *style);
extern void GUIRCStyleDeallocUnref(GtkRcStyle *rcstyle);

extern void *GUICreateMenuItemIcon(u_int8_t **icon);

extern guint32 gdk_parse_geometry(
      const gchar *s,
      gint *x, gint *y, gint *width, gint *height
);
extern int GUICListGetCellGeometry(
      void *w, int column, int row,
      int *x, int *y, int *width, int *height
);
extern void GUIGetWindowRootPosition(
      void *w, int *x, int *y
);
extern void GUIGetPositionRoot(
      void *w, int x, int y, int *rx, int *ry
);

extern void gtk_window_minimize(GtkWindow *window);

extern GdkBitmap *GUICreateBitmapFromDataRGBA(
      gint width, gint height, gint bpl,
      const guint8 *rgba, guint8 threshold,
      GdkWindow *window
);

extern void *GUICreateCursorFromData(
      u_int8_t **cursor_data,
      double hot_x, double hot_y,
      int width, int height   /* Both can be 0. */
);
extern void GUISetWMIcon(GdkWindow *w, u_int8_t **icon);
extern void GUISetWidgetTip(GtkWidget *w, const gchar *tip);
extern void GUIShowTipsNow(GtkWidget *w);
extern void GUISetGlobalTipsState(gbool state);

extern void GUIButtonChangeLayout(
      void *button, int show_pixmap, int show_label
);
extern void GUIButtonPixmapUpdate(
      void *button, u_int8_t **icon, const char *label
);
extern void *GUIButtonPixmap(u_int8_t **icon);
extern void *GUIButtonPixmapLabelH(
      u_int8_t **icon, const char *label, void **label_rtn
);
extern void *GUIButtonPixmapLabelV(
      u_int8_t **icon, const char *label, void **label_rtn
);

extern void *GUIToggleButtonPixmap(u_int8_t **icon);
extern void *GUIToggleButtonPixmapLabelH(
      u_int8_t **icon, const char *label, void **label_rtn
);
extern void *GUIToggleButtonPixmapLabelV(
      u_int8_t **icon, const char *label, void **label_rtn
);

extern void *GUIPromptBarWithBrowse(
      u_int8_t **icon, const char *label,
      void **label_rtn, void **entry_rtn, void **browse_rtn,
      void *browse_client_data, void (*browse_cb)(void *, void *)
);
extern void *GUIPromptBar(          
      u_int8_t **icon, const char *label,
      void **label_rtn, void **entry_rtn                   
);

extern void GUIDNDSetSrc(
      void *w, const void *drag_type, int ndrag_types,
      unsigned int actions, unsigned int buttons,
      void (*begin_cb)(GtkWidget *, GdkDragContext *, gpointer),
      void (*request_data_cb)(GtkWidget *, GdkDragContext *,
            GtkSelectionData *, guint, guint, gpointer),
      void (*delete_data_cb)(GtkWidget *, GdkDragContext *, gpointer),
      void (*end_cb)(GtkWidget *, GdkDragContext *, gpointer),
      gpointer client_data
);
extern void GUIDNDSetTar(
      void *w, const void *drag_type, int ndrag_types,
      unsigned int actions, unsigned int default_action_same,
      unsigned int default_action,
      void (*recieved_data_cb)(GtkWidget *, GdkDragContext *,
            gint, gint, GtkSelectionData *, guint, guint,
            gpointer  
      ),
      gpointer client_data
);
extern void GUIDNDSetDragIcon(
      GdkPixmap *pixmap, GdkBitmap *mask, gint hot_x, gint hot_y
);

extern GtkWidget *GUIBannerCreate(
      const gchar *label, const gchar *font_name,
      GdkColor color_fg, GdkColor color_bg,
      gint align,             /* One of GTK_JUSTIFY_*. */
      gbool expand
);

extern void *GUIComboCreate(
      const char *label,
      const char *text,       /* Initial text. */
      void *list,             /* Initial glist of items for combo list. */
      int max_items,          /* Maximum items allowed. */
      void **combo_rtn, /* Combo widget return. */
      void *client_data,
      void (*func_cb)(GtkWidget *w, void *),
      void (*list_change_cb)(GtkWidget *, void *, GList *)
);
extern void GUIComboActivateValue(void *w, const char *value);
extern void GUIComboAddItem(void *w, const char *value);
extern void *GUIComboGetList(void *w);
extern void GUIComboSetList(void *w, void *list);
extern void GUIComboClearAll(void *w);

extern void *GUIMenuBarCreate(void **accel_group);
extern void *GUIMenuCreateTearOff(void);
extern void *GUIMenuCreate(void);
extern void *GUIMenuItemCreate(
      void *menu, int type,   /* One of GUI_MENU_ITEM_TYPE_*. */
      void *accel_group,
      u_int8_t **icon, const char *label,
      int accel_key, unsigned int accel_mods,
      void **functional_widget_rtn,
      void *client_data,
      void (*func_cb)(GtkWidget *w, void *)
);
extern void GUISetMenuItemCrossingCB(
      void *w,
      int (*enter_cb)(void *, void *, void *),
      void *enter_client_data,
      int (*leave_cb)(void *, void *, void *),
      void *leave_client_data
);
extern void *GUIMenuAddToMenuBar(
      void *menu_bar, void *menu,
      const char *menu_bar_item_label,
      int align   /* One of GUI_MENU_BAR_ALIGN_*. */
);
extern void GUIMenuItemSetLabel(void *menu_item, const char *label);
extern void GUIMenuItemSetPixmap(void *menu_item, u_int8_t **icon_data);
extern void *GUIMenuAddToMenuBarPixmapH(
      void *menu_bar, void *menu,
      const char *menu_bar_item_label, const u_int8_t **icon,
      int align       /* One of GUI_MENU_BAR_ALIGN_*. */
);
extern void GUIMenuItemSetSubMenu(
      void *menu_item, void *sub_menu
);

extern void *GUIPullOutCreateH(
      void *parent_box,
      int homogeneous, int spacing,           /* Of client vbox. */
      int expand, int fill, int padding,      /* Of holder hbox. */
      int toplevel_width, int toplevel_height,
      void *pull_out_client_data,
      void (*pull_out_cb)(void *, void *),
      void *push_in_client_data,
      void (*push_in_cb)(void *, void *)
);
extern void *GUIPullOutGetToplevelWindow(
      void *client_box,
      int *x, int *y, int *width, int *height
);
extern void GUIPullOutPullOut(void *client_box);
extern void GUIPullOutPushIn(void *client_box);


#endif      /* GUIUTILS_H */

Generated by  Doxygen 1.6.0   Back to index