~ubuntu-branches/ubuntu/raring/almanah/raring-proposed

« back to all changes in this revision

Viewing changes to src/widgets/font-style-menu-action.c

  • Committer: Package Import Robot
  • Author(s): Angel Abad
  • Date: 2012-10-29 10:14:18 UTC
  • mfrom: (1.4.1) (10.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20121029101418-k2c27xb0aku22zeg
Tags: 0.10.0-1~exp1
* Imported Upstream version 0.10.0
* debian/control:
  - Bump evolution Build-Depends ( >=3.6.0)
  - debian/control: Depends on evolution-common (>= 3.6.0)
* Bump Standards-Version to 3.9.4 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
2
/*
 
3
 * Almanah
 
4
 * Copyright (C) Álvaro Peña 2011 <alvaropg@gmail.com>
 
5
 *
 
6
 * Almanah is free software: you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation, either version 3 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * Almanah is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with Almanah.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#include <gtk/gtk.h>
 
21
 
 
22
#include "font-style-menu-action.h"
 
23
 
 
24
G_DEFINE_TYPE (AlmanahFontStyleMenuAction, almanah_font_style_menu_action, GTK_TYPE_ACTION)
 
25
 
 
26
static void
 
27
almanah_font_style_menu_action_class_init (AlmanahFontStyleMenuActionClass *klass)
 
28
{
 
29
        GtkActionClass *action_class = GTK_ACTION_CLASS (klass);
 
30
 
 
31
        /* This class only has been created to allow a menu into a toolitem
 
32
         * in the data/almanah.ui file (see the unique toolbar) in the way
 
33
         * described in the GtkUIManager documentation ("Note that toolitem
 
34
         * elements may contain a menu element, but only if their associated
 
35
         * action specifies a GtkMenuToolButton as proxy")
 
36
         *
 
37
         * See: https://bugzilla.gnome.org/show_bug.cgi?id=590335
 
38
         */
 
39
        action_class->toolbar_item_type = GTK_TYPE_MENU_TOOL_BUTTON;
 
40
}
 
41
 
 
42
static void
 
43
almanah_font_style_menu_action_init (AlmanahFontStyleMenuAction *self)
 
44
{
 
45
}
 
46
 
 
47
GtkAction *
 
48
almanah_font_style_menu_action_new (const gchar *name, const gchar *label, const gchar *tooltip, const gchar *stock_id)
 
49
{
 
50
        g_return_val_if_fail (name != NULL, NULL);
 
51
 
 
52
        return g_object_new (ALMANAH_TYPE_FONT_STYLE_MENU_ACTION,
 
53
                             "name", name,
 
54
                             "label", label,
 
55
                             "tooltip", tooltip,
 
56
                             "stock-id", stock_id,
 
57
                             NULL);
 
58
}