/usr/include/gtkmm-2.4/gtkmm/menu_elems.h is in libgtkmm-2.4-dev 1:2.24.4-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | /* $Id$ */
#ifndef _GTKMM_MENU_ELEMS_H
#define _GTKMM_MENU_ELEMS_H
/* menu_elems.h
*
* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtkmm/container.h>
#include <gtkmm/menuitem.h>
#include <gtkmm/imagemenuitem.h>
#include <gtkmm/radiomenuitem.h>
#include <gtkmm/checkmenuitem.h>
#include <gtkmm/tearoffmenuitem.h>
#include <gtkmm/separatormenuitem.h>
#include <gtkmm/accelgroup.h>
#include <gtkmm/accelkey.h>
#include <gdk/gdkkeysyms.h>
namespace Gtk
{
class Menu;
namespace Menu_Helpers
{
// input class (MenuItem-Factory)
class Element
{
public:
typedef sigc::slot<void> CallSlot;
Element();
Element(MenuItem& child);
~Element();
const Glib::RefPtr<MenuItem>& get_child() const;
protected:
void set_child(MenuItem* pChild);
void set_accel_key(const AccelKey& accel_key);
//We use a RefPtr to avoid leaks when the manage()d widget never gets added to a container.
//TODO: RefPtr is probably meant only for use with a create() method - see the extra reference() in set_child().
Glib::RefPtr<MenuItem> child_;
};
/** Use this class and its subclasses to build menu items.
* For example,
* @code
* m_Menu_File.items().push_back( Gtk::Menu_Helpers::MenuElem("_New",
* sigc::mem_fun(*this, &ExampleWindow::on_menu_file_new) ) );
* @endcode
*
* @ingroup Menus
*/
class MenuElem : public Element
{
public:
MenuElem(MenuItem& child);
/** Create a labeled, non-accelerated MenuItem with a sigc::slot
* @param label The menu item's name
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
MenuElem(const Glib::ustring& label, const CallSlot& slot = CallSlot());
/** Create a labeled, accelerated MenuItem with a sigc::slot
* @param label The menu item's name
* @param key The accelerator key combination
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
MenuElem(const Glib::ustring& label, const AccelKey& key,
const CallSlot& slot = CallSlot());
/** Create a labeled, non-accelerated MenuItem with a submenu
* @param label The menu item's name
* @param submenu The sub menu
*/
MenuElem(const Glib::ustring& label, Gtk::Menu& submenu);
/** Create a labeled, accelerated MenuItem with a submenu
* @param label The menu item's name
* @param key The accelerator key combination
* @param submenu The sub menu
*/
MenuElem(const Glib::ustring& label,
const AccelKey& key,
Gtk::Menu& submenu);
};
class SeparatorElem : public Element
{
public:
SeparatorElem();
};
class ImageMenuElem : public Element
{
public:
ImageMenuElem(ImageMenuItem& child);
/** Create a labeled, non-accelerated MenuItem with a sigc::slot
* @param label The menu item's name
* @param image_widget The image
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
ImageMenuElem(const Glib::ustring& label,
Gtk::Widget& image_widget,
const CallSlot& slot = CallSlot());
/** Create a labeled, accelerated MenuItem with a sigc::slot
* @param label The menu item's name
* @param key The accelerator key combination
* @param image_widget The image
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
ImageMenuElem(const Glib::ustring& label, const AccelKey& key,
Gtk::Widget& image_widget,
const CallSlot& slot = CallSlot());
/** Create a labeled, non-accelerated MenuItem with a submenu
* @param label The menu item's name
* @param image_widget The image
* @param submenu The sub menu
*/
ImageMenuElem(const Glib::ustring& label,
Gtk::Widget& image_widget,
Gtk::Menu& submenu);
/** Create a labeled, accelerated MenuItem with a submenu
* @param label The menu item's name
* @param key The accelerator key combination
* @param image_widget The image
* @param submenu The sub menu
*/
ImageMenuElem(const Glib::ustring& label, const AccelKey& key,
Gtk::Widget& image_widget,
Gtk::Menu& submenu);
};
class StockMenuElem : public Element
{
public:
/** Create a non-accelerated MenuItem from a stock item
* @param stock_id The ID of the stock item
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
StockMenuElem(const Gtk::StockID& stock_id,
const CallSlot& slot = CallSlot());
/** Create an accelerated MenuItem from a stock item
* @param stock_id The ID of the stock item
* @param key The accelerator key combination
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
StockMenuElem(const Gtk::StockID& stock_id,
const AccelKey& key,
const CallSlot& slot = CallSlot());
/** Create a non-accelerated MenuItem from a stock item with a submenu
* @param stock_id The ID of the stock item
* @param submenu The sub menu
*/
StockMenuElem(const Gtk::StockID& stock_id,
Gtk::Menu& submenu);
/** Create an accelerated MenuItem from a stock item with a submenu
* @param stock_id The ID of the stock item
* @param key The accelerator key combination
* @param submenu The sub menu
*/
StockMenuElem(const Gtk::StockID& stock_id,
const AccelKey& key,
Gtk::Menu& submenu);
};
class CheckMenuElem : public Element
{
public:
CheckMenuElem(CheckMenuItem& child);
/** Create a labeled, non-accelerated MenuItem with a sigc::slot
* @param label The menu item's name
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
CheckMenuElem(const Glib::ustring& label, const CallSlot& slot = CallSlot());
/** Create a labeled, accelerated CheckMenuItem with a sigc::slot
* @param label The menu item's name
* @param key The accelerator key combination
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
CheckMenuElem(const Glib::ustring& label, const AccelKey& key,
const CallSlot& slot = CallSlot());
};
class RadioMenuElem : public Element
{
public:
RadioMenuElem(RadioMenuItem& child);
/** Create a labeled, non-accelerated MenuItem with a sigc::slot
* @param label The menu item's name
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
RadioMenuElem(RadioMenuItem::Group&, const Glib::ustring& label,
const CallSlot& slot = CallSlot());
/** Create a labeled, accelerated CheckMenuItem with a sigc::slot
* @param group The RadioMenuItem group in which to put this.
* @param label The menu item's name
* @param key The accelerator key combination
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
RadioMenuElem(RadioMenuItem::Group& group, const Glib::ustring& label,
const AccelKey& key,
const CallSlot& slot = CallSlot());
protected:
RadioMenuItem::Group* gr_;
};
class TearoffMenuElem : public Element
{
public:
TearoffMenuElem(TearoffMenuItem& child);
/** Create a non-accelerated TearoffMenuItem with a sigc::slot
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
TearoffMenuElem(const CallSlot& slot = CallSlot());
/** Create accelerated TearoffMenuItem with a sigc::slot
* @param key The accelerator key combination
* @param slot Use sigc::mem_fun() to specify a signal handler
*/
TearoffMenuElem(const AccelKey& key,
const CallSlot& slot = CallSlot());
};
} /* namespace Menu_Helpers */
} /* namespace Gtk */
#endif //_GTKMM_MENU_ELEMS_H
|