2005-10-31 22:58:01 +00:00
|
|
|
/*
|
|
|
|
* mooutils-misc.h
|
|
|
|
*
|
2006-02-23 14:03:17 +00:00
|
|
|
* Copyright (C) 2004-2006 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2005-10-31 22:58:01 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MOO_UTILS_MISC_H__
|
|
|
|
#define __MOO_UTILS_MISC_H__
|
|
|
|
|
2006-03-21 03:23:37 -06:00
|
|
|
#include <gtk/gtk.h>
|
2005-10-31 22:58:01 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
gboolean moo_open_url (const char *url);
|
|
|
|
gboolean moo_open_email (const char *address,
|
|
|
|
const char *subject,
|
|
|
|
const char *body);
|
|
|
|
|
|
|
|
|
2006-08-15 03:52:38 -05:00
|
|
|
gboolean _moo_window_is_hidden (GtkWindow *window);
|
|
|
|
void _moo_window_present (GtkWindow *window,
|
2006-07-05 14:16:29 -05:00
|
|
|
guint32 stamp);
|
2006-08-15 03:52:38 -05:00
|
|
|
GtkWindow *_moo_get_top_window (GSList *windows);
|
|
|
|
GtkWindow *_moo_get_toplevel_window (void);
|
2005-10-31 22:58:01 +00:00
|
|
|
|
2006-08-15 03:52:38 -05:00
|
|
|
gboolean _moo_window_set_icon_from_stock (GtkWindow *window,
|
2005-10-31 22:58:01 +00:00
|
|
|
const char *stock_id);
|
|
|
|
|
|
|
|
void moo_log_window_show (void);
|
|
|
|
void moo_log_window_hide (void);
|
|
|
|
|
2006-03-21 03:23:37 -06:00
|
|
|
/* these two are wrappers for g_print, needed for python stdout/stderr */
|
2006-03-15 02:16:42 -06:00
|
|
|
void moo_print (const char *string);
|
|
|
|
void moo_print_err (const char *string);
|
2005-10-31 22:58:01 +00:00
|
|
|
|
2006-03-15 02:16:42 -06:00
|
|
|
void moo_set_log_func_window (gboolean show_now);
|
2005-10-31 22:58:01 +00:00
|
|
|
void moo_set_log_func_file (const char *log_file);
|
2006-03-15 02:16:42 -06:00
|
|
|
void moo_set_log_func_silent (void);
|
|
|
|
void moo_reset_log_func (void);
|
2005-10-31 22:58:01 +00:00
|
|
|
|
2006-03-29 02:04:18 -06:00
|
|
|
|
2005-11-17 07:04:35 +00:00
|
|
|
void moo_segfault (void);
|
2006-08-15 03:52:38 -05:00
|
|
|
gboolean _moo_debug_enabled (void) G_GNUC_CONST;
|
2005-11-17 07:04:35 +00:00
|
|
|
|
2006-06-14 23:39:34 -05:00
|
|
|
void _moo_disable_win32_error_message(void);
|
|
|
|
void _moo_enable_win32_error_message (void);
|
2005-10-31 22:58:01 +00:00
|
|
|
|
2006-03-29 02:04:18 -06:00
|
|
|
#define MOO_TYPE_DATA_DIR_TYPE (moo_data_dir_type_get_type ())
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
MOO_DATA_SHARE,
|
|
|
|
MOO_DATA_LIB
|
|
|
|
} MooDataDirType;
|
|
|
|
|
2006-04-09 04:00:52 -05:00
|
|
|
GType moo_data_dir_type_get_type (void) G_GNUC_CONST;
|
2006-03-29 02:04:18 -06:00
|
|
|
|
2006-04-05 05:01:17 -05:00
|
|
|
/* application directory on win32 */
|
2006-04-09 04:00:52 -05:00
|
|
|
char *moo_get_app_dir (void);
|
2006-08-04 06:57:15 -05:00
|
|
|
char *moo_get_dll_dir (const char *dll);
|
2006-04-09 04:00:52 -05:00
|
|
|
|
2006-03-29 02:04:18 -06:00
|
|
|
/* ~/.appname */
|
2006-06-07 05:34:39 -05:00
|
|
|
gboolean moo_make_user_data_dir (void);
|
2006-04-09 04:00:52 -05:00
|
|
|
char *moo_get_user_data_dir (void);
|
|
|
|
char *moo_get_user_data_file (const char *basename);
|
|
|
|
gboolean moo_save_user_data_file (const char *basename,
|
|
|
|
const char *content,
|
|
|
|
gssize len,
|
|
|
|
GError **error);
|
|
|
|
|
2006-04-16 17:01:41 -05:00
|
|
|
/* user data comes last; MOO_DATA_DIR comes first */
|
2006-03-29 02:04:18 -06:00
|
|
|
/* $MOO_APP_DIR:$MOO_DATA_DIRS:$prefix/share/appname or
|
|
|
|
$MOO_APP_DIR:$MOO_LIB_DIRS:$prefix/lib/appname */
|
2006-04-09 04:00:52 -05:00
|
|
|
char **moo_get_data_dirs (MooDataDirType type,
|
2006-03-29 02:04:18 -06:00
|
|
|
guint *n_dirs);
|
2006-04-09 04:00:52 -05:00
|
|
|
char **moo_get_data_subdirs (const char *subdir,
|
2006-03-29 02:04:18 -06:00
|
|
|
MooDataDirType type,
|
|
|
|
guint *n_dirs);
|
2006-04-09 04:00:52 -05:00
|
|
|
#define moo_get_data_files moo_get_data_subdirs
|
2006-03-29 02:04:18 -06:00
|
|
|
|
|
|
|
|
2006-08-15 03:52:38 -05:00
|
|
|
void _moo_selection_data_set_pointer (GtkSelectionData *data,
|
2005-11-27 14:03:12 +00:00
|
|
|
GdkAtom type,
|
|
|
|
gpointer ptr);
|
2006-08-15 03:52:38 -05:00
|
|
|
gpointer _moo_selection_data_get_pointer (GtkSelectionData *data,
|
2005-11-27 14:03:12 +00:00
|
|
|
GdkAtom type);
|
|
|
|
|
2006-08-15 03:52:38 -05:00
|
|
|
GdkModifierType _moo_get_modifiers (GtkWidget *widget);
|
2005-11-28 04:36:58 +00:00
|
|
|
|
2006-08-15 03:52:38 -05:00
|
|
|
void _moo_menu_item_set_accel_label (GtkWidget *menu_item,
|
2005-11-28 04:36:58 +00:00
|
|
|
const char *label);
|
2006-08-15 03:52:38 -05:00
|
|
|
void _moo_menu_item_set_label (GtkWidget *menu_item,
|
2005-12-02 17:50:28 +00:00
|
|
|
const char *label,
|
|
|
|
gboolean mnemonic);
|
2005-11-28 04:36:58 +00:00
|
|
|
|
2006-08-15 03:52:38 -05:00
|
|
|
void _moo_widget_set_tooltip (GtkWidget *widget,
|
2006-04-26 18:14:18 -05:00
|
|
|
const char *tip);
|
|
|
|
|
2006-08-15 03:52:38 -05:00
|
|
|
char **_moo_splitlines (const char *string);
|
2006-06-10 03:33:42 -05:00
|
|
|
|
2006-08-19 00:20:55 -05:00
|
|
|
const char *_moo_get_pid_string (void);
|
|
|
|
|
2005-11-27 14:03:12 +00:00
|
|
|
|
2005-10-31 22:58:01 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __MOO_UTILS_MISC_H__ */
|