]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktreemenu.c
filechooserbutton: In SELECT_FOLDER, when the selection is empty, show (None) in...
[~andy/gtk] / gtk / gtktreemenu.c
index 9340ee68d9669476ae9b054688d2517c8d46d274..8fef02e6f97af0807ea9c798e7afbf845d2ab28b 100644 (file)
  * 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
@@ -38,7 +36,6 @@
 #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,
@@ -253,7 +256,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
   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
@@ -274,11 +277,11 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
                   _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,
@@ -289,7 +292,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
                                                         GTK_TYPE_TREE_MODEL,
                                                         GTK_PARAM_READWRITE));
 
-  /**
+  /*
    * GtkTreeMenu:root:
    *
    * The #GtkTreePath that is the root for this menu, or %NULL.
@@ -300,7 +303,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
    *
    * 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
    */
@@ -313,7 +316,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
                                                        GTK_TYPE_TREE_PATH,
                                                        GTK_PARAM_READWRITE));
 
-  /**
+  /*
    * GtkTreeMenu:cell-area:
    *
    * The #GtkCellArea used to render cells in the menu items.
@@ -331,7 +334,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
                                                         GTK_TYPE_CELL_AREA,
                                                         GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
-  /**
+  /*
    * GtkTreeMenu:tearoff:
    *
    * Specifies whether this menu comes with a leading tearoff menu item
@@ -346,7 +349,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
                                                          FALSE,
                                                          GTK_PARAM_READWRITE));
 
-  /**
+  /*
    * GtkTreeMenu:wrap-width:
    *
    * If wrap-width is set to a positive value, the list will be
@@ -365,7 +368,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
                                                      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
@@ -387,7 +390,7 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
                                                      -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
@@ -690,7 +693,7 @@ gtk_tree_menu_get_path_item (GtkTreeMenu          *menu,
               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.
                  */
@@ -706,7 +709,7 @@ gtk_tree_menu_get_path_item (GtkTreeMenu          *menu,
             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.
              */
@@ -882,7 +885,7 @@ row_inserted_cb (GtkTreeModel     *model,
           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;
@@ -961,7 +964,7 @@ row_reordered_cb (GtkTreeModel    *model,
   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)
     {
@@ -1548,11 +1551,11 @@ _gtk_tree_menu_new (void)
   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.
  *
@@ -1566,13 +1569,13 @@ _gtk_tree_menu_new_with_area (GtkCellArea    *area)
                                     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.
  *
@@ -1590,7 +1593,7 @@ _gtk_tree_menu_new_full (GtkCellArea         *area,
                                     NULL);
 }
 
-/**
+/*
  * _gtk_tree_menu_set_model:
  * @menu: a #GtkTreeMenu
  * @model: (allow-none): the #GtkTreeModel to build the menu hierarchy from, or %NULL.
@@ -1611,7 +1614,7 @@ _gtk_tree_menu_set_model (GtkTreeMenu  *menu,
   rebuild_menu (menu);
 }
 
-/**
+/*
  * _gtk_tree_menu_get_model:
  * @menu: a #GtkTreeMenu
  *
@@ -1634,7 +1637,7 @@ _gtk_tree_menu_get_model (GtkTreeMenu *menu)
   return priv->model;
 }
 
-/**
+/*
  * _gtk_tree_menu_set_root:
  * @menu: a #GtkTreeMenu
  * @path: (allow-none): the #GtkTreePath which is the root of @menu, or %NULL.
@@ -1645,8 +1648,8 @@ _gtk_tree_menu_get_model (GtkTreeMenu *menu)
  * Since: 3.0
  */
 void
-_gtk_tree_menu_set_root (GtkTreeMenu         *menu,
-                         GtkTreePath         *path)
+_gtk_tree_menu_set_root (GtkTreeMenu *menu,
+                         GtkTreePath *path)
 {
   GtkTreeMenuPrivate *priv;
 
@@ -1666,7 +1669,7 @@ _gtk_tree_menu_set_root (GtkTreeMenu         *menu,
   rebuild_menu (menu);
 }
 
-/**
+/*
  * _gtk_tree_menu_get_root:
  * @menu: a #GtkTreeMenu
  *
@@ -1693,7 +1696,7 @@ _gtk_tree_menu_get_root (GtkTreeMenu *menu)
   return NULL;
 }
 
-/**
+/*
  * _gtk_tree_menu_get_tearoff:
  * @menu: a #GtkTreeMenu
  *
@@ -1715,7 +1718,7 @@ _gtk_tree_menu_get_tearoff (GtkTreeMenu *menu)
   return priv->tearoff;
 }
 
-/**
+/*
  * _gtk_tree_menu_set_tearoff:
  * @menu: a #GtkTreeMenu
  * @tearoff: whether the menu should have a leading tearoff menu item.
@@ -1744,7 +1747,7 @@ _gtk_tree_menu_set_tearoff (GtkTreeMenu *menu,
     }
 }
 
-/**
+/*
  * _gtk_tree_menu_get_wrap_width:
  * @menu: a #GtkTreeMenu
  *
@@ -1767,7 +1770,7 @@ _gtk_tree_menu_get_wrap_width (GtkTreeMenu *menu)
   return priv->wrap_width;
 }
 
-/**
+/*
  * _gtk_tree_menu_set_wrap_width:
  * @menu: a #GtkTreeMenu
  * @width: the wrap width
@@ -1798,7 +1801,7 @@ _gtk_tree_menu_set_wrap_width (GtkTreeMenu *menu,
     }
 }
 
-/**
+/*
  * _gtk_tree_menu_get_row_span_column:
  * @menu: a #GtkTreeMenu
  *
@@ -1822,7 +1825,7 @@ _gtk_tree_menu_get_row_span_column (GtkTreeMenu *menu)
   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.
@@ -1854,7 +1857,7 @@ _gtk_tree_menu_set_row_span_column (GtkTreeMenu *menu,
     }
 }
 
-/**
+/*
  * _gtk_tree_menu_get_column_span_column:
  * @menu: a #GtkTreeMenu
  *
@@ -1878,7 +1881,7 @@ _gtk_tree_menu_get_column_span_column (GtkTreeMenu *menu)
   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.
@@ -1910,12 +1913,12 @@ _gtk_tree_menu_set_column_span_column (GtkTreeMenu *menu,
     }
 }
 
-/**
+/*
  * _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
@@ -1932,13 +1935,13 @@ _gtk_tree_menu_get_row_separator_func (GtkTreeMenu *menu)
   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.
@@ -1967,7 +1970,7 @@ _gtk_tree_menu_set_row_separator_func (GtkTreeMenu          *menu,
   rebuild_menu (menu);
 }
 
-/**
+/*
  * _gtk_tree_menu_get_header_func:
  * @menu: a #GtkTreeMenu
  *
@@ -1989,7 +1992,7 @@ _gtk_tree_menu_get_header_func (GtkTreeMenu *menu)
   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.