You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

113 regels
4.9 KiB

  1. /* gtktextdisplay.c - display layed-out text
  2. *
  3. * Copyright (c) 1992-1994 The Regents of the University of California.
  4. * Copyright (c) 1994-1997 Sun Microsystems, Inc.
  5. * Copyright (c) 2000 Red Hat, Inc.
  6. * Tk->Gtk port by Havoc Pennington
  7. *
  8. * This file can be used under your choice of two licenses, the LGPL
  9. * and the original Tk license.
  10. *
  11. * LGPL:
  12. *
  13. * This library is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU Lesser General Public
  15. * License as published by the Free Software Foundation; either
  16. * version 2 of the License, or (at your option) any later version.
  17. *
  18. * This library is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. * Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public
  24. * License along with this library; if not, write to the Free
  25. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26. *
  27. * Original Tk license:
  28. *
  29. * This software is copyrighted by the Regents of the University of
  30. * California, Sun Microsystems, Inc., and other parties. The
  31. * following terms apply to all files associated with the software
  32. * unless explicitly disclaimed in individual files.
  33. *
  34. * The authors hereby grant permission to use, copy, modify,
  35. * distribute, and license this software and its documentation for any
  36. * purpose, provided that existing copyright notices are retained in
  37. * all copies and that this notice is included verbatim in any
  38. * distributions. No written agreement, license, or royalty fee is
  39. * required for any of the authorized uses. Modifications to this
  40. * software may be copyrighted by their authors and need not follow
  41. * the licensing terms described here, provided that the new terms are
  42. * clearly indicated on the first page of each file where they apply.
  43. *
  44. * IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY
  45. * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  46. * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION,
  47. * OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED
  48. * OF THE POSSIBILITY OF SUCH DAMAGE.
  49. *
  50. * THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
  51. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  52. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
  53. * NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
  54. * AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
  55. * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  56. *
  57. * GOVERNMENT USE: If you are acquiring this software on behalf of the
  58. * U.S. government, the Government shall have only "Restricted Rights"
  59. * in the software and related documentation as defined in the Federal
  60. * Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
  61. * are acquiring the software on behalf of the Department of Defense,
  62. * the software shall be classified as "Commercial Computer Software"
  63. * and the Government shall have only "Restricted Rights" as defined
  64. * in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
  65. * foregoing, the authors grant the U.S. Government and others acting
  66. * in its behalf permission to use and distribute the software in
  67. * accordance with the terms specified in this license.
  68. *
  69. */
  70. /*
  71. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  72. * file for a list of people on the GTK+ Team. See the ChangeLog
  73. * files for a list of changes. These files are distributed with
  74. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  75. */
  76. #ifndef __GTK_TEXT_DISPLAY_H__
  77. #define __GTK_TEXT_DISPLAY_H__
  78. #include <gtk/gtktextlayout.h>
  79. G_BEGIN_DECLS
  80. /* A semi-public header intended for use by code that also
  81. * uses GtkTextLayout
  82. */
  83. /* The drawable should be pre-initialized to your preferred background.
  84. * widget - Widget to grab some style info from
  85. * drawable - Drawable to render to
  86. * cursor_gc - Graphics context to use for cursor
  87. * x_offset/y_offset - Position of the drawable in layout coordinates
  88. * x/y/width/height - Region of the layout to render. x,y must be inside
  89. * the drawable.
  90. * widgets - list of widgets that need exposing
  91. */
  92. void gtk_text_layout_draw (GtkTextLayout *layout,
  93. GtkWidget *widget,
  94. GdkDrawable *drawable,
  95. GdkGC *cursor_gc,
  96. gint x_offset,
  97. gint y_offset,
  98. gint x,
  99. gint y,
  100. gint width,
  101. gint height,
  102. GList **widgets);
  103. G_END_DECLS
  104. #endif /* __GTK_TEXT_DISPLAY_H__ */