Jabber WindowGram Client (JWGC)

Introduction Screenshots Installation Downloads
Documentation Browse Source Resources Project Site

Stable Version
-none-

Latest Version
beta5



Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

X_fonts.c File Reference

#include "mit-copyright.h"
#include "X_fonts.h"
#include "new_string.h"
#include "error.h"
#include "pointer_dictionary.h"
#include "main.h"

Go to the source code of this file.

Defines

#define STYLE_CLASS   "StyleKey.Style1.Style2.Style3.SubstyleKey.Substyle.FontfamilyKey"
#define FAMILY_CLASS   "FontfamilyKey.Fontfamily.Size.Face"

Functions

char * get_string_resources ()
void add_fid (XFontStruct *font)
XFontStruct * get_fontst_from_fid (Font fid)
XFontStruct * get_font (Display *dpy, string style, string substyle, int size, int face)


Define Documentation

#define FAMILY_CLASS   "FontfamilyKey.Fontfamily.Size.Face"
 

#define STYLE_CLASS   "StyleKey.Style1.Style2.Style3.SubstyleKey.Substyle.FontfamilyKey"
 


Function Documentation

void add_fid XFontStruct *  font  ) 
 

Definition at line 142 of file X_fonts.c.

References pointer_dictionary_binding, pointer_dictionary_Create(), pointer_dictionary_Define(), and _pointer_dictionary_binding::value.

00144 {
00145 
00146         char *fidstr;
00147         pointer_dictionary_binding *binding;
00148         int exists;
00149 
00150         if (!fidst_dict)
00151                 fidst_dict = pointer_dictionary_Create(37);
00152         fidstr = Font_to_hex(font->fid);
00153         binding = pointer_dictionary_Define(fidst_dict, fidstr, &exists);
00154         free(fidstr);
00155 
00156         if (!exists)
00157                 binding->value = (pointer) font;
00158 }

XFontStruct* get_font Display *  dpy,
string  style,
string  substyle,
int  size,
int  face
 

Definition at line 248 of file X_fonts.c.

References dpy, and ERROR.

00254 {
00255         char *family, *fontname;
00256         XFontStruct *fontst;
00257 
00258         if (size == SPECIAL_SIZE) {
00259                 /* attempt to process @font explicitly */
00260                 if ((fontst = get_fontst(dpy, substyle)))
00261                         return (fontst);
00262         }
00263         else {
00264                 if ((family = get_family(style, substyle))) {
00265                         if ((fontname = get_fontname(family, size, face)))
00266                                 if ((fontst = get_fontst(dpy, fontname)))
00267                                         return (fontst);
00268                 }
00269                 else {
00270                         if ((fontname = get_fontname(substyle, size, face)))
00271                                 if ((fontst = get_fontst(dpy, fontname)))
00272                                         return (fontst);
00273                 }
00274 
00275                 /*
00276                  * At this point, the no-failure case didn't happen, and the
00277                  * case of substyle being the fontfamily didn't happen,
00278                  * either.
00279                  */
00280 
00281                 fontst = NULL;
00282                 if (!(fontst = complete_get_fontst(dpy, style, "text", size, face)))
00283                         if (!(fontst = complete_get_fontst(dpy, "default", substyle, size, face)))
00284                                 if (!(fontst = complete_get_fontst(dpy, "default", "text", size, face)))
00285                                         if ((fontname = get_fontname("default", size, face)))
00286                                                 fontst = get_fontst(dpy, fontname);
00287                 if (fontst)
00288                         return (fontst);
00289         }
00290 
00291         /* If all else fails, try fixed */
00292 
00293         if ((fontst = get_fontst(dpy, "fixed")))
00294                 return (fontst);
00295 
00296         /* No fonts available.  Die. */
00297 
00298         ERROR("Unable to open font \"fixed\".  Aborting...");
00299         exit(1);
00300 }

XFontStruct* get_fontst_from_fid Font  fid  ) 
 

Definition at line 162 of file X_fonts.c.

References pointer_dictionary_binding, pointer_dictionary_Define(), and _pointer_dictionary_binding::value.

00164 {
00165         char *fidstr;
00166         pointer_dictionary_binding *binding;
00167         int exists;
00168 
00169         fidstr = Font_to_hex(fid);
00170 
00171         binding = pointer_dictionary_Define(fidst_dict, fidstr, &exists);
00172         free(fidstr);
00173         return ((XFontStruct *) binding->value);
00174 }

char* get_string_resources  ) 
 



Last updated at Tue Dec 18 21:07:42 PST 2007. This site and project hosted by...SourceForge.net Logo

Source Perspective by Fisheye