<commit_before>/*
 * peas-activatable.h
 * This file is part of libpeas
 *
 * Copyright (C) 2010 <NAME>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Library 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 Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "peas-activatable.h"

/**
 * SECTION:peas-activatable
 * @short_description: Interface for activatable extensions
 * @see_also: #PeasExtensionSet
 *
 * #PeasActivatable is an interface which should be implemented by extensions
 * that should be activated on an object of a certain type (depending on the
 * application). For instance, in a typical windowed application,
 * #PeasActivatable extension instances could be bound to individual toplevel
 * windows.
 *
 * It is typical to use #PeasActivatable along with #PeasExtensionSet in order
 * to activate and deactivate extensions automatically when plugins are loaded
 * or unloaded.
 *
 * You can also use the code of this interface as a base for your own
 * extension types, as illustrated by gedit's #GeditWindowActivatable and
 * #GeditDocumentActivatable interfaces.
 **/

G_DEFINE_INTERFACE(PeasActivatable, peas_activatable, G_TYPE_OBJECT)

void
peas_activatable_default_init (PeasActivatableInterface *iface)
{
  /**
   * PeasActivatable:object:
   *
   * The object property contains the targetted object for this
   * #PeasActivatable instance, for example a toplevel window in a typical
   * windowed application. It is set at construction time and won't change.
   */
  g_object_interface_install_property (iface,
                                       g_param_spec_object ("object",
                                                            "Object",
                                                            "Object",
                                                            G_TYPE_OBJECT,
                                                            G_PARAM_READWRITE |
                                                            G_PARAM_CONSTRUCT_ONLY |
                                                            G_PARAM_STATIC_STRINGS));
}

/**
 * peas_activatable_activate:
 * @activatable: A #PeasActivatable.
 *
 * Activates the extension on the targetted object.<commit_msg>Install the property just once.<commit_after>/*
 * peas-activatable.h
 * This file is part of libpeas
 *
 * Copyright (C) 2010 <NAME>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Library 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 Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "peas-activatable.h"

/**
 * SECTION:peas-activatable
 * @short_description: Interface for activatable extensions
 * @see_also: #PeasExtensionSet
 *
 * #PeasActivatable is an interface which should be implemented by extensions
 * that should be activated on an object of a certain type (depending on the
 * application). For instance, in a typical windowed application,
 * #PeasActivatable extension instances could be bound to individual toplevel
 * windows.
 *
 * It is typical to use #PeasActivatable along with #PeasExtensionSet in order
 * to activate and deactivate extensions automatically when plugins are loaded
 * or unloaded.
 *
 * You can also use the code of this interface as a base for your own
 * extension types, as illustrated by gedit's #GeditWindowActivatable and
 * #GeditDocumentActivatable interfaces.
 **/

G_DEFINE_INTERFACE(PeasActivatable, peas_activatable, G_TYPE_OBJECT)

void
peas_activatable_default_init (PeasActivatableInterface *iface)
{
  static gboolean initialized = FALSE;

  if (!initialized)
    {
      /**
       * PeasActivatable:object:
       *
       * The object property contains the targetted object for this
       * #PeasActivatable instance, for example a toplevel window in a typical
       * windowed application. It is set at construction time and won't change.
       */
      g_object_interface_install_property (iface,
                                           g_param_spec_object ("object",
                                                                "Object",
                                                                "Object",
                                                                G_TYPE_OBJECT,
                                                                G_PARAM_READWRITE |
                                                                G_PARAM_CONSTRUCT_ONLY |
                                                                G_PARAM_STATIC_STRINGS));
    }
}

/**
 * peas_activatable_activate:
 * @activatable: A #PeasActivatable.
 *
 * Activates the extension on the targetted object.
{'fraction_non_alphanumeric': 0.05798575788402848, 'fraction_numerical': 0.006442861987114276, 'mean_word_length': 2.2808676307007785, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 27, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3485347', 'n_tokens_mistral': 1439, 'n_tokens_neox': 1401, 'n_words': 593}