diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 7889b1a530..3074c45f27 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +Tue Sep 13 14:16:27 2005 Tim Janik + + * gtk/tmpl/gtkrc.sgml: fixed wording and typos in some places. + added a new section "Optimizing RC Style Matches". + 2005-09-11 Matthias Clasen * gdk/gdk-sections.txt: Add gdk_intern_static_string. diff --git a/docs/reference/gdk/tmpl/gdkscreen.sgml b/docs/reference/gdk/tmpl/gdkscreen.sgml index ea7050d4da..800a9e0d55 100644 --- a/docs/reference/gdk/tmpl/gdkscreen.sgml +++ b/docs/reference/gdk/tmpl/gdkscreen.sgml @@ -41,6 +41,16 @@ when GDK gets multihead support. @gdkscreen: the object which received the signal. + + + + + + + + + + @@ -275,6 +285,42 @@ when GDK gets multihead support. @Returns: + + + + + +@screen: +@Returns: + + + + + + + +@screen: +@options: + + + + + + + +@screen: +@Returns: + + + + + + + +@screen: +@dpi: + + diff --git a/docs/reference/gdk/tmpl/properties.sgml b/docs/reference/gdk/tmpl/properties.sgml index dc63c5ac59..39e40ef913 100644 --- a/docs/reference/gdk/tmpl/properties.sgml +++ b/docs/reference/gdk/tmpl/properties.sgml @@ -235,6 +235,15 @@ Finds or creates an atom corresponding to a given string. @Returns: the atom corresponding to @atom_name. + + + + + +@atom_name: +@Returns: + + Determines the string corresponding to an atom. diff --git a/docs/reference/gtk/tmpl/gtkrc.sgml b/docs/reference/gtk/tmpl/gtkrc.sgml index 773c6a2a85..7f8687db46 100644 --- a/docs/reference/gtk/tmpl/gtkrc.sgml +++ b/docs/reference/gtk/tmpl/gtkrc.sgml @@ -51,14 +51,18 @@ attaches them to particular widgets. The attachment is done by the widget, widget_class, and class declarations. As an example of such a statement: + widget "mywindow.*.GtkEntry" style "my-entry-class" + attaches the style "my-entry-class" -to all widgets whose widget class +to all widgets whose widget path matches the pattern -"mywindow.*.GtkEntry". +"mywindow.*.GtkEntry". That is, all +#GtkEntry widgets which are part of a #GtkWindow named "mywindow". + The patterns here are given in the standard shell glob syntax. The "?" wildcard matches @@ -66,7 +70,7 @@ any character, while "*" matches zero or more of any character. The three types of matching are against the widget path, the class path and the class -hierarchy. Both the widget and the class paths consists of a +hierarchy. Both the widget path and the class path consist of a "." separated list of all the parents of the widget and the widget itself from outermost to innermost. The difference is that in @@ -77,9 +81,9 @@ for the class path, the class name is always used. So, if you have a #GtkEntry named -"myentry", inside of a of a window +"myentry", inside of a horizontal box in a window named "mywindow", then the -widget path is: "mwindow.GtkHBox.myentry" +widget path is: "mywindow.GtkHBox.myentry" while the class path is: "GtkWindow.GtkHBox.GtkEntry". @@ -119,6 +123,80 @@ that GTK+ creates internally. +Optimizing RC Style Matches + +Everytime a widget is created and added to the layout hierarchy of a #GtkWindow +("anchored" to be exact), a list of matching RC styles out of all RC styles read +in so far is composed. +For this, every RC style is matched against the widgets class path, +the widgets name path and widgets inheritance hierarchy. +As a consequence, significant slowdown can be caused by utilization of many +RC styles and by using RC sytle patterns that are slow or complicated to match +against a given widget. +The following ordered list provides a number of advices (prioritized by effectiveness) +to reduce the performance overhead associated with RC style matches: + + + + + Move RC styles for specific applications into RC files dedicated to those + applications and parse application specific RC files only from + applications that are affected by them. + This reduces the overall amount of RC styles that have to be considered + for a match across a group of applications. + + + + Merge multiple styles which use the same matching rule, for instance: + + style "Foo" { foo_content } + class "X" style "Foo" + style "Bar" { bar_content } + class "X" style "Bar" + + is faster to match as: + + style "FooBar" { foo_content bar_content } + class "X" style "FooBar" + + + + + Use of wildcards should be avoided, this can reduce the individual RC style + match to a single integer comparison in most cases. + + + + To avoid complex recursive matching, specification of full class names + (for class matches) or full path names (for + widget and widget_class matches) + is to be preferred over shortened names + containing "*" or "?". + + + + If at all necessary, wildcards should only be used at the tail or head + of a pattern. This reduces the match complexity to a string comparison + per RC style. + + + + When using wildcards, use of "?" should be preferred + over "*". This can reduce the matching complexity from + O(n^2) to O(n). For example "Gtk*Box" can be turned into + "Gtk?Box" and will still match #GtkHBox and #GtkVBox. + + + + The use of "*" wildcards should be restricted as much + as possible, because matching "A*B*C*RestString" can + result in matching complexities worse than O(n^2) in the length of strings. + + + + + + Toplevel declarations An RC file is a text file which is composed of a sequence diff --git a/docs/reference/gtk/tmpl/gtkselection.sgml b/docs/reference/gtk/tmpl/gtkselection.sgml index 7728143b84..e272972cf9 100644 --- a/docs/reference/gtk/tmpl/gtkselection.sgml +++ b/docs/reference/gtk/tmpl/gtkselection.sgml @@ -332,6 +332,46 @@ selection handling code. @Returns: + + + + + +@selection_data: +@Returns: + + + + + + + +@targets: +@n_targets: +@writable: +@Returns: + + + + + + + +@targets: +@n_targets: +@Returns: + + + + + + + +@targets: +@n_targets: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkstock.sgml b/docs/reference/gtk/tmpl/gtkstock.sgml index 369dd8e33b..4b8c915403 100644 --- a/docs/reference/gtk/tmpl/gtkstock.sgml +++ b/docs/reference/gtk/tmpl/gtkstock.sgml @@ -773,6 +773,7 @@ The "Save As" item. + The "Select All" item. @@ -781,6 +782,7 @@ The "Select All" item. @Since: 2.10 + The "Color" item. diff --git a/docs/reference/gtk/tmpl/gtktoolbar.sgml b/docs/reference/gtk/tmpl/gtktoolbar.sgml index 57faf2d146..3d07d9a538 100644 --- a/docs/reference/gtk/tmpl/gtktoolbar.sgml +++ b/docs/reference/gtk/tmpl/gtktoolbar.sgml @@ -102,6 +102,16 @@ accessed through the function described below. @toolbar: @style: + + + + + + + + + + diff --git a/docs/reference/gtk/tmpl/gtkwindow.sgml b/docs/reference/gtk/tmpl/gtkwindow.sgml index dfb1a77903..1cd7a2ba98 100644 --- a/docs/reference/gtk/tmpl/gtkwindow.sgml +++ b/docs/reference/gtk/tmpl/gtkwindow.sgml @@ -99,6 +99,11 @@ Toplevel which can contain other widgets + + + + + @@ -688,6 +693,15 @@ Deprecated alias for gtk_window_set_position(). @setting: + + + + + +@window: +@setting: + + @@ -790,6 +804,15 @@ Deprecated alias for gtk_window_set_position(). @Returns: + + + + + +@window: +@Returns: + +