Commit 230b3525 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

docs

2001-10-02  Havoc Pennington  <hp@redhat.com>

	* gdk/x11/gdkwindow-x11.c: docs

	* tests/testtextbuffer.c (logical_motion_tests): add sentence
	boundary tests

2001-10-02  Havoc Pennington  <hp@redhat.com>

	* gtk/tree_widget.sgml: s/empahsis/emphasis/

	* gtk/tmpl/gtkobject.sgml: update docs
parent ced4124e
2001-10-02 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkwindow-x11.c: docs
* tests/testtextbuffer.c (logical_motion_tests): add sentence
boundary tests
Tue Oct 2 20:18:32 2001 Kristian Rietveld <kristian@planet.nl>
* demos/gtk-demo/Makefile.am: add editable_cells.c,
......
2001-10-02 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkwindow-x11.c: docs
* tests/testtextbuffer.c (logical_motion_tests): add sentence
boundary tests
Tue Oct 2 20:18:32 2001 Kristian Rietveld <kristian@planet.nl>
* demos/gtk-demo/Makefile.am: add editable_cells.c,
......
2001-10-02 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkwindow-x11.c: docs
* tests/testtextbuffer.c (logical_motion_tests): add sentence
boundary tests
Tue Oct 2 20:18:32 2001 Kristian Rietveld <kristian@planet.nl>
* demos/gtk-demo/Makefile.am: add editable_cells.c,
......
2001-10-02 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkwindow-x11.c: docs
* tests/testtextbuffer.c (logical_motion_tests): add sentence
boundary tests
Tue Oct 2 20:18:32 2001 Kristian Rietveld <kristian@planet.nl>
* demos/gtk-demo/Makefile.am: add editable_cells.c,
......
2001-10-02 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkwindow-x11.c: docs
* tests/testtextbuffer.c (logical_motion_tests): add sentence
boundary tests
Tue Oct 2 20:18:32 2001 Kristian Rietveld <kristian@planet.nl>
* demos/gtk-demo/Makefile.am: add editable_cells.c,
......
2001-10-02 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkwindow-x11.c: docs
* tests/testtextbuffer.c (logical_motion_tests): add sentence
boundary tests
Tue Oct 2 20:18:32 2001 Kristian Rietveld <kristian@planet.nl>
* demos/gtk-demo/Makefile.am: add editable_cells.c,
......
2001-10-02 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkwindow-x11.c: docs
* tests/testtextbuffer.c (logical_motion_tests): add sentence
boundary tests
Tue Oct 2 20:18:32 2001 Kristian Rietveld <kristian@planet.nl>
* demos/gtk-demo/Makefile.am: add editable_cells.c,
......
2001-10-02 Havoc Pennington <hp@redhat.com>
* gtk/tree_widget.sgml: s/empahsis/emphasis/
* gtk/tmpl/gtkobject.sgml: update docs
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtk-sections.txt: Move standard gobject stuff to
......
......@@ -77,35 +77,102 @@ Windows
<!-- ##### ENUM GdkWindowHints ##### -->
<para>
</para>
@GDK_HINT_POS:
@GDK_HINT_MIN_SIZE:
@GDK_HINT_MAX_SIZE:
@GDK_HINT_BASE_SIZE:
@GDK_HINT_ASPECT:
@GDK_HINT_RESIZE_INC:
@GDK_HINT_WIN_GRAVITY:
@GDK_HINT_USER_POS:
@GDK_HINT_USER_SIZE:
Used to indicate which fields of a #GdkGeometry struct should be paid attention
to. Also, the presence/absence of @GDK_HINT_POS, @GDK_HINT_USER_POS, and
@GDK_HINT_USER_SIZE is significant, though they don't directly refer to
#GdkGeometry fields. @GDK_HINT_USER_POS will be set automatically by #GtkWindow
if you call gtk_window_move(). @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE
should be set if the user specified a size/position using a --geometry
command-line argument; gtk_window_parse_geometry() automatically sets these
flags.
</para>
@GDK_HINT_POS: indicates that the program has positioned the window
@GDK_HINT_MIN_SIZE: min size fields are set
@GDK_HINT_MAX_SIZE: max size fields are set
@GDK_HINT_BASE_SIZE: base size fields are set
@GDK_HINT_ASPECT: aspect ratio fields are set
@GDK_HINT_RESIZE_INC: resize increment fields are set
@GDK_HINT_WIN_GRAVITY: window gravity field is set
@GDK_HINT_USER_POS: indicates that the window's position was explicitly set by the user
@GDK_HINT_USER_SIZE: indicates that the window's size was explicitly set by the user
<!-- ##### STRUCT GdkGeometry ##### -->
<para>
</para>
@min_width:
@min_height:
@max_width:
@max_height:
@base_width:
@base_height:
@width_inc:
@height_inc:
@min_aspect:
@max_aspect:
@win_gravity:
The #GdkGeometry struct gives the window manager information about
a window's geometry constraints. Normally you would set these on
the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow
then sets the hints on the #GdkWindow it creates.
</para>
<para>
gdk_window_set_geometry_hints() expects the hints to be fully valid already and
simply passes them to the window manager; in contrast,
gtk_window_set_geometry_hints() performs some interpretation. For example,
#GtkWindow will apply the hints to the geometry widget instead of the toplevel
window, if you set a geometry widget. Also, the
min_width/min_height/max_width/max_height fields may be set to -1, and
#GtkWindow will substitute the size request of the window or geometry widget. If
the minimum size hint is not provided, #GtkWindow will use its requisition as
the minimum size. If the minimum size is provided and a geometry widget is set,
#GtkWindow will take the minimum size as the minimum size of the geometry widget
rather than the entire window. The base size is treated similarly.
</para>
<para>
The canonical use-case for gtk_window_set_geometry_hints() is to get a terminal
widget to resize properly. Here, the terminal text area should be the geometry
widget; #GtkWindow will then automatically set the base size to the size of
other widgets in the terminal window, such as the menubar and scrollbar. Then,
the width_inc and height_inc fields should be set to the size of one character
in the terminal. Finally, the base size should be set to the size of one
character. The net effect is that the minimum size of the terminal
will have a 1x1 character terminal area, and only terminal sizes on
the "character grid" will be allowed.
</para>
<para>
Here's an example of how the terminal example would be implemented, assuming
a terminal area widget called "terminal" and a toplevel window "toplevel":
<programlisting>
GdkGeometry hints;
hints.base_width = terminal->char_width;
hints.base_height = terminal->char_height;
hints.min_width = terminal->char_width;
hints.min_height = terminal->char_height;
hints.width_inc = terminal->char_width;
hints.height_inc = terminal->char_height;
gtk_window_set_geometry_hints (GTK_WINDOW (toplevel),
GTK_WIDGET (terminal),
&hints,
GDK_HINT_RESIZE_INC |
GDK_HINT_MIN_SIZE |
GDK_HINT_BASE_SIZE);
</programlisting>
</para>
<para>
The other useful fields are the @min_aspect and @max_aspect fields; these
contain a width/height ratio as a floating point number. If a geometry widget is
set, the aspect applies to the geometry widget rather than the entire window.
The most common use of these hints is probably to set @min_aspect and
@max_aspect to the same value, thus forcing the window to keep a constant aspect
ratio.
</para>
@min_width: minimum width of window (or -1 to use requisition, with #GtkWindow only)
@min_height minimum height of window (or -1 to use requisition, with #GtkWindow only)
@max_width: maximum width of window (or -1 to use requisition, with #GtkWindow only)
@max_height: maximum height of window (or -1 to use requisition, with #GtkWindow only)
@base_width: allowed window widths are base_width + width_inc * N where N is any integer (-1 allowed with #GtkWindow)
@base_height: allowed window widths are base_height + height_inc * N where N is any integer (-1 allowed with #GtkWindow)
@width_inc: width resize increment
@height_inc: height resize increment
@min_aspect: minimum width/height ratio
@max_aspect: maximum width/height ratio
@win_gravity: window gravity, see gtk_window_set_gravity()
<!-- ##### ENUM GdkGravity ##### -->
<para>
......
......@@ -376,6 +376,12 @@ The last structured enumerated type value.
</para>
<!-- ##### MACRO GTK_TYPE_TREE_VIEW_COLUMN ##### -->
<para>
</para>
<!-- ##### MACRO GTK_VALUE_ARGS ##### -->
<para>
Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ARGS
......@@ -995,6 +1001,12 @@ produce superscript and subscript.
</para>
<!-- ##### STRUCT GtkTreeSelectionClass ##### -->
<para>
</para>
<!-- ##### ENUM GtkTreeSelectionMode ##### -->
<para>
......
......@@ -96,9 +96,9 @@ Creates a new #GtkMenu.
Adds a new #GtkMenuItem to the end of the menu's item list.
</para>
<!-- # Unused Parameters # -->
@menu: a #GtkMenu.
@child: The #GtkMenuItem to add.
<!-- # Unused Parameters # -->
@m:
@c:
......@@ -108,9 +108,9 @@ Adds a new #GtkMenuItem to the end of the menu's item list.
Adds a new #GtkMenuItem to the beginning of the menu's item list.
</para>
<!-- # Unused Parameters # -->
@menu: a #GtkMenu.
@child: The #GtkMenuItem to add.
<!-- # Unused Parameters # -->
@menu_child:
@m:
@c:
......@@ -122,10 +122,10 @@ Adds a new #GtkMenuItem to the menu's item list at the position
indicated by @position.
</para>
<!-- # Unused Parameters # -->
@menu: a #GtkMenu.
@child: The #GtkMenuItem to add.
@pos:
<!-- # Unused Parameters # -->
@position: The position in the item list where @child is added.
Positions are numbered from 0 to n-1.
......
This diff is collapsed.
......@@ -36,12 +36,6 @@ GtkTreeView
</para>
<!-- ##### STRUCT GtkTreeSelectionClass ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GtkTreeViewColumnDropFunc ##### -->
<para>
......
......@@ -14,13 +14,6 @@ GtkTreeViewColumn
</para>
<!-- ##### MACRO GTK_TYPE_TREE_VIEW_COLUMN ##### -->
<para>
</para>
<!-- ##### STRUCT GtkTreeViewColumn ##### -->
<para>
......
......@@ -30,8 +30,8 @@
<member>the cell renderers (GtkCellRenderer etc.)</member>
<member>and the model interface (GtkTreeModel)</member>
</simplelist>
The <emphasis>View</empahsis> is composed of the first three,
while the last is the <empahsis>Model</empahsis>. One of the
The <emphasis>View</emphasis> is composed of the first three,
while the last is the <emphasis>Model</emphasis>. One of the
prime benefits of the MVC design is that multiple views can be
created of a single model. For example, a model mapping the file
system could be created for a file manager. Many views could be
......
......@@ -1374,6 +1374,17 @@ gdk_window_set_modal_hint (GdkWindow *window,
0);
}
/**
* gdk_window_set_geometry_hints:
* @window: a #GdkWindow
* @geometry: geometry hints
* @geom_mask: bitmask indicating fields of @geometry to pay attention to
*
* Sets the geometry hints for @window. Hints flagged in @geom_mask
* are set, hints not flagged in @geom_mask are unset.
* To unset all hints, use a @geom_mask of 0 and a @geometry of %NULL.
*
**/
void
gdk_window_set_geometry_hints (GdkWindow *window,
GdkGeometry *geometry,
......
......@@ -934,7 +934,7 @@ logical_motion_tests (void)
expected[8] = 11; /* before 'x' */
expected[9] = 12; /* before 'y' */
expected[10] = 13; /* before 'z' */
expected[11] = 14; /* after 'z' */
expected[11] = 14; /* after 'z' (only matters going backward) */
expected_steps = 11;
gtk_text_buffer_get_start_iter (buffer, &iter);
......@@ -951,17 +951,15 @@ logical_motion_tests (void)
pos, expected[i]);
}
/* g_print ("%d = %d\n", pos, expected[i]); */
++i;
}
while (gtk_text_iter_forward_cursor_position (&iter));
if (i != expected_steps)
g_error ("Expected %d steps, there were actually %d\n", expected_steps, i);
if (!gtk_text_iter_is_end (&iter))
g_error ("Expected to stop at the end iterator\n");
if (i != expected_steps)
g_error ("Expected %d steps, there were actually %d\n", expected_steps, i);
i = expected_steps;
do
......@@ -987,6 +985,84 @@ logical_motion_tests (void)
if (!gtk_text_iter_is_start (&iter))
g_error ("Expected to stop at the start iterator\n");
/* Check sentence boundaries */
gtk_text_buffer_set_text (buffer, "Hi.\nHi. \nHi! Hi. Hi? Hi.", -1);
memset (expected, 0, sizeof (expected));
expected[0] = 0; /* before first Hi */
expected[1] = 3; /* After first . */
expected[2] = 7; /* After second . */
expected[3] = 12; /* After ! */
expected[4] = 16; /* After third . */
expected[5] = 20; /* After ? */
expected_steps = 6;
gtk_text_buffer_get_start_iter (buffer, &iter);
i = 0;
do
{
int pos;
pos = gtk_text_iter_get_offset (&iter);
if (pos != expected[i])
{
g_error ("Sentence position %d, expected %d",
pos, expected[i]);
}
++i;
}
while (gtk_text_iter_forward_sentence_end (&iter));
if (i != expected_steps)
g_error ("Expected %d steps, there were actually %d\n", expected_steps, i);
if (!gtk_text_iter_is_end (&iter))
g_error ("Expected to stop at the end iterator\n");
gtk_text_buffer_set_text (buffer, "Hi.\nHi. \nHi! Hi. Hi? Hi.", -1);
memset (expected, 0, sizeof (expected));
expected[0] = 24;
expected[1] = 22;
expected[2] = 17;
expected[3] = 14;
expected[4] = 9;
expected[5] = 4;
expected[6] = 0;
expected_steps = 7;
gtk_text_buffer_get_end_iter (buffer, &iter);
i = 0;
do
{
int pos;
pos = gtk_text_iter_get_offset (&iter);
if (pos != expected[i])
{
g_error ("Sentence position %d, expected %d",
pos, expected[i]);
}
++i;
}
while (gtk_text_iter_backward_sentence_start (&iter));
if (i != expected_steps)
g_error ("Expected %d steps, there were actually %d\n", expected_steps, i);
if (gtk_text_iter_get_offset (&iter) != 0)
g_error ("Expected to stop at the start iterator\n");
g_print ("Logical motion tests passed\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment