Back to index

libunity  5.92.0
Classes | Defines | Enumerations | Functions | Variables
unity-lens-search.c File Reference
#include <glib.h>
#include <glib-object.h>
#include "unity.h"
#include <stdlib.h>
#include <string.h>
#include <dee.h>

Go to the source code of this file.

Classes

struct  _UnityLensSearchPrivate

Defines

#define _g_free0(var)   (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var)   ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var)   ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define UNITY_LENS_SEARCH_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_LENS_SEARCH, UnityLensSearchPrivate))

Enumerations

enum  { UNITY_LENS_SEARCH_DUMMY_PROPERTY, UNITY_LENS_SEARCH_SEARCH_STRING, UNITY_LENS_SEARCH_HINTS, UNITY_LENS_SEARCH_RESULTS_MODEL }

Functions

gboolean unity_lens_search_was_finished (UnityLensSearch *self)
static void _g_free0_ (gpointer var)
static void _g_variant_unref0_ (gpointer var)
GHashTable * unity_lens_search_get_reply_hints (UnityLensSearch *self)
static GObject * unity_lens_search_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties)
static void _unity_lens_search___lambda3_ (UnityLensSearch *self)
static void __unity_lens_search___lambda3__unity_lens_search_finished (UnityLensSearch *_sender, gpointer self)
static void unity_lens_search_finalize (GObject *obj)
static void _vala_unity_lens_search_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
static void _vala_unity_lens_search_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
void unity_lens_search_finished (UnityLensSearch *self)
UnityLensSearch * unity_lens_search_construct (GType object_type, const gchar *search_string, GHashTable *hints, DeeSerializableModel *results_model)
UnityLensSearch * unity_lens_search_new (const gchar *search_string, GHashTable *hints, DeeSerializableModel *results_model)
gboolean unity_lens_search_equals (UnityLensSearch *self, UnityLensSearch *other)
static gpointer _g_variant_ref0 (gpointer self)
void unity_lens_search_set_reply_hint (UnityLensSearch *self, const gchar *key, GVariant *variant)
static gpointer _g_hash_table_ref0 (gpointer self)
const gchar * unity_lens_search_get_search_string (UnityLensSearch *self)
static void unity_lens_search_set_search_string (UnityLensSearch *self, const gchar *value)
GHashTable * unity_lens_search_get_hints (UnityLensSearch *self)
static void unity_lens_search_set_hints (UnityLensSearch *self, GHashTable *value)
DeeSerializableModel * unity_lens_search_get_results_model (UnityLensSearch *self)
static gpointer _g_object_ref0 (gpointer self)
static void unity_lens_search_set_results_model (UnityLensSearch *self, DeeSerializableModel *value)
static void unity_lens_search_class_init (UnityLensSearchClass *klass)
static void unity_lens_search_instance_init (UnityLensSearch *self)
GType unity_lens_search_get_type (void)

Variables

static gpointer unity_lens_search_parent_class = NULL

Class Documentation

struct _UnityLensSearchPrivate

Definition at line 35 of file unity-lens-search.c.

Class Members
GHashTable * _hints
GHashTable * _reply_hints
DeeSerializableModel * _results_model
gchar * _search_string
gboolean got_finished

Define Documentation

#define _g_free0 (   var)    (var = (g_free (var), NULL))

Definition at line 31 of file unity-lens-search.c.

#define _g_hash_table_unref0 (   var)    ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

Definition at line 32 of file unity-lens-search.c.

#define _g_object_unref0 (   var)    ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

Definition at line 33 of file unity-lens-search.c.

#define UNITY_LENS_SEARCH_GET_PRIVATE (   o)    (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_LENS_SEARCH, UnityLensSearchPrivate))

Definition at line 46 of file unity-lens-search.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
UNITY_LENS_SEARCH_DUMMY_PROPERTY 
UNITY_LENS_SEARCH_SEARCH_STRING 
UNITY_LENS_SEARCH_HINTS 
UNITY_LENS_SEARCH_RESULTS_MODEL 

Definition at line 47 of file unity-lens-search.c.


Function Documentation

static void __unity_lens_search___lambda3__unity_lens_search_finished ( UnityLensSearch *  _sender,
gpointer  self 
) [static]

Definition at line 268 of file unity-lens-search.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void _g_free0_ ( gpointer  var) [static]

Definition at line 130 of file unity-lens-search.c.

                                     {
       var = (g_free (var), NULL);
}

Here is the caller graph for this function:

static gpointer _g_hash_table_ref0 ( gpointer  self) [static]

Definition at line 175 of file unity-lens-search.c.

                                                   {
       return self ? g_hash_table_ref (self) : NULL;
}

Here is the caller graph for this function:

static gpointer _g_object_ref0 ( gpointer  self) [static]

Definition at line 246 of file unity-lens-search.c.

                                               {
       return self ? g_object_ref (self) : NULL;
}

Here is the caller graph for this function:

static gpointer _g_variant_ref0 ( gpointer  self) [static]

Definition at line 140 of file unity-lens-search.c.

                                                {
       return self ? g_variant_ref (self) : NULL;
}

Here is the caller graph for this function:

static void _g_variant_unref0_ ( gpointer  var) [static]

Definition at line 135 of file unity-lens-search.c.

                                              {
       (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}

Here is the caller graph for this function:

static void _unity_lens_search___lambda3_ ( UnityLensSearch *  self) [static]

Definition at line 263 of file unity-lens-search.c.

                                                                  {
       self->priv->got_finished = TRUE;
}

Here is the caller graph for this function:

static void _vala_unity_lens_search_get_property ( GObject *  object,
guint  property_id,
GValue *  value,
GParamSpec *  pspec 
) [static]

Definition at line 329 of file unity-lens-search.c.

                                                                                                                           {
       UnityLensSearch * self;
       self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_LENS_SEARCH, UnityLensSearch);
       switch (property_id) {
              case UNITY_LENS_SEARCH_SEARCH_STRING:
              g_value_set_string (value, unity_lens_search_get_search_string (self));
              break;
              case UNITY_LENS_SEARCH_HINTS:
              g_value_set_boxed (value, unity_lens_search_get_hints (self));
              break;
              case UNITY_LENS_SEARCH_RESULTS_MODEL:
              g_value_set_object (value, unity_lens_search_get_results_model (self));
              break;
              default:
              G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
              break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void _vala_unity_lens_search_set_property ( GObject *  object,
guint  property_id,
const GValue *  value,
GParamSpec *  pspec 
) [static]

Definition at line 349 of file unity-lens-search.c.

                                                                                                                                 {
       UnityLensSearch * self;
       self = G_TYPE_CHECK_INSTANCE_CAST (object, UNITY_TYPE_LENS_SEARCH, UnityLensSearch);
       switch (property_id) {
              case UNITY_LENS_SEARCH_SEARCH_STRING:
              unity_lens_search_set_search_string (self, g_value_get_string (value));
              break;
              case UNITY_LENS_SEARCH_HINTS:
              unity_lens_search_set_hints (self, g_value_get_boxed (value));
              break;
              case UNITY_LENS_SEARCH_RESULTS_MODEL:
              unity_lens_search_set_results_model (self, g_value_get_object (value));
              break;
              default:
              G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
              break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_lens_search_class_init ( UnityLensSearchClass *  klass) [static]

Definition at line 285 of file unity-lens-search.c.

                                                                        {
       unity_lens_search_parent_class = g_type_class_peek_parent (klass);
       g_type_class_add_private (klass, sizeof (UnityLensSearchPrivate));
       G_OBJECT_CLASS (klass)->get_property = _vala_unity_lens_search_get_property;
       G_OBJECT_CLASS (klass)->set_property = _vala_unity_lens_search_set_property;
       G_OBJECT_CLASS (klass)->constructor = unity_lens_search_constructor;
       G_OBJECT_CLASS (klass)->finalize = unity_lens_search_finalize;
       g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_SEARCH_SEARCH_STRING, g_param_spec_string ("search-string", "search-string", "search-string", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
       g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_SEARCH_HINTS, g_param_spec_boxed ("hints", "hints", "hints", G_TYPE_HASH_TABLE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
       g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_SEARCH_RESULTS_MODEL, g_param_spec_object ("results-model", "results-model", "results-model", dee_serializable_model_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
       g_signal_new ("finished", UNITY_TYPE_LENS_SEARCH, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

UnityLensSearch* unity_lens_search_construct ( GType  object_type,
const gchar *  search_string,
GHashTable *  hints,
DeeSerializableModel *  results_model 
)

Definition at line 71 of file unity-lens-search.c.

                                                                                                                                                     {
       UnityLensSearch * self = NULL;
       const gchar* _tmp0_;
       GHashTable* _tmp1_;
       DeeSerializableModel* _tmp2_;
       g_return_val_if_fail (search_string != NULL, NULL);
       g_return_val_if_fail (hints != NULL, NULL);
       g_return_val_if_fail (results_model != NULL, NULL);
       _tmp0_ = search_string;
       _tmp1_ = hints;
       _tmp2_ = results_model;
       self = (UnityLensSearch*) g_object_new (object_type, "search-string", _tmp0_, "hints", _tmp1_, "results-model", _tmp2_, NULL);
       return self;
}

Here is the caller graph for this function:

static GObject * unity_lens_search_constructor ( GType  type,
guint  n_construct_properties,
GObjectConstructParam *  construct_properties 
) [static]

Definition at line 273 of file unity-lens-search.c.

                                                                                                                                        {
       GObject * obj;
       GObjectClass * parent_class;
       UnityLensSearch * self;
       parent_class = G_OBJECT_CLASS (unity_lens_search_parent_class);
       obj = parent_class->constructor (type, n_construct_properties, construct_properties);
       self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_LENS_SEARCH, UnityLensSearch);
       g_signal_connect_object (self, "finished", (GCallback) __unity_lens_search___lambda3__unity_lens_search_finished, self, 0);
       return obj;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean unity_lens_search_equals ( UnityLensSearch *  self,
UnityLensSearch *  other 
)

Definition at line 102 of file unity-lens-search.c.

                                                                                  {
       gboolean result = FALSE;
       gboolean _tmp0_ = FALSE;
       UnityLensSearch* _tmp1_;
       gboolean _tmp5_;
       g_return_val_if_fail (self != NULL, FALSE);
       _tmp1_ = other;
       if (_tmp1_ == NULL) {
              _tmp0_ = TRUE;
       } else {
              const gchar* _tmp2_;
              UnityLensSearch* _tmp3_;
              const gchar* _tmp4_;
              _tmp2_ = self->priv->_search_string;
              _tmp3_ = other;
              _tmp4_ = _tmp3_->priv->_search_string;
              _tmp0_ = g_strcmp0 (_tmp2_, _tmp4_) != 0;
       }
       _tmp5_ = _tmp0_;
       if (_tmp5_) {
              result = FALSE;
              return result;
       }
       result = TRUE;
       return result;
}

Here is the caller graph for this function:

static void unity_lens_search_finalize ( GObject *  obj) [static]

Definition at line 306 of file unity-lens-search.c.

                                                      {
       UnityLensSearch * self;
       self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TYPE_LENS_SEARCH, UnityLensSearch);
       _g_free0 (self->priv->_search_string);
       _g_hash_table_unref0 (self->priv->_hints);
       _g_object_unref0 (self->priv->_results_model);
       _g_hash_table_unref0 (self->priv->_reply_hints);
       G_OBJECT_CLASS (unity_lens_search_parent_class)->finalize (obj);
}

Here is the caller graph for this function:

void unity_lens_search_finished ( UnityLensSearch *  self)

Definition at line 65 of file unity-lens-search.c.

                                                        {
       g_return_if_fail (self != NULL);
       g_signal_emit_by_name (self, "finished");
}
GHashTable* unity_lens_search_get_hints ( UnityLensSearch *  self)

Definition at line 214 of file unity-lens-search.c.

                                                                {
       GHashTable* result;
       GHashTable* _tmp0_;
       g_return_val_if_fail (self != NULL, NULL);
       _tmp0_ = self->priv->_hints;
       result = _tmp0_;
       return result;
}

Here is the caller graph for this function:

GHashTable* unity_lens_search_get_reply_hints ( UnityLensSearch *  self)

Definition at line 180 of file unity-lens-search.c.

                                                                      {
       GHashTable* result = NULL;
       GHashTable* _tmp0_;
       GHashTable* _tmp1_;
       g_return_val_if_fail (self != NULL, NULL);
       _tmp0_ = self->priv->_reply_hints;
       _tmp1_ = _g_hash_table_ref0 (_tmp0_);
       result = _tmp1_;
       return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

DeeSerializableModel* unity_lens_search_get_results_model ( UnityLensSearch *  self)

Definition at line 236 of file unity-lens-search.c.

                                                                                  {
       DeeSerializableModel* result;
       DeeSerializableModel* _tmp0_;
       g_return_val_if_fail (self != NULL, NULL);
       _tmp0_ = self->priv->_results_model;
       result = _tmp0_;
       return result;
}

Here is the caller graph for this function:

const gchar* unity_lens_search_get_search_string ( UnityLensSearch *  self)

Definition at line 192 of file unity-lens-search.c.

                                                                         {
       const gchar* result;
       const gchar* _tmp0_;
       g_return_val_if_fail (self != NULL, NULL);
       _tmp0_ = self->priv->_search_string;
       result = _tmp0_;
       return result;
}

Here is the caller graph for this function:

GType unity_lens_search_get_type ( void  )

Definition at line 317 of file unity-lens-search.c.

                                        {
       static volatile gsize unity_lens_search_type_id__volatile = 0;
       if (g_once_init_enter (&unity_lens_search_type_id__volatile)) {
              static const GTypeInfo g_define_type_info = { sizeof (UnityLensSearchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_lens_search_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityLensSearch), 0, (GInstanceInitFunc) unity_lens_search_instance_init, NULL };
              GType unity_lens_search_type_id;
              unity_lens_search_type_id = g_type_register_static (G_TYPE_INITIALLY_UNOWNED, "UnityLensSearch", &g_define_type_info, 0);
              g_once_init_leave (&unity_lens_search_type_id__volatile, unity_lens_search_type_id);
       }
       return unity_lens_search_type_id__volatile;
}

Here is the call graph for this function:

static void unity_lens_search_instance_init ( UnityLensSearch *  self) [static]

Definition at line 299 of file unity-lens-search.c.

                                                                     {
       self->priv = UNITY_LENS_SEARCH_GET_PRIVATE (self);
       self->priv->got_finished = FALSE;
       self->priv->_reply_hints = NULL;
}

Here is the caller graph for this function:

UnityLensSearch* unity_lens_search_new ( const gchar *  search_string,
GHashTable *  hints,
DeeSerializableModel *  results_model 
)

Definition at line 87 of file unity-lens-search.c.

                                                                                                                            {
       return unity_lens_search_construct (UNITY_TYPE_LENS_SEARCH, search_string, hints, results_model);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_lens_search_set_hints ( UnityLensSearch *  self,
GHashTable *  value 
) [static]

Definition at line 224 of file unity-lens-search.c.

                                                                                   {
       GHashTable* _tmp0_;
       GHashTable* _tmp1_;
       g_return_if_fail (self != NULL);
       _tmp0_ = value;
       _tmp1_ = _g_hash_table_ref0 (_tmp0_);
       _g_hash_table_unref0 (self->priv->_hints);
       self->priv->_hints = _tmp1_;
       g_object_notify ((GObject *) self, "hints");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity_lens_search_set_reply_hint ( UnityLensSearch *  self,
const gchar *  key,
GVariant *  variant 
)

Definition at line 145 of file unity-lens-search.c.

                                                                                                   {
       GHashTable* _tmp0_;
       GHashTable* _tmp4_;
       const gchar* _tmp5_;
       gchar* _tmp6_;
       GVariant* _tmp7_;
       GVariant* _tmp8_;
       g_return_if_fail (self != NULL);
       g_return_if_fail (key != NULL);
       g_return_if_fail (variant != NULL);
       _tmp0_ = self->priv->_reply_hints;
       if (_tmp0_ == NULL) {
              GHashFunc _tmp1_;
              GEqualFunc _tmp2_;
              GHashTable* _tmp3_;
              _tmp1_ = g_str_hash;
              _tmp2_ = g_str_equal;
              _tmp3_ = g_hash_table_new_full (_tmp1_, _tmp2_, _g_free0_, _g_variant_unref0_);
              _g_hash_table_unref0 (self->priv->_reply_hints);
              self->priv->_reply_hints = _tmp3_;
       }
       _tmp4_ = self->priv->_reply_hints;
       _tmp5_ = key;
       _tmp6_ = g_strdup (_tmp5_);
       _tmp7_ = variant;
       _tmp8_ = _g_variant_ref0 (_tmp7_);
       g_hash_table_insert (_tmp4_, _tmp6_, _tmp8_);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_lens_search_set_results_model ( UnityLensSearch *  self,
DeeSerializableModel *  value 
) [static]

Definition at line 251 of file unity-lens-search.c.

                                                                                                     {
       DeeSerializableModel* _tmp0_;
       DeeSerializableModel* _tmp1_;
       g_return_if_fail (self != NULL);
       _tmp0_ = value;
       _tmp1_ = _g_object_ref0 (_tmp0_);
       _g_object_unref0 (self->priv->_results_model);
       self->priv->_results_model = _tmp1_;
       g_object_notify ((GObject *) self, "results-model");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_lens_search_set_search_string ( UnityLensSearch *  self,
const gchar *  value 
) [static]

Definition at line 202 of file unity-lens-search.c.

                                                                                            {
       const gchar* _tmp0_;
       gchar* _tmp1_;
       g_return_if_fail (self != NULL);
       _tmp0_ = value;
       _tmp1_ = g_strdup (_tmp0_);
       _g_free0 (self->priv->_search_string);
       self->priv->_search_string = _tmp1_;
       g_object_notify ((GObject *) self, "search-string");
}

Here is the caller graph for this function:

gboolean unity_lens_search_was_finished ( UnityLensSearch *  self)

Definition at line 92 of file unity-lens-search.c.

                                                                {
       gboolean result = FALSE;
       gboolean _tmp0_;
       g_return_val_if_fail (self != NULL, FALSE);
       _tmp0_ = self->priv->got_finished;
       result = _tmp0_;
       return result;
}

Here is the caller graph for this function:


Variable Documentation

gpointer unity_lens_search_parent_class = NULL [static]

Definition at line 44 of file unity-lens-search.c.