glade-app.h 5.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2001 Ximian, Inc.
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 19 20 21
 *
 * Authors:
 *   Naba Kumar <naba@gnome.org>
 */
22
 
23 24 25
#ifndef __GLADE_APP_H__
#define __GLADE_APP_H__

26 27 28
#include <gladeui/glade-editor.h>
#include <gladeui/glade-palette.h>
#include <gladeui/glade-clipboard.h>
Tristan Van Berkom's avatar
Tristan Van Berkom committed
29

30 31 32 33 34 35 36 37 38
G_BEGIN_DECLS

#define GLADE_TYPE_APP            (glade_app_get_type())
#define GLADE_APP(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_APP, GladeApp))
#define GLADE_APP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_APP, GladeAppClass))
#define GLADE_IS_APP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_APP))
#define GLADE_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_APP))
#define GLADE_APP_GET_CLASS(o)    (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_APP, GladeAppClass))

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
#define GLADE_TYPE_POINTER_MODE   (glade_pointer_mode_get_type())

typedef struct _GladeApp         GladeApp;
typedef struct _GladeAppPrivate  GladeAppPrivate;
typedef struct _GladeAppClass    GladeAppClass;
typedef enum   _GladePointerMode GladePointerMode;


/**
 * GladePointerMode:
 * @GLADE_POINTER_SELECT:      Mouse pointer used for selecting widgets
 * @GLADE_POINTER_ADD_WIDGET:  Mouse pointer used for adding widgets
 * @GLADE_POINTER_DRAG_RESIZE: Mouse pointer used for dragging and 
 *                             resizing widgets in containers
 *
 * Indicates what the pointer is used for in the workspace.
 */
enum _GladePointerMode
{
	GLADE_POINTER_SELECT = 0,
	GLADE_POINTER_ADD_WIDGET,
	GLADE_POINTER_DRAG_RESIZE
};
62 63 64

struct _GladeApp
{
65
	GObject parent_instance;
66 67
	
	GladeAppPrivate *priv;
68 69 70 71 72 73
};

struct _GladeAppClass
{
	GObjectClass parent_class;
	
74
	/* class methods */
75 76
	void   (*  show_properties) (GladeApp* app,
				     gboolean  raise);
77 78
	void   (*  hide_properties) (GladeApp* app);

79
	/* signals */
80
	void   (* update_ui_signal) (GladeApp    *app);
81 82
};

83
 
84
GType              glade_app_get_type   (void) G_GNUC_CONST;
85

86 87
GladeApp*          glade_app_new        (void);

88 89
GType              glade_pointer_mode_get_type (void) G_GNUC_CONST;

90
GladeApp*          glade_app_get        (void);
91

92
void               glade_app_update_ui  (void);
93

Tristan Van Berkom's avatar
Tristan Van Berkom committed
94
void               glade_app_set_window (GtkWidget *window);
95
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
96
GtkWidget*         glade_app_get_window (void);
97

98
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
99
GladeEditor*       glade_app_get_editor (void);
100
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
101
GladePalette*      glade_app_get_palette (void);
102
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
103
GladeClipboard*    glade_app_get_clipboard (void);
104
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
105
GtkWidget*         glade_app_get_clipboard_view (void);
106

Tristan Van Berkom's avatar
Tristan Van Berkom committed
107
GladeProject*      glade_app_get_project (void);
108
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
109
void               glade_app_set_project (GladeProject *project);
110 111

GladePointerMode   glade_app_get_pointer_mode (void);
112
 
113 114
void               glade_app_set_pointer_mode (GladePointerMode mode);

Tristan Van Berkom's avatar
Tristan Van Berkom committed
115
void               glade_app_add_project (GladeProject *project);
116
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
117
void               glade_app_remove_project (GladeProject *project);
118
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
119
GList*             glade_app_get_projects (void);
120
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
121
GKeyFile*          glade_app_get_config (void);
122
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
123
gboolean           glade_app_is_project_loaded (const gchar *project_path);
124
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
125
GladeProject*      glade_app_get_project_by_path (const gchar *project_path);
126
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
127
void               glade_app_show_properties (gboolean raise);
128
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
129
void               glade_app_hide_properties (void);
130

131
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
132
void               glade_app_command_copy (void);
133
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
134
void               glade_app_command_cut (void);
135
 
136
void               glade_app_command_paste (GladePlaceholder *placeholder);
137
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
138
void               glade_app_command_delete (void);
139

Tristan Van Berkom's avatar
Tristan Van Berkom committed
140
void               glade_app_command_delete_clipboard (void);
141
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
142
void               glade_app_command_undo (void);
143
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
144
void               glade_app_command_redo (void);
145

146
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
147
gint               glade_app_config_save (void);
148
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
149
void               glade_app_set_transient_parent (GtkWindow *parent);
150
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
151
GtkWindow         *glade_app_get_transient_parent (void);
152
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
153
void               glade_app_set_accel_group (GtkAccelGroup *accel_group);
154
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
155
void               glade_app_update_instance_count  (GladeProject *project);
156

157
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
158
GtkWidget 	 *glade_app_undo_button_new (void);
159
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
160
GtkWidget 	 *glade_app_redo_button_new (void);
161

162
 
Tristan Van Berkom's avatar
Tristan Van Berkom committed
163
GList            *glade_app_get_selection (void);
164

165 166 167 168

/* These handle selection on a global scope and take care
 * of multiple project logic.
 */
169
 
170
gboolean           glade_app_is_selected       (GObject  *object);
171
 
172 173
void               glade_app_selection_set     (GObject  *object,
					        gboolean  emit_signal);
174
 
175 176
void               glade_app_selection_add     (GObject  *object,
					        gboolean  emit_signal);
177
 
178 179
void               glade_app_selection_remove  (GObject  *object,
					        gboolean  emit_signal);
180
 
181
void               glade_app_selection_clear   (gboolean  emit_signal);
182
 
183
void               glade_app_selection_changed (void);
184

185
/* package paths */
186

187
const gchar       *glade_app_get_catalogs_dir  (void) G_GNUC_CONST;
188

189
const gchar       *glade_app_get_modules_dir   (void) G_GNUC_CONST;
190

191
const gchar       *glade_app_get_plugins_dir   (void) G_GNUC_CONST;
192

193
const gchar       *glade_app_get_pixmaps_dir   (void) G_GNUC_CONST;
194

195
const gchar       *glade_app_get_locale_dir    (void) G_GNUC_CONST;
196

197 198 199
G_END_DECLS

#endif /* __GLADE_APP_H__ */