Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Copyright © 2011 Canonical Ltd.
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, but
0012  * 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 Public
0017  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Author: Ryan Lortie <desrt@desrt.ca>
0020  */
0021 
0022 #ifndef __G_MENU_H__
0023 #define __G_MENU_H__
0024 
0025 #include <gio/gmenumodel.h>
0026 
0027 G_BEGIN_DECLS
0028 
0029 #define G_TYPE_MENU          (g_menu_get_type ())
0030 #define G_MENU(inst)         (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
0031                               G_TYPE_MENU, GMenu))
0032 #define G_IS_MENU(inst)      (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
0033                               G_TYPE_MENU))
0034 
0035 #define G_TYPE_MENU_ITEM     (g_menu_item_get_type ())
0036 #define G_MENU_ITEM(inst)    (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
0037                               G_TYPE_MENU_ITEM, GMenuItem))
0038 #define G_IS_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
0039                               G_TYPE_MENU_ITEM))
0040 
0041 typedef struct _GMenuItem GMenuItem;
0042 typedef struct _GMenu     GMenu;
0043 
0044 GIO_AVAILABLE_IN_2_32
0045 GType       g_menu_get_type                         (void) G_GNUC_CONST;
0046 GIO_AVAILABLE_IN_2_32
0047 GMenu *     g_menu_new                              (void);
0048 
0049 GIO_AVAILABLE_IN_2_32
0050 void        g_menu_freeze                           (GMenu       *menu);
0051 
0052 GIO_AVAILABLE_IN_2_32
0053 void        g_menu_insert_item                      (GMenu       *menu,
0054                                                      gint         position,
0055                                                      GMenuItem   *item);
0056 GIO_AVAILABLE_IN_2_32
0057 void        g_menu_prepend_item                     (GMenu       *menu,
0058                                                      GMenuItem   *item);
0059 GIO_AVAILABLE_IN_2_32
0060 void        g_menu_append_item                      (GMenu       *menu,
0061                                                      GMenuItem   *item);
0062 GIO_AVAILABLE_IN_2_32
0063 void        g_menu_remove                           (GMenu       *menu,
0064                                                      gint         position);
0065 
0066 GIO_AVAILABLE_IN_2_38
0067 void        g_menu_remove_all                       (GMenu       *menu);
0068 
0069 GIO_AVAILABLE_IN_2_32
0070 void        g_menu_insert                           (GMenu       *menu,
0071                                                      gint         position,
0072                                                      const gchar *label,
0073                                                      const gchar *detailed_action);
0074 GIO_AVAILABLE_IN_2_32
0075 void        g_menu_prepend                          (GMenu       *menu,
0076                                                      const gchar *label,
0077                                                      const gchar *detailed_action);
0078 GIO_AVAILABLE_IN_2_32
0079 void        g_menu_append                           (GMenu       *menu,
0080                                                      const gchar *label,
0081                                                      const gchar *detailed_action);
0082 
0083 GIO_AVAILABLE_IN_2_32
0084 void        g_menu_insert_section                   (GMenu       *menu,
0085                                                      gint         position,
0086                                                      const gchar *label,
0087                                                      GMenuModel  *section);
0088 GIO_AVAILABLE_IN_2_32
0089 void        g_menu_prepend_section                  (GMenu       *menu,
0090                                                      const gchar *label,
0091                                                      GMenuModel  *section);
0092 GIO_AVAILABLE_IN_2_32
0093 void        g_menu_append_section                   (GMenu       *menu,
0094                                                      const gchar *label,
0095                                                      GMenuModel  *section);
0096 
0097 GIO_AVAILABLE_IN_2_32
0098 void        g_menu_insert_submenu                   (GMenu       *menu,
0099                                                      gint        position,
0100                                                      const gchar *label,
0101                                                      GMenuModel  *submenu);
0102 GIO_AVAILABLE_IN_2_32
0103 void        g_menu_prepend_submenu                  (GMenu       *menu,
0104                                                      const gchar *label,
0105                                                      GMenuModel  *submenu);
0106 GIO_AVAILABLE_IN_2_32
0107 void        g_menu_append_submenu                   (GMenu       *menu,
0108                                                      const gchar *label,
0109                                                      GMenuModel  *submenu);
0110 
0111 
0112 GIO_AVAILABLE_IN_2_32
0113 GType       g_menu_item_get_type                    (void) G_GNUC_CONST;
0114 GIO_AVAILABLE_IN_2_32
0115 GMenuItem * g_menu_item_new                         (const gchar *label,
0116                                                      const gchar *detailed_action);
0117 
0118 GIO_AVAILABLE_IN_2_34
0119 GMenuItem * g_menu_item_new_from_model              (GMenuModel  *model,
0120                                                      gint         item_index);
0121 
0122 GIO_AVAILABLE_IN_2_32
0123 GMenuItem * g_menu_item_new_submenu                 (const gchar *label,
0124                                                      GMenuModel  *submenu);
0125 
0126 GIO_AVAILABLE_IN_2_32
0127 GMenuItem * g_menu_item_new_section                 (const gchar *label,
0128                                                      GMenuModel  *section);
0129 
0130 GIO_AVAILABLE_IN_2_34
0131 GVariant *  g_menu_item_get_attribute_value         (GMenuItem   *menu_item,
0132                                                      const gchar *attribute,
0133                                                      const GVariantType *expected_type);
0134 GIO_AVAILABLE_IN_2_34
0135 gboolean    g_menu_item_get_attribute               (GMenuItem   *menu_item,
0136                                                      const gchar *attribute,
0137                                                      const gchar *format_string,
0138                                                      ...);
0139 GIO_AVAILABLE_IN_2_34
0140 GMenuModel *g_menu_item_get_link                    (GMenuItem   *menu_item,
0141                                                      const gchar *link);
0142 
0143 GIO_AVAILABLE_IN_2_32
0144 void        g_menu_item_set_attribute_value         (GMenuItem   *menu_item,
0145                                                      const gchar *attribute,
0146                                                      GVariant    *value);
0147 GIO_AVAILABLE_IN_2_32
0148 void        g_menu_item_set_attribute               (GMenuItem   *menu_item,
0149                                                      const gchar *attribute,
0150                                                      const gchar *format_string,
0151                                                      ...);
0152 GIO_AVAILABLE_IN_2_32
0153 void        g_menu_item_set_link                    (GMenuItem   *menu_item,
0154                                                      const gchar *link,
0155                                                      GMenuModel  *model);
0156 GIO_AVAILABLE_IN_2_32
0157 void        g_menu_item_set_label                   (GMenuItem   *menu_item,
0158                                                      const gchar *label);
0159 GIO_AVAILABLE_IN_2_32
0160 void        g_menu_item_set_submenu                 (GMenuItem   *menu_item,
0161                                                      GMenuModel  *submenu);
0162 GIO_AVAILABLE_IN_2_32
0163 void        g_menu_item_set_section                 (GMenuItem   *menu_item,
0164                                                      GMenuModel  *section);
0165 GIO_AVAILABLE_IN_2_32
0166 void        g_menu_item_set_action_and_target_value (GMenuItem   *menu_item,
0167                                                      const gchar *action,
0168                                                      GVariant    *target_value);
0169 GIO_AVAILABLE_IN_2_32
0170 void        g_menu_item_set_action_and_target       (GMenuItem   *menu_item,
0171                                                      const gchar *action,
0172                                                      const gchar *format_string,
0173                                                      ...);
0174 GIO_AVAILABLE_IN_2_32
0175 void        g_menu_item_set_detailed_action         (GMenuItem   *menu_item,
0176                                                      const gchar *detailed_action);
0177 
0178 GIO_AVAILABLE_IN_2_38
0179 void        g_menu_item_set_icon                    (GMenuItem   *menu_item,
0180                                                      GIcon       *icon);
0181 
0182 G_END_DECLS
0183 
0184 #endif /* __G_MENU_H__ */