| 85 }; |
85 }; |
| 86 |
86 |
| 87 G_BEGIN_DECLS |
87 G_BEGIN_DECLS |
| 88 |
88 |
| 89 /** |
89 /** |
| 90 * @return GType for GntMenuItem. |
90 * Returns: GType for GntMenuItem. |
| 91 */ |
91 */ |
| 92 GType gnt_menuitem_get_gtype(void); |
92 GType gnt_menuitem_get_gtype(void); |
| 93 |
93 |
| 94 /** |
94 /** |
| 95 * Create a new menuitem. |
95 * Create a new menuitem. |
| 96 * |
96 * |
| 97 * @param text Label for the menuitem. |
97 * @text: Label for the menuitem. |
| 98 * |
98 * |
| 99 * @return The newly created menuitem. |
99 * Returns: The newly created menuitem. |
| 100 */ |
100 */ |
| 101 GntMenuItem * gnt_menuitem_new(const char *text); |
101 GntMenuItem * gnt_menuitem_new(const char *text); |
| 102 |
102 |
| 103 /** |
103 /** |
| 104 * Set a callback function for a menuitem. |
104 * Set a callback function for a menuitem. |
| 105 * |
105 * |
| 106 * @param item The menuitem. |
106 * @item: The menuitem. |
| 107 * @param callback The callback function. |
107 * @callback: The callback function. |
| 108 * @param data Data to send to the callback function. |
108 * @data: Data to send to the callback function. |
| 109 */ |
109 */ |
| 110 void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data); |
110 void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data); |
| 111 |
111 |
| 112 /** |
112 /** |
| 113 * Set a submenu for a menuitem. A menuitem with a submenu cannot have a callback. |
113 * Set a submenu for a menuitem. A menuitem with a submenu cannot have a callback. |
| 114 * |
114 * |
| 115 * @param item The menuitem. |
115 * @item: The menuitem. |
| 116 * @param menu The submenu. |
116 * @menu: The submenu. |
| 117 */ |
117 */ |
| 118 void gnt_menuitem_set_submenu(GntMenuItem *item, GntMenu *menu); |
118 void gnt_menuitem_set_submenu(GntMenuItem *item, GntMenu *menu); |
| 119 |
119 |
| 120 /** |
120 /** |
| 121 * Get the submenu for a menuitem. |
121 * Get the submenu for a menuitem. |
| 122 * |
122 * |
| 123 * @param item The menuitem. |
123 * @item: The menuitem. |
| 124 * |
124 * |
| 125 * @return The submenu, or @c NULL. |
125 * Returns: The submenu, or @c NULL. |
| 126 * |
126 * |
| 127 * @since 2.3.0 |
127 * @since 2.3.0 |
| 128 */ |
128 */ |
| 129 GntMenu *gnt_menuitem_get_submenu(GntMenuItem *item); |
129 GntMenu *gnt_menuitem_get_submenu(GntMenuItem *item); |
| 130 |
130 |
| 131 /** |
131 /** |
| 132 * Set a trigger key for the item. |
132 * Set a trigger key for the item. |
| 133 * |
133 * |
| 134 * @param item The menuitem |
134 * @item: The menuitem |
| 135 * @param trigger The key that will trigger the item when the parent manu is visible |
135 * @trigger: The key that will trigger the item when the parent manu is visible |
| 136 */ |
136 */ |
| 137 void gnt_menuitem_set_trigger(GntMenuItem *item, char trigger); |
137 void gnt_menuitem_set_trigger(GntMenuItem *item, char trigger); |
| 138 |
138 |
| 139 /** |
139 /** |
| 140 * Get the trigger key for a menuitem. |
140 * Get the trigger key for a menuitem. |
| 141 * |
141 * |
| 142 * @param item The menuitem |
142 * @item: The menuitem |
| 143 * |
143 * |
| 144 * @return The trigger key for the menuitem. |
144 * Returns: The trigger key for the menuitem. |
| 145 * |
145 * |
| 146 * @see gnt_menuitem_set_trigger |
146 * @see gnt_menuitem_set_trigger |
| 147 */ |
147 */ |
| 148 char gnt_menuitem_get_trigger(GntMenuItem *item); |
148 char gnt_menuitem_get_trigger(GntMenuItem *item); |
| 149 |
149 |
| 150 /** |
150 /** |
| 151 * Set an ID for the menuitem. |
151 * Set an ID for the menuitem. |
| 152 * |
152 * |
| 153 * @param item The menuitem. |
153 * @item: The menuitem. |
| 154 * @param id The ID for the menuitem. |
154 * @id: The ID for the menuitem. |
| 155 * |
155 * |
| 156 * @since 2.3.0 |
156 * @since 2.3.0 |
| 157 */ |
157 */ |
| 158 void gnt_menuitem_set_id(GntMenuItem *item, const char *id); |
158 void gnt_menuitem_set_id(GntMenuItem *item, const char *id); |
| 159 |
159 |
| 160 /** |
160 /** |
| 161 * Get the ID of the menuitem. |
161 * Get the ID of the menuitem. |
| 162 * |
162 * |
| 163 * @param item The menuitem. |
163 * @item: The menuitem. |
| 164 * |
164 * |
| 165 * @return The ID for the menuitem. |
165 * Returns: The ID for the menuitem. |
| 166 * |
166 * |
| 167 * @since 2.3.0 |
167 * @since 2.3.0 |
| 168 */ |
168 */ |
| 169 const char * gnt_menuitem_get_id(GntMenuItem *item); |
169 const char * gnt_menuitem_get_id(GntMenuItem *item); |
| 170 |
170 |
| 171 /** |
171 /** |
| 172 * Activate a menuitem. |
172 * Activate a menuitem. |
| 173 * Activating the menuitem will first trigger the 'activate' signal for the |
173 * Activating the menuitem will first trigger the 'activate' signal for the |
| 174 * menuitem. Then the callback for the menuitem is triggered, if there is one. |
174 * menuitem. Then the callback for the menuitem is triggered, if there is one. |
| 175 * |
175 * |
| 176 * @param item The menuitem. |
176 * @item: The menuitem. |
| 177 * |
177 * |
| 178 * @return Whether the callback for the menuitem was called. |
178 * Returns: Whether the callback for the menuitem was called. |
| 179 * |
179 * |
| 180 * @since 2.3.0 |
180 * @since 2.3.0 |
| 181 */ |
181 */ |
| 182 gboolean gnt_menuitem_activate(GntMenuItem *item); |
182 gboolean gnt_menuitem_activate(GntMenuItem *item); |
| 183 |
183 |