~ubuntu-branches/ubuntu/trusty/pango1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to pango/pango-utils.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-03-09 10:39:11 UTC
  • mfrom: (1.6.4) (63.3.30 sid)
  • Revision ID: package-import@ubuntu.com-20120309103911-0jpxqwnix351v3se
Tags: 1.29.5-1
* New upstream release.
  - Fix GI annotation syntax. Closes: #640855
* debian/control.in: Bump Build-Depends on libglib2.0-dev to (>= 2.31.0).
* debian/patches/00git_transfer_annotations.patch: Removed, merged upstream.
* Set pkg-gnome-maintainers@lists.alioth.debian.org as Maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
 * Splits a %G_SEARCHPATH_SEPARATOR-separated list of files, stripping
177
177
 * white space and substituting ~/ with $HOME/.
178
178
 *
179
 
 * Return value: a list of strings to be freed with g_strfreev()
 
179
 * Return value: (transfer full) (array zero-terminated=1): a list of
 
180
 * strings to be freed with g_strfreev()
180
181
 **/
181
182
char **
182
183
pango_split_file_list (const char *str)
235
236
/**
236
237
 * pango_read_line:
237
238
 * @stream: a stdio stream
238
 
 * @str: #GString buffer into which to write the result
 
239
 * @str: (out): #GString buffer into which to write the result
239
240
 *
240
241
 * Reads an entire line from a file into a buffer. Lines may
241
242
 * be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter
343
344
 
344
345
/**
345
346
 * pango_skip_space:
346
 
 * @pos: in/out string position
 
347
 * @pos: (inout): in/out string position
347
348
 *
348
349
 * Skips 0 or more characters of white space.
349
350
 *
365
366
 
366
367
/**
367
368
 * pango_scan_word:
368
 
 * @pos: in/out string position
369
 
 * @out: a #GString into which to write the result
 
369
 * @pos: (inout): in/out string position
 
370
 * @out: (out): a #GString into which to write the result
370
371
 *
371
372
 * Scans a word into a #GString buffer. A word consists
372
373
 * of [A-Za-z_] followed by zero or more [A-Za-z_0-9]
407
408
 
408
409
/**
409
410
 * pango_scan_string:
410
 
 * @pos: in/out string position
411
 
 * @out: a #GString into which to write the result
 
411
 * @pos: (inout): in/out string position
 
412
 * @out: (out): a #GString into which to write the result
412
413
 *
413
414
 * Scans a string into a #GString buffer. The string may either
414
415
 * be a sequence of non-white-space characters, or a quoted
497
498
 
498
499
/**
499
500
 * pango_scan_int:
500
 
 * @pos: in/out string position
501
 
 * @out: an int into which to write the result
 
501
 * @pos: (inout): in/out string position
 
502
 * @out: (out): an int into which to write the result
502
503
 *
503
504
 * Scans an integer.
504
505
 * Leading white space is skipped.
689
690
 * Return value: the Pango sysconf directory. The returned string should
690
691
 * not be freed.
691
692
 */
692
 
G_CONST_RETURN char *
 
693
const char *
693
694
pango_get_sysconf_subdirectory (void)
694
695
{
695
 
#ifdef G_OS_WIN32
696
 
  static gchar *result = NULL;
 
696
  static const gchar *result = NULL;
697
697
 
698
698
  if (result == NULL)
699
699
    {
 
700
#ifdef G_OS_WIN32
700
701
      gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll);
701
702
      result = g_build_filename (root, "etc\\pango", NULL);
702
703
      g_free (root);
 
704
#else
 
705
      const char *sysconfdir = g_getenv ("PANGO_SYSCONFDIR");
 
706
      if (sysconfdir != NULL)
 
707
        result = g_build_filename (sysconfdir, "pango", NULL);
 
708
      else
 
709
        result = SYSCONFDIR "/pango";
 
710
#endif
703
711
    }
704
712
  return result;
705
 
#else
706
 
  return SYSCONFDIR "/pango";
707
 
#endif
708
713
}
709
714
 
710
715
/**
718
723
 * Return value: the Pango lib directory. The returned string should
719
724
 * not be freed.
720
725
 */
721
 
G_CONST_RETURN char *
 
726
const char *
722
727
pango_get_lib_subdirectory (void)
723
728
{
724
 
#ifdef G_OS_WIN32
725
 
  static gchar *result = NULL;
 
729
  static const gchar *result = NULL;
726
730
 
727
731
  if (result == NULL)
728
732
    {
 
733
#ifdef G_OS_WIN32
729
734
      gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll);
730
735
      /* If we are running against an uninstalled copy of the Pango DLL,
731
736
       * use the compile-time installation prefix.
735
740
      else
736
741
        result = g_build_filename (root, "lib\\pango", NULL);
737
742
      g_free (root);
 
743
#else
 
744
      const char *libdir = g_getenv ("PANGO_LIBDIR");
 
745
      if (libdir != NULL)
 
746
        result = g_build_filename (libdir, "pango", NULL);
 
747
      else
 
748
        result = LIBDIR "/pango";
 
749
#endif
738
750
    }
739
751
  return result;
740
 
#else
741
 
  return LIBDIR "/pango";
742
 
#endif
743
752
}
744
753
 
745
754
 
765
774
/**
766
775
 * pango_parse_enum:
767
776
 * @type: enum type to parse, eg. %PANGO_TYPE_ELLIPSIZE_MODE.
768
 
 * @str: string to parse.  May be %NULL.
769
 
 * @value: integer to store the result in, or %NULL.
 
777
 * @str: (allow-none): string to parse.  May be %NULL.
 
778
 * @value: (out) (allow-none): integer to store the result in, or %NULL.
770
779
 * @warn: if %TRUE, issue a g_warning() on bad input.
771
 
 * @possible_values: place to store list of possible values on failure, or %NULL.
 
780
 * @possible_values: (out) (allow-none): place to store list of possible values on failure, or %NULL.
772
781
 *
773
782
 * Parses an enum type and stores the result in @value.
774
783
 *
969
978
 
970
979
#ifdef HAVE_CAIRO_WIN32
971
980
 
972
 
static const char *builtin_aliases[] = {
 
981
static const char * const builtin_aliases[] = {
973
982
  "courier = \"courier new\"",
974
983
  "\"segoe ui\" = \"segoe ui,meiryo,malgun gothic,microsoft jhenghei,microsoft yahei,gisha,leelawadee,arial unicode ms,browallia new,mingliu,simhei,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"",
975
984
  "tahoma = \"tahoma,arial unicode ms,lucida sans unicode,browallia new,mingliu,simhei,gulimche,ms gothic,sylfaen,kartika,latha,mangal,raavi\"",
1086
1095
/**
1087
1096
 * pango_lookup_aliases:
1088
1097
 * @fontname: an ascii string
1089
 
 * @families: will be set to an array of font family names.
 
1098
 * @families: (out) (array length=n_families): will be set to an array of font family names.
1090
1099
 *    this array is owned by pango and should not be freed.
1091
 
 * @n_families: will be set to the length of the @families array.
 
1100
 * @n_families: (out): will be set to the length of the @families array.
1092
1101
 *
1093
1102
 * Look up all user defined aliases for the alias @fontname.
1094
1103
 * The resulting font family names will be stored in @families,
1214
1223
 
1215
1224
/**
1216
1225
 * pango_quantize_line_geometry:
1217
 
 * @thickness: pointer to the thickness of a line, in Pango units
1218
 
 * @position: corresponding position
 
1226
 * @thickness: (inout): pointer to the thickness of a line, in Pango units
 
1227
 * @position: (inout): corresponding position
1219
1228
 *
1220
1229
 * Quantizes the thickness and position of a line, typically an
1221
1230
 * underline or strikethrough, to whole device pixels, that is integer
1286
1295
 
1287
1296
/**
1288
1297
 * pango_extents_to_pixels:
1289
 
 * @inclusive: rectangle to round to pixels inclusively, or %NULL.
1290
 
 * @nearest: rectangle to round to nearest pixels, or %NULL.
 
1298
 * @inclusive: (allow-none): rectangle to round to pixels inclusively, or %NULL.
 
1299
 * @nearest: (allow-none): rectangle to round to nearest pixels, or %NULL.
1291
1300
 *
1292
1301
 * Converts extents from Pango units to device units, dividing by the
1293
1302
 * %PANGO_SCALE factor and performing rounding.