Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:54

0001 /*
0002  * Copyright © 2010 Codethink Limited
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General
0017  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Authors: Ryan Lortie <desrt@desrt.ca>
0020  */
0021 
0022 #ifndef __G_ACTION_H__
0023 #define __G_ACTION_H__
0024 
0025 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0026 #error "Only <gio/gio.h> can be included directly."
0027 #endif
0028 
0029 #include <gio/giotypes.h>
0030 
0031 G_BEGIN_DECLS
0032 
0033 #define G_TYPE_ACTION                                       (g_action_get_type ())
0034 #define G_ACTION(inst)                                      (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
0035                                                              G_TYPE_ACTION, GAction))
0036 #define G_IS_ACTION(inst)                                   (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_ACTION))
0037 #define G_ACTION_GET_IFACE(inst)                            (G_TYPE_INSTANCE_GET_INTERFACE ((inst),                  \
0038                                                              G_TYPE_ACTION, GActionInterface))
0039 
0040 typedef struct _GActionInterface                            GActionInterface;
0041 
0042 struct _GActionInterface
0043 {
0044   GTypeInterface g_iface;
0045 
0046   /* virtual functions */
0047   const gchar *        (* get_name)             (GAction  *action);
0048   const GVariantType * (* get_parameter_type)   (GAction  *action);
0049   const GVariantType * (* get_state_type)       (GAction  *action);
0050   GVariant *           (* get_state_hint)       (GAction  *action);
0051 
0052   gboolean             (* get_enabled)          (GAction  *action);
0053   GVariant *           (* get_state)            (GAction  *action);
0054 
0055   void                 (* change_state)         (GAction  *action,
0056                                                  GVariant *value);
0057   void                 (* activate)             (GAction  *action,
0058                                                  GVariant *parameter);
0059 };
0060 
0061 GIO_AVAILABLE_IN_2_30
0062 GType                   g_action_get_type                               (void) G_GNUC_CONST;
0063 
0064 GIO_AVAILABLE_IN_ALL
0065 const gchar *           g_action_get_name                               (GAction            *action);
0066 GIO_AVAILABLE_IN_ALL
0067 const GVariantType *    g_action_get_parameter_type                     (GAction            *action);
0068 GIO_AVAILABLE_IN_ALL
0069 const GVariantType *    g_action_get_state_type                         (GAction            *action);
0070 GIO_AVAILABLE_IN_ALL
0071 GVariant *              g_action_get_state_hint                         (GAction            *action);
0072 
0073 GIO_AVAILABLE_IN_ALL
0074 gboolean                g_action_get_enabled                            (GAction            *action);
0075 GIO_AVAILABLE_IN_ALL
0076 GVariant *              g_action_get_state                              (GAction            *action);
0077 
0078 GIO_AVAILABLE_IN_ALL
0079 void                    g_action_change_state                           (GAction            *action,
0080                                                                          GVariant           *value);
0081 GIO_AVAILABLE_IN_ALL
0082 void                    g_action_activate                               (GAction            *action,
0083                                                                          GVariant           *parameter);
0084 
0085 GIO_AVAILABLE_IN_2_28
0086 gboolean                g_action_name_is_valid                          (const gchar        *action_name);
0087 
0088 GIO_AVAILABLE_IN_2_38
0089 gboolean                g_action_parse_detailed_name                    (const gchar        *detailed_name,
0090                                                                          gchar             **action_name,
0091                                                                          GVariant          **target_value,
0092                                                                          GError            **error);
0093 
0094 GIO_AVAILABLE_IN_2_38
0095 gchar *                 g_action_print_detailed_name                    (const gchar        *action_name,
0096                                                                          GVariant           *target_value);
0097 
0098 G_END_DECLS
0099 
0100 #endif /* __G_ACTION_H__ */