~ubuntu-branches/ubuntu/utopic/pango1.0/utopic

« back to all changes in this revision

Viewing changes to .pc/10_scan-module-files-in-dirs.patch/pango/modules.c

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-02-21 17:58:07 UTC
  • mfrom: (1.6.6)
  • Revision ID: package-import@ubuntu.com-20130221175807-jtjv8iqwt3ix2px8
Tags: 1.32.5-0ubuntu1
* New upstream release; several changes from Rico Tzschichholz - thanks!
* debian/control:
  - Add build-depend on libharfbuzz-dev (>= 0.9.9)
  - Bump build-depend on libfonconfig1-dev (>= 2.5.0)
* debian/libpango1.0-0.symbols:
  - Updated
* debian/patches:
  - 00git_*.patch, dropped, they are upstream
  - 10_scan-module-files-in-dirs.patch,
    11_module-files-append-module-files-d.patch. refeshed
  - readd-pangox.patch, Readd libpangox library to temporarily
    preserve backwards compat
  - 0001-Link-basicfc-module-to-HarfBuzz.patch: Add, git backport to link
    correctly against harfbuzz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
  GTypeModuleClass parent_class;
89
89
};
90
90
 
 
91
G_LOCK_DEFINE_STATIC (maps);
91
92
static GList *maps = NULL;
 
93
/* the following are readonly after init_modules */
92
94
static GSList *registered_engines = NULL;
93
95
static GSList *dlloaded_engines = NULL;
94
96
static GHashTable *dlloaded_modules;
106
108
static GQuark
107
109
get_warned_quark (void)
108
110
{
109
 
  static GQuark warned_quark = 0;
 
111
  static GQuark warned_quark = 0; /* MT-safe */
110
112
 
111
113
  if (G_UNLIKELY (!warned_quark))
112
114
    warned_quark = g_quark_from_static_string ("pango-module-warned");
131
133
                guint          engine_type_id,
132
134
                guint          render_type_id)
133
135
{
134
 
  GList *tmp_list = maps;
 
136
  GList *tmp_list;
135
137
  PangoMapInfo *map_info = NULL;
136
138
  gboolean found_earlier = FALSE;
137
139
 
 
140
  G_LOCK (maps);
 
141
 
 
142
  tmp_list = maps;
138
143
  while (tmp_list)
139
144
    {
140
145
      map_info = tmp_list->data;
173
178
      g_list_free_1(tmp_list);
174
179
    }
175
180
 
 
181
  G_UNLOCK (maps);
 
182
 
176
183
  return map_info->map;
177
184
}
178
185
 
278
285
  gobject_class->finalize = pango_module_finalize;
279
286
}
280
287
 
 
288
G_LOCK_DEFINE_STATIC (engine);
281
289
 
282
290
static PangoEngine *
283
291
pango_engine_pair_get_engine (PangoEnginePair *pair)
284
292
{
 
293
  G_LOCK (engine);
 
294
 
285
295
  if (!pair->engine)
286
296
    {
287
297
      if (g_type_module_use (G_TYPE_MODULE (pair->module)))
303
313
        }
304
314
    }
305
315
 
 
316
  G_UNLOCK (engine);
 
317
 
306
318
  return pair->engine;
307
319
}
308
320
 
382
394
{
383
395
  static GEnumClass *class = NULL;
384
396
  GEnumValue *value;
385
 
  if (!class)
386
 
    class = g_type_class_ref (PANGO_TYPE_SCRIPT);
 
397
  if (g_once_init_enter (&class))
 
398
    g_once_init_leave (&class, g_type_class_ref (PANGO_TYPE_SCRIPT));
387
399
 
388
400
  value = g_enum_get_value_by_nick (class, str);
389
401
  if (!value)
438
450
          switch (i)
439
451
            {
440
452
            case 0:
441
 
              if (!g_path_is_absolute (tmp_buf->str)) {
442
 
                const gchar *abs_file_name = g_build_filename (module_file_dir, tmp_buf->str, NULL);
443
 
                g_string_assign (tmp_buf, abs_file_name);
444
 
                g_free ((gpointer) abs_file_name);
445
 
              }
 
453
              if (!g_path_is_absolute (tmp_buf->str))
 
454
                {
 
455
                  const gchar *lib_dir = pango_get_lib_subdirectory ();
 
456
                  const gchar *abs_file_name = g_build_filename (lib_dir,
 
457
                                                                 MODULE_VERSION,
 
458
                                                                 "modules",
 
459
                                                                 tmp_buf->str,
 
460
                                                                 NULL);
 
461
                  g_string_assign (tmp_buf, abs_file_name);
 
462
                  g_free ((gpointer) abs_file_name);
 
463
                }
446
464
              pair->module = find_or_create_module (tmp_buf->str);
447
465
              break;
448
466
            case 1:
533
551
  dlloaded_modules = g_hash_table_new (g_str_hash, g_str_equal);
534
552
 
535
553
  if (!file_str)
536
 
    file_str = g_build_filename (pango_get_sysconf_subdirectory (),
537
 
                                 "pango.modules",
538
 
                                 NULL);
 
554
    {
 
555
      files = g_new (char *, 3);
539
556
 
540
 
  files = pango_split_file_list (file_str);
 
557
      files[0] = g_build_filename (pango_get_sysconf_subdirectory (),
 
558
                                   "pango.modules",
 
559
                                   NULL);
 
560
      files[1] = g_build_filename (pango_get_lib_subdirectory (),
 
561
                                   MODULE_VERSION,
 
562
                                   "modules.cache",
 
563
                                   NULL);
 
564
      files[2] = NULL;
 
565
    }
 
566
  else
 
567
    files = pango_split_file_list (file_str);
541
568
 
542
569
  n = 0;
543
570
  while (files[n])
549
576
      if (module_file)
550
577
        {
551
578
          const gchar *module_file_dir = g_path_get_dirname (files[n]);
552
 
          process_module_file(module_file, module_file_dir);
 
579
          process_module_file (module_file, module_file_dir);
553
580
          g_free ((gpointer) module_file_dir);
554
581
          fclose(module_file);
555
582
        }
564
591
static void
565
592
init_modules (void)
566
593
{
567
 
  static gboolean init = FALSE;
 
594
  static gsize init = 0;
568
595
  int i;
569
596
 
570
 
  if (init)
571
 
    return;
572
 
  else
573
 
    init = TRUE;
574
 
 
575
 
  /* Make sure that the type system is initialized */
576
 
  g_type_init ();
577
 
 
578
 
  for (i = 0; _pango_included_lang_modules[i].list; i++)
579
 
    pango_module_register (&_pango_included_lang_modules[i]);
580
 
  read_modules ();
 
597
  if (g_once_init_enter (&init))
 
598
    {
 
599
      /* Make sure that the type system is initialized */
 
600
      g_type_init ();
 
601
 
 
602
      for (i = 0; _pango_included_lang_modules[i].list; i++)
 
603
        pango_module_register (&_pango_included_lang_modules[i]);
 
604
      read_modules ();
 
605
 
 
606
      g_once_init_leave (&init, 1);
 
607
    }
581
608
}
582
609
 
583
610
static void
643
670
 
644
671
  if (!dlloaded_engines && !registered_engines)
645
672
    {
646
 
      static gboolean no_module_warning = FALSE;
 
673
      static gboolean no_module_warning = FALSE; /* MT-safe */
647
674
      if (!no_module_warning)
648
675
        {
649
676
          gchar *filename = g_build_filename (pango_get_sysconf_subdirectory (),