[gtk+/native-layout-incubator-2] Added tests to testheightforwidth to reflect new height-for-width treeviews (and also the wrapping e



commit 04a8eba9a639b92c08287e0980e379621b5a28cd
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Jun 30 11:30:29 2010 -0400

    Added tests to testheightforwidth to reflect new height-for-width treeviews
    (and also the wrapping expander label).

 tests/testheightforwidth.c |  423 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 423 insertions(+), 0 deletions(-)
---
diff --git a/tests/testheightforwidth.c b/tests/testheightforwidth.c
index 9a54295..2c27047 100644
--- a/tests/testheightforwidth.c
+++ b/tests/testheightforwidth.c
@@ -546,6 +546,429 @@ TestInterface interfaces[] = {
     NULL
   },
 
+  {
+    "Wrapping Expander",
+    "This test demonstrates how the expander label can fill to its natural width "
+    "and also trade height for width.",
+    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+    "<interface>"
+    "  <requires lib=\"gtk+\" version=\"2.20\"/>"
+    "  <!-- interface-naming-policy project-wide -->"
+    "  <object class=\"GtkWindow\" id=\"window\">"
+    "    <property name=\"default_width\">500</property>"
+    "    <child>"
+    "      <object class=\"GtkHPaned\" id=\"hpaned1\">"
+    "        <property name=\"visible\">True</property>"
+    "        <property name=\"can_focus\">True</property>"
+    "        <child>"
+    "          <object class=\"GtkExpander\" id=\"expander1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"can_focus\">True</property>"
+    "            <child>"
+    "              <object class=\"GtkLabel\" id=\"label2\">"
+    "                <property name=\"visible\">True</property>"
+    "                <property name=\"label\" translatable=\"yes\">More wrapping text to fill the largish content area in the expander </property>"
+    "                <property name=\"wrap\">True</property>"
+    "                <property name=\"width_chars\">10</property>"
+    "                <attributes>"
+    "                  <attribute name=\"weight\" value=\"bold\"/>"
+    "                  <attribute name=\"foreground\" value=\"#0000D0F00000\"/>"
+    "                </attributes>"
+    "              </object>"
+    "            </child>"
+    "            <child type=\"label\">"
+    "              <object class=\"GtkLabel\" id=\"label1\">"
+    "                <property name=\"visible\">True</property>"
+    "                <property name=\"label\" translatable=\"yes\">Here is some expander text that wraps</property>"
+    "                <property name=\"wrap\">True</property>"
+    "                <property name=\"width_chars\">10</property>"
+    "                <attributes>"
+    "                  <attribute name=\"weight\" value=\"bold\"/>"
+    "                  <attribute name=\"foreground\" value=\"blue\"/>"
+    "                </attributes>"
+    "              </object>"
+    "            </child>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">False</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "        <child>"
+    "          <object class=\"GtkLabel\" id=\"label3\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"label\" translatable=\"yes\">static\n"
+    "text\n"
+    "here</property>"
+    "            <attributes>"
+    "              <attribute name=\"foreground\" value=\"red\"/>"
+    "            </attributes>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">True</property>"
+    "            <property name=\"shrink\">True</property>"
+    "          </packing>"
+    "        </child>"
+    "      </object>"
+    "    </child>"
+    "  </object>"
+    "</interface>",
+    NULL
+  },
+
+  {
+    "Ellipsizing Treeview",
+    "Demonstrates how natural size can be shared across treeview columns and renderers.",
+    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+    "<interface>"
+    "  <requires lib=\"gtk+\" version=\"2.20\"/>"
+    "  <!-- interface-naming-policy project-wide -->"
+    "  <object class=\"GtkWindow\" id=\"window\">"
+    "    <property name=\"default_width\">500</property>"
+    "    <child>"
+    "      <object class=\"GtkHPaned\" id=\"hpaned1\">"
+    "        <property name=\"visible\">True</property>"
+    "        <property name=\"can_focus\">True</property>"
+    "        <property name=\"position\">400</property>"
+    "        <child>"
+    "          <object class=\"GtkTreeView\" id=\"treeview1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"can_focus\">True</property>"
+    "            <property name=\"model\">liststore1</property>"
+    "            <property name=\"headers_clickable\">False</property>"
+    "            <property name=\"search_column\">0</property>"
+    "            <child>"
+    "              <object class=\"GtkTreeViewColumn\" id=\"treeviewcolumn1\">"
+    "                <property name=\"sizing\">autosize</property>"
+    "                <property name=\"title\" translatable=\"yes\">#1</property>"
+    "                <property name=\"expand\">True</property>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererText\" id=\"cellrenderertext1\">"
+    "                    <property name=\"ellipsize\">end</property>"
+    "                  </object>"
+    "                  <attributes>"
+    "                    <attribute name=\"text\">0</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererPixbuf\" id=\"cellrendererpixbuf1\"/>"
+    "                  <attributes>"
+    "                    <attribute name=\"icon-name\">1</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "              </object>"
+    "            </child>"
+    "            <child>"
+    "              <object class=\"GtkTreeViewColumn\" id=\"treeviewcolumn2\">"
+    "                <property name=\"sizing\">autosize</property>"
+    "                <property name=\"title\" translatable=\"yes\">#2</property>"
+    "                <property name=\"expand\">True</property>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererPixbuf\" id=\"cellrendererpixbuf2\"/>"
+    "                  <attributes>"
+    "                    <attribute name=\"icon-name\">1</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererText\" id=\"cellrenderertext2\">"
+    "                    <property name=\"ellipsize\">start</property>"
+    "                  </object>"
+    "                  <attributes>"
+    "                    <attribute name=\"text\">2</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererText\" id=\"cellrenderertext3\">"
+    "                    <property name=\"ellipsize\">end</property>"
+    "                  </object>"
+    "                  <attributes>"
+    "                    <attribute name=\"text\">3</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "              </object>"
+    "            </child>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">False</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "        <child>"
+    "          <object class=\"GtkLabel\" id=\"label1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"label\" translatable=\"yes\">static\n"
+    "text\n"
+    "here</property>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">True</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "      </object>"
+    "    </child>"
+    "  </object>"
+    "  <object class=\"GtkListStore\" id=\"liststore1\">"
+    "    <columns>"
+    "      <!-- column-name first-text -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name icon-name -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name second-text -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name third-text -->"
+    "      <column type=\"gchararray\"/>"
+    "    </columns>"
+    "    <data>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">both columns</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-ok</col>"
+    "        <col id=\"2\" translatable=\"yes\">this</col>"
+    "        <col id=\"3\" translatable=\"yes\">this</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">contain ellipsizing cell renderers</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-cancel</col>"
+    "        <col id=\"2\" translatable=\"yes\">renderer</col>"
+    "        <col id=\"3\" translatable=\"yes\">renderer</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">to demonstrate natural</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-info</col>"
+    "        <col id=\"2\" translatable=\"yes\">is not</col>"
+    "        <col id=\"3\" translatable=\"yes\">can</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">distribution of size</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-apply</col>"
+    "        <col id=\"2\" translatable=\"yes\">wide</col>"
+    "        <col id=\"3\" translatable=\"yes\">be</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">across columns</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-dialog-warning</col>"
+    "        <col id=\"2\" translatable=\"yes\">at all</col>"
+    "        <col id=\"3\" translatable=\"yes\">wide because of this long text.</col>"
+    "      </row>"
+    "    </data>"
+    "  </object>"
+    "</interface>",
+    NULL
+  },
+
+  {
+    "Wrapping Treeview",
+    "Demonstrates how treeviews can recalculate row heights based on allocated widths.",
+    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+    "<interface>"
+    "  <requires lib=\"gtk+\" version=\"2.20\"/>"
+    "  <!-- interface-naming-policy project-wide -->"
+    "  <object class=\"GtkListStore\" id=\"liststore1\">"
+    "    <columns>"
+    "      <!-- column-name first-text -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name icon-name -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name second-text -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name third-text -->"
+    "      <column type=\"gchararray\"/>"
+    "    </columns>"
+    "    <data>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">both columns contain word-wrapping</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-ok</col>"
+    "        <col id=\"2\" translatable=\"yes\">this</col>"
+    "        <col id=\"3\" translatable=\"yes\">this</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">cell renderers</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-cancel</col>"
+    "        <col id=\"2\" translatable=\"yes\">renderer</col>"
+    "        <col id=\"3\" translatable=\"yes\">renderer</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">to demonstrate height-for-width</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-info</col>"
+    "        <col id=\"2\" translatable=\"yes\">is not</col>"
+    "        <col id=\"3\" translatable=\"yes\">can</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">trading</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-apply</col>"
+    "        <col id=\"2\" translatable=\"yes\">wide</col>"
+    "        <col id=\"3\" translatable=\"yes\">be</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">for individual rows</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-dialog-warning</col>"
+    "        <col id=\"2\" translatable=\"yes\">at all</col>"
+    "        <col id=\"3\" translatable=\"yes\">wide because of this long text.</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">---------------</col>"
+    "        <col id=\"1\" translatable=\"yes\"></col>"
+    "        <col id=\"2\" translatable=\"yes\">-------</col>"
+    "        <col id=\"3\" translatable=\"yes\">-------------</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">here we add some</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-bold</col>"
+    "        <col id=\"2\" translatable=\"yes\">more</col>"
+    "        <col id=\"3\" translatable=\"yes\">lets put some more</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">more text just</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-execute</col>"
+    "        <col id=\"2\" translatable=\"yes\">and</col>"
+    "        <col id=\"3\" translatable=\"yes\">text in all these</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">to show the scrolled window</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-add</col>"
+    "        <col id=\"2\" translatable=\"yes\">more</col>"
+    "        <col id=\"3\" translatable=\"yes\">columns</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">resizing and scrolling</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-remove</col>"
+    "        <col id=\"2\" translatable=\"yes\">text</col>"
+    "        <col id=\"3\" translatable=\"yes\">damn there are alot</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">more and more</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-copy</col>"
+    "        <col id=\"2\" translatable=\"yes\">here</col>"
+    "        <col id=\"3\" translatable=\"yes\">of columns to fill</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">text to enter</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-paste</col>"
+    "        <col id=\"2\" translatable=\"yes\">more</col>"
+    "        <col id=\"3\" translatable=\"yes\">in this liststore !</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">bla bla bla...</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-edit</col>"
+    "        <col id=\"2\" translatable=\"yes\">text</col>"
+    "        <col id=\"3\" translatable=\"yes\">ok here it comes</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">almost getting to the last column here</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-italic</col>"
+    "        <col id=\"2\" translatable=\"yes\">more</col>"
+    "        <col id=\"3\" translatable=\"yes\">its getting closer</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">stop its the last row !</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-save</col>"
+    "        <col id=\"2\" translatable=\"yes\">text</col>"
+    "        <col id=\"3\" translatable=\"yes\">and tada we reached the last damn row</col>"
+    "      </row>"
+    "    </data>"
+    "  </object>"
+    "  <object class=\"GtkWindow\" id=\"window\">"
+    "    <property name=\"default_width\">700</property>"
+    "    <property name=\"default_height\">400</property>"
+    "    <child>"
+    "      <object class=\"GtkHPaned\" id=\"hpaned1\">"
+    "        <property name=\"visible\">True</property>"
+    "        <property name=\"can_focus\">True</property>"
+    "        <property name=\"position\">400</property>"
+    "        <child>"
+    "          <object class=\"GtkScrolledWindow\" id=\"scrolledwindow1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"can_focus\">True</property>"
+    "            <property name=\"hscrollbar_policy\">automatic</property>"
+    "            <property name=\"vscrollbar_policy\">automatic</property>"
+    "            <property name=\"shadow_type\">in</property>"
+    "            <child>"
+    "              <object class=\"GtkTreeView\" id=\"treeview1\">"
+    "                <property name=\"visible\">True</property>"
+    "                <property name=\"can_focus\">True</property>"
+    "                <property name=\"model\">liststore1</property>"
+    "                <property name=\"headers_clickable\">False</property>"
+    "                <property name=\"search_column\">0</property>"
+    "                <child>"
+    "                  <object class=\"GtkTreeViewColumn\" id=\"treeviewcolumn1\">"
+    "                    <property name=\"sizing\">autosize</property>"
+    "                    <property name=\"title\" translatable=\"yes\">#1</property>"
+    "                    <property name=\"expand\">True</property>"
+    "                    <child>"
+    "                      <object class=\"GtkCellRendererText\" id=\"cellrenderertext1\">"
+    "                        <property name=\"width_chars\">10</property>"
+    "                        <property name=\"wrap_mode\">word</property>"
+    "                        <property name=\"wrap_width\">300</property>"
+    "                      </object>"
+    "                      <attributes>"
+    "                        <attribute name=\"text\">0</attribute>"
+    "                      </attributes>"
+    "                    </child>"
+    "                    <child>"
+    "                      <object class=\"GtkCellRendererPixbuf\" id=\"cellrendererpixbuf1\"/>"
+    "                      <attributes>"
+    "                        <attribute name=\"icon-name\">1</attribute>"
+    "                      </attributes>"
+    "                    </child>"
+    "                  </object>"
+    "                </child>"
+    "                <child>"
+    "                  <object class=\"GtkTreeViewColumn\" id=\"treeviewcolumn2\">"
+    "                    <property name=\"sizing\">autosize</property>"
+    "                    <property name=\"title\" translatable=\"yes\">#2</property>"
+    "                    <property name=\"expand\">True</property>"
+    "                    <child>"
+    "                      <object class=\"GtkCellRendererPixbuf\" id=\"cellrendererpixbuf2\"/>"
+    "                      <attributes>"
+    "                        <attribute name=\"icon-name\">1</attribute>"
+    "                      </attributes>"
+    "                    </child>"
+    "                    <child>"
+    "                      <object class=\"GtkCellRendererText\" id=\"cellrenderertext2\">"
+    "                        <property name=\"ellipsize\">start</property>"
+    "                      </object>"
+    "                      <attributes>"
+    "                        <attribute name=\"text\">2</attribute>"
+    "                      </attributes>"
+    "                    </child>"
+    "                    <child>"
+    "                      <object class=\"GtkCellRendererText\" id=\"cellrenderertext3\">"
+    "                        <property name=\"width_chars\">10</property>"
+    "                        <property name=\"wrap_mode\">word</property>"
+    "                        <property name=\"wrap_width\">300</property>"
+    "                      </object>"
+    "                      <attributes>"
+    "                        <attribute name=\"text\">3</attribute>"
+    "                      </attributes>"
+    "                    </child>"
+    "                  </object>"
+    "                </child>"
+    "              </object>"
+    "            </child>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">False</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "        <child>"
+    "          <object class=\"GtkLabel\" id=\"label1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"label\" translatable=\"yes\">static\n"
+    "text\n"
+    "here\n</property>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">True</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "      </object>"
+    "    </child>"
+    "  </object>"
+    "</interface>",
+    NULL
+  },
 };
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]