diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-01 11:30:00 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-01 11:30:00 +0800 |
commit | 71c5738707028d12a3129a94a1b3823a7fab573c (patch) | |
tree | 262692b346e33d5cb0a08a3845ab9dc749f46068 /widgets/text | |
parent | c1a12789acbbc59830e9141da9024debaecccdb2 (diff) | |
download | gsoc2013-evolution-71c5738707028d12a3129a94a1b3823a7fab573c.tar gsoc2013-evolution-71c5738707028d12a3129a94a1b3823a7fab573c.tar.gz gsoc2013-evolution-71c5738707028d12a3129a94a1b3823a7fab573c.tar.bz2 gsoc2013-evolution-71c5738707028d12a3129a94a1b3823a7fab573c.tar.lz gsoc2013-evolution-71c5738707028d12a3129a94a1b3823a7fab573c.tar.xz gsoc2013-evolution-71c5738707028d12a3129a94a1b3823a7fab573c.tar.zst gsoc2013-evolution-71c5738707028d12a3129a94a1b3823a7fab573c.zip |
Only #include specific libgnome[ui] headers; easier to track.
Stop including top-level libgnome[ui] headers -- <gnome.h>,
<libgnome/libgnome.h> and <libgnomeui/libgnomeui.h>. Instead, include
specific header files so we can track them easier.
Also, remove several unshipped test programs. Mostly ETable stuff.
Diffstat (limited to 'widgets/text')
-rw-r--r-- | widgets/text/e-text-model-test.c | 93 | ||||
-rw-r--r-- | widgets/text/e-text-test.c | 172 |
2 files changed, 0 insertions, 265 deletions
diff --git a/widgets/text/e-text-model-test.c b/widgets/text/e-text-model-test.c deleted file mode 100644 index 0f1f216cfb..0000000000 --- a/widgets/text/e-text-model-test.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Chris Lahey <clahey@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include <gnome.h> - -#include "e-util/e-util.h" -#include "misc/e-canvas.h" - -#include "e-text-model.h" -#include "e-text-model-uri.h" -#include "e-text.h" - -#if 0 -static void -describe_model (ETextModel *model) -{ - gint i, N; - g_return_if_fail (E_IS_TEXT_MODEL (model)); - - N = e_text_model_object_count (model); - - g_print ("text: %s\n", e_text_model_get_text (model)); - g_print ("objs: %d\n", N); - - for (i=0; i<N; ++i) { - gchar *s = e_text_model_strdup_nth_object (model, i); - g_print ("obj%d: %s\n", i, s); - g_free (s); - } -} -#endif - -int -main (int argc, gchar **argv) -{ - GtkWidget *win[2], *canvas[2]; - GnomeCanvasItem *item[2]; - ETextModel *model; - gint i; - - gnome_init ("ETextModelTest", "0.0", argc, argv); - - model = e_text_model_uri_new (); - - e_text_model_set_text (model, "My favorite website is http://www.ximian.com. My next favorite www.assbarn.com."); - - /* describe_model (model); */ - - for (i=0; i<2; ++i) { - win[i] = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_widget_push_colormap (gdk_rgb_get_colormap ()); - canvas[i] = e_canvas_new (); - gtk_widget_pop_colormap (); - - item[i] = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas[i])), - e_text_get_type (), - "model", model, - "font", "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1", - "anchor", GTK_ANCHOR_NORTH, - "line_wrap", TRUE, - "width", 150.0, - "editable", TRUE, - NULL); - - gtk_container_add (GTK_CONTAINER (win[i]), canvas[i]); - gtk_widget_show_all (win[i]); - } - - gtk_main (); - - return 0; -} diff --git a/widgets/text/e-text-test.c b/widgets/text/e-text-test.c deleted file mode 100644 index adba386ad1..0000000000 --- a/widgets/text/e-text-test.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * e-text-test.c - E-Text item test program - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Iain Holmes <ih@csd.abdn.ac.uk> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * Copyright 2000: Iain Holmes <ih@csd.abdn.ac.uk> - * - */ - -#include <gnome.h> - -#include "misc/e-canvas.h" -#include "misc/e-unicode.h" - -#include "e-text.h" - -GnomeCanvasItem *rect; - -static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, GnomeCanvasItem *item) -{ - double height; - gnome_canvas_item_set( item, - "width", (double) allocation->width, - NULL ); - g_object_get(item, - "height", &height, - NULL); - height = MAX(height, allocation->height); - gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, allocation->width, height ); - gnome_canvas_item_set( rect, - "x2", (double) allocation->width, - "y2", (double) height, - NULL ); -} - -static void -reflow (GtkWidget *canvas, GnomeCanvasItem *item) -{ - double height; - g_object_get(item, - "height", &height, - NULL); - height = MAX(height, canvas->allocation.height); - gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, canvas->allocation.width, height ); - gnome_canvas_item_set( rect, - "x2", (double) canvas->allocation.width, - "y2", (double) height, - NULL ); -} - -static void -quit_cb (gpointer data, GObject *where_object_was) -{ - gtk_main_quit (); -} - -static void -change_text_cb (GtkEntry *entry, - EText *text) -{ - gchar *str; - - str = e_utf8_gtk_entry_get_text (entry); - gnome_canvas_item_set (GNOME_CANVAS_ITEM (text), - "text", str, - NULL); -} - -static void -change_font_cb (GtkEntry *entry, - EText *text) -{ - gchar *font; - - font = gtk_entry_get_text (entry); - gnome_canvas_item_set (GNOME_CANVAS_ITEM (text), - "font", font, - NULL); -} - -int -main (int argc, - char **argv) -{ - GtkWidget *window, *canvas, *scroller, *vbox, *text, *font; - GtkWidget *frame; - GnomeCanvasItem *item; - - gnome_init ("ETextTest", "0.0.1", argc, argv); - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window), "EText Test"); - g_object_weak_ref (G_OBJECT (window), - quit_cb, NULL); - - gtk_widget_push_colormap (gdk_rgb_get_colormap ()); - canvas = e_canvas_new (); - gtk_widget_pop_colormap (); - scroller = gtk_scrolled_window_new (NULL, NULL); - vbox = gtk_vbox_new (FALSE, 2); - - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_box_pack_start (GTK_BOX (vbox), scroller, TRUE, TRUE, 2); - gtk_container_add (GTK_CONTAINER (scroller), canvas); - - frame = gtk_frame_new ("Text"); - text = gtk_entry_new (); - gtk_entry_set_text(GTK_ENTRY(text), "Hello World! This is a really long string to test out the ellipsis stuff."); - gtk_container_add (GTK_CONTAINER (frame), text); - gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); - - frame = gtk_frame_new ("Font"); - font = gtk_entry_new (); - gtk_entry_set_text(GTK_ENTRY(font), "fixed"); - gtk_container_add (GTK_CONTAINER (frame), font); - gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); - - rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ), - gnome_canvas_rect_get_type(), - "x1", (double) 0, - "y1", (double) 0, - "x2", (double) 100, - "y2", (double) 100, - "fill_color", "white", - NULL ); - - item = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)), - e_text_get_type (), - "text", "Hello World! This is a really long string to test out the ellipsis stuff.", - "font", "fixed", - "fill_color", "black", - "anchor", GTK_ANCHOR_NW, - "clip", TRUE, - "use_ellipsis", TRUE, - "editable", TRUE, - "line_wrap", TRUE, - "max_lines", 2, - "width", 150.0, - NULL); - - g_signal_connect (text, "activate", - G_CALLBACK (change_text_cb), item); - g_signal_connect (font, "activate", - G_CALLBACK (change_font_cb), item); - - g_signal_connect (canvas , "size_allocate", - G_CALLBACK (allocate_callback), - item ); - g_signal_connect (canvas , "reflow", - G_CALLBACK (reflow), - item ); - gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0.0, 0.0, 400.0, 400.0); - gtk_widget_show_all (window); - gtk_main (); - - return 0; -} |