This repository has been archived on 2020-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
gnoemoe/gnoemoe/gm-support.h

170 lines
4.4 KiB
C
Raw Normal View History

2005-11-07 10:56:25 +01:00
#ifndef __GM_SUPPORT_H__
#define __GM_SUPPORT_H__
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <gtk/gtk.h>
#include <libgnomevfs/gnome-vfs.h>
2006-01-02 18:57:26 +01:00
#undef _
#include <glib/gi18n.h>
#include "gm-color-table.h"
2005-11-07 10:56:25 +01:00
/*
* Standard gettext macros.
#ifdef ENABLE_NLS
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#else
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
#ifndef _
# define _(String) (String)
#endif
# define N_(String) (String)
#endif
2006-01-02 18:57:26 +01:00
*/
2005-11-07 10:56:25 +01:00
#define CALC_COLOR_RANGE(x) (int)((-(1/((x * 0.5)+1))+1)*255)
/** \defgroup support */
/** \ingroup support
* \brief Widget container for tabs
*
* Contains all widgets that could be useful to be modified.
* Stored here because it makes it easier to look them up.
*
*/
typedef struct _GmLabelInfo GmLabelInfo;
struct _GmLabelInfo {
/** \brief GtkButton widget
*
* GtkButton widget, reference to the tabs exit button
*/
GtkWidget *button_exit;
/** \brief GtkImage widget
*
* GtkImage widget, reference to the tabs exit button image
*/
GtkWidget *image_exit;
/** \brief GtkLabel widget
*
* GtkLabel widget, reference to the tabs label
*/
GtkWidget *label_name;
/** \brief GtkImage widget
*
* GtkImage widget, reference to the tabs icon
*/
GtkWidget *image_icon;
};
/** \ingroup support
* \brief Key/value pair struct
*
* Contains two fields. Used to create hash tables
*
*/
typedef struct _GmKeyValuePair {
gchar *key; /**< the key */
gchar *value; /**< the value */
} GmKeyValuePair;
typedef struct _GmFetchHandle GmFetchHandle;
struct _GmFetchHandle {
GnomeVFSAsyncHandle *handle;
GFunc cb;
gpointer user_data;
GList *source_uri;
GList *dest_uri;
GnomeVFSXferPhase cur_phase;
GnomeVFSXferPhase prev_phase;
GnomeVFSXferProgressStatus prev_status;
GnomeVFSXferProgressStatus status;
GnomeVFSFileSize bytes_total;
GnomeVFSFileSize file_size;
GnomeVFSFileSize bytes_copied;
GnomeVFSFileSize total_bytes_copied;
gulong files_total;
gulong cur_file;
gulong prev_file;
gchar *cur_file_name;
gboolean aborted;
gboolean done;
};
gchar *gm_fix_decimal_point(gchar *line, int len);
gchar *gm_fix_decimal_point_rev(gchar *line, int len);
gchar *gm_ansi_strip(gchar * s);
int garray_length(gchar **s);
void gm_g_list_free_simple(GList *s);
gchar *gm_g_list_find_simple(GList *s, gchar *f);
2005-11-07 10:56:25 +01:00
2006-03-29 14:23:28 +02:00
gint gm_error_dialog(gchar * message, GtkWindow * parent);
gint gm_warning_dialog(gchar * message, GtkWindow * parent);
gint gm_info_dialog(gchar * message, GtkWindow * parent);
gint gm_question_dialog(gchar * message, GtkWindow * parent);
2005-11-07 10:56:25 +01:00
void gm_do_events();
void gm_directory_remove_all(const gchar * path, gboolean remove_self);
gint gm_url_regex_match(const gchar *msg, int len, GArray *start, GArray *end);
void gm_open_url(const gchar *url);
2005-11-07 10:56:25 +01:00
GmFetchHandle * gm_fetch(const GList *source, const GList *dest,
GFunc cb, gpointer user_data);
void gm_fetch_handle_free(GmFetchHandle *g);
gboolean gm_is_end_scrolled(GtkScrolledWindow *wnd, guint charHeight);
void gm_scroll_end(GtkTextView *view, gboolean needs);
typedef gboolean (*ReadProgressFunc) (long, long, gchar *, gpointer);
gchar *gm_read_file(gchar const *fname);
2005-11-07 10:56:25 +01:00
GtkWidget *gm_create_tab_label(const gchar *icon, const gchar *caption,
gboolean has_exit, GmLabelInfo *info);
void gm_widget_destroy_data(GtkWidget *caller, GtkWidget *destroyer);
const gchar *gm_default_charset();
void gm_notebook_focus_from_label(GtkNotebook *note, gchar *caption);
2006-03-31 22:28:12 +02:00
GtkWidget *gm_find_parent(GtkWidget *widget, GType parent_type);
* VERSION CHANGED TO 2.0.9 * po/POTFILES.in: added gnoemoe/dialogs/gm-world-paste-dialog.c and ui/gm-world-paste.glade * po/nl.po: added translations * ui/Makefile.am: * ui/gm-ui.xml: * ui/gm-world-paste.glade: new paste dialog * gnoemoe/mcp/Makefile.include: added gm-cell-renderer-text.[ch] * gnoemoe/mcp/gm-cell-renderer-text.[ch]: new cell renderer for rendering userlist * gnoemoe/mcp/gm-mcp-vmoo-client.c: update metrics in timeout so to reduce the number of updates when resizing * gnoemoe/mcp/gm-mcp-icecrew-serverinfo.c: max version set to 1.0 (1.0 does not actively request the info because it will be send on initialization). Set menu item invisible instead of insensitive when there is no info available * gnoemoe/mcp/gm-mcp-icecrew-userlist.c: fixed menu item substitution * gnoemoe/mcp/gm-mcp-vmoo-userlist.c: removed support for status because it doesn't really support it * gm-mcp-userlist-view.[ch]: moved column constants to header. Render items with new gm-cell-renderer-text. * gnoemoe/mcp/gm-mcp-icecrew-playerdb.[ch]: made gm_mcp_icecrew_playerdb_players public * gnoemoe/dialogs/Makefile.include: added gm-world-paste-dialog * gnoemoe/dialogs/gm-world-paste-dialog.[ch]: new paste dialog * gnoemoe/dialogs/gm-world-properties-dialog.c: * gnoemoe/dialogs/gm-world-logs-dialog.c: fixed leaking tree stores * gnoemoe/widgets/Makefile.include: added gm-commands.[ch] * gnoemoe/widgets/gm-commands.[ch]: new file for handling action activation (removed from gm-app-view) * gnoemoe/widgets/gm-world-view.c: fixed userlist size restore * gnoemoe/widgets/gm-app-view.c: removed action handlers * gnoemoe/gm-support.[ch]: added gm_find_child * gnoemoe/gm-world.c: removed debug message * gnoemoe/gm-ui.h: changed actions to gm-commands
2006-04-23 16:51:04 +02:00
GtkWidget *gm_find_child(GtkWidget *widget, GType parent_type);
2006-03-31 22:28:12 +02:00
2006-02-06 19:39:19 +01:00
gchar *gm_from_utf8_with_fallback(gchar const *text, gssize len,
gchar const *to, gchar const *fallback);
gchar *gm_to_utf8_with_fallback(gchar const *text, gssize len,
gchar const *from, gchar const *fallback);
GtkWidget *gm_container_item(GtkContainer *cnt, GType type);
2005-11-07 10:56:25 +01:00
typedef enum _GmSchemedFlags {
GM_SCHEMED_COLORS = 1 << 0,
GM_SCHEMED_FONT = 1 << 1
} GmSchemedFlags;
void gm_register_schemed(GtkWidget *widget, GmColorTable *Table,
GmSchemedFlags flags);
2005-11-07 10:56:25 +01:00
#endif /* __GM_SUPPORT_H__ */