Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions
pango-modules.h File Reference
#include "pango-engine.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PangoliteMapEntry
struct  _PangoliteIncludedModule

Typedefs

typedef struct _PangoliteMap
typedef struct _PangoliteMapEntry
typedef struct _PangoliteIncludedModule

Functions

PangoliteMap * pangolite_find_map (const char *lang, guint engine_type_id, guint render_type_id)
 pangolite_find_map: : the language tag for which to find the map (in the form en or en_US) : the render type for the map to find : the engine type for the map to find
PangoliteMapEntry * pangolite_map_get_entry (PangoliteMap *map, guint32 wc)
 pangolite_map_get_entry: : a #PangoliteMap : an ISO-10646 codepoint
PangoliteEngine * pangolite_map_get_engine (PangoliteMap *map, guint32 wc)
 pangolite_map_get_engine: : a #PangoliteMap : an ISO-10646 codepoint
void pangolite_module_register (PangoliteIncludedModule *module)
 pangolite_module_register: : a #PangoliteIncludedModule

Class Documentation

struct _PangoliteMapEntry

Definition at line 53 of file pango-modules.h.

Class Members
PangoliteEngineInfo * info
gboolean is_exact

Typedef Documentation

typedef struct _PangoliteIncludedModule

Definition at line 59 of file pango-modules.h.

typedef struct _PangoliteMap

Definition at line 50 of file pango-modules.h.

typedef struct _PangoliteMapEntry

Definition at line 51 of file pango-modules.h.


Function Documentation

PangoliteMap* pangolite_find_map ( const char *  lang,
guint  engine_type_id,
guint  render_type_id 
)

pangolite_find_map: : the language tag for which to find the map (in the form en or en_US) : the render type for the map to find : the engine type for the map to find

Locate a #PangoliteMap for a particular engine type and render type. The resulting map can be used to determine the engine for each character.

Return value:

Definition at line 109 of file modules.c.

{
  GList        *tmp_list = maps;
  PangoliteMapInfo *map_info = NULL;
  gboolean     found_earlier = FALSE;

  while (tmp_list) {
    map_info = tmp_list->data;
    if (map_info->engine_type_id == engine_type_id &&
        map_info->render_type_id == render_type_id) {
      if (strcmp(map_info->lang, lang) == 0)
        break;
      else
        found_earlier = TRUE;
    }
    tmp_list = tmp_list->next;
  }
  
  if (!tmp_list) {
    map_info = g_new(PangoliteMapInfo, 1);
    map_info->lang = g_strdup(lang);
    map_info->engine_type_id = engine_type_id;
    map_info->render_type_id = render_type_id;
    
    build_map(map_info);    
    maps = g_list_prepend(maps, map_info);
  }
  else if (found_earlier) {
    /* Move the found map to the beginning of the list
     * for speed next time around if we had to do
     * any failing strcmps.
     */
    maps = g_list_remove_link(maps, tmp_list);
    maps = g_list_prepend(maps, tmp_list->data);
    g_list_free_1(tmp_list);
  }  
  return map_info->map;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PangoliteEngine* pangolite_map_get_engine ( PangoliteMap *  map,
guint32  wc 
)

pangolite_map_get_engine: : a #PangoliteMap : an ISO-10646 codepoint

Returns the engine listed in the map for a given codepoint.

Return value: the engine, if one is listed for the codepoint, or NULL. The lookup may cause the engine to be loaded; once an engine is loaded

Definition at line 493 of file modules.c.

{
  PangoliteSubmap *submap = &map->submaps[wc / 256];
  PangoliteMapEntry *entry = submap->is_leaf ? &submap->d.entry : 
    &submap->d.leaves[wc % 256];
  
  if (entry->info)
    return pangolite_engine_pair_get_engine((PangoliteEnginePair *)entry->info);
  else
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PangoliteMapEntry* pangolite_map_get_entry ( PangoliteMap *  map,
guint32  wc 
)

pangolite_map_get_entry: : a #PangoliteMap : an ISO-10646 codepoint

Returns the entry in the map for a given codepoint. The entry contains information about engine that should be used for the codepoint and also whether the engine matches the language tag for the map was created exactly or just approximately.

Return value: the #PangoliteMapEntry for the codepoint. This value is owned by the #PangoliteMap and should not be freed.

Definition at line 475 of file modules.c.

{
  PangoliteSubmap *submap = &map->submaps[wc / 256];
  return submap->is_leaf ? &submap->d.entry : &submap->d.leaves[wc % 256];
}
void pangolite_module_register ( PangoliteIncludedModule *  module)

pangolite_module_register: : a #PangoliteIncludedModule

Registers a statically linked module with Pangolite. The

PangoliteIncludedModule structure that is passed in contains the

functions that would otherwise be loaded from a dynamically loaded module.

Definition at line 515 of file modules.c.

{
  GSList *tmp_list = NULL;
  
  handle_included_module(module, &tmp_list);  
  registered_engines = g_slist_concat(registered_engines, 
                                      g_slist_reverse(tmp_list));
}

Here is the call graph for this function: