Mercurial > hg > xemacs-beta
annotate src/objects-gtk.c @ 5492:e82f5b7010fe
Merge some stuff in man, fix up Makefile
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-02-19 Ben Wing <ben@xemacs.org>
* widget.texi:
* widget.texi (Top):
* widget.texi (Introduction):
* widget.texi (User Interface):
* widget.texi (Programming Example):
* widget.texi (Setting Up the Buffer):
* widget.texi (Basic Types):
* widget.texi (link):
* widget.texi (url-link):
* widget.texi (info-link):
* widget.texi (push-button):
* widget.texi (editable-field):
* widget.texi (text):
* widget.texi (menu-choice):
* widget.texi (radio-button-choice):
* widget.texi (item):
* widget.texi (choice-item):
* widget.texi (toggle):
* widget.texi (checkbox):
* widget.texi (checklist):
* widget.texi (editable-list):
* widget.texi (group):
* widget.texi (Sexp Types):
* widget.texi (constants):
* widget.texi (generic):
* widget.texi (atoms):
* widget.texi (composite):
* widget.texi (Widget Properties):
* widget.texi (Defining New Widgets):
* widget.texi (Widget Browser):
* widget.texi (Widget Minor Mode):
* widget.texi (Utilities):
* widget.texi (Widget Wishlist):
* widget.texi (Widget Internals):
* widget.texi (GNU Free Documentation License):
* widget.texi (Index):
Sync with FSF 23.1.92.
2010-02-19 Ben Wing <ben@xemacs.org>
* texinfo/fdl.texi: New file.
* texinfo/texinfo.texi:
* texinfo/texinfo.texi (Top):
* texinfo/texinfo.texi (Copying Conditions):
* texinfo/texinfo.texi (Overview):
* texinfo/texinfo.texi (Reporting Bugs):
* texinfo/texinfo.texi (Using Texinfo):
* texinfo/texinfo.texi (Output Formats):
* texinfo/texinfo.texi (Info Files):
* texinfo/texinfo.texi (Printed Books):
* texinfo/texinfo.texi (Formatting Commands):
* texinfo/texinfo.texi (Conventions):
* texinfo/texinfo.texi (Comments):
* texinfo/texinfo.texi (Minimum):
* texinfo/texinfo.texi (Six Parts):
* texinfo/texinfo.texi (Short Sample):
* texinfo/texinfo.texi (History):
* texinfo/texinfo.texi (Texinfo Mode):
* texinfo/texinfo.texi (Texinfo Mode Overview):
* texinfo/texinfo.texi (XEmacs Editing):
* texinfo/texinfo.texi (Inserting):
* texinfo/texinfo.texi (Showing the Structure):
* texinfo/texinfo.texi (Updating Nodes and Menus):
* texinfo/texinfo.texi (Updating Commands):
* texinfo/texinfo.texi (Updating Requirements):
* texinfo/texinfo.texi (Other Updating Commands):
* texinfo/texinfo.texi (Info Formatting):
* texinfo/texinfo.texi (Printing):
* texinfo/texinfo.texi (Texinfo Mode Summary):
* texinfo/texinfo.texi (Beginning a File):
* texinfo/texinfo.texi (Sample Beginning):
* texinfo/texinfo.texi (Texinfo File Header):
* texinfo/texinfo.texi (First Line):
* texinfo/texinfo.texi (Start of Header):
* texinfo/texinfo.texi (setfilename):
* texinfo/texinfo.texi (settitle):
* texinfo/texinfo.texi (End of Header):
* texinfo/texinfo.texi (Document Permissions):
* texinfo/texinfo.texi (copying):
* texinfo/texinfo.texi (insertcopying):
* texinfo/texinfo.texi (Titlepage & Copyright Page):
* texinfo/texinfo.texi (titlepage):
* texinfo/texinfo.texi (titlefont center sp):
* texinfo/texinfo.texi (title subtitle author):
* texinfo/texinfo.texi (Copyright):
* texinfo/texinfo.texi (end titlepage):
* texinfo/texinfo.texi (headings on off):
* texinfo/texinfo.texi (Contents):
* texinfo/texinfo.texi (The Top Node):
* texinfo/texinfo.texi (Top Node Example):
* texinfo/texinfo.texi (Master Menu Parts):
* texinfo/texinfo.texi (Global Document Commands):
* texinfo/texinfo.texi (documentdescription):
* texinfo/texinfo.texi (setchapternewpage):
* texinfo/texinfo.texi (paragraphindent):
* texinfo/texinfo.texi (firstparagraphindent):
* texinfo/texinfo.texi (exampleindent):
* texinfo/texinfo.texi (Software Copying Permissions):
* texinfo/texinfo.texi (Ending a File):
* texinfo/texinfo.texi (Printing Indices & Menus):
* texinfo/texinfo.texi (File End):
* texinfo/texinfo.texi (Structuring):
* texinfo/texinfo.texi (Tree Structuring):
* texinfo/texinfo.texi (Structuring Command Types):
* texinfo/texinfo.texi (makeinfo top):
* texinfo/texinfo.texi (chapter):
* texinfo/texinfo.texi (unnumbered & appendix):
* texinfo/texinfo.texi (majorheading & chapheading):
* texinfo/texinfo.texi (section):
* texinfo/texinfo.texi (unnumberedsec appendixsec heading):
* texinfo/texinfo.texi (subsection):
* texinfo/texinfo.texi (unnumberedsubsec appendixsubsec subheading):
* texinfo/texinfo.texi (subsubsection):
* texinfo/texinfo.texi (Raise/lower sections):
* texinfo/texinfo.texi (Nodes):
* texinfo/texinfo.texi (Two Paths):
* texinfo/texinfo.texi (Node Menu Illustration):
* texinfo/texinfo.texi (node):
* texinfo/texinfo.texi (Node Names):
* texinfo/texinfo.texi (Writing a Node):
* texinfo/texinfo.texi (Node Line Tips):
* texinfo/texinfo.texi (Node Line Requirements):
* texinfo/texinfo.texi (First Node):
* texinfo/texinfo.texi (makeinfo top command):
* texinfo/texinfo.texi (makeinfo Pointer Creation):
* texinfo/texinfo.texi (anchor):
* texinfo/texinfo.texi (Menus):
* texinfo/texinfo.texi (Menu Location):
* texinfo/texinfo.texi (Writing a Menu):
* texinfo/texinfo.texi (Menu Parts):
* texinfo/texinfo.texi (Less Cluttered Menu Entry):
* texinfo/texinfo.texi (Menu Example):
* texinfo/texinfo.texi (Other Info Files):
* texinfo/texinfo.texi (Cross References):
* texinfo/texinfo.texi (References):
* texinfo/texinfo.texi (Cross Reference Commands):
* texinfo/texinfo.texi (Cross Reference Parts):
* texinfo/texinfo.texi (xref):
* texinfo/texinfo.texi (Reference Syntax):
* texinfo/texinfo.texi (One Argument):
* texinfo/texinfo.texi (Two Arguments):
* texinfo/texinfo.texi (Three Arguments):
* texinfo/texinfo.texi (Four and Five Arguments):
* texinfo/texinfo.texi (Top Node Naming):
* texinfo/texinfo.texi (ref):
* texinfo/texinfo.texi (pxref):
* texinfo/texinfo.texi (inforef):
* texinfo/texinfo.texi (uref):
* texinfo/texinfo.texi (cite):
* texinfo/texinfo.texi (Marking Text):
* texinfo/texinfo.texi (Indicating):
* texinfo/texinfo.texi (Useful Highlighting):
* texinfo/texinfo.texi (code):
* texinfo/texinfo.texi (kbd):
* texinfo/texinfo.texi (key):
* texinfo/texinfo.texi (samp):
* texinfo/texinfo.texi (verb):
* texinfo/texinfo.texi (var):
* texinfo/texinfo.texi (env):
* texinfo/texinfo.texi (file):
* texinfo/texinfo.texi (command):
* texinfo/texinfo.texi (option):
* texinfo/texinfo.texi (dfn):
* texinfo/texinfo.texi (abbr):
* texinfo/texinfo.texi (acronym):
* texinfo/texinfo.texi (indicateurl):
* texinfo/texinfo.texi (email):
* texinfo/texinfo.texi (Emphasis):
* texinfo/texinfo.texi (emph & strong):
* texinfo/texinfo.texi (Smallcaps):
* texinfo/texinfo.texi (Fonts):
* texinfo/texinfo.texi (Quotations and Examples):
* texinfo/texinfo.texi (Block Enclosing Commands):
* texinfo/texinfo.texi (quotation):
* texinfo/texinfo.texi (example):
* texinfo/texinfo.texi (verbatim):
* texinfo/texinfo.texi (verbatiminclude):
* texinfo/texinfo.texi (lisp):
* texinfo/texinfo.texi (small):
* texinfo/texinfo.texi (display):
* texinfo/texinfo.texi (format):
* texinfo/texinfo.texi (exdent):
* texinfo/texinfo.texi (flushleft & flushright):
* texinfo/texinfo.texi (noindent):
* texinfo/texinfo.texi (indent):
* texinfo/texinfo.texi (cartouche):
* texinfo/texinfo.texi (Lists and Tables):
* texinfo/texinfo.texi (Introducing Lists):
* texinfo/texinfo.texi (itemize):
* texinfo/texinfo.texi (enumerate):
* texinfo/texinfo.texi (Two-column Tables):
* texinfo/texinfo.texi (table):
* texinfo/texinfo.texi (ftable vtable):
* texinfo/texinfo.texi (itemx):
* texinfo/texinfo.texi (Multi-column Tables):
* texinfo/texinfo.texi (Multitable Column Widths):
* texinfo/texinfo.texi (Multitable Rows):
* texinfo/texinfo.texi (Special Displays):
* texinfo/texinfo.texi (Floats):
* texinfo/texinfo.texi (float):
* texinfo/texinfo.texi (caption shortcaption):
* texinfo/texinfo.texi (listoffloats):
* texinfo/texinfo.texi (Images):
* texinfo/texinfo.texi (Image Syntax):
* texinfo/texinfo.texi (Image Scaling):
* texinfo/texinfo.texi (Footnotes):
* texinfo/texinfo.texi (Footnote Commands):
* texinfo/texinfo.texi (Footnote Styles):
* texinfo/texinfo.texi (Indices):
* texinfo/texinfo.texi (Index Entries):
* texinfo/texinfo.texi (Predefined Indices):
* texinfo/texinfo.texi (Indexing Commands):
* texinfo/texinfo.texi (Combining Indices):
* texinfo/texinfo.texi (syncodeindex):
* texinfo/texinfo.texi (synindex):
* texinfo/texinfo.texi (New Indices):
* texinfo/texinfo.texi (Insertions):
* texinfo/texinfo.texi (Atsign Braces Comma):
* texinfo/texinfo.texi (Inserting an Atsign):
* texinfo/texinfo.texi (Inserting Braces):
* texinfo/texinfo.texi (Inserting a Comma):
* texinfo/texinfo.texi (Inserting Quote Characters):
* texinfo/texinfo.texi (Inserting Space):
* texinfo/texinfo.texi (Not Ending a Sentence):
* texinfo/texinfo.texi (Ending a Sentence):
* texinfo/texinfo.texi (Multiple Spaces):
* texinfo/texinfo.texi (frenchspacing):
* texinfo/texinfo.texi (dmn):
* texinfo/texinfo.texi (Inserting Accents):
* texinfo/texinfo.texi (Inserting Quotation Marks):
* texinfo/texinfo.texi (Dots Bullets):
* texinfo/texinfo.texi (dots):
* texinfo/texinfo.texi (bullet):
* texinfo/texinfo.texi (TeX and copyright):
* texinfo/texinfo.texi (tex):
* texinfo/texinfo.texi (copyright symbol):
* texinfo/texinfo.texi (registered symbol):
* texinfo/texinfo.texi (euro):
* texinfo/texinfo.texi (pounds):
* texinfo/texinfo.texi (textdegree):
* texinfo/texinfo.texi (minus):
* texinfo/texinfo.texi (geq leq):
* texinfo/texinfo.texi (math):
* texinfo/texinfo.texi (Click Sequences):
* texinfo/texinfo.texi (Glyphs):
* texinfo/texinfo.texi (Glyphs Summary):
* texinfo/texinfo.texi (result):
* texinfo/texinfo.texi (expansion):
* texinfo/texinfo.texi (Print Glyph):
* texinfo/texinfo.texi (Error Glyph):
* texinfo/texinfo.texi (Equivalence):
* texinfo/texinfo.texi (Point Glyph):
* texinfo/texinfo.texi (Breaks):
* texinfo/texinfo.texi (Break Commands):
* texinfo/texinfo.texi (Line Breaks):
* texinfo/texinfo.texi (- and hyphenation):
* texinfo/texinfo.texi (allowcodebreaks):
* texinfo/texinfo.texi (w):
* texinfo/texinfo.texi (tie):
* texinfo/texinfo.texi (sp):
* texinfo/texinfo.texi (page):
* texinfo/texinfo.texi (group):
* texinfo/texinfo.texi (need):
* texinfo/texinfo.texi (Definition Commands):
* texinfo/texinfo.texi (Def Cmd Template):
* texinfo/texinfo.texi (Def Cmd Continuation Lines):
* texinfo/texinfo.texi (Optional Arguments):
* texinfo/texinfo.texi (deffnx):
* texinfo/texinfo.texi (Def Cmds in Detail):
* texinfo/texinfo.texi (Functions Commands):
* texinfo/texinfo.texi (Variables Commands):
* texinfo/texinfo.texi (Typed Functions):
* texinfo/texinfo.texi (Typed Variables):
* texinfo/texinfo.texi (Data Types):
* texinfo/texinfo.texi (Abstract Objects):
* texinfo/texinfo.texi (Object-Oriented Variables):
* texinfo/texinfo.texi (Object-Oriented Methods):
* texinfo/texinfo.texi (Defining Macros):
* texinfo/texinfo.texi (Invoking Macros):
* texinfo/texinfo.texi (Macro Details):
* texinfo/texinfo.texi (alias):
* texinfo/texinfo.texi (definfoenclose):
* texinfo/texinfo.texi (Hardcopy):
* texinfo/texinfo.texi (Use TeX):
* texinfo/texinfo.texi (Format with tex/texindex):
* texinfo/texinfo.texi (Format with texi2dvi):
* texinfo/texinfo.texi (Print with lpr):
* texinfo/texinfo.texi (Within XEmacs):
* texinfo/texinfo.texi (Texinfo Mode Printing):
* texinfo/texinfo.texi (Compile-Command):
* texinfo/texinfo.texi (Requirements Summary):
* texinfo/texinfo.texi (Preparing for TeX):
* texinfo/texinfo.texi (Overfull hboxes):
* texinfo/texinfo.texi (smallbook):
* texinfo/texinfo.texi (A4 Paper):
* texinfo/texinfo.texi (pagesizes):
* texinfo/texinfo.texi (Cropmarks and Magnification):
* texinfo/texinfo.texi (PDF Output):
* texinfo/texinfo.texi (Obtaining TeX):
* texinfo/texinfo.texi (Creating and Installing Info Files):
* texinfo/texinfo.texi (Creating an Info File):
* texinfo/texinfo.texi (makeinfo advantages):
* texinfo/texinfo.texi (Invoking makeinfo):
* texinfo/texinfo.texi (makeinfo options):
* texinfo/texinfo.texi (Pointer Validation):
* texinfo/texinfo.texi (makeinfo in XEmacs):
* texinfo/texinfo.texi (texinfo-format commands):
* texinfo/texinfo.texi (Batch Formatting):
* texinfo/texinfo.texi (Tag and Split Files):
* texinfo/texinfo.texi (Installing an Info File):
* texinfo/texinfo.texi (Directory File):
* texinfo/texinfo.texi (New Info File):
* texinfo/texinfo.texi (Other Info Directories):
* texinfo/texinfo.texi (Installing Dir Entries):
* texinfo/texinfo.texi (Invoking install-info):
* texinfo/texinfo.texi (Generating HTML):
* texinfo/texinfo.texi (HTML Translation):
* texinfo/texinfo.texi (HTML Splitting):
* texinfo/texinfo.texi (HTML CSS):
* texinfo/texinfo.texi (HTML Xref):
* texinfo/texinfo.texi (HTML Xref Link Basics):
* texinfo/texinfo.texi (HTML Xref Node Name Expansion):
* texinfo/texinfo.texi (HTML Xref Command Expansion):
* texinfo/texinfo.texi (HTML Xref 8-bit Character Expansion):
* texinfo/texinfo.texi (HTML Xref Mismatch):
* texinfo/texinfo.texi (Command List):
* texinfo/texinfo.texi (Command Syntax):
* texinfo/texinfo.texi (Tips):
* texinfo/texinfo.texi (Sample Texinfo Files):
* texinfo/texinfo.texi (Short Sample Texinfo File):
* texinfo/texinfo.texi (GNU Sample Texts):
* texinfo/texinfo.texi (Invoking sample):
* texinfo/texinfo.texi (GNU Free Documentation License):
* texinfo/texinfo.texi (Index):
* texinfo/texinfo.texi (Verbatim Copying License):
* texinfo/texinfo.texi (All-permissive Copying License):
* texinfo/texinfo.texi (Include Files):
* texinfo/texinfo.texi (Using Include Files):
* texinfo/texinfo.texi (texinfo-multiple-files-update):
* texinfo/texinfo.texi (Include Files Requirements):
* texinfo/texinfo.texi (Sample Include File):
* texinfo/texinfo.texi (Include Files Evolution):
* texinfo/texinfo.texi (Headings):
* texinfo/texinfo.texi (Headings Introduced):
* texinfo/texinfo.texi (Heading Format):
* texinfo/texinfo.texi (Heading Choice):
* texinfo/texinfo.texi (Custom Headings):
* texinfo/texinfo.texi (Catching Mistakes):
* texinfo/texinfo.texi (makeinfo Preferred):
* texinfo/texinfo.texi (Debugging with Info):
* texinfo/texinfo.texi (Debugging with TeX):
* texinfo/texinfo.texi (Using texinfo-show-structure):
* texinfo/texinfo.texi (Using occur):
* texinfo/texinfo.texi (Running Info-Validate):
* texinfo/texinfo.texi (Using Info-validate):
* texinfo/texinfo.texi (Unsplit):
* texinfo/texinfo.texi (Tagifying):
* texinfo/texinfo.texi (Splitting):
* texinfo/texinfo.texi (Refilling Paragraphs):
* texinfo/texinfo.texi (Command and Variable Index):
* texinfo/texinfo.texi (General Index):
* texinfo/version.texi: New file.
Sync with FSF 23.1.92. Make new directory to hold the files needed
to generate texinfo.info, since there are three such files now.
2010-02-19 Ben Wing <ben@xemacs.org>
* Makefile:
* Makefile (src_files1):
* Makefile (DIR):
* Makefile (texinfo-srcs):
* Makefile ($(INFODIR)/widget.info):
* Makefile ($(INFODIR)/texinfo.info):
* Makefile (.PHONY):
* Makefile (texinfo.dvi):
* Makefile (texinfo.pdf):
* Makefile ($(HTMLDIR)/widget.html):
* Makefile ($(HTMLDIR)/texinfo.html):
Incorporate texinfo.texi moving to a subdirectory texinfo/.
Do some tricks to reduce the amount of duplication while still
maintaining compatible with non-GNU make (at least, with
Solaris make).
* doclicense.texi: New file.
* info.texi:
* info.texi (Top):
* info.texi (Getting Started):
* info.texi (Help-Small-Screen):
* info.texi (Help):
* info.texi (Help-P):
* info.texi (Help-^L):
* info.texi (Help-Inv):
* info.texi (Help-]):
* info.texi (Help-M):
* info.texi (Help-FOO):
* info.texi (Help-Xref):
* info.texi (Help-Int):
* info.texi (Help-Q):
* info.texi (Advanced):
* info.texi (Search Text):
* info.texi (Search Index):
* info.texi (Go to node):
* info.texi (Choose menu subtopic):
* info.texi (Create Info buffer):
* info.texi (XEmacs Info Variables):
* info.texi (Expert Info):
* info.texi (Add):
* info.texi (Menus):
* info.texi (Cross-refs):
* info.texi (Help-Cross):
* info.texi (Tags):
* info.texi (Checking):
* info.texi (Index):
* texinfo.tex:
* texinfo.tex (paragraphindent{%):
* texinfo.tex (sectionheading will have):
* texinfo.tex (chapterzzz{#3}%):
* texinfo.tex (subsubsection = \numberedsubsubsec):
* texinfo.tex (subsubsection = \appendixsubsubsec):
* texinfo.tex (subsubsection = \unnumberedsubsubsec):
* texinfo.tex (sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynumbered}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yomitfromtoc}{}):
* texinfo.tex (sectionheading to do the printing.):
* texinfo.tex (sectionlevel}{#1}{#4}%):
* texinfo.tex (sectionheading, q.v.):
Sync with FSF 23.1.92.
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Fri, 19 Feb 2010 22:39:19 -0600 |
| parents | 3c3c1d139863 |
| children |
| rev | line source |
|---|---|
| 462 | 1 /* X-specific Lisp objects. |
| 2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. | |
| 3 Copyright (C) 1995 Board of Trustees, University of Illinois. | |
| 4 Copyright (C) 1995 Tinker Systems. | |
| 872 | 5 Copyright (C) 1995, 1996, 2002 Ben Wing. |
| 462 | 6 Copyright (C) 1995 Sun Microsystems, Inc. |
| 7 | |
| 8 This file is part of XEmacs. | |
| 9 | |
| 10 XEmacs is free software; you can redistribute it and/or modify it | |
| 11 under the terms of the GNU General Public License as published by the | |
| 12 Free Software Foundation; either version 2, or (at your option) any | |
| 13 later version. | |
| 14 | |
| 15 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 18 for more details. | |
| 19 | |
| 20 You should have received a copy of the GNU General Public License | |
| 21 along with XEmacs; see the file COPYING. If not, write to | |
| 22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 23 Boston, MA 02111-1307, USA. */ | |
| 24 | |
| 25 /* Synched up with: Not in FSF. */ | |
| 26 | |
| 27 /* Authors: Jamie Zawinski, Chuck Thompson, Ben Wing */ | |
| 28 /* Gtk version by William Perry */ | |
| 29 | |
| 30 #include <config.h> | |
| 31 #include "lisp.h" | |
| 32 | |
| 872 | 33 #include "buffer.h" |
| 3676 | 34 #include "charset.h" |
| 872 | 35 #include "device-impl.h" |
| 36 #include "insdel.h" | |
| 462 | 37 |
| 872 | 38 #include "console-gtk-impl.h" |
| 39 #include "objects-gtk-impl.h" | |
| 462 | 40 |
| 41 /* sigh */ | |
|
4908
b3ce27ca7647
various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
3676
diff
changeset
|
42 #include "sysgdkx.h" |
| 462 | 43 |
| 3659 | 44 /* XListFonts doesn't allocate memory unconditionally based on this. (For |
| 45 XFree86 in 2005, at least. */ | |
| 46 #define MAX_FONT_COUNT INT_MAX | |
| 47 | |
| 48 #ifdef DEBUG_XEMACS | |
| 49 Fixnum debug_x_objects; | |
| 50 #endif /* DEBUG_XEMACS */ | |
| 51 | |
| 462 | 52 |
| 53 /************************************************************************/ | |
| 54 /* color instances */ | |
| 55 /************************************************************************/ | |
| 56 | |
| 57 /* Replacement for XAllocColor() that tries to return the nearest | |
| 58 available color if the colormap is full. Original was from FSFmacs, | |
| 59 but rewritten by Jareth Hein <jareth@camelot-soft.com> 97/11/25 | |
| 60 Modified by Lee Kindness <lkindness@csl.co.uk> 31/08/99 to handle previous | |
| 61 total failure which was due to a read/write colorcell being the nearest | |
| 62 match - tries the next nearest... | |
| 63 | |
| 64 Gdk takes care of all this behind the scenes, so we don't need to | |
| 65 worry about it. | |
| 66 | |
| 67 Return value is 1 for normal success, 2 for nearest color success, | |
| 68 3 for Non-deallocable sucess. */ | |
| 69 int | |
| 2286 | 70 allocate_nearest_color (GdkColormap *colormap, GdkVisual *UNUSED (visual), |
| 462 | 71 GdkColor *color_def) |
| 72 { | |
| 73 int rc; | |
| 74 | |
| 75 rc = gdk_colormap_alloc_color (colormap, color_def, FALSE, TRUE); | |
| 76 | |
| 77 if (rc == TRUE) | |
| 78 return (1); | |
| 79 | |
| 80 return (0); | |
| 81 } | |
| 82 | |
| 83 int | |
| 867 | 84 gtk_parse_nearest_color (struct device *d, GdkColor *color, Ibyte *name, |
| 578 | 85 Bytecount len, Error_Behavior errb) |
| 462 | 86 { |
| 87 GdkColormap *cmap; | |
| 88 GdkVisual *visual; | |
| 89 int result; | |
| 90 | |
| 91 cmap = DEVICE_GTK_COLORMAP(d); | |
| 92 visual = DEVICE_GTK_VISUAL (d); | |
| 93 | |
| 94 xzero (*color); | |
| 95 { | |
| 96 const Extbyte *extname; | |
| 665 | 97 Bytecount extnamelen; |
| 462 | 98 |
| 99 TO_EXTERNAL_FORMAT (DATA, (name, len), ALLOCA, (extname, extnamelen), Qbinary); | |
| 100 | |
| 101 result = gdk_color_parse (extname, color); | |
| 102 } | |
| 103 | |
| 104 if (result == FALSE) | |
| 105 { | |
| 563 | 106 maybe_invalid_argument ("unrecognized color", make_string (name, len), |
| 107 Qcolor, errb); | |
| 462 | 108 return 0; |
| 109 } | |
| 110 result = allocate_nearest_color (cmap, visual, color); | |
| 111 if (!result) | |
| 112 { | |
| 563 | 113 maybe_signal_error (Qgui_error, "couldn't allocate color", |
| 114 make_string (name, len), Qcolor, errb); | |
| 462 | 115 return 0; |
| 116 } | |
| 117 | |
| 118 return result; | |
| 119 } | |
| 120 | |
| 121 static int | |
| 122 gtk_initialize_color_instance (struct Lisp_Color_Instance *c, Lisp_Object name, | |
| 578 | 123 Lisp_Object device, Error_Behavior errb) |
| 462 | 124 { |
| 125 GdkColor color; | |
| 126 int result; | |
| 127 | |
| 128 result = gtk_parse_nearest_color (XDEVICE (device), &color, | |
| 129 XSTRING_DATA (name), | |
| 130 XSTRING_LENGTH (name), | |
| 131 errb); | |
| 132 | |
| 133 if (!result) | |
| 134 return 0; | |
| 135 | |
| 136 /* Don't allocate the data until we're sure that we will succeed, | |
| 137 or the finalize method may get fucked. */ | |
| 138 c->data = xnew (struct gtk_color_instance_data); | |
| 139 if (result == 3) | |
| 140 COLOR_INSTANCE_GTK_DEALLOC (c) = 0; | |
| 141 else | |
| 142 COLOR_INSTANCE_GTK_DEALLOC (c) = 1; | |
| 143 COLOR_INSTANCE_GTK_COLOR (c) = gdk_color_copy (&color); | |
| 144 return 1; | |
| 145 } | |
| 146 | |
| 147 static void | |
| 148 gtk_print_color_instance (struct Lisp_Color_Instance *c, | |
| 149 Lisp_Object printcharfun, | |
| 2286 | 150 int UNUSED (escapeflag)) |
| 462 | 151 { |
| 152 GdkColor *color = COLOR_INSTANCE_GTK_COLOR (c); | |
| 800 | 153 write_fmt_string (printcharfun, " %ld=(%X,%X,%X)", |
| 154 color->pixel, color->red, color->green, color->blue); | |
| 462 | 155 } |
| 156 | |
| 157 static void | |
| 158 gtk_finalize_color_instance (struct Lisp_Color_Instance *c) | |
| 159 { | |
| 160 if (c->data) | |
| 161 { | |
| 162 if (DEVICE_LIVE_P (XDEVICE (c->device))) | |
| 163 { | |
| 164 if (COLOR_INSTANCE_GTK_DEALLOC (c)) | |
| 165 { | |
| 166 gdk_colormap_free_colors (DEVICE_GTK_COLORMAP (XDEVICE (c->device)), | |
| 167 COLOR_INSTANCE_GTK_COLOR (c), 1); | |
| 168 } | |
| 169 gdk_color_free (COLOR_INSTANCE_GTK_COLOR (c)); | |
| 170 } | |
|
4976
16112448d484
Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents:
4962
diff
changeset
|
171 xfree (c->data); |
| 462 | 172 c->data = 0; |
| 173 } | |
| 174 } | |
| 175 | |
| 176 /* Color instances are equal if they resolve to the same color on the | |
| 177 screen (have the same RGB values). I imagine that | |
| 178 "same RGB values" == "same cell in the colormap." Arguably we should | |
| 179 be comparing their names or pixel values instead. */ | |
| 180 | |
| 181 static int | |
| 182 gtk_color_instance_equal (struct Lisp_Color_Instance *c1, | |
| 183 struct Lisp_Color_Instance *c2, | |
| 2286 | 184 int UNUSED (depth)) |
| 462 | 185 { |
| 186 return (gdk_color_equal (COLOR_INSTANCE_GTK_COLOR (c1), | |
| 187 COLOR_INSTANCE_GTK_COLOR (c2))); | |
| 188 } | |
| 189 | |
| 2515 | 190 static Hashcode |
| 2286 | 191 gtk_color_instance_hash (struct Lisp_Color_Instance *c, int UNUSED (depth)) |
| 462 | 192 { |
| 193 return (gdk_color_hash (COLOR_INSTANCE_GTK_COLOR (c), NULL)); | |
| 194 } | |
| 195 | |
| 196 static Lisp_Object | |
| 197 gtk_color_instance_rgb_components (struct Lisp_Color_Instance *c) | |
| 198 { | |
| 199 GdkColor *color = COLOR_INSTANCE_GTK_COLOR (c); | |
| 200 return (list3 (make_int (color->red), | |
| 201 make_int (color->green), | |
| 202 make_int (color->blue))); | |
| 203 } | |
| 204 | |
| 205 static int | |
| 2286 | 206 gtk_valid_color_name_p (struct device *UNUSED (d), Lisp_Object color) |
| 462 | 207 { |
| 208 GdkColor c; | |
| 209 const char *extname; | |
| 210 | |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4962
diff
changeset
|
211 extname = LISP_STRING_TO_EXTERNAL (color, Qctext); |
| 462 | 212 |
| 213 if (gdk_color_parse (extname, &c) != TRUE) | |
| 214 return(0); | |
| 215 return (1); | |
| 216 } | |
| 217 | |
| 2527 | 218 static Lisp_Object |
| 219 gtk_color_list (void) | |
| 220 { | |
| 221 /* #### BILL!!! | |
| 222 Is this correct? */ | |
| 223 return call0 (intern ("x-color-list-internal")); | |
| 224 } | |
| 225 | |
| 462 | 226 |
| 227 /************************************************************************/ | |
| 228 /* font instances */ | |
| 229 /************************************************************************/ | |
| 230 | |
| 231 static int | |
| 2286 | 232 gtk_initialize_font_instance (struct Lisp_Font_Instance *f, |
| 233 Lisp_Object UNUSED (name), | |
| 234 Lisp_Object UNUSED (device), Error_Behavior errb) | |
| 462 | 235 { |
| 236 GdkFont *gf; | |
| 237 XFontStruct *xf; | |
| 238 const char *extname; | |
| 239 | |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4962
diff
changeset
|
240 extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext); |
| 462 | 241 |
| 242 gf = gdk_font_load (extname); | |
| 243 | |
| 244 if (!gf) | |
| 245 { | |
| 563 | 246 maybe_signal_error (Qgui_error, "couldn't load font", f->name, |
| 247 Qfont, errb); | |
| 462 | 248 return 0; |
| 249 } | |
| 250 | |
| 2054 | 251 xf = (XFontStruct*) GDK_FONT_XFONT (gf); |
| 462 | 252 |
| 253 /* Don't allocate the data until we're sure that we will succeed, | |
| 254 or the finalize method may get fucked. */ | |
| 255 f->data = xnew (struct gtk_font_instance_data); | |
| 256 FONT_INSTANCE_GTK_FONT (f) = gf; | |
| 257 f->ascent = gf->ascent; | |
| 258 f->descent = gf->descent; | |
| 259 f->height = gf->ascent + gf->descent; | |
| 260 | |
| 261 /* Now lets figure out the width of the font */ | |
| 262 { | |
| 263 /* following change suggested by Ted Phelps <phelps@dstc.edu.au> */ | |
| 264 unsigned int def_char = 'n'; /*xf->default_char;*/ | |
| 265 unsigned int byte1, byte2; | |
| 266 | |
| 267 once_more: | |
| 268 byte1 = def_char >> 8; | |
| 269 byte2 = def_char & 0xFF; | |
| 270 | |
| 271 if (xf->per_char) | |
| 272 { | |
| 273 /* Old versions of the R5 font server have garbage (>63k) as | |
| 274 def_char. 'n' might not be a valid character. */ | |
| 275 if (byte1 < xf->min_byte1 || | |
| 276 byte1 > xf->max_byte1 || | |
| 277 byte2 < xf->min_char_or_byte2 || | |
| 278 byte2 > xf->max_char_or_byte2) | |
| 279 f->width = 0; | |
| 280 else | |
| 281 f->width = xf->per_char[(byte1 - xf->min_byte1) * | |
| 282 (xf->max_char_or_byte2 - | |
| 283 xf->min_char_or_byte2 + 1) + | |
| 284 (byte2 - xf->min_char_or_byte2)].width; | |
| 285 } | |
| 286 else | |
| 287 f->width = xf->max_bounds.width; | |
| 288 | |
| 289 /* Some fonts have a default char whose width is 0. This is no good. | |
| 290 If that's the case, first try 'n' as the default char, and if n has | |
| 291 0 width too (unlikely) then just use the max width. */ | |
| 292 if (f->width == 0) | |
| 293 { | |
| 294 if (def_char == xf->default_char) | |
| 295 f->width = xf->max_bounds.width; | |
| 296 else | |
| 297 { | |
| 298 def_char = xf->default_char; | |
| 299 goto once_more; | |
| 300 } | |
| 301 } | |
| 302 } | |
| 303 | |
| 304 /* If all characters don't exist then there could potentially be | |
| 305 0-width characters lurking out there. Not setting this flag | |
| 306 trips an optimization that would make them appear to have width | |
| 307 to redisplay. This is bad. So we set it if not all characters | |
| 308 have the same width or if not all characters are defined. | |
| 309 */ | |
| 310 /* #### This sucks. There is a measurable performance increase | |
| 311 when using proportional width fonts if this flag is not set. | |
| 312 Unfortunately so many of the fucking X fonts are not fully | |
| 313 defined that we could almost just get rid of this damn flag and | |
| 314 make it an assertion. */ | |
| 315 f->proportional_p = (xf->min_bounds.width != xf->max_bounds.width || | |
| 316 (/* x_handle_non_fully_specified_fonts */ 0 && | |
| 317 !xf->all_chars_exist)); | |
| 318 #if 0 | |
| 319 f->width = gdk_char_width (gf, 'n'); | |
| 320 f->proportional_p = (gdk_char_width (gf, '|') != gdk_char_width (gf, 'W')) ? 1 : 0; | |
| 321 #endif | |
| 322 return 1; | |
| 323 } | |
| 324 | |
| 325 static void | |
| 326 gtk_print_font_instance (struct Lisp_Font_Instance *f, | |
| 327 Lisp_Object printcharfun, | |
| 2286 | 328 int UNUSED (escapeflag)) |
| 462 | 329 { |
| 800 | 330 write_fmt_string (printcharfun, " 0x%lx", |
| 331 (unsigned long) gdk_font_id (FONT_INSTANCE_GTK_FONT (f))); | |
| 462 | 332 } |
| 333 | |
| 334 static void | |
| 335 gtk_finalize_font_instance (struct Lisp_Font_Instance *f) | |
| 336 { | |
| 337 if (f->data) | |
| 338 { | |
| 339 if (DEVICE_LIVE_P (XDEVICE (f->device))) | |
| 340 { | |
| 341 gdk_font_unref (FONT_INSTANCE_GTK_FONT (f)); | |
| 342 } | |
|
4976
16112448d484
Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents:
4962
diff
changeset
|
343 xfree (f->data); |
| 462 | 344 f->data = 0; |
| 345 } | |
| 346 } | |
| 347 | |
| 348 /* Forward declarations for X specific functions at the end of the file */ | |
| 349 Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font, int expandp); | |
| 2527 | 350 static Lisp_Object __gtk_font_list_internal (const char *pattern); |
| 462 | 351 |
| 352 static Lisp_Object | |
| 2286 | 353 gtk_font_instance_truename (struct Lisp_Font_Instance *f, |
| 354 Error_Behavior UNUSED (errb)) | |
| 462 | 355 { |
| 872 | 356 if (NILP (FONT_INSTANCE_TRUENAME (f))) |
| 462 | 357 { |
| 872 | 358 FONT_INSTANCE_TRUENAME (f) = __get_gtk_font_truename (FONT_INSTANCE_GTK_FONT (f), 1); |
| 462 | 359 |
| 872 | 360 if (NILP (FONT_INSTANCE_TRUENAME (f))) |
| 462 | 361 { |
| 362 /* Ok, just this once, return the font name as the truename. | |
| 363 (This is only used by Fequal() right now.) */ | |
| 364 return f->name; | |
| 365 } | |
| 366 } | |
| 872 | 367 return (FONT_INSTANCE_TRUENAME (f)); |
| 462 | 368 } |
| 369 | |
| 370 static Lisp_Object | |
| 2286 | 371 gtk_font_instance_properties (struct Lisp_Font_Instance *UNUSED (f)) |
| 462 | 372 { |
| 373 Lisp_Object result = Qnil; | |
| 374 | |
| 375 /* #### BILL!!! */ | |
| 376 /* There seems to be no way to get this information under Gtk */ | |
| 377 return result; | |
| 378 } | |
| 379 | |
| 380 static Lisp_Object | |
| 2527 | 381 gtk_font_list (Lisp_Object pattern, Lisp_Object UNUSED (device), |
| 2286 | 382 Lisp_Object UNUSED (maxnumber)) |
| 462 | 383 { |
| 384 const char *patternext; | |
| 385 | |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4962
diff
changeset
|
386 patternext = LISP_STRING_TO_EXTERNAL (pattern, Qbinary); |
| 462 | 387 |
| 2527 | 388 return (__gtk_font_list_internal (patternext)); |
| 462 | 389 } |
| 390 | |
| 3659 | 391 /* Include the charset support, shared, for the moment, with X11. */ |
| 392 #define THIS_IS_GTK | |
| 393 #include "objects-xlike-inc.c" | |
| 462 | 394 |
| 395 | |
| 396 /************************************************************************/ | |
| 397 /* initialization */ | |
| 398 /************************************************************************/ | |
| 399 | |
| 400 void | |
| 401 syms_of_objects_gtk (void) | |
| 402 { | |
| 403 } | |
| 404 | |
| 405 void | |
| 406 console_type_create_objects_gtk (void) | |
| 407 { | |
| 408 /* object methods */ | |
| 409 | |
| 410 CONSOLE_HAS_METHOD (gtk, initialize_color_instance); | |
| 411 CONSOLE_HAS_METHOD (gtk, print_color_instance); | |
| 412 CONSOLE_HAS_METHOD (gtk, finalize_color_instance); | |
| 413 CONSOLE_HAS_METHOD (gtk, color_instance_equal); | |
| 414 CONSOLE_HAS_METHOD (gtk, color_instance_hash); | |
| 415 CONSOLE_HAS_METHOD (gtk, color_instance_rgb_components); | |
| 416 CONSOLE_HAS_METHOD (gtk, valid_color_name_p); | |
| 2527 | 417 CONSOLE_HAS_METHOD (gtk, color_list); |
| 462 | 418 |
| 419 CONSOLE_HAS_METHOD (gtk, initialize_font_instance); | |
| 420 CONSOLE_HAS_METHOD (gtk, print_font_instance); | |
| 421 CONSOLE_HAS_METHOD (gtk, finalize_font_instance); | |
| 422 CONSOLE_HAS_METHOD (gtk, font_instance_truename); | |
| 423 CONSOLE_HAS_METHOD (gtk, font_instance_properties); | |
| 2527 | 424 CONSOLE_HAS_METHOD (gtk, font_list); |
| 462 | 425 #ifdef MULE |
| 426 CONSOLE_HAS_METHOD (gtk, find_charset_font); | |
| 427 CONSOLE_HAS_METHOD (gtk, font_spec_matches_charset); | |
| 428 #endif | |
| 429 } | |
| 430 | |
| 431 void | |
| 432 vars_of_objects_gtk (void) | |
| 433 { | |
| 3659 | 434 #ifdef DEBUG_XEMACS |
| 435 DEFVAR_INT ("debug-x-objects", &debug_x_objects /* | |
| 436 If non-zero, display debug information about X objects | |
| 437 */ ); | |
| 438 debug_x_objects = 0; | |
| 439 #endif | |
| 462 | 440 } |
| 441 | |
| 442 static int | |
| 443 valid_font_name_p (Display *dpy, char *name) | |
| 444 { | |
| 445 /* Maybe this should be implemented by callign XLoadFont and trapping | |
| 446 the error. That would be a lot of work, and wasteful as hell, but | |
| 447 might be more correct. | |
| 448 */ | |
| 449 int nnames = 0; | |
| 450 char **names = 0; | |
| 451 if (! name) | |
| 452 return 0; | |
| 453 names = XListFonts (dpy, name, 1, &nnames); | |
| 454 if (names) | |
| 455 XFreeFontNames (names); | |
| 456 return (nnames != 0); | |
| 457 } | |
| 458 | |
| 459 Lisp_Object | |
| 460 __get_gtk_font_truename (GdkFont *gdk_font, int expandp) | |
| 461 { | |
| 462 Display *dpy = GDK_FONT_XDISPLAY (gdk_font); | |
| 463 GSList *names = ((GdkFontPrivate *) gdk_font)->names; | |
| 464 Lisp_Object font_name = Qnil; | |
| 465 | |
| 466 while (names) | |
| 467 { | |
| 468 if (names->data) | |
| 469 { | |
| 2054 | 470 if (valid_font_name_p (dpy, (char*) names->data)) |
| 462 | 471 { |
| 472 if (!expandp) | |
| 473 { | |
| 474 /* They want the wildcarded version */ | |
|
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
3676
diff
changeset
|
475 font_name = build_cistring ((char*) names->data); |
| 462 | 476 } |
| 477 else | |
| 478 { | |
| 479 /* Need to expand out */ | |
| 480 int nnames = 0; | |
| 481 char **x_font_names = 0; | |
| 482 | |
| 2054 | 483 x_font_names = XListFonts (dpy, (char*) names->data, 1, &nnames); |
| 462 | 484 if (x_font_names) |
| 485 { | |
|
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
3676
diff
changeset
|
486 font_name = build_cistring (x_font_names[0]); |
| 462 | 487 XFreeFontNames (x_font_names); |
| 488 } | |
| 489 } | |
| 490 break; | |
| 491 } | |
| 492 } | |
| 493 names = names->next; | |
| 494 } | |
| 495 return (font_name); | |
| 496 } | |
| 497 | |
| 2527 | 498 static Lisp_Object __gtk_font_list_internal (const char *pattern) |
| 462 | 499 { |
| 500 char **names; | |
| 501 int count = 0; | |
| 502 Lisp_Object result = Qnil; | |
| 503 | |
| 504 names = XListFonts (GDK_DISPLAY (), pattern, MAX_FONT_COUNT, &count); | |
| 505 while (count--) | |
|
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
3676
diff
changeset
|
506 result = Fcons (build_extstring (names [count], Qbinary), result); |
| 462 | 507 if (names) |
| 508 XFreeFontNames (names); | |
| 509 | |
| 510 return result; | |
| 511 } |
