X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgmenumodel.c;h=612f8e7aeb1bc11ac1991127d65cf60758418fae;hb=d9ad40b4eaf1a9197ab363de4346a8d84f45f5c1;hp=1affa6de672f99af166a71e51044b3580f3bdbe2;hpb=32747def4bb4cce7cfc4f0f8ba8560392ec9ad3d;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gmenumodel.c b/gio/gmenumodel.c index 1affa6d..612f8e7 100644 --- a/gio/gmenumodel.c +++ b/gio/gmenumodel.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. + * License along with this library; if not, see . * * Author: Ryan Lortie */ @@ -27,6 +25,7 @@ * SECTION:gmenumodel * @title: GMenuModel * @short_description: An abstract class representing the contents of a menu + * @include: gio/gio.h * @see_also: #GActionGroup * * #GMenuModel represents the contents of a menu -- an ordered list of @@ -44,39 +43,35 @@ * it (or, in the case of the 'root' menu, is defined by the context * in which it is used). * - * As an example, consider the visible portions of the menu in - * . + * As an example, consider the visible portions of this menu: * - * + * ## An example menu # {#menu-example} + * + * ![](menu-example.png) * * There are 8 "menus" visible in the screenshot: one menubar, two * submenus and 5 sections: - * - * the toplevel menubar (containing 4 items) - * the View submenu (containing 3 sections) - * the first section of the View submenu (containing 2 items) - * the second section of the View submenu (containing 1 item) - * the final section of the View submenu (containing 1 item) - * the Highlight Mode submenu (containing 2 sections) - * the Sources section (containing 2 items) - * the Markup section (containing 2 items) - * - * - * illustrates the conceptual connection between + * + * - the toplevel menubar (containing 4 items) + * - the View submenu (containing 3 sections) + * - the first section of the View submenu (containing 2 items) + * - the second section of the View submenu (containing 1 item) + * - the final section of the View submenu (containing 1 item) + * - the Highlight Mode submenu (containing 2 sections) + * - the Sources section (containing 2 items) + * - the Markup section (containing 2 items) + * + * The [example][menu-model] illustrates the conceptual connection between * these 8 menus. Each large block in the figure represents a menu and the * smaller blocks within the large block represent items in that menu. Some * items contain references to other menus. * - * + * ## A menu example # {#menu-model} * - * Notice that the separators visible in - * appear nowhere in . This is because + * ![](menu-model.png) + * + * Notice that the separators visible in the [example][menu-example] + * appear nowhere in the [menu model][menu-model]. This is because * separators are not explicitly represented in the menu model. Instead, * a separator is inserted between any two non-empty sections of a menu. * Section items can have labels just like any other item. In that case, @@ -87,12 +82,10 @@ * outside the application. Examples include global menus, jumplists, * dash boards, etc. To support such uses, it is necessary to 'export' * information about actions and their representation in menus, which - * is exactly what the - * GActionGroup exporter - * and the - * GMenuModel exporter - * do for #GActionGroup and #GMenuModel. The client-side counterparts - * to make use of the exported information are #GDBusActionGroup and + * is exactly what the [GActionGroup exporter][gio-GActionGroup-exporter] + * and the [GMenuModel exporter][gio-GMenuModel-exporter] do for + * #GActionGroup and #GMenuModel. The client-side counterparts to + * make use of the exported information are #GDBusActionGroup and * #GDBusMenuModel. * * The API of #GMenuModel is very generic, with iterators for the @@ -117,48 +110,37 @@ * While a wide variety of stateful actions is possible, the following * is the minimum that is expected to be supported by all users of exported * menu information: - * - * an action with no parameter type and no state - * an action with no parameter type and boolean state - * an action with string parameter type and string state - * - * - * Stateless - * + * - an action with no parameter type and no state + * - an action with no parameter type and boolean state + * - an action with string parameter type and string state + * + * ## Stateless + * * A stateless action typically corresponds to an ordinary menu item. - * - * + * * Selecting such a menu item will activate the action (with no parameter). - * - * * - * Boolean State - * + * ## Boolean State + * * An action with a boolean state will most typically be used with a "toggle" * or "switch" menu item. The state can be set directly, but activating the * action (with no parameter) results in the state being toggled. - * - * + * * Selecting a toggle menu item will activate the action. The menu item should * be rendered as "checked" when the state is true. - * - * * - * String Parameter and State - * + * ## String Parameter and State + * * Actions with string parameters and state will most typically be used to * represent an enumerated choice over the items available for a group of * radio menu items. Activating the action with a string parameter is * equivalent to setting that parameter as the state. - * - * + * * Radio menu items, in addition to being associated with the action, will * have a target value. Selecting that menu item will result in activation * of the action with the target value as the parameter. The menu item should * be rendered as "selected" when the state of the action is equal to the * target value of the menu item. - * - * */ /** @@ -589,7 +571,7 @@ g_menu_model_get_item_attribute_value (GMenuModel *model, * g_variant_get(), followed by a g_variant_unref(). As such, * @format_string must make a complete copy of the data (since the * #GVariant may go away after the call to g_variant_unref()). In - * particular, no '&' characters are allowed in @format_string. + * particular, no '&' characters are allowed in @format_string. * * Returns: %TRUE if the named attribute was found with the expected * type @@ -851,7 +833,7 @@ g_menu_attribute_iter_finalize (GObject *object) static void g_menu_attribute_iter_init (GMenuAttributeIter *iter) { - iter->priv = g_menu_attribute_iter_get_private (iter); + iter->priv = g_menu_attribute_iter_get_instance_private (iter); } static void @@ -1005,7 +987,7 @@ g_menu_link_iter_finalize (GObject *object) static void g_menu_link_iter_init (GMenuLinkIter *iter) { - iter->priv = g_menu_link_iter_get_private (iter); + iter->priv = g_menu_link_iter_get_instance_private (iter); } static void