2006-04-16 17:02:33 -05:00
|
|
|
/*
|
|
|
|
* moousertools.h
|
|
|
|
*
|
2010-12-21 20:15:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
|
2006-04-16 17:02:33 -05:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* This file is part of medit. medit is free software; you can
|
|
|
|
* redistribute it and/or modify it under the terms of the
|
|
|
|
* GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2.1 of the License,
|
|
|
|
* or (at your option) any later version.
|
2006-04-16 17:02:33 -05:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
|
2006-04-16 17:02:33 -05:00
|
|
|
*/
|
|
|
|
|
2007-06-10 04:06:03 -05:00
|
|
|
#ifndef MOO_USER_TOOLS_H
|
|
|
|
#define MOO_USER_TOOLS_H
|
2006-04-16 17:02:33 -05:00
|
|
|
|
|
|
|
#include <mooutils/moouixml.h>
|
2010-08-30 22:19:58 -07:00
|
|
|
#include "moocommand.h"
|
2006-04-16 17:02:33 -05:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2009-11-01 12:44:46 -08:00
|
|
|
#define MOO_USER_TOOLS_PLUGIN_ID "UserTools"
|
2006-04-16 17:02:33 -05:00
|
|
|
|
2006-08-17 23:53:34 -05:00
|
|
|
#define MOO_TYPE_USER_TOOL_INFO (_moo_user_tool_info_get_type ())
|
|
|
|
|
2006-08-16 20:27:19 -05:00
|
|
|
typedef enum {
|
2006-08-17 23:53:34 -05:00
|
|
|
MOO_USER_TOOL_MENU,
|
|
|
|
MOO_USER_TOOL_CONTEXT
|
|
|
|
} MooUserToolType;
|
2006-08-16 20:27:19 -05:00
|
|
|
|
|
|
|
typedef enum {
|
2006-08-17 23:53:34 -05:00
|
|
|
MOO_USER_TOOL_POS_END,
|
|
|
|
MOO_USER_TOOL_POS_START
|
|
|
|
} MooUserToolPosition;
|
2006-08-16 20:27:19 -05:00
|
|
|
|
|
|
|
typedef struct {
|
2006-08-22 23:22:32 -05:00
|
|
|
char *id;
|
2006-08-17 23:53:34 -05:00
|
|
|
char *name;
|
|
|
|
char *accel;
|
|
|
|
char *menu;
|
2007-09-02 15:42:17 -05:00
|
|
|
char *filter;
|
2006-08-17 23:53:34 -05:00
|
|
|
char *options;
|
|
|
|
MooUserToolPosition position;
|
2007-02-27 22:23:57 -06:00
|
|
|
MooCommandFactory *cmd_factory;
|
2006-08-17 23:53:34 -05:00
|
|
|
MooCommandData *cmd_data;
|
|
|
|
MooUserToolType type;
|
|
|
|
char *file;
|
2006-08-23 02:41:56 -05:00
|
|
|
guint ref_count : 29;
|
|
|
|
guint enabled : 1;
|
|
|
|
guint deleted : 1;
|
|
|
|
guint builtin : 1;
|
2006-08-17 23:53:34 -05:00
|
|
|
} MooUserToolInfo;
|
|
|
|
|
|
|
|
GType _moo_user_tool_info_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
MooUserToolInfo *_moo_user_tool_info_new (void);
|
|
|
|
void _moo_user_tool_info_unref (MooUserToolInfo *info);
|
|
|
|
|
2008-01-09 21:14:10 -06:00
|
|
|
void _moo_edit_load_user_tools (void);
|
|
|
|
void _moo_edit_load_user_tools_type (MooUserToolType type);
|
2006-08-17 23:53:34 -05:00
|
|
|
|
|
|
|
typedef void (*MooToolFileParseFunc) (MooUserToolInfo *info,
|
2006-08-16 20:27:19 -05:00
|
|
|
gpointer data);
|
|
|
|
|
2006-08-19 00:21:29 -05:00
|
|
|
/* caller must free the list and unref() the contents */
|
2007-11-23 01:23:53 -06:00
|
|
|
GSList *_moo_edit_parse_user_tools (MooUserToolType type,
|
|
|
|
gboolean all);
|
2006-08-17 23:53:34 -05:00
|
|
|
void _moo_edit_save_user_tools (MooUserToolType type,
|
2006-08-23 02:41:56 -05:00
|
|
|
GSList *user_info);
|
2006-04-20 03:57:05 -05:00
|
|
|
|
2006-04-16 17:02:33 -05:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-06-10 04:06:03 -05:00
|
|
|
#endif /* MOO_USER_TOOLS_H */
|