Blame gladeui/glade-project.h

Packit 1e8aac
#ifndef __GLADE_PROJECT_H__
Packit 1e8aac
#define __GLADE_PROJECT_H__
Packit 1e8aac
Packit 1e8aac
#include <gladeui/glade-widget.h>
Packit 1e8aac
#include <gladeui/glade-command.h>
Packit 1e8aac
#include <gladeui/glade-xml-utils.h>
Packit 1e8aac
Packit 1e8aac
G_BEGIN_DECLS
Packit 1e8aac
Packit 1e8aac
#define GLADE_TYPE_PROJECT            (glade_project_get_type ())
Packit 1e8aac
#define GLADE_PROJECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_PROJECT, GladeProject))
Packit 1e8aac
#define GLADE_PROJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_PROJECT, GladeProjectClass))
Packit 1e8aac
#define GLADE_IS_PROJECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_PROJECT))
Packit 1e8aac
#define GLADE_IS_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_PROJECT))
Packit 1e8aac
#define GLADE_PROJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_TYPE_PROJECT, GladeProjectClass))
Packit 1e8aac
Packit 1e8aac
typedef struct _GladeProjectPrivate  GladeProjectPrivate;
Packit 1e8aac
typedef struct _GladeProjectClass    GladeProjectClass;
Packit 1e8aac
Packit 1e8aac
/**
Packit 1e8aac
 * GladePointerMode:
Packit 1e8aac
 * @GLADE_POINTER_SELECT:      Mouse pointer used for selecting widgets
Packit 1e8aac
 * @GLADE_POINTER_ADD_WIDGET:  Mouse pointer used for adding widgets
Packit 1e8aac
 * @GLADE_POINTER_DRAG_RESIZE: Mouse pointer used for dragging and 
Packit 1e8aac
 *                             resizing widgets in containers
Packit 1e8aac
 * @GLADE_POINTER_MARGIN_EDIT: Mouse pointer used to edit widget margins
Packit 1e8aac
 * @GLADE_POINTER_ALIGN_EDIT:  Mouse pointer used to edit widget alignment
Packit 1e8aac
 *
Packit 1e8aac
 * Indicates what the pointer is used for in the workspace.
Packit 1e8aac
 */
Packit 1e8aac
typedef enum
Packit 1e8aac
{
Packit 1e8aac
  GLADE_POINTER_SELECT = 0,
Packit 1e8aac
  GLADE_POINTER_ADD_WIDGET,
Packit 1e8aac
  GLADE_POINTER_DRAG_RESIZE,
Packit 1e8aac
  GLADE_POINTER_MARGIN_EDIT,
Packit 1e8aac
  GLADE_POINTER_ALIGN_EDIT
Packit 1e8aac
} GladePointerMode;
Packit 1e8aac
Packit 1e8aac
typedef enum
Packit 1e8aac
{
Packit 1e8aac
  GLADE_SUPPORT_OK                   = 0,
Packit 1e8aac
  GLADE_SUPPORT_DEPRECATED           = (0x01 << 0),
Packit 1e8aac
  GLADE_SUPPORT_MISMATCH             = (0x01 << 1)
Packit 1e8aac
} GladeSupportMask;
Packit 1e8aac
Packit 1e8aac
/**
Packit 1e8aac
 * GladeProjectModelColumns:
Packit 1e8aac
 * @GLADE_PROJECT_MODEL_COLUMN_ICON_NAME: name of the icon for the widget
Packit 1e8aac
 * @GLADE_PROJECT_MODEL_COLUMN_NAME: Name of the widget
Packit 1e8aac
 * @GLADE_PROJECT_MODEL_COLUMN_TYPE_NAME: The type name of the widget
Packit 1e8aac
 * @GLADE_PROJECT_MODEL_COLUMN_OBJECT: the GObject of the widget
Packit 1e8aac
 * @GLADE_PROJECT_MODEL_COLUMN_MISC: the auxilary text describing a widget's role
Packit 1e8aac
 * @GLADE_PROJECT_MODEL_COLUMN_WARNING: the support warning text for this widget
Packit 1e8aac
 * @GLADE_PROJECT_MODEL_N_COLUMNS: Number of columns
Packit 1e8aac
 *
Packit 1e8aac
 * The tree view columns provided by the GtkTreeModel implemented
Packit 1e8aac
 * by GladeProject
Packit 1e8aac
 *
Packit 1e8aac
 **/
Packit 1e8aac
typedef enum
Packit 1e8aac
{
Packit 1e8aac
  GLADE_PROJECT_MODEL_COLUMN_ICON_NAME,
Packit 1e8aac
  GLADE_PROJECT_MODEL_COLUMN_NAME,
Packit 1e8aac
  GLADE_PROJECT_MODEL_COLUMN_TYPE_NAME,
Packit 1e8aac
  GLADE_PROJECT_MODEL_COLUMN_OBJECT,
Packit 1e8aac
  GLADE_PROJECT_MODEL_COLUMN_MISC,
Packit 1e8aac
  GLADE_PROJECT_MODEL_COLUMN_WARNING,
Packit 1e8aac
  GLADE_PROJECT_MODEL_N_COLUMNS
Packit 1e8aac
} GladeProjectModelColumns;
Packit 1e8aac
Packit 1e8aac
/**
Packit 1e8aac
 * GladeVerifyFlags:
Packit 1e8aac
 * @GLADE_VERIFY_VERSIONS: Verify version mismatches
Packit 1e8aac
 * @GLADE_VERIFY_DEPRECATIONS: Verify deprecations
Packit 1e8aac
 * @GLADE_VERIFY_UNRECOGNIZED: Verify unrecognized types
Packit 1e8aac
 *
Packit 1e8aac
 */
Packit 1e8aac
typedef enum {
Packit 1e8aac
  GLADE_VERIFY_VERSIONS      = (1 << 0),
Packit 1e8aac
  GLADE_VERIFY_DEPRECATIONS  = (1 << 1),
Packit 1e8aac
  GLADE_VERIFY_UNRECOGNIZED  = (1 << 2)
Packit 1e8aac
} GladeVerifyFlags;
Packit 1e8aac
Packit 1e8aac
struct _GladeProject
Packit 1e8aac
{
Packit 1e8aac
  GObject parent_instance;
Packit 1e8aac
Packit 1e8aac
  GladeProjectPrivate *priv;
Packit 1e8aac
};
Packit 1e8aac
Packit 1e8aac
struct _GladeProjectClass
Packit 1e8aac
{
Packit 1e8aac
  GObjectClass parent_class;
Packit 1e8aac
Packit 1e8aac
  void          (*add_object)          (GladeProject *project,
Packit 1e8aac
                                        GladeWidget  *widget);
Packit 1e8aac
  void          (*remove_object)       (GladeProject *project,
Packit 1e8aac
                                        GladeWidget  *widget);
Packit 1e8aac
Packit 1e8aac
  void          (*undo)                (GladeProject *project);
Packit 1e8aac
  void          (*redo)                (GladeProject *project);
Packit 1e8aac
  GladeCommand *(*next_undo_item)      (GladeProject *project);
Packit 1e8aac
  GladeCommand *(*next_redo_item)      (GladeProject *project);
Packit 1e8aac
  void          (*push_undo)           (GladeProject *project,
Packit 1e8aac
                                        GladeCommand *command);
Packit 1e8aac
Packit 1e8aac
  void          (*changed)             (GladeProject *project,
Packit 1e8aac
                                        GladeCommand *command,
Packit 1e8aac
                                        gboolean      forward);
Packit 1e8aac
Packit 1e8aac
  void          (*widget_name_changed) (GladeProject *project,
Packit 1e8aac
                                        GladeWidget  *widget);
Packit 1e8aac
  void          (*selection_changed)   (GladeProject *project); 
Packit 1e8aac
  void          (*close)               (GladeProject *project);
Packit 1e8aac
Packit 1e8aac
  void          (*parse_finished)      (GladeProject *project);
Packit 1e8aac
  
Packit 1e8aac
  void   (* glade_reserved1)   (void);
Packit 1e8aac
  void   (* glade_reserved2)   (void);
Packit 1e8aac
  void   (* glade_reserved3)   (void);
Packit 1e8aac
  void   (* glade_reserved4)   (void);
Packit 1e8aac
  void   (* glade_reserved5)   (void);
Packit 1e8aac
  void   (* glade_reserved6)   (void);
Packit 1e8aac
  void   (* glade_reserved7)   (void);
Packit 1e8aac
  void   (* glade_reserved8)   (void);
Packit 1e8aac
};
Packit 1e8aac
Packit 1e8aac
Packit 1e8aac
GType               glade_project_get_type            (void) G_GNUC_CONST;
Packit 1e8aac
Packit 1e8aac
GladeProject       *glade_project_new                 (void);
Packit 1e8aac
GladeProject       *glade_project_load                (const gchar         *path);
Packit 1e8aac
gboolean            glade_project_load_from_file      (GladeProject        *project, 
Packit 1e8aac
                                                       const gchar         *path);
Packit 1e8aac
gboolean            glade_project_save                (GladeProject        *project,
Packit 1e8aac
                                                       const gchar         *path, 
Packit 1e8aac
                                                       GError             **error);
Packit 1e8aac
gboolean            glade_project_save_verify         (GladeProject        *project,
Packit 1e8aac
                                                       const gchar         *path,
Packit 1e8aac
						       GladeVerifyFlags     flags,
Packit 1e8aac
                                                       GError             **error);
Packit 1e8aac
gboolean            glade_project_autosave            (GladeProject        *project,
Packit 1e8aac
                                                       GError             **error);
Packit 1e8aac
gboolean            glade_project_backup              (GladeProject        *project,
Packit 1e8aac
                                                       const gchar         *path, 
Packit 1e8aac
                                                       GError             **error);
Packit 1e8aac
void                glade_project_push_progress        (GladeProject       *project);
Packit 1e8aac
gboolean            glade_project_load_cancelled       (GladeProject       *project);
Packit 1e8aac
void                glade_project_cancel_load          (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
void                glade_project_preview              (GladeProject       *project, 
Packit 1e8aac
                                                        GladeWidget        *gwidget);
Packit 1e8aac
void                glade_project_properties           (GladeProject       *project);
Packit 1e8aac
gchar              *glade_project_resource_fullpath    (GladeProject       *project,
Packit 1e8aac
                                                        const gchar        *resource);
Packit 1e8aac
void                glade_project_set_resource_path    (GladeProject       *project,
Packit 1e8aac
                                                        const gchar        *path);
Packit 1e8aac
const gchar        *glade_project_get_resource_path    (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
void                glade_project_widget_visibility_changed (GladeProject  *project,
Packit 1e8aac
                                                             GladeWidget   *widget,
Packit 1e8aac
                                                             gboolean       visible);
Packit 1e8aac
void                glade_project_check_reordered      (GladeProject       *project,
Packit 1e8aac
                                                        GladeWidget        *parent,
Packit 1e8aac
                                                        GList              *old_order);
Packit 1e8aac
Packit 1e8aac
void                glade_project_set_template         (GladeProject       *project,
Packit 1e8aac
							GladeWidget        *widget);
Packit 1e8aac
GladeWidget        *glade_project_get_template         (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
void                glade_project_set_license          (GladeProject       *project,
Packit 1e8aac
                                                        const gchar        *license);
Packit 1e8aac
Packit 1e8aac
const gchar        *glade_project_get_license          (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
/* Commands */
Packit 1e8aac
void                glade_project_undo                 (GladeProject       *project);
Packit 1e8aac
void                glade_project_redo                 (GladeProject       *project);
Packit 1e8aac
GladeCommand       *glade_project_next_undo_item       (GladeProject       *project);
Packit 1e8aac
GladeCommand       *glade_project_next_redo_item       (GladeProject       *project);
Packit 1e8aac
void                glade_project_push_undo            (GladeProject       *project,
Packit 1e8aac
                                                        GladeCommand       *cmd);
Packit 1e8aac
GtkWidget          *glade_project_undo_items           (GladeProject       *project);
Packit 1e8aac
GtkWidget          *glade_project_redo_items           (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
/* Add/Remove Objects */
Packit 1e8aac
const GList        *glade_project_get_objects          (GladeProject       *project);
Packit 1e8aac
void                glade_project_add_object           (GladeProject       *project,
Packit 1e8aac
                                                        GObject            *object);
Packit 1e8aac
void                glade_project_remove_object        (GladeProject       *project,
Packit 1e8aac
                                                        GObject            *object);
Packit 1e8aac
gboolean            glade_project_has_object           (GladeProject       *project,
Packit 1e8aac
                                                        GObject            *object);
Packit 1e8aac
void                glade_project_widget_changed       (GladeProject       *project,
Packit 1e8aac
                                                        GladeWidget        *gwidget);
Packit 1e8aac
Packit 1e8aac
/* Widget names */
Packit 1e8aac
GladeWidget        *glade_project_get_widget_by_name   (GladeProject       *project,
Packit 1e8aac
                                                        const gchar        *name);
Packit 1e8aac
void                glade_project_set_widget_name      (GladeProject       *project,
Packit 1e8aac
                                                        GladeWidget        *widget, 
Packit 1e8aac
							const gchar        *name);
Packit 1e8aac
gchar              *glade_project_new_widget_name      (GladeProject       *project,
Packit 1e8aac
                                                        GladeWidget        *widget,
Packit 1e8aac
                                                        const gchar        *base_name);
Packit 1e8aac
gboolean            glade_project_available_widget_name(GladeProject       *project,
Packit 1e8aac
                                                        GladeWidget        *widget,
Packit 1e8aac
                                                        const gchar        *name);
Packit 1e8aac
Packit 1e8aac
/* Selection */
Packit 1e8aac
gboolean            glade_project_is_selected          (GladeProject       *project,
Packit 1e8aac
                                                        GObject            *object);
Packit 1e8aac
void                glade_project_selection_set        (GladeProject       *project,
Packit 1e8aac
                                                        GObject            *object,
Packit 1e8aac
                                                        gboolean            emit_signal);
Packit 1e8aac
void                glade_project_selection_add        (GladeProject       *project,
Packit 1e8aac
                                                        GObject            *object,
Packit 1e8aac
                                                        gboolean            emit_signal);
Packit 1e8aac
void                glade_project_selection_remove     (GladeProject       *project,
Packit 1e8aac
                                                        GObject            *object,
Packit 1e8aac
                                                        gboolean            emit_signal);
Packit 1e8aac
void                glade_project_selection_clear      (GladeProject       *project,
Packit 1e8aac
                                                        gboolean            emit_signal);
Packit 1e8aac
void                glade_project_selection_changed    (GladeProject       *project);
Packit 1e8aac
void                glade_project_queue_selection_changed (GladeProject    *project);
Packit 1e8aac
GList              *glade_project_selection_get        (GladeProject       *project);
Packit 1e8aac
gboolean            glade_project_get_has_selection    (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
/* Accessors */ 
Packit 1e8aac
const gchar        *glade_project_get_path             (GladeProject       *project);
Packit 1e8aac
gchar              *glade_project_get_name             (GladeProject       *project);
Packit 1e8aac
void                glade_project_reset_path           (GladeProject       *project);
Packit 1e8aac
gboolean            glade_project_is_loading           (GladeProject       *project);
Packit 1e8aac
time_t              glade_project_get_file_mtime       (GladeProject       *project);
Packit 1e8aac
gboolean            glade_project_get_readonly         (GladeProject       *project);
Packit 1e8aac
gboolean            glade_project_get_modified         (GladeProject       *project);
Packit 1e8aac
void                glade_project_set_pointer_mode     (GladeProject       *project,
Packit 1e8aac
                                                        GladePointerMode    mode);
Packit 1e8aac
GladePointerMode    glade_project_get_pointer_mode     (GladeProject       *project);
Packit 1e8aac
void                glade_project_set_add_item         (GladeProject       *project,
Packit 1e8aac
                                                        GladeWidgetAdaptor *adaptor);
Packit 1e8aac
GladeWidgetAdaptor *glade_project_get_add_item         (GladeProject       *project);
Packit 1e8aac
void                glade_project_set_target_version   (GladeProject       *project,
Packit 1e8aac
							const gchar        *catalog,
Packit 1e8aac
							gint                major,
Packit 1e8aac
							gint                minor);
Packit 1e8aac
void                glade_project_get_target_version   (GladeProject       *project,
Packit 1e8aac
                                                        const gchar        *catalog,
Packit 1e8aac
                                                        gint               *major,
Packit 1e8aac
                                                        gint               *minor);
Packit 1e8aac
GList              *glade_project_required_libs        (GladeProject       *project);
Packit 1e8aac
gchar              *glade_project_display_dependencies (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
GList              *glade_project_toplevels            (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
void                glade_project_set_translation_domain (GladeProject *project,
Packit 1e8aac
                                                          const gchar *domain);
Packit 1e8aac
const gchar        *glade_project_get_translation_domain (GladeProject *project);
Packit 1e8aac
Packit 1e8aac
void                glade_project_set_css_provider_path  (GladeProject *project,
Packit 1e8aac
                                                          const gchar  *path);
Packit 1e8aac
Packit 1e8aac
const gchar        *glade_project_get_css_provider_path  (GladeProject *project);
Packit 1e8aac
Packit 1e8aac
/* Verifications */
Packit 1e8aac
gboolean            glade_project_verify               (GladeProject       *project,
Packit 1e8aac
							gboolean            saving,
Packit 1e8aac
							GladeVerifyFlags    flags);
Packit 1e8aac
gchar              *glade_project_verify_widget_adaptor(GladeProject       *project,
Packit 1e8aac
                                                        GladeWidgetAdaptor *adaptor,
Packit 1e8aac
                                                        GladeSupportMask   *mask);
Packit 1e8aac
void                glade_project_verify_property      (GladeProperty      *property);
Packit 1e8aac
void                glade_project_verify_signal        (GladeWidget        *widget,
Packit 1e8aac
                                                        GladeSignal        *signal);
Packit 1e8aac
gboolean            glade_project_writing_preview      (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
/* General selection driven commands */
Packit 1e8aac
void                glade_project_copy_selection       (GladeProject       *project);
Packit 1e8aac
void                glade_project_command_cut          (GladeProject       *project); 
Packit 1e8aac
void                glade_project_command_paste        (GladeProject       *project,
Packit 1e8aac
                                                        GladePlaceholder   *placeholder);
Packit 1e8aac
void                glade_project_command_delete       (GladeProject       *project);
Packit 1e8aac
Packit 1e8aac
G_END_DECLS
Packit 1e8aac
Packit 1e8aac
#endif /* __GLADE_PROJECT_H__ */