IdePerspective: gnome-builder Reference Manual

## IdePerspective IdePerspective |

## Functions

gboolean | ide_perspective_agree_to_shutdown ()
GActionGroup * | ide_perspective_get_actions ()
gchar * | ide_perspective_get_icon_name ()
gchar * | ide_perspective_get_id ()
gboolean | ide_perspective_get_needs_attention ()
gint | ide_perspective_get_priority ()
gchar * | ide_perspective_get_title ()
GtkWidget * | ide_perspective_get_titlebar ()
gboolean | ide_perspective_is_early ()
void | ide_perspective_set_fullscreen ()
void | ide_perspective_views_foreach ()

## Types and Values

#define | IDE_TYPE_PERSPECTIVE
struct | IdePerspectiveInterface
| IdePerspective

## Object Hierarchy

        GInterface
        ╰── IdePerspective

## Prerequisites

IdePerspective requires GObject.

## Known Implementations

IdePerspective is implemented by IdeEditorPerspective, IdeGenesisPerspective, IdeGreeterPerspective and IdePreferencesPerspective.

## Description

## Functions

### ide_perspective_agree_to_shutdown ()

    gboolean
    ide_perspective_agree_to_shutdown (IdePerspective *self);

This interface method is called when the workbench would like to shutdown. If the perspective needs to focus and ask the user a question, this is the place to do so. You may run a GtkDialog using `gtk_dialog_run()` or simply focus your perspective and return `FALSE`.

#### Parameters

self | An IdePerspective. |

#### Returns

`TRUE` to allow the workbench to continue shutting down.

### ide_perspective_get_actions ()

    GActionGroup *
    ide_perspective_get_actions (IdePerspective *self);

This interface method should retrieve a GActionGroup associated with the perspective, if necessary. The GActionGroup will automatically be registered with the "perspective" action prefix while the perspective is active. A perspective is "active" when it is currently displayed in the workbench.

#### Parameters

self | An IdePerspective. |

#### Returns

A GActionGroup or `NULL`.

[nullable][transfer full]

### ide_perspective_get_icon_name ()

    gchar *
    ide_perspective_get_icon_name (IdePerspective *self);

This interface methods retrieves the icon name to use when displaying the perspective selection sidebar.

If you implement an "icon-name" property, the icon may change at runtime.

#### Parameters

self | An IdePerspective. |

#### Returns

A newly allcoated string that contains the icon-name to use for the perspective.

[nullable]

### ide_perspective_get_id ()

    gchar *
    ide_perspective_get_id (IdePerspective *self);

This interface method is used to identify the perspective. It should be a short internal name, such as "editor" which should not be translated. Internally, the default implementation of this method will return the name of the instances GType.

This value should be unique per workspace.

#### Parameters

self | An IdePerspective |

#### Returns

A string identifier for the perspective.

[nullable]

### ide_perspective_get_needs_attention ()

    gboolean
    ide_perspective_get_needs_attention (IdePerspective *self);

This interface method returns `TRUE` if the interface needs attention.

One such use of this would be to indicate that contents within a perspective have changed since the user last focused the perspective. This should also be implemented with a boolean property named "needs-attention". If you call `g_object_notify()` (or one of its variants), the notifcation visual will be rendered with your icon.

#### Parameters

self | An IdePerspective. |

#### Returns

`TRUE` if the perspective needs attention.

### ide_perspective_get_priority ()

    gint
    ide_perspective_get_priority (IdePerspective *self);

### ide_perspective_get_title ()

    gchar *
    ide_perspective_get_title (IdePerspective *self);

This interface method gets the title of the perspective. This is used for tooltips in the perspective selector and potentially other UI components.

#### Parameters

self | An IdePerspective |

#### Returns

A string which will not be modified or freed.

### ide_perspective_get_titlebar ()

    GtkWidget *
    ide_perspective_get_titlebar (IdePerspective *self);

This interface method should return a GtkWidget suitable for being embedded as the titlebar for the application. If you return `NULL` from this method, a suitable titlebar will be created for you.

You may use IdeHeaderBar for a base implementation to save you the trouble of creating a titlebar similar to other perspectives in Builder.

#### Parameters

self | An IdePerspective. |

#### Returns

A GtkWidget or `NULL`.

[transfer none][nullable]

### ide_perspective_is_early ()

    gboolean
    ide_perspective_is_early (IdePerspective *self);

If `TRUE`, the perspective can be used before loading a project.

### ide_perspective_set_fullscreen ()

    void
    ide_perspective_set_fullscreen (IdePerspective *self,
                                    gboolean fullscreen);

This interface method is used to notify the perspective that it is going into fullscreen mode. The IdeWorkbench will notify the perspective before it is displayed.

#### Parameters

self | An IdePerspective. |
fullscreen | If fullscreen mode should be activated. |

### ide_perspective_views_foreach ()

    void
    ide_perspective_views_foreach (IdePerspective *self,
                                   GtkCallback callback,
                                   gpointer user_data);

This interface method is used to iterate all IdeLayoutView's that are descendents of `self` .

#### Parameters

self | An IdePerspective. |
callback | A GtkCallback. | [scope call]
user_data | user data for `callback` . |

## Types and Values

### IDE_TYPE_PERSPECTIVE

    #define IDE_TYPE_PERSPECTIVE (ide_perspective_get_type())

### struct IdePerspectiveInterface

    struct IdePerspectiveInterface {
      GTypeInterface parent;

      gboolean      (*agree_to_shutdown)   (IdePerspective *self);
      GActionGroup *(*get_actions)         (IdePerspective *self);
      gchar        *(*get_icon_name)       (IdePerspective *self);
      gchar        *(*get_id)              (IdePerspective *self);
      gboolean      (*get_needs_attention) (IdePerspective *self);
      gint          (*get_priority)        (IdePerspective *self);
      gchar        *(*get_title)           (IdePerspective *self);
      GtkWidget    *(*get_titlebar)        (IdePerspective *self);
      gboolean      (*is_early)            (IdePerspective *self);
      void          (*set_fullscreen)      (IdePerspective *self,
                                            gboolean        fullscreen);
      void          (*views_foreach)       (IdePerspective *self,
                                            GtkCallback     callback,
                                            gpointer        user_data);
    };

### IdePerspective

    typedef struct _IdePerspective IdePerspective;