Commit 77b9ff15 authored by Matthew Leeds's avatar Matthew Leeds
Browse files

buildui: Move build-tools plugin to libide

Now that IdeConfiguration is derivable, it makes more sense to have the
view for it in libide so it too can be subclassed.

https://bugzilla.gnome.org/show_bug.cgi?id=777959
parent e747b35b
......@@ -274,7 +274,6 @@ dnl ***********************************************************************
m4_include([plugins/autotools/configure.ac])
m4_include([plugins/autotools-templates/configure.ac])
m4_include([plugins/beautifier/configure.ac])
m4_include([plugins/build-tools/configure.ac])
m4_include([plugins/c-pack/configure.ac])
m4_include([plugins/cargo/configure.ac])
m4_include([plugins/clang/configure.ac])
......
......@@ -212,3 +212,89 @@ popover.transfers list row:first-child {
popover.transfers list row > box {
padding: 10px;
}
/*
buildpanel button.popup:active,
buildpanel button.popup:checked,
buildpanel button.popup {
background-image: none;
background-color: transparent;
box-shadow: none;
border-style: none;
margin: 0;
padding: 0;
}
*/
list.buildpanel row {
padding: 10px;
border-bottom: 1px solid alpha(@borders, 0.4);
}
list.buildpanel row:last-child {
border-bottom: none;
}
buildpanel list row {
padding: 6px;
border-bottom: 1px solid alpha(@borders, 0.4);
}
buildpanel list row:last-child {
border-bottom: none;
}
buildpanel list row label.file {
opacity: 0.5;
}
buildpanel box.build-status {
background: shade(@theme_bg_color, 0.96);
}
buildperspective list.sidebar row:selected button:hover {
border-color: transparent;
box-shadow: none;
background: transparent;
color: @theme_selected_fg_color;
opacity: 1;
}
buildperspective list.sidebar row:selected button,
buildperspective list.sidebar row:selected button:active {
opacity: 0.8;
}
buildperspective list.sidebar {
border-right: 1px solid alpha(@borders, 0.55);
}
configurationview list row {
padding: 10px;
border-bottom: 1px solid alpha(@borders, 0.4);
}
configurationview list row:last-child {
border-bottom: none;
}
configurationview list row entry {
background: transparent;
border: none;
padding: 0;
margin: 0;
}
/* hrmm, we can use this to get row separators */
buildpanel treeview,
configurationview treeview {
border-bottom: 1px solid alpha(@borders, 0.4);
}
buildpanel list > label {
font-weight: bold;
opacity: 0.55;
margin: 6px 10px 0px 10px;
}
......@@ -381,6 +381,25 @@ libide_1_0_la_SOURCES = \
buildsystem/ide-build-log-private.h \
buildsystem/ide-build-stage-private.h \
buildsystem/ide-buildsystem-plugin.c \
buildui/ide-build-configuration-row.c \
buildui/ide-build-configuration-row.h \
buildui/ide-build-configuration-view.c \
buildui/ide-build-configuration-view.h \
buildui/ide-build-log-panel.c \
buildui/ide-build-log-panel.h \
buildui/ide-build-panel.c \
buildui/ide-build-panel.h \
buildui/ide-build-perspective.c \
buildui/ide-build-perspective.h \
buildui/ide-build-plugin.c \
buildui/ide-build-tool.c \
buildui/ide-build-tool.h \
buildui/ide-build-workbench-addin.c \
buildui/ide-build-workbench-addin.h \
buildui/ide-environment-editor-row.c \
buildui/ide-environment-editor-row.h \
buildui/ide-environment-editor.c \
buildui/ide-environment-editor.h \
editor/ide-editor-frame-actions.c \
editor/ide-editor-frame-actions.h \
editor/ide-editor-frame-private.h \
......
[Plugin]
Module=build-tools-plugin
Name=Build Tools
Module=build-ui-plugin
Name=Build UI
Description=Build panel and command line tools
Authors=Christian Hergert <christian@hergert.me>
Copyright=Copyright © 2015 Christian Hergert
Depends=editor
Hidden=true
Builtin=true
Embedded=ide_build_tool_register_types
X-Tool-Name=build
X-Tool-Description=Build a project
/* gbp-build-configuration-row.c
/* ide-build-configuration-row.c
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
......@@ -16,9 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "gbp-build-configuration-row.h"
#define G_LOG_DOMAIN "ide-build-configuration-row"
struct _GbpBuildConfigurationRow
#include "ide-build-configuration-row.h"
struct _IdeBuildConfigurationRow
{
GtkListBoxRow parent_instance;
......@@ -39,15 +41,15 @@ enum {
LAST_PROP
};
G_DEFINE_TYPE (GbpBuildConfigurationRow, gbp_build_configuration_row, GTK_TYPE_LIST_BOX_ROW)
G_DEFINE_TYPE (IdeBuildConfigurationRow, ide_build_configuration_row, GTK_TYPE_LIST_BOX_ROW)
static GParamSpec *properties [LAST_PROP];
static void
gbp_build_configuration_row_set_configuration (GbpBuildConfigurationRow *self,
ide_build_configuration_row_set_configuration (IdeBuildConfigurationRow *self,
IdeConfiguration *configuration)
{
g_assert (GBP_IS_BUILD_CONFIGURATION_ROW (self));
g_assert (IDE_IS_BUILD_CONFIGURATION_ROW (self));
g_assert (IDE_IS_CONFIGURATION (configuration));
if (g_set_object (&self->configuration, configuration))
......@@ -57,27 +59,27 @@ gbp_build_configuration_row_set_configuration (GbpBuildConfigurationRow *self,
}
static void
gbp_build_configuration_row_finalize (GObject *object)
ide_build_configuration_row_finalize (GObject *object)
{
GbpBuildConfigurationRow *self = (GbpBuildConfigurationRow *)object;
IdeBuildConfigurationRow *self = (IdeBuildConfigurationRow *)object;
g_clear_object (&self->configuration);
G_OBJECT_CLASS (gbp_build_configuration_row_parent_class)->finalize (object);
G_OBJECT_CLASS (ide_build_configuration_row_parent_class)->finalize (object);
}
static void
gbp_build_configuration_row_get_property (GObject *object,
ide_build_configuration_row_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GbpBuildConfigurationRow *self = GBP_BUILD_CONFIGURATION_ROW (object);
IdeBuildConfigurationRow *self = IDE_BUILD_CONFIGURATION_ROW (object);
switch (prop_id)
{
case PROP_CONFIGURATION:
g_value_set_object (value, gbp_build_configuration_row_get_configuration (self));
g_value_set_object (value, ide_build_configuration_row_get_configuration (self));
break;
default:
......@@ -86,17 +88,17 @@ gbp_build_configuration_row_get_property (GObject *object,
}
static void
gbp_build_configuration_row_set_property (GObject *object,
ide_build_configuration_row_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GbpBuildConfigurationRow *self = GBP_BUILD_CONFIGURATION_ROW (object);
IdeBuildConfigurationRow *self = IDE_BUILD_CONFIGURATION_ROW (object);
switch (prop_id)
{
case PROP_CONFIGURATION:
gbp_build_configuration_row_set_configuration (self, g_value_get_object (value));
ide_build_configuration_row_set_configuration (self, g_value_get_object (value));
break;
case PROP_ACTIVE:
......@@ -123,14 +125,14 @@ gbp_build_configuration_row_set_property (GObject *object,
}
static void
gbp_build_configuration_row_class_init (GbpBuildConfigurationRowClass *klass)
ide_build_configuration_row_class_init (IdeBuildConfigurationRowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = gbp_build_configuration_row_finalize;
object_class->get_property = gbp_build_configuration_row_get_property;
object_class->set_property = gbp_build_configuration_row_set_property;
object_class->finalize = ide_build_configuration_row_finalize;
object_class->get_property = ide_build_configuration_row_get_property;
object_class->set_property = ide_build_configuration_row_set_property;
properties [PROP_CONFIGURATION] =
g_param_spec_object ("configuration",
......@@ -155,24 +157,24 @@ gbp_build_configuration_row_class_init (GbpBuildConfigurationRowClass *klass)
g_object_class_install_properties (object_class, LAST_PROP, properties);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/plugins/build-tools-plugin/gbp-build-configuration-row.ui");
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationRow, label);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationRow, duplicate);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationRow, delete);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationRow, radio);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationRow, controls);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/plugins/buildui/ide-build-configuration-row.ui");
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationRow, label);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationRow, duplicate);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationRow, delete);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationRow, radio);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationRow, controls);
}
static void
gbp_build_configuration_row_init (GbpBuildConfigurationRow *self)
ide_build_configuration_row_init (IdeBuildConfigurationRow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
IdeConfiguration *
gbp_build_configuration_row_get_configuration (GbpBuildConfigurationRow *self)
ide_build_configuration_row_get_configuration (IdeBuildConfigurationRow *self)
{
g_return_val_if_fail (GBP_IS_BUILD_CONFIGURATION_ROW (self), NULL);
g_return_val_if_fail (IDE_IS_BUILD_CONFIGURATION_ROW (self), NULL);
return self->configuration;
}
/* gbp-build-configuration-row.h
/* ide-build-configuration-row.h
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
......@@ -16,21 +16,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GBP_BUILD_CONFIGURATION_ROW_H
#define GBP_BUILD_CONFIGURATION_ROW_H
#ifndef IDE_BUILD_CONFIGURATION_ROW_H
#define IDE_BUILD_CONFIGURATION_ROW_H
#include <gtk/gtk.h>
#include <ide.h>
G_BEGIN_DECLS
#define GBP_TYPE_BUILD_CONFIGURATION_ROW (gbp_build_configuration_row_get_type())
#define IDE_TYPE_BUILD_CONFIGURATION_ROW (ide_build_configuration_row_get_type())
G_DECLARE_FINAL_TYPE (GbpBuildConfigurationRow, gbp_build_configuration_row, GBP, BUILD_CONFIGURATION_ROW, GtkListBoxRow)
G_DECLARE_FINAL_TYPE (IdeBuildConfigurationRow, ide_build_configuration_row, IDE, BUILD_CONFIGURATION_ROW, GtkListBoxRow)
GtkWidget *gbp_build_configuration_row_new (IdeConfiguration *configuration);
IdeConfiguration *gbp_build_configuration_row_get_configuration (GbpBuildConfigurationRow *self);
GtkWidget *ide_build_configuration_row_new (IdeConfiguration *configuration);
IdeConfiguration *ide_build_configuration_row_get_configuration (IdeBuildConfigurationRow *self);
G_END_DECLS
#endif /* GBP_BUILD_CONFIGURATION_ROW_H */
#endif /* IDE_BUILD_CONFIGURATION_ROW_H */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GbpBuildConfigurationRow" parent="GtkListBoxRow">
<template class="IdeBuildConfigurationRow" parent="GtkListBoxRow">
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
......
/* gbp-build-configuration-view.c
/* ide-build-configuration-view.c
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
......@@ -16,15 +16,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define G_LOG_DOMAIN "ide-build-configuration-view"
#include <ide.h>
#include <string.h>
#include "gbp-build-configuration-view.h"
#include "ide-build-configuration-view.h"
#include "ide-environment-editor.h"
#include "ide-internal.h"
struct _GbpBuildConfigurationView
struct _IdeBuildConfigurationView
{
EggColumnLayout parent_instance;
......@@ -48,7 +50,7 @@ enum {
LAST_PROP
};
G_DEFINE_TYPE (GbpBuildConfigurationView, gbp_build_configuration_view, EGG_TYPE_COLUMN_LAYOUT)
G_DEFINE_TYPE (IdeBuildConfigurationView, ide_build_configuration_view, EGG_TYPE_COLUMN_LAYOUT)
static GParamSpec *properties [LAST_PROP];
......@@ -175,13 +177,13 @@ create_device_row (gpointer item,
}
static void
device_row_activated (GbpBuildConfigurationView *self,
device_row_activated (IdeBuildConfigurationView *self,
GtkListBoxRow *row,
GtkListBox *list_box)
{
IdeDevice *device;
g_assert (GBP_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (IDE_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (GTK_IS_LIST_BOX_ROW (row));
g_assert (GTK_IS_LIST_BOX (list_box));
......@@ -192,13 +194,13 @@ device_row_activated (GbpBuildConfigurationView *self,
}
static void
runtime_row_activated (GbpBuildConfigurationView *self,
runtime_row_activated (IdeBuildConfigurationView *self,
GtkListBoxRow *row,
GtkListBox *list_box)
{
IdeRuntime *runtime;
g_assert (GBP_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (IDE_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (GTK_IS_LIST_BOX_ROW (row));
g_assert (GTK_IS_LIST_BOX (list_box));
......@@ -220,7 +222,7 @@ treat_null_as_empty (GBinding *binding,
}
static void
gbp_build_configuration_view_connect (GbpBuildConfigurationView *self,
ide_build_configuration_view_connect (IdeBuildConfigurationView *self,
IdeConfiguration *configuration)
{
IdeRuntimeManager *runtime_manager;
......@@ -228,7 +230,7 @@ gbp_build_configuration_view_connect (GbpBuildConfigurationView *self,
IdeContext *context;
IdeEnvironment *environment;
g_assert (GBP_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (IDE_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (IDE_IS_CONFIGURATION (configuration));
context = ide_object_get_context (IDE_OBJECT (configuration));
......@@ -270,10 +272,10 @@ gbp_build_configuration_view_connect (GbpBuildConfigurationView *self,
}
static void
gbp_build_configuration_view_disconnect (GbpBuildConfigurationView *self,
ide_build_configuration_view_disconnect (IdeBuildConfigurationView *self,
IdeConfiguration *configuration)
{
g_assert (GBP_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (IDE_IS_BUILD_CONFIGURATION_VIEW (self));
g_assert (IDE_IS_CONFIGURATION (configuration));
gtk_list_box_bind_model (self->device_list_box, NULL, NULL, NULL, NULL);
......@@ -285,31 +287,31 @@ gbp_build_configuration_view_disconnect (GbpBuildConfigurationView *self,
}
static void
gbp_build_configuration_view_destroy (GtkWidget *widget)
ide_build_configuration_view_destroy (GtkWidget *widget)
{
GbpBuildConfigurationView *self = (GbpBuildConfigurationView *)widget;
IdeBuildConfigurationView *self = (IdeBuildConfigurationView *)widget;
if (self->configuration != NULL)
{
gbp_build_configuration_view_disconnect (self, self->configuration);
ide_build_configuration_view_disconnect (self, self->configuration);
g_clear_object (&self->configuration);
}
GTK_WIDGET_CLASS (gbp_build_configuration_view_parent_class)->destroy (widget);
GTK_WIDGET_CLASS (ide_build_configuration_view_parent_class)->destroy (widget);
}
static void
gbp_build_configuration_view_get_property (GObject *object,
ide_build_configuration_view_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GbpBuildConfigurationView *self = GBP_BUILD_CONFIGURATION_VIEW (object);
IdeBuildConfigurationView *self = IDE_BUILD_CONFIGURATION_VIEW (object);
switch (prop_id)
{
case PROP_CONFIGURATION:
g_value_set_object (value, gbp_build_configuration_view_get_configuration (self));
g_value_set_object (value, ide_build_configuration_view_get_configuration (self));
break;
default:
......@@ -318,17 +320,17 @@ gbp_build_configuration_view_get_property (GObject *object,
}
static void
gbp_build_configuration_view_set_property (GObject *object,
ide_build_configuration_view_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GbpBuildConfigurationView *self = GBP_BUILD_CONFIGURATION_VIEW (object);
IdeBuildConfigurationView *self = IDE_BUILD_CONFIGURATION_VIEW (object);
switch (prop_id)
{
case PROP_CONFIGURATION:
gbp_build_configuration_view_set_configuration (self, g_value_get_object (value));
ide_build_configuration_view_set_configuration (self, g_value_get_object (value));
break;
default:
......@@ -337,13 +339,13 @@ gbp_build_configuration_view_set_property (GObject *object,
}
static void
gbp_build_configuration_view_class_init (GbpBuildConfigurationViewClass *klass)
ide_build_configuration_view_class_init (IdeBuildConfigurationViewClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = gbp_build_configuration_view_get_property;
object_class->set_property = gbp_build_configuration_view_set_property;
object_class->get_property = ide_build_configuration_view_get_property;
object_class->set_property = ide_build_configuration_view_set_property;
properties [PROP_CONFIGURATION] =
g_param_spec_object ("configuration",
......@@ -354,22 +356,22 @@ gbp_build_configuration_view_class_init (GbpBuildConfigurationViewClass *klass)
g_object_class_install_properties (object_class, LAST_PROP, properties);
widget_class->destroy = gbp_build_configuration_view_destroy;
widget_class->destroy = ide_build_configuration_view_destroy;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/plugins/build-tools-plugin/gbp-build-configuration-view.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/plugins/buildui/ide-build-configuration-view.ui");
gtk_widget_class_set_css_name (widget_class, "configurationview");
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationView, configure_entry);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationView, device_list_box);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationView, display_name_entry);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationView, environment_editor);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationView, prefix_entry);
gtk_widget_class_bind_template_child (widget_class, GbpBuildConfigurationView, runtime_list_box);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationView, configure_entry);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationView, device_list_box);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationView, display_name_entry);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationView, environment_editor);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationView, prefix_entry);
gtk_widget_class_bind_template_child (widget_class, IdeBuildConfigurationView, runtime_list_box);
g_type_ensure (IDE_TYPE_ENVIRONMENT_EDITOR);
}
static void
gbp_build_configuration_view_init (GbpBuildConfigurationView *self)
ide_build_configuration_view_init (IdeBuildConfigurationView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
......@@ -387,32 +389,32 @@ gbp_build_configuration_view_init (GbpBuildConfigurationView *self)
}
IdeConfiguration *
gbp_build_configuration_view_get_configuration (GbpBuildConfigurationView *self)
ide_build_configuration_view_get_configuration (IdeBuildConfigurationView *self)
{
g_return_val_if_fail (GBP_IS_BUILD_CONFIGURATION_VIEW (self), NULL);
g_return_val_if_fail (IDE_IS_BUILD_CONFIGURATION_VIEW (self), NULL);
return self->configuration;
}
void
gbp_build_configuration_view_set_configuration (GbpBuildConfigurationView *self,
ide_build_configuration_view_set_configuration (IdeBuildConfigurationView *self,
IdeConfiguration *configuration)
{
g_return_if_fail (GBP_IS_BUILD_CONFIGURATION_VIEW (self));
g_return_if_fail (IDE_IS_BUILD_CONFIGURATION_VIEW (self));
g_return_if_fail (!configuration || IDE_IS_CONFIGURATION (configuration));
if (self->configuration != configuration)
{
if (self->configuration != NULL)
{
gbp_build_configuration_view_disconnect (self, self->configuration);
ide_build_configuration_view_disconnect (self, self->configuration);
g_clear_object (&self->configuration);
}
if (configuration != NULL)
{
self->configuration = g_object_ref (configuration);
gbp_build_configuration_view_connect (self, configuration);
ide_build_configuration_view_connect (self, configuration);
}
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CONFIGURATION]);
......
/* gbp-build-configuration-view.h
/* ide-build-configuration-view.h
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
......@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GBP_BUILD_CONFIGURATION_VIEW_H
#define GBP_BUILD_CONFIGURATION_VIEW_H
#ifndef IDE_BUILD_CONFIGURATION_VIEW_H
#define IDE_BUILD_CONFIGURATION_VIEW_H
#include <ide.h>
......@@ -25,14 +25,14 @@
G_BEGIN_DECLS
#define GBP_TYPE_BUILD_CONFIGURATION_VIEW (gbp_build_configuration_view_get_type())
#define IDE_TYPE_BUILD_CONFIGURATION_VIEW (ide_build_configuration_view_get_type())
G_DECLARE_FINAL_TYPE (GbpBuildConfigurationView, gbp_build_configuration_view, GBP, BUILD_CONFIGURATION_VIEW, EggColumnLayout)
G_DECLARE_FINAL_TYPE (IdeBuildConfigurationView, ide_build_configuration_view, IDE, BUILD_CONFIGURATION_VIEW, EggColumnLayout)
IdeConfiguration *gbp_build_configuration_view_get_configuration (GbpBuildConfigurationView *self);
void gbp_build_configuration_view_set_configuration (GbpBuildConfigurationView *self,
IdeConfiguration