* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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 <http://www.gnu.org/licenses/>.
*/
-/**
+/*
* SECTION:gtktreemenu
* @Short_Description: A GtkMenu automatically created from a #GtkTreeModel
* @Title: GtkTreeMenu
#include "gtktreemenu.h"
#include "gtkmarshalers.h"
#include "gtkmenuitem.h"
-#include "gtktearoffmenuitem.h"
#include "gtkseparatormenuitem.h"
#include "gtkcellareabox.h"
#include "gtkcellareacontext.h"
#include "gtkmenushellprivate.h"
#include "gtkprivate.h"
+#undef GDK_DEPRECATED
+#undef GDK_DEPRECATED_FOR
+#define GDK_DEPRECATED
+#define GDK_DEPRECATED_FOR(f)
+
+#include "deprecated/gtktearoffmenuitem.h"
/* GObjectClass */
static GObject *gtk_tree_menu_constructor (GType type,
widget_class->get_preferred_width = gtk_tree_menu_get_preferred_width;
widget_class->get_preferred_height = gtk_tree_menu_get_preferred_height;
- /**
+ /*
* GtkTreeMenu::menu-activate:
* @menu: a #GtkTreeMenu
* @path: the #GtkTreePath string for the item which was activated
_gtk_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
- /**
+ /*
* GtkTreeMenu:model:
*
* The #GtkTreeModel from which the menu is constructed.
- *
+ *
* Since: 3.0
*/
g_object_class_install_property (object_class,
GTK_TYPE_TREE_MODEL,
GTK_PARAM_READWRITE));
- /**
+ /*
* GtkTreeMenu:root:
*
* The #GtkTreePath that is the root for this menu, or %NULL.
*
* If you dont provide a root for the #GtkTreeMenu then the whole
* model will be added to the menu. Specifying a root allows you
- * to build a menu for a given #GtkTreePath and it's children.
+ * to build a menu for a given #GtkTreePath and its children.
*
* Since: 3.0
*/
GTK_TYPE_TREE_PATH,
GTK_PARAM_READWRITE));
- /**
+ /*
* GtkTreeMenu:cell-area:
*
* The #GtkCellArea used to render cells in the menu items.
GTK_TYPE_CELL_AREA,
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- /**
+ /*
* GtkTreeMenu:tearoff:
*
* Specifies whether this menu comes with a leading tearoff menu item
FALSE,
GTK_PARAM_READWRITE));
- /**
+ /*
* GtkTreeMenu:wrap-width:
*
* If wrap-width is set to a positive value, the list will be
0,
GTK_PARAM_READWRITE));
- /**
+ /*
* GtkTreeMenu:row-span-column:
*
* If this is set to a non-negative value, it must be the index of a column
-1,
GTK_PARAM_READWRITE));
- /**
+ /*
* GtkTreeMenu:column-span-column:
*
* If this is set to a non-negative value, it must be the index of a column
path = gtk_tree_row_reference_get_path (row);
if (!path)
- /* Return any first child where it's row-reference became invalid,
+ /* Return any first child where its row-reference became invalid,
* this is because row-references get null paths before we recieve
* the "row-deleted" signal.
*/
path = gtk_cell_view_get_displayed_row (GTK_CELL_VIEW (view));
if (!path)
- /* Return any first child where it's row-reference became invalid,
+ /* Return any first child where its row-reference became invalid,
* this is because row-references get null paths before we recieve
* the "row-deleted" signal.
*/
depth = gtk_tree_path_get_depth (path);
index = indices[depth -1];
- /* Menus with a header include a menuitem for it's root node
+ /* Menus with a header include a menuitem for its root node
* and a separator menu item */
if (priv->menu_with_header)
index += 2;
GtkTreeMenuPrivate *priv = menu->priv;
gboolean this_menu = FALSE;
- if (path == NULL && priv->root == NULL)
+ if (gtk_tree_path_get_depth (path) == 0 && !priv->root)
this_menu = TRUE;
else if (priv->root)
{
return (GtkWidget *)g_object_new (GTK_TYPE_TREE_MENU, NULL);
}
-/**
+/*
* _gtk_tree_menu_new_with_area:
* @area: the #GtkCellArea to use to render cells in the menu
*
- * Creates a new #GtkTreeMenu using @area to render it's cells.
+ * Creates a new #GtkTreeMenu using @area to render its cells.
*
* Return value: A newly created #GtkTreeMenu with no model or root.
*
NULL);
}
-/**
+/*
* _gtk_tree_menu_new_full:
* @area: (allow-none): the #GtkCellArea to use to render cells in the menu, or %NULL.
* @model: (allow-none): the #GtkTreeModel to build the menu heirarchy from, or %NULL.
* @root: (allow-none): the #GtkTreePath indicating the root row for this menu, or %NULL.
*
- * Creates a new #GtkTreeMenu hierarchy from the provided @model and @root using @area to render it's cells.
+ * Creates a new #GtkTreeMenu hierarchy from the provided @model and @root using @area to render its cells.
*
* Return value: A newly created #GtkTreeMenu.
*
NULL);
}
-/**
+/*
* _gtk_tree_menu_set_model:
* @menu: a #GtkTreeMenu
* @model: (allow-none): the #GtkTreeModel to build the menu hierarchy from, or %NULL.
rebuild_menu (menu);
}
-/**
+/*
* _gtk_tree_menu_get_model:
* @menu: a #GtkTreeMenu
*
return priv->model;
}
-/**
+/*
* _gtk_tree_menu_set_root:
* @menu: a #GtkTreeMenu
* @path: (allow-none): the #GtkTreePath which is the root of @menu, or %NULL.
* Since: 3.0
*/
void
-_gtk_tree_menu_set_root (GtkTreeMenu *menu,
- GtkTreePath *path)
+_gtk_tree_menu_set_root (GtkTreeMenu *menu,
+ GtkTreePath *path)
{
GtkTreeMenuPrivate *priv;
rebuild_menu (menu);
}
-/**
+/*
* _gtk_tree_menu_get_root:
* @menu: a #GtkTreeMenu
*
return NULL;
}
-/**
+/*
* _gtk_tree_menu_get_tearoff:
* @menu: a #GtkTreeMenu
*
return priv->tearoff;
}
-/**
+/*
* _gtk_tree_menu_set_tearoff:
* @menu: a #GtkTreeMenu
* @tearoff: whether the menu should have a leading tearoff menu item.
}
}
-/**
+/*
* _gtk_tree_menu_get_wrap_width:
* @menu: a #GtkTreeMenu
*
return priv->wrap_width;
}
-/**
+/*
* _gtk_tree_menu_set_wrap_width:
* @menu: a #GtkTreeMenu
* @width: the wrap width
}
}
-/**
+/*
* _gtk_tree_menu_get_row_span_column:
* @menu: a #GtkTreeMenu
*
return priv->row_span_col;
}
-/**
+/*
* _gtk_tree_menu_set_row_span_column:
* @menu: a #GtkTreeMenu
* @row_span: the column in the model to fetch the row span for a given menu item.
}
}
-/**
+/*
* _gtk_tree_menu_get_column_span_column:
* @menu: a #GtkTreeMenu
*
return priv->col_span_col;
}
-/**
+/*
* _gtk_tree_menu_set_column_span_column:
* @menu: a #GtkTreeMenu
* @column_span: the column in the model to fetch the column span for a given menu item.
}
}
-/**
+/*
* _gtk_tree_menu_get_row_separator_func:
* @menu: a #GtkTreeMenu
- *
+ *
* Gets the current #GtkTreeViewRowSeparatorFunc separator function.
- *
+ *
* Return value: the current row separator function.
*
* Since: 3.0
return priv->row_separator_func;
}
-/**
+/*
* _gtk_tree_menu_set_row_separator_func:
* @menu: a #GtkTreeMenu
* @func: (allow-none): a #GtkTreeViewRowSeparatorFunc, or %NULL to unset the separator function.
* @data: (allow-none): user data to pass to @func, or %NULL
* @destroy: (allow-none): destroy notifier for @data, or %NULL
- *
+ *
* Sets the row separator function, which is used to determine
* whether a row should be drawn as a separator. If the row separator
* function is %NULL, no separators are drawn. This is the default value.
rebuild_menu (menu);
}
-/**
+/*
* _gtk_tree_menu_get_header_func:
* @menu: a #GtkTreeMenu
*
return priv->header_func;
}
-/**
+/*
* _gtk_tree_menu_set_header_func:
* @menu: a #GtkTreeMenu
* @func: (allow-none): a #GtkTreeMenuHeaderFunc, or %NULL to unset the header function.