summaryrefslogtreecommitdiff
path: root/gladeui/glade-app.h
blob: 28fa2c8df11f3eeb5d1c6e34803aa90bbd483fd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/* -*- 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
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Authors:
 *   Naba Kumar <naba@gnome.org>
 */
 
#ifndef __GLADE_APP_H__
#define __GLADE_APP_H__

#include <gladeui/glade-editor.h>
#include <gladeui/glade-palette.h>
#include <gladeui/glade-clipboard.h>

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))

#define GLADE_TYPE_POINTER_MODE   (glade_pointer_mode_get_type())

#define GLADE_ENV_CATALOG_PATH    "GLADE_CATALOG_PATH"
#define GLADE_ENV_MODULE_PATH     "GLADE_MODULE_PATH"

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
};

struct _GladeApp
{
	GObject parent_instance;
	
	GladeAppPrivate *priv;
};

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

	/* signals */
	void   (* update_ui_signal) (GladeApp    *app);
};

 
GType              glade_app_get_type   (void) G_GNUC_CONST;

GladeApp*          glade_app_new        (void);

GType              glade_pointer_mode_get_type (void) G_GNUC_CONST;

GladeApp*          glade_app_get        (void);

void               glade_app_update_ui  (void);

void               glade_app_set_window (GtkWidget *window);
 
GtkWidget*         glade_app_get_window (void);

 
GladeEditor*       glade_app_get_editor (void);
 
GladePalette*      glade_app_get_palette (void);
 
GladeClipboard*    glade_app_get_clipboard (void);
 
GtkWidget*         glade_app_get_clipboard_view (void);

GladeProject*      glade_app_get_project (void);
 
void               glade_app_set_project (GladeProject *project);

GladePointerMode   glade_app_get_pointer_mode (void);
 
void               glade_app_set_pointer_mode (GladePointerMode mode);

void               glade_app_add_project (GladeProject *project);
 
void               glade_app_remove_project (GladeProject *project);
 
GList*             glade_app_get_projects (void);
 
GKeyFile*          glade_app_get_config (void);
 
gboolean           glade_app_is_project_loaded (const gchar *project_path);
 
GladeProject*      glade_app_get_project_by_path (const gchar *project_path);
 
void               glade_app_show_properties (gboolean raise);
 
void               glade_app_hide_properties (void);

 
void               glade_app_command_copy (void);
 
void               glade_app_command_cut (void);
 
void               glade_app_command_paste (GladePlaceholder *placeholder);
 
void               glade_app_command_delete (void);

void               glade_app_command_delete_clipboard (void);
 
void               glade_app_command_undo (void);
 
void               glade_app_command_redo (void);

 
gint               glade_app_config_save (void);
 
void               glade_app_set_transient_parent (GtkWindow *parent);
 
GtkWindow         *glade_app_get_transient_parent (void);
 
void               glade_app_set_accel_group (GtkAccelGroup *accel_group);
 
void               glade_app_update_instance_count  (GladeProject *project);

 
GtkWidget         *glade_app_undo_button_new (void);
 
GtkWidget         *glade_app_redo_button_new (void);

 
GList             *glade_app_get_selection (void);


/* These handle selection on a global scope and take care
 * of multiple project logic.
 */
 
gboolean           glade_app_is_selected       (GObject  *object);
 
void               glade_app_selection_set     (GObject  *object,
					        gboolean  emit_signal);
 
void               glade_app_selection_add     (GObject  *object,
					        gboolean  emit_signal);
 
void               glade_app_selection_remove  (GObject  *object,
					        gboolean  emit_signal);
 
void               glade_app_selection_clear   (gboolean  emit_signal);
 
void               glade_app_selection_changed (void);

/* package paths */

const gchar       *glade_app_get_catalogs_dir  (void) G_GNUC_CONST;

const gchar       *glade_app_get_modules_dir   (void) G_GNUC_CONST;

const gchar       *glade_app_get_plugins_dir   (void) G_GNUC_CONST;

const gchar       *glade_app_get_pixmaps_dir   (void) G_GNUC_CONST;

const gchar       *glade_app_get_locale_dir    (void) G_GNUC_CONST;

G_END_DECLS

#endif /* __GLADE_APP_H__ */