File libgedit-gfls-0.3.0.obscpio of Package libgedit-gfls
07070100000000000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/LICENSES07070100000001000081A400000000000000000000000167CC91EC00001D07000000000000000000000000000000000000003300000000libgedit-gfls-0.3.0/LICENSES/LGPL-3.0-or-later.txtGNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms
and conditions of version 3 of the GNU General Public License, supplemented
by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser General
Public License, and the "GNU GPL" refers to version 3 of the GNU General Public
License.
"The Library" refers to a covered work governed by this License, other than
an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided by the
Library, but which is not otherwise based on the Library. Defining a subclass
of a class defined by the Library is deemed a mode of using an interface provided
by the Library.
A "Combined Work" is a work produced by combining or linking an Application
with the Library. The particular version of the Library with which the Combined
Work was made is also called the "Linked Version".
The "Minimal Corresponding Source" for a Combined Work means the Corresponding
Source for the Combined Work, excluding any source code for portions of the
Combined Work that, considered in isolation, are based on the Application,
and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the object
code and/or source code for the Application, including any data and utility
programs needed for reproducing the Combined Work from the Application, but
excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without
being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility
refers to a function or data to be supplied by an Application that uses the
facility (other than as an argument passed when the facility is invoked),
then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure
that, in the event an Application does not supply the function or data, the
facility still operates, and performs whatever part of its purpose remains
meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License
applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header
file that is part of the Library. You may convey such object code under terms
of your choice, provided that, if the incorporated material is not limited
to numerical parameters, data structure layouts and accessors, or small macros,
inline functions and templates (ten or fewer lines in length), you do both
of the following:
a) Give prominent notice with each copy of the object code that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together,
effectively do not restrict modification of the portions of the Library contained
in the Combined Work and reverse engineering for debugging such modifications,
if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during execution, include
the copyright notice for the Library among these notices, as well as a reference
directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License,
and the Corresponding Application Code in a form suitable for, and under terms
that permit, the user to recombine or relink the Application with a modified
version of the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (a) uses at run time a copy of the Library
already present on the user's computer system, and (b) will operate properly
with a modified version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would otherwise be required
to provide such information under section 6 of the GNU GPL, and only to the
extent that such information is necessary to install and execute a modified
version of the Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option 4d0, the
Installation Information must accompany the Minimal Corresponding Source and
Corresponding Application Code. If you use option 4d1, you must provide the
Installation Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side
by side in a single library together with other library facilities that are
not Applications and are not covered by this License, and convey such a combined
library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities, conveyed under the
terms of this License.
b) Give prominent notice with the combined library that part of it is a work
based on the Library, and explaining where to find the accompanying uncombined
form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the
GNU Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library as you
received it specifies that a certain numbered version of the GNU Lesser General
Public License "or any later version" applies to it, you have the option of
following the terms and conditions either of that published version or of
any later version published by the Free Software Foundation. If the Library
as you received it does not specify a version number of the GNU Lesser General
Public License, you may choose any version of the GNU Lesser General Public
License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether
future versions of the GNU Lesser General Public License shall apply, that
proxy's public statement of acceptance of any version is permanent authorization
for you to choose that version for the Library.
07070100000002000081A400000000000000000000000167CC91EC0000030D000000000000000000000000000000000000001900000000libgedit-gfls-0.3.0/NEWSlibgedit-gfls news
News in 0.3.0, 2025-03-08
-------------------------
- Improve some parts of the library (see the reference manual for changes).
- Experiment with new Encoding interfaces and classes, but the code has been
removed (a simpler approach is planned).
- Improve the documentation.
- Write more unit tests.
- Translation updates.
News in 0.2.1, 2024-12-07
-------------------------
- Translation updates.
News in 0.2.0, 2024-08-31
-------------------------
- New classes and interfaces: GflsAttributeKeys, GflsLoaderConfig,
GflsLoaderConfigSimple.
- Build: add tests option.
- Do some planning, write some notes.
News in 0.1.0, 2024-04-27 (stable version)
------------------------------------------
- First version.
- See the API reference for what's included.
07070100000003000081A400000000000000000000000167CC91EC000001BE000000000000000000000000000000000000001E00000000libgedit-gfls-0.3.0/README.mdlibgedit-gfls
=============
Short description
-----------------
Gedit Technology - File loading and saving
Longer description
------------------
libgedit-gfls is part of
[Gedit Technology](https://gedit-text-editor.org/technology.html).
It is a module dedicated to file loading and saving for the needs of gedit and
other similar text editors.
Dependencies
------------
- GLib/GIO (required)
- GTK 3 (optional, used for interactive tests)
07070100000004000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000001A00000000libgedit-gfls-0.3.0/build07070100000005000081A400000000000000000000000167CC91EC00000002000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/build/.gitignore*
07070100000006000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000001900000000libgedit-gfls-0.3.0/docs07070100000007000081A400000000000000000000000167CC91EC0000033F000000000000000000000000000000000000002900000000libgedit-gfls-0.3.0/docs/file-loading.mdlibgedit-gfls :: file loading TODO list
=======================================
File loading steps
------------------
Name: GflsLoadingDriver, or GflsLoadingManager, or GflsLoader.
Steps:
1. Create a GflsLoaderConfig(Simple).
2. (Optional) If GFile as input, query the GFileInfo.
3. (Optional) Check the GFileInfo against the GflsLoaderConfig(Simple) (check
the file size).
4. Load all the raw content into memory (with max size).
5. (Optional) Transform if needed the raw content into the final content
suitable to be inserted into a GtkTextBuffer (encoding conversion, splitting
very long lines, escaping invalid characters and maybe others, keeping the
relevant information along the way in order to reverse the operation - or
show an error - upon saving).
6. Insert the final content into the GtkTextBuffer.
07070100000008000081A400000000000000000000000167CC91EC000002C6000000000000000000000000000000000000003300000000libgedit-gfls-0.3.0/docs/generic-and-extensible.mdlibgedit-gfls :: generic and extensible API
===========================================
Have for Gfls a **generic** and **extensible** API.
Assumptions
-----------
- Assume **GIO** use, in all cases.
- Assume the intention to work with **text** (but allow workarounds if there are
invalid chars).
Use-case
--------
Tepl has a framework (so with an inversion of control), with TeplAbstractFactory
that apps subclass to customize the default behavior of Tepl.
For a high-level file loading and saving API, Tepl can thus call the generic
Gfls functions (i.e., probably just using interfaces, not concrete classes), and
call TeplAbstractFactory functions to create and configure the concrete Gfls
objects.
07070100000009000081A400000000000000000000000167CC91EC000003E3000000000000000000000000000000000000002F00000000libgedit-gfls-0.3.0/docs/low-level-features.mdlibgedit-gfls :: low-level features
===================================
Done
----
Loading: provide a maximum number of bytes to read, and get a GBytes as a
result, knowing if it is truncated.
Loading: detect if there is a very long line in a UTF-8 string.
To implement
------------
Have a list of encodings.
Loading: encoding auto-detection.
Loading: check if the content is valid in a given encoding (useful if the user
explicitly asks for a certain encoding).
Loading: encoding conversion to UTF-8.
Loading: detect BOM.
Split a GBytes into a list of chunks. Each chunk contains:
- a GBytes
- a boolean to tell if the GBytes is a valid UTF-8 string.
To isolate invalid chars.
Further split the list of chunks to isolate very long lines (in UTF-8) into
their own chunks.
Transform a very-long-line chunk with the line split at a certain column, and
with a certain algorithm to split the line (at chars or word-chars). Adding a
boolean to tell that the very long line has been split.
0707010000000A000081A400000000000000000000000167CC91EC0000035E000000000000000000000000000000000000002A00000000libgedit-gfls-0.3.0/docs/low-level-kit.mdlibgedit-gfls :: low-level kit
==============================
There is some desire to create something:
- Generic and extensible.
- With a clear split between the backend and frontend.
But where libgedit-gfls is located on the stack, it makes more sense to provide
a low-level "kit" (above GIO and libICU, probably not GTK).
That is, no interfaces, just concrete classes and functions (the "meat").
Providing useful utilities and building blocks. Solving specific and independent
problems that anyway need to be solved ("divide and conquer").
Then in libgedit-tepl the building blocks can be assembled, creating a
high-level API, something generic and extensible by the application, and so on.
Integration
-----------
To see the finish line, it is necessary to **integrate** the different features.
Incrementally/progressively, not all at once at the end.
0707010000000B000081A400000000000000000000000167CC91EC00000391000000000000000000000000000000000000002200000000libgedit-gfls-0.3.0/docs/names.mdlibgedit-gfls :: names brainstorming
====================================
- GflsInfo, replacing GtkSourceFile or TeplFile. In the latter implementations,
there is the ambiguity between a GFile (called a "location") and a TeplFile
object (called "file").
With GflsInfo, a GFile object would remain to be called a "file", simply. And
GflsInfo reflect the fact that it gathers a GFileInfo (basically) for later
use.
- GflsFile to extend GFile with more functions.
- GflsLoader interface (that takes a GflsLoaderConfig as an input), with
GflsLoaderBasic for dealing with UTF-8 only.
- Driver: like a compiler driver that invokes several smaller programs. Have a
driver for loading, and a driver for saving, that invoke smaller utilities
with phases. The utilities are just classes and functions to be called (in the
same process). A bit like a "Manager" class, except that the name is shorter.
0707010000000C000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000002300000000libgedit-gfls-0.3.0/docs/reference0707010000000D000081A400000000000000000000000167CC91EC000008B1000000000000000000000000000000000000003A00000000libgedit-gfls-0.3.0/docs/reference/libgedit-gfls-docs.xml<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
%gtkdocentities;
]>
<book id="index">
<bookinfo>
<title>libgedit-gfls &package_api_version; Reference Manual</title>
<releaseinfo>For &package_string;</releaseinfo>
</bookinfo>
<warning>
<para>
At the current stage of development of libgedit-gfls,
<emphasis>the API is more experimental</emphasis>.
There are no API stability guarantees. And there can be unfinished
features.
</para>
</warning>
<part id="api-reference">
<title>libgedit-gfls API Reference</title>
<xi:include href="xml/gfls-init.xml"/>
<xi:include href="xml/gfls-attribute-keys.xml"/>
<xi:include href="xml/gfls-input-stream.xml"/>
<xi:include href="xml/gfls-loader-basic.xml"/>
<xi:include href="xml/gfls-loader-config.xml"/>
<xi:include href="xml/gfls-loader-config-simple.xml"/>
<xi:include href="xml/gfls-unsaved-document-titles.xml"/>
<xi:include href="xml/gfls-utf8.xml"/>
</part>
<part id="annexes">
<title>Annexes</title>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
<index id="api-index-full">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-1" role="0.1">
<title>Index of new symbols in 0.1</title>
<xi:include href="xml/api-index-0.1.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-2" role="0.2">
<title>Index of new symbols in 0.2</title>
<xi:include href="xml/api-index-0.2.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-3" role="0.3">
<title>Index of new symbols in 0.3</title>
<xi:include href="xml/api-index-0.3.xml"><xi:fallback /></xi:include>
</index>
</part>
</book>
0707010000000E000081A400000000000000000000000167CC91EC0000099B000000000000000000000000000000000000003E00000000libgedit-gfls-0.3.0/docs/reference/libgedit-gfls-sections.txt<INCLUDE>gfls/gfls.h</INCLUDE>
<SECTION>
<FILE>gfls-attribute-keys</FILE>
GflsAttributeKeys
gfls_attribute_keys_new
gfls_attribute_keys_add
gfls_attribute_keys_to_string
<SUBSECTION Standard>
GFLS_ATTRIBUTE_KEYS
GFLS_ATTRIBUTE_KEYS_CLASS
GFLS_ATTRIBUTE_KEYS_GET_CLASS
GFLS_IS_ATTRIBUTE_KEYS
GFLS_IS_ATTRIBUTE_KEYS_CLASS
GFLS_TYPE_ATTRIBUTE_KEYS
GflsAttributeKeysClass
GflsAttributeKeysPrivate
gfls_attribute_keys_get_type
</SECTION>
<SECTION>
<FILE>gfls-init</FILE>
gfls_init
gfls_finalize
<SUBSECTION Standard>
GFLS_H_INSIDE
</SECTION>
<SECTION>
<FILE>gfls-input-stream</FILE>
gfls_input_stream_read_async
gfls_input_stream_read_finish
</SECTION>
<SECTION>
<FILE>gfls-loader-basic</FILE>
GFLS_LOADER_ERROR
GflsLoaderError
gfls_loader_basic_load_async
gfls_loader_basic_load_finish
<SUBSECTION Standard>
GFLS_TYPE_LOADER_ERROR
gfls_loader_error_get_type
gfls_loader_error_quark
</SECTION>
<SECTION>
<FILE>gfls-loader-config</FILE>
GflsLoaderConfig
GflsLoaderConfigInterface
<SUBSECTION Standard>
GFLS_IS_LOADER_CONFIG
GFLS_LOADER_CONFIG
GFLS_LOADER_CONFIG_GET_INTERFACE
GFLS_TYPE_LOADER_CONFIG
gfls_loader_config_get_type
</SECTION>
<SECTION>
<FILE>gfls-loader-config-simple</FILE>
GflsLoaderConfigSimple
gfls_loader_config_simple_new_from_file
gfls_loader_config_simple_new_from_stream
gfls_loader_config_simple_get_file
gfls_loader_config_simple_get_stream
<SUBSECTION Standard>
GFLS_IS_LOADER_CONFIG_SIMPLE
GFLS_IS_LOADER_CONFIG_SIMPLE_CLASS
GFLS_LOADER_CONFIG_SIMPLE
GFLS_LOADER_CONFIG_SIMPLE_CLASS
GFLS_LOADER_CONFIG_SIMPLE_GET_CLASS
GFLS_TYPE_LOADER_CONFIG_SIMPLE
GflsLoaderConfigSimpleClass
GflsLoaderConfigSimplePrivate
gfls_loader_config_simple_get_type
</SECTION>
<SECTION>
<FILE>gfls-unsaved-document-titles</FILE>
GflsUnsavedDocumentTitles
GflsUnsavedDocumentTitleCallback
gfls_unsaved_document_titles_new
gfls_unsaved_document_titles_get_default
gfls_unsaved_document_titles_allocate_number
gfls_unsaved_document_titles_release_number
gfls_unsaved_document_titles_get_title
gfls_unsaved_document_titles_set_title_callback
<SUBSECTION Standard>
GFLS_IS_UNSAVED_DOCUMENT_TITLES
GFLS_IS_UNSAVED_DOCUMENT_TITLES_CLASS
GFLS_TYPE_UNSAVED_DOCUMENT_TITLES
GFLS_UNSAVED_DOCUMENT_TITLES
GFLS_UNSAVED_DOCUMENT_TITLES_CLASS
GFLS_UNSAVED_DOCUMENT_TITLES_GET_CLASS
GflsUnsavedDocumentTitlesClass
GflsUnsavedDocumentTitlesPrivate
gfls_unsaved_document_titles_get_type
</SECTION>
<SECTION>
<FILE>gfls-utf8</FILE>
gfls_utf8_find_very_long_line
</SECTION>
0707010000000F000081A400000000000000000000000167CC91EC00000479000000000000000000000000000000000000002F00000000libgedit-gfls-0.3.0/docs/reference/meson.buildsubdir('xml')
FS.copyfile(
'libgedit-gfls-sections.txt',
'libgedit-gfls-@0@-sections.txt'.format(GFLS_API_VERSION)
)
gtkdoc_module_name = 'libgedit-gfls-@0@'.format(GFLS_API_VERSION)
html_dir = get_option('prefix') / GNOME.gtkdoc_html_dir(gtkdoc_module_name)
glib_docpath = dependency('glib-2.0').get_variable(pkgconfig: 'prefix') / 'share/gtk-doc/html/glib'
gobject_docpath = dependency('gobject-2.0').get_variable(pkgconfig: 'prefix') / 'share/gtk-doc/html/gobject'
gio_docpath = dependency('gio-2.0').get_variable(pkgconfig: 'prefix') / 'share/gtk-doc/html/gio'
#gtk_docpath = dependency('gtk+-3.0').get_variable(pkgconfig: 'prefix') / 'share/gtk-doc/html/gtk3'
GNOME.gtkdoc(
gtkdoc_module_name,
main_xml: 'libgedit-gfls-docs.xml',
src_dir: include_directories('../../gfls/'),
dependencies: GFLS_LIB_DEP,
scan_args: ['--rebuild-types'],
gobject_typesfile: 'libgedit-gfls-@0@.types'.format(GFLS_API_VERSION),
fixxref_args: [
'--html-dir=@0@'.format(html_dir),
'--extra-dir=@0@'.format(glib_docpath),
'--extra-dir=@0@'.format(gobject_docpath),
'--extra-dir=@0@'.format(gio_docpath),
],
install: true
)
07070100000010000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000002700000000libgedit-gfls-0.3.0/docs/reference/xml07070100000011000081A400000000000000000000000167CC91EC00000062000000000000000000000000000000000000003D00000000libgedit-gfls-0.3.0/docs/reference/xml/gtkdocentities.ent.in<!ENTITY package_string "@PACKAGE_STRING@">
<!ENTITY package_api_version "@PACKAGE_API_VERSION@">
07070100000012000081A400000000000000000000000167CC91EC000001A0000000000000000000000000000000000000003300000000libgedit-gfls-0.3.0/docs/reference/xml/meson.buildgtkdocentities_conf_data = configuration_data()
gtkdocentities_conf_data.set('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version()))
gtkdocentities_conf_data.set('PACKAGE_API_VERSION', GFLS_API_VERSION)
gtkdocentities_filename = 'gtkdocentities.ent'
configure_file(
input: gtkdocentities_filename + '.in',
output: gtkdocentities_filename,
configuration: gtkdocentities_conf_data
)
07070100000013000081A400000000000000000000000167CC91EC000003E0000000000000000000000000000000000000003300000000libgedit-gfls-0.3.0/docs/split-backend-frontend.mdlibgedit-gfls :: split backend from frontend
============================================
To allow the possibility of a GTK 3 and GTK 4 frontends, sharing the single
codebase for the backend (based on GLib/GIO and libICU).
First idea
----------
Have two main headers, something like that:
```
#include <gfls/gfls-glib.h>
#include <gfls/gfls-gtk.h>
```
Inspired by libpeas 1.x.
Second idea
-----------
- The Gfls lib contains only the backend, it must not depend on GTK.
- Implement the GTK 3 frontend in Tepl (where TeplInfoBar is directly available,
and the libgedit-gtksourceview API too).
The backend still has GtkTextView and its limitations in mind. Example:
- Instead of providing at the end a single UTF-8 string (which is not possible
in certain cases like invalid chars that need to be escaped), provide _a list_
of a data structure containing: a GBytes, boolean infos such as whether it is
valid UTF-8, whether it's a very long line that has already been split, etc.
07070100000014000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000001900000000libgedit-gfls-0.3.0/gfls07070100000015000081A400000000000000000000000167CC91EC00000D90000000000000000000000000000000000000002F00000000libgedit-gfls-0.3.0/gfls/gfls-attribute-keys.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-attribute-keys.h"
/**
* SECTION:gfls-attribute-keys
* @Title: GflsAttributeKeys
* @Short_description: A list of #GFile attribute keys
*
* #GflsAttributeKeys is a small utility to build a list of #GFile attribute
* keys. The result is a single string to pass as an argument to a function like
* g_file_query_info().
*
* It is useful for doing only a single query with a list of keys coming from
* different parts of the program. To take an example, Gfls might have its own
* list of keys to query, but it is desirable to ask the application for
* additional keys.
*/
/* Rationale
* =========
*
* The goal is to get desired #GFileInfo attributes in one query.
*
* Reasons to do it in one query:
* 1. To avoid unnecessary round-trips (?) (especially for remote files).
* Actually I don't know how it is implemented in GIO and GVfs. In case of
* doubt a single query is better since the implementation has the
* *possibility* to optimize network usage.
* 2. For convenience in the implementation, to just call one pair of
* async()/finish() functions for that task.
*/
struct _GflsAttributeKeysPrivate
{
/* Element-type: "owned gchar *" */
GPtrArray *array;
};
G_DEFINE_TYPE_WITH_PRIVATE (GflsAttributeKeys, gfls_attribute_keys, G_TYPE_OBJECT)
static void
gfls_attribute_keys_finalize (GObject *object)
{
GflsAttributeKeys *keys = GFLS_ATTRIBUTE_KEYS (object);
g_clear_pointer (&keys->priv->array, g_ptr_array_unref);
G_OBJECT_CLASS (gfls_attribute_keys_parent_class)->finalize (object);
}
static void
gfls_attribute_keys_class_init (GflsAttributeKeysClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gfls_attribute_keys_finalize;
}
static void
gfls_attribute_keys_init (GflsAttributeKeys *keys)
{
keys->priv = gfls_attribute_keys_get_instance_private (keys);
keys->priv->array = g_ptr_array_new_null_terminated (0, g_free, TRUE);
}
/**
* gfls_attribute_keys_new:
*
* Returns: (transfer full): a new #GflsAttributeKeys object.
* Since: 0.2
*/
GflsAttributeKeys *
gfls_attribute_keys_new (void)
{
return g_object_new (GFLS_TYPE_ATTRIBUTE_KEYS, NULL);
}
/**
* gfls_attribute_keys_add:
* @keys: a #GflsAttributeKeys.
* @str: the value to add.
*
* Adds @str to @keys.
*
* @str has the same semantics as the corresponding parameter of
* g_file_query_info().
*
* Since: 0.2
*/
void
gfls_attribute_keys_add (GflsAttributeKeys *keys,
const gchar *str)
{
g_return_if_fail (GFLS_IS_ATTRIBUTE_KEYS (keys));
g_return_if_fail (str != NULL);
g_ptr_array_add (keys->priv->array, g_strdup (str));
}
/**
* gfls_attribute_keys_to_string:
* @keys: a #GflsAttributeKeys.
*
* Returns: (transfer full) (nullable): the complete string to pass to
* g_file_query_info() (for example), or %NULL if the list is empty.
* Since: 0.2
*/
gchar *
gfls_attribute_keys_to_string (GflsAttributeKeys *keys)
{
g_return_val_if_fail (GFLS_IS_ATTRIBUTE_KEYS (keys), NULL);
if (keys->priv->array->len == 0)
{
return NULL;
}
/* The list is *not* optimized here (to remove duplicates, simplify when
* there are wildcards, etc). It is already optimized in GIO, but as an
* implementation detail: by g_file_attribute_matcher_new(), which is
* called by g_file_query_info().
*/
return g_strjoinv (",", (gchar **) keys->priv->array->pdata);
}
07070100000016000081A400000000000000000000000167CC91EC000006EC000000000000000000000000000000000000002F00000000libgedit-gfls-0.3.0/gfls/gfls-attribute-keys.h/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_ATTRIBUTE_KEYS_H
#define GFLS_ATTRIBUTE_KEYS_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <glib-object.h>
#include <gmodule.h>
G_BEGIN_DECLS
#define GFLS_TYPE_ATTRIBUTE_KEYS (gfls_attribute_keys_get_type ())
#define GFLS_ATTRIBUTE_KEYS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GFLS_TYPE_ATTRIBUTE_KEYS, GflsAttributeKeys))
#define GFLS_ATTRIBUTE_KEYS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GFLS_TYPE_ATTRIBUTE_KEYS, GflsAttributeKeysClass))
#define GFLS_IS_ATTRIBUTE_KEYS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GFLS_TYPE_ATTRIBUTE_KEYS))
#define GFLS_IS_ATTRIBUTE_KEYS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GFLS_TYPE_ATTRIBUTE_KEYS))
#define GFLS_ATTRIBUTE_KEYS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GFLS_TYPE_ATTRIBUTE_KEYS, GflsAttributeKeysClass))
typedef struct _GflsAttributeKeys GflsAttributeKeys;
typedef struct _GflsAttributeKeysClass GflsAttributeKeysClass;
typedef struct _GflsAttributeKeysPrivate GflsAttributeKeysPrivate;
struct _GflsAttributeKeys
{
GObject parent;
GflsAttributeKeysPrivate *priv;
};
struct _GflsAttributeKeysClass
{
GObjectClass parent_class;
gpointer padding[12];
};
G_MODULE_EXPORT
GType gfls_attribute_keys_get_type (void);
G_MODULE_EXPORT
GflsAttributeKeys * gfls_attribute_keys_new (void);
G_MODULE_EXPORT
void gfls_attribute_keys_add (GflsAttributeKeys *keys,
const gchar *str);
G_MODULE_EXPORT
gchar * gfls_attribute_keys_to_string (GflsAttributeKeys *keys);
G_END_DECLS
#endif /* GFLS_ATTRIBUTE_KEYS_H */
07070100000017000081A400000000000000000000000167CC91EC00000479000000000000000000000000000000000000002600000000libgedit-gfls-0.3.0/gfls/gfls-error.c/* SPDX-FileCopyrightText: 2024-2025 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-config.h"
#include "gfls-error.h"
#include <glib/gi18n-lib.h>
GQuark
gfls_loader_error_quark (void)
{
static GQuark quark = 0;
if (G_UNLIKELY (quark == 0))
{
quark = g_quark_from_static_string ("gfls-loader-error");
}
return quark;
}
GError *
_gfls_loader_error_too_big_file_size (void)
{
return g_error_new_literal (GFLS_LOADER_ERROR,
GFLS_LOADER_ERROR_TOO_BIG,
_("The size of the file is too big."));
}
GError *
_gfls_loader_error_too_big_read (void)
{
return g_error_new_literal (GFLS_LOADER_ERROR,
GFLS_LOADER_ERROR_TOO_BIG,
_("Limit on the number of bytes to read reached."));
}
GError *
_gfls_loader_error_not_utf8 (void)
{
return g_error_new_literal (GFLS_LOADER_ERROR,
GFLS_LOADER_ERROR_NOT_UTF8,
_("The content is not encoded in UTF-8."));
}
GError *
_gfls_loader_error_has_very_long_line (void)
{
return g_error_new_literal (GFLS_LOADER_ERROR,
GFLS_LOADER_ERROR_HAS_VERY_LONG_LINE,
_("The content contains a very long line."));
}
07070100000018000081A400000000000000000000000167CC91EC00000502000000000000000000000000000000000000002600000000libgedit-gfls-0.3.0/gfls/gfls-error.h/* SPDX-FileCopyrightText: 2024-2025 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_ERROR_H
#define GFLS_ERROR_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <glib.h>
#include <gmodule.h>
G_BEGIN_DECLS
#define GFLS_LOADER_ERROR gfls_loader_error_quark ()
/**
* GflsLoaderError:
* @GFLS_LOADER_ERROR_TOO_BIG: The content is too big.
* @GFLS_LOADER_ERROR_NOT_UTF8: The content is not a valid UTF-8 string. Used by
* basic loaders that don't support charset conversion.
* @GFLS_LOADER_ERROR_HAS_VERY_LONG_LINE: The content contains a very long line.
*
* An error code used with the %GFLS_LOADER_ERROR domain.
*
* Since: 0.1
*/
typedef enum _GflsLoaderError
{
GFLS_LOADER_ERROR_TOO_BIG,
GFLS_LOADER_ERROR_NOT_UTF8,
GFLS_LOADER_ERROR_HAS_VERY_LONG_LINE,
} GflsLoaderError;
G_MODULE_EXPORT
GQuark gfls_loader_error_quark (void);
G_GNUC_INTERNAL
GError * _gfls_loader_error_too_big_file_size (void);
G_GNUC_INTERNAL
GError * _gfls_loader_error_too_big_read (void);
G_GNUC_INTERNAL
GError * _gfls_loader_error_not_utf8 (void);
G_GNUC_INTERNAL
GError * _gfls_loader_error_has_very_long_line (void);
G_END_DECLS
#endif /* GFLS_ERROR_H */
07070100000019000081A400000000000000000000000167CC91EC00000532000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/gfls/gfls-init.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-init.h"
#include "gfls-unsaved-document-titles.h"
/**
* SECTION:gfls-init
* @Title: Gfls Initialization and Finalization
*/
/**
* gfls_init:
*
* Initializes the Gfls library (e.g. for the internationalization).
*
* This function can be called several times, but is meant to be called at the
* beginning of main(), before any other Gfls function call.
*
* Since: 0.1
*/
void
gfls_init (void)
{
}
/**
* gfls_finalize:
*
* Free the resources allocated by Gfls. For example it unrefs the singleton
* objects.
*
* It is not mandatory to call this function, it's just to be friendlier to
* memory debugging tools. This function is meant to be called at the end of
* main(). It can be called several times.
*
* Since: 0.1
*/
void
gfls_finalize (void)
{
static gboolean done = FALSE;
/* Unref the singleton only once, even if this function is called
* multiple times, to see if a reference is not released correctly.
* Normally the singleton have a ref count of 1. If for some reason the
* ref count is increased somewhere, it needs to be decreased
* accordingly, at the right place.
*/
if (!done)
{
_gfls_unsaved_document_titles_unref_default_instance ();
done = TRUE;
}
}
0707010000001A000081A400000000000000000000000167CC91EC000001A9000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/gfls/gfls-init.h/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_INIT_H
#define GFLS_INIT_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <gmodule.h>
G_BEGIN_DECLS
G_MODULE_EXPORT
void gfls_init (void);
G_MODULE_EXPORT
void gfls_finalize (void);
G_END_DECLS
#endif /* GFLS_INIT_H */
0707010000001B000081A400000000000000000000000167CC91EC000025D2000000000000000000000000000000000000002D00000000libgedit-gfls-0.3.0/gfls/gfls-input-stream.c/* SPDX-FileCopyrightText: 2023 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-input-stream.h"
/**
* SECTION:gfls-input-stream
* @Title: GflsInputStream
* @Short_description: Additional functions for #GInputStream
*
* Additional functions for #GInputStream.
*/
/* Problem with g_file_load_partial_contents_async/finish():
*
* From an API point of view, the maximum number of bytes to read is not
* provided *initially*, the GFileReadMoreCallback is called at least once. For
* example if I try to load a 100MB file with that function, nothing tells me
* that I'll be able to restrict it to 20MB (the API doesn't guarantee it).
*
* gfls_input_stream_read_async/finish() solves this (and works on any
* GInputStream, which we need for stdin support).
*/
typedef struct
{
/* Buffer to store the bytes read. It needs to contain one more byte at
* the end to nul-terminate the string. Note that it can contain nul
* bytes inside the content too (whatever is read from the input
* stream).
*/
guint8 *buf;
/* The number of bytes currently allocated to @buf. */
gsize buf_size;
/* The current position inside @buf where to write the next bytes.
* Invariant: buf_pos < buf_size
*/
gsize buf_pos;
/* Max value for @buf_size. */
gsize buf_max_size;
/* Boolean to know if the content from the input stream needed to be
* truncated because the maximum number of bytes to read has been
* reached (and there *is* more content to read).
*/
guint truncated : 1;
} TaskData;
/* 8 KiB, a value recommended by g_input_stream_read_bytes(). */
#define CHUNK_SIZE (8192)
static void read_next_chunk (GTask *task);
static TaskData *
task_data_new (gsize expected_size,
gsize max_size)
{
TaskData *task_data;
gsize initial_buf_size;
/* +1 to nul-terminate the buffer. */
initial_buf_size = MIN (expected_size + 1, max_size + 1);
task_data = g_new (TaskData, 1);
task_data->buf = g_malloc (initial_buf_size);
task_data->buf_size = initial_buf_size;
task_data->buf_pos = 0;
task_data->buf_max_size = max_size + 1;
task_data->truncated = FALSE;
return task_data;
}
static void
task_data_free (TaskData *task_data)
{
if (task_data != NULL)
{
g_free (task_data->buf);
g_free (task_data);
}
}
static gboolean
task_data_max_reached (TaskData *task_data)
{
g_assert (task_data->buf_pos < task_data->buf_max_size);
/* When this is true, it's still possible to nul-terminate the buffer. */
return task_data->buf_pos == task_data->buf_max_size - 1;
}
/* Returns: the new value for @n_bytes_to_write. */
static gsize
task_data_prepare_buffer (TaskData *task_data,
gsize n_bytes_to_write)
{
gsize required_buf_size = task_data->buf_pos + n_bytes_to_write + 1;
if (required_buf_size <= task_data->buf_size)
{
return n_bytes_to_write;
}
/* Needs to realloc the buffer */
if (required_buf_size <= task_data->buf_max_size)
{
task_data->buf = g_realloc (task_data->buf, required_buf_size);
task_data->buf_size = required_buf_size;
return n_bytes_to_write;
}
task_data->buf = g_realloc (task_data->buf, task_data->buf_max_size);
task_data->buf_size = task_data->buf_max_size;
return task_data->buf_size - task_data->buf_pos - 1;
}
static void
task_data_nul_terminate_buffer (TaskData *task_data)
{
task_data->buf[task_data->buf_pos] = '\0';
}
static GBytes *
task_data_buffer_to_gbytes (TaskData *task_data)
{
GBytes *bytes;
bytes = g_bytes_new_take (task_data->buf, task_data->buf_pos);
task_data->buf = NULL;
return bytes;
}
static void
read_past_max_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GInputStream *input_stream = G_INPUT_STREAM (source_object);
GTask *task = user_data;
TaskData *task_data;
GBytes *bytes;
GError *error = NULL;
bytes = g_input_stream_read_bytes_finish (input_stream, result, &error);
if (error != NULL)
{
g_task_return_error (task, error);
g_object_unref (task);
return;
}
task_data = g_task_get_task_data (task);
if (g_bytes_get_size (bytes) > 0)
{
task_data->truncated = TRUE;
}
g_bytes_unref (bytes);
task_data_nul_terminate_buffer (task_data);
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
static void
read_past_max (GTask *task)
{
GInputStream *input_stream;
input_stream = g_task_get_source_object (task);
g_input_stream_read_bytes_async (input_stream,
1,
g_task_get_priority (task),
g_task_get_cancellable (task),
read_past_max_cb,
task);
}
static void
read_next_chunk_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GInputStream *input_stream = G_INPUT_STREAM (source_object);
GTask *task = user_data;
GError *error = NULL;
gssize n_bytes_read;
TaskData *task_data;
n_bytes_read = g_input_stream_read_finish (input_stream, result, &error);
if (error != NULL)
{
g_task_return_error (task, error);
g_object_unref (task);
return;
}
if (n_bytes_read < 0)
{
/* Should not happen, already handled with error != NULL, but
* have robust code.
*/
g_task_return_boolean (task, FALSE);
g_object_unref (task);
return;
}
task_data = g_task_get_task_data (task);
if (n_bytes_read == 0)
{
task_data_nul_terminate_buffer (task_data);
g_task_return_boolean (task, TRUE);
g_object_unref (task);
return;
}
task_data->buf_pos += n_bytes_read;
read_next_chunk (task);
}
static void
read_next_chunk (GTask *task)
{
GInputStream *input_stream;
TaskData *task_data;
gsize actual_size_to_read;
input_stream = g_task_get_source_object (task);
task_data = g_task_get_task_data (task);
if (task_data_max_reached (task_data))
{
read_past_max (task);
return;
}
actual_size_to_read = task_data_prepare_buffer (task_data, CHUNK_SIZE);
g_input_stream_read_async (input_stream,
task_data->buf + task_data->buf_pos,
actual_size_to_read,
g_task_get_priority (task),
g_task_get_cancellable (task),
read_next_chunk_cb,
task);
}
/**
* gfls_input_stream_read_async:
* @input_stream: a #GInputStream.
* @expected_size: the expected number of bytes contained in @input_stream.
* @max_size: the maximum number of bytes to read.
* @io_priority: the I/O priority of the request. E.g. %G_PRIORITY_LOW,
* %G_PRIORITY_DEFAULT or %G_PRIORITY_HIGH.
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
* @callback: (scope async): a #GAsyncReadyCallback to call when the operation
* is finished.
* @user_data: user data to pass to @callback.
*
* This function starts a read operation on @input_stream. It is meant to be
* used as the only read operation on @input_stream, to get a #GBytes as a
* result, with @max_size as the provided maximum number of bytes to read.
*
* @expected_size is typically a #GFile size as returned by
* g_file_info_get_size(). But note that in that case, the returned #GBytes may
* contain a different number of bytes than what was expected (the
* TOC/TOU problem: time of check to time of use). @expected_size is used as an
* indication to how much memory to allocate initially.
*
* See the #GAsyncResult documentation to know how to use this function.
*
* Since: 0.1
*/
void
gfls_input_stream_read_async (GInputStream *input_stream,
gsize expected_size,
gsize max_size,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GTask *task;
TaskData *task_data;
g_return_if_fail (G_IS_INPUT_STREAM (input_stream));
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
task = g_task_new (input_stream, cancellable, callback, user_data);
g_task_set_priority (task, io_priority);
task_data = task_data_new (expected_size, max_size);
g_task_set_task_data (task, task_data, (GDestroyNotify) task_data_free);
read_next_chunk (task);
}
/**
* gfls_input_stream_read_finish:
* @input_stream: a #GInputStream.
* @result: a #GAsyncResult.
* @is_truncated: will be set to %TRUE if the @input_stream contains more data
* to be read, but the maximum number of bytes to read has been reached.
* @error: a #GError, or %NULL.
*
* Finishes an operation started with gfls_input_stream_read_async().
*
* If @is_truncated is set to %TRUE, it is not an error (@error is not set), and
* a #GBytes is returned. However, since gfls_input_stream_read_async() is meant
* to be used as the only read operation on @input_stream, it is an undefined
* behavior if you try to read more content from @input_stream.
*
* The data contained in the resulting #GBytes is always zero-terminated, but
* this is not included in the #GBytes length. The resulting #GBytes should be
* freed with g_bytes_unref() when no longer in use.
*
* Returns: a #GBytes, or %NULL on error.
* Since: 0.1
*/
GBytes *
gfls_input_stream_read_finish (GInputStream *input_stream,
GAsyncResult *result,
gboolean *is_truncated,
GError **error)
{
gboolean ok;
g_return_val_if_fail (G_IS_INPUT_STREAM (input_stream), NULL);
g_return_val_if_fail (g_task_is_valid (result, input_stream), NULL);
g_return_val_if_fail (is_truncated != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
ok = g_task_propagate_boolean (G_TASK (result), error);
if (ok)
{
TaskData *task_data;
task_data = g_task_get_task_data (G_TASK (result));
*is_truncated = task_data->truncated;
return task_data_buffer_to_gbytes (task_data);
}
*is_truncated = FALSE;
return NULL;
}
0707010000001C000081A400000000000000000000000167CC91EC0000036C000000000000000000000000000000000000002D00000000libgedit-gfls-0.3.0/gfls/gfls-input-stream.h/* SPDX-FileCopyrightText: 2023 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_INPUT_STREAM_H
#define GFLS_INPUT_STREAM_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <gio/gio.h>
G_BEGIN_DECLS
G_MODULE_EXPORT
void gfls_input_stream_read_async (GInputStream *input_stream,
gsize expected_size,
gsize max_size,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
G_MODULE_EXPORT
GBytes * gfls_input_stream_read_finish (GInputStream *input_stream,
GAsyncResult *result,
gboolean *is_truncated,
GError **error);
G_END_DECLS
#endif /* GFLS_INPUT_STREAM_H */
0707010000001D000081A400000000000000000000000167CC91EC0000233B000000000000000000000000000000000000002D00000000libgedit-gfls-0.3.0/gfls/gfls-loader-basic.c/* SPDX-FileCopyrightText: 2023-2025 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-loader-basic.h"
#include "gfls-error.h"
#include "gfls-input-stream.h"
#include "gfls-utf8.h"
/**
* SECTION:gfls-loader-basic
* @Title: GflsLoaderBasic
* @Short_description: Basic file loader
*
* Basic file loader that validates input for GtkTextView purposes:
* - Must not exceed a certain size (because all the content of a GtkTextBuffer
* is stored in memory).
* - Must be valid UTF-8 already (GTK in general accepts only UTF-8 only
* strings).
* - Must not contain very long lines (not well supported by the GtkTextView
* widget, there can be performance problems and freezes).
*
* So:
* - No character encoding auto-detection and/or conversion.
* - No workarounds for problems found, just return an error without the
* possibility to re-configure the loading.
*
* But this basic file loader offers a convenient API for the above: #GFile
* loading with the intention to put its content into a GtkTextBuffer.
*/
/* When the file size is unknown, start with 8 KiB. */
#define DEFAULT_FILE_SIZE (8192)
typedef struct
{
/* Config */
gsize max_size;
guint max_n_bytes_per_line;
/* Intermediate data */
gsize expected_file_size;
// TODO: close explicitly the stream? to get a GError if any.
// With g_input_stream_close_async/finish().
// Do it here? Or in gfls_input_stream_read_async/finish(), since it is
// meant as the only read operation?
GInputStream *input_stream;
/* Result */
GBytes *bytes;
} TaskData;
static TaskData *
task_data_new (gsize max_size,
guint max_n_bytes_per_line)
{
TaskData *task_data;
task_data = g_new0 (TaskData, 1);
task_data->max_size = max_size;
task_data->max_n_bytes_per_line = max_n_bytes_per_line;
return task_data;
}
static void
task_data_free (TaskData *task_data)
{
if (task_data != NULL)
{
g_clear_object (&task_data->input_stream);
g_clear_pointer (&task_data->bytes, g_bytes_unref);
g_free (task_data);
}
}
static void
check_bytes (GTask *task)
{
TaskData *task_data;
const gchar *text;
gsize n_bytes;
task_data = g_task_get_task_data (task);
text = g_bytes_get_data (task_data->bytes, &n_bytes);
if (!g_utf8_validate_len (text, n_bytes, NULL))
{
g_task_return_error (task, _gfls_loader_error_not_utf8 ());
g_object_unref (task);
return;
}
if (gfls_utf8_find_very_long_line (text, task_data->max_n_bytes_per_line) != NULL)
{
g_task_return_error (task, _gfls_loader_error_has_very_long_line ());
g_object_unref (task);
return;
}
/* Everything OK, finally done. */
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
static void
read_input_stream_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GInputStream *input_stream = G_INPUT_STREAM (source_object);
GTask *task = G_TASK (user_data);
TaskData *task_data;
gboolean is_truncated = FALSE;
GError *error = NULL;
task_data = g_task_get_task_data (task);
g_clear_pointer (&task_data->bytes, g_bytes_unref);
task_data->bytes = gfls_input_stream_read_finish (input_stream,
result,
&is_truncated,
&error);
if (error != NULL)
{
g_task_return_error (task, error);
g_object_unref (task);
return;
}
if (is_truncated)
{
/* Free memory as early as possible, especially because it
* reached the maximum.
*/
g_clear_pointer (&task_data->bytes, g_bytes_unref);
g_task_return_error (task, _gfls_loader_error_too_big_read ());
g_object_unref (task);
return;
}
check_bytes (task);
}
static void
read_input_stream (GTask *task)
{
TaskData *task_data = g_task_get_task_data (task);
gfls_input_stream_read_async (task_data->input_stream,
task_data->expected_file_size,
task_data->max_size,
g_task_get_priority (task),
g_task_get_cancellable (task),
read_input_stream_cb,
task);
}
static void
open_file_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GFile *file = G_FILE (source_object);
GTask *task = G_TASK (user_data);
GFileInputStream *file_input_stream;
TaskData *task_data;
GError *error = NULL;
file_input_stream = g_file_read_finish (file, result, &error);
if (error != NULL)
{
g_task_return_error (task, error);
g_object_unref (task);
g_clear_object (&file_input_stream);
return;
}
task_data = g_task_get_task_data (task);
g_clear_object (&task_data->input_stream);
task_data->input_stream = G_INPUT_STREAM (file_input_stream);
read_input_stream (task);
}
static void
open_file (GTask *task)
{
GFile *file = g_task_get_source_object (task);
g_file_read_async (file,
g_task_get_priority (task),
g_task_get_cancellable (task),
open_file_cb,
task);
}
static void
query_file_info_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GFile *file = G_FILE (source_object);
GTask *task = G_TASK (user_data);
TaskData *task_data;
GFileInfo *info;
GError *error = NULL;
info = g_file_query_info_finish (file, result, &error);
if (error != NULL)
{
g_task_return_error (task, error);
g_object_unref (task);
g_clear_object (&info);
return;
}
task_data = g_task_get_task_data (task);
if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE))
{
task_data->expected_file_size = g_file_info_get_size (info);
if (task_data->expected_file_size > task_data->max_size)
{
g_task_return_error (task, _gfls_loader_error_too_big_file_size ());
g_object_unref (task);
g_clear_object (&info);
return;
}
}
else
{
task_data->expected_file_size = DEFAULT_FILE_SIZE;
}
open_file (task);
g_clear_object (&info);
}
static void
query_file_info (GTask *task)
{
GFile *file = g_task_get_source_object (task);
g_file_query_info_async (file,
G_FILE_ATTRIBUTE_STANDARD_SIZE,
G_FILE_QUERY_INFO_NONE,
g_task_get_priority (task),
g_task_get_cancellable (task),
query_file_info_cb,
task);
}
/**
* gfls_loader_basic_load_async:
* @file: a #GFile.
* @max_size: the maximum allowed number of bytes in total.
* @max_n_bytes_per_line: the maximum allowed number of bytes per line, as per
* gfls_utf8_find_very_long_line().
* @io_priority: the I/O priority of the request. E.g. %G_PRIORITY_LOW,
* %G_PRIORITY_DEFAULT or %G_PRIORITY_HIGH.
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
* @callback: (scope async): a #GAsyncReadyCallback to call when the operation
* is finished.
* @user_data: user data to pass to @callback.
*
* Starts a basic file loading operation.
*
* If the @file content is not a valid UTF-8 string, or if the @max_size or
* @max_n_bytes_per_line conditions are not satisfied, an error will be returned
* without the file content.
*
* See the #GAsyncResult documentation to know how to use this function.
*
* Since: 0.1
*/
void
gfls_loader_basic_load_async (GFile *file,
gsize max_size,
guint max_n_bytes_per_line,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GTask *task;
TaskData *task_data;
g_return_if_fail (G_IS_FILE (file));
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_priority (task, io_priority);
task_data = task_data_new (max_size, max_n_bytes_per_line);
g_task_set_task_data (task, task_data, (GDestroyNotify) task_data_free);
query_file_info (task);
}
/**
* gfls_loader_basic_load_finish:
* @file: a #GFile.
* @result: a #GAsyncResult.
* @error: a #GError, or %NULL.
*
* Finishes an operation started with gfls_loader_basic_load_async().
*
* If everything went well, a #GBytes with the #GFile content (unmodified) is
* returned. It is guaranteed to be a valid UTF-8 string.
*
* Otherwise an error is returned. The %GFLS_LOADER_ERROR domain is used, among
* others.
*
* The data contained in the resulting #GBytes is always zero-terminated, but
* this is not included in the #GBytes length. The resulting #GBytes should be
* freed with g_bytes_unref() when no longer in use.
*
* Returns: a #GBytes, or %NULL on error.
* Since: 0.1
*/
GBytes *
gfls_loader_basic_load_finish (GFile *file,
GAsyncResult *result,
GError **error)
{
gboolean ok;
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (g_task_is_valid (result, file), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
ok = g_task_propagate_boolean (G_TASK (result), error);
if (ok)
{
TaskData *task_data;
GBytes *bytes;
task_data = g_task_get_task_data (G_TASK (result));
bytes = task_data->bytes;
task_data->bytes = NULL;
return bytes;
}
return NULL;
}
0707010000001E000081A400000000000000000000000167CC91EC0000033F000000000000000000000000000000000000002D00000000libgedit-gfls-0.3.0/gfls/gfls-loader-basic.h/* SPDX-FileCopyrightText: 2023 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_LOADER_BASIC_H
#define GFLS_LOADER_BASIC_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <gio/gio.h>
G_BEGIN_DECLS
G_MODULE_EXPORT
void gfls_loader_basic_load_async (GFile *file,
gsize max_size,
guint max_n_bytes_per_line,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
G_MODULE_EXPORT
GBytes * gfls_loader_basic_load_finish (GFile *file,
GAsyncResult *result,
GError **error);
G_END_DECLS
#endif /* GFLS_LOADER_BASIC_H */
0707010000001F000081A400000000000000000000000167CC91EC00000C05000000000000000000000000000000000000003500000000libgedit-gfls-0.3.0/gfls/gfls-loader-config-simple.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-loader-config-simple.h"
/**
* SECTION:gfls-loader-config-simple
* @Title: GflsLoaderConfigSimple
* @Short_description: Loader configuration
*/
struct _GflsLoaderConfigSimplePrivate
{
GFile *file;
GInputStream *input_stream;
};
G_DEFINE_TYPE_WITH_PRIVATE (GflsLoaderConfigSimple, gfls_loader_config_simple, G_TYPE_OBJECT)
static void
gfls_loader_config_simple_dispose (GObject *object)
{
GflsLoaderConfigSimple *config = GFLS_LOADER_CONFIG_SIMPLE (object);
g_clear_object (&config->priv->file);
g_clear_object (&config->priv->input_stream);
G_OBJECT_CLASS (gfls_loader_config_simple_parent_class)->dispose (object);
}
static void
gfls_loader_config_simple_class_init (GflsLoaderConfigSimpleClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gfls_loader_config_simple_dispose;
}
static void
gfls_loader_config_simple_init (GflsLoaderConfigSimple *config)
{
config->priv = gfls_loader_config_simple_get_instance_private (config);
}
/**
* gfls_loader_config_simple_new_from_file:
* @file: a #GFile.
*
* Creates a new #GflsLoaderConfigSimple object with @file for the input
* content.
*
* Returns: (transfer full): a new #GflsLoaderConfigSimple object.
* Since: 0.2
*/
GflsLoaderConfigSimple *
gfls_loader_config_simple_new_from_file (GFile *file)
{
GflsLoaderConfigSimple *config;
g_return_val_if_fail (G_IS_FILE (file), NULL);
config = g_object_new (GFLS_TYPE_LOADER_CONFIG_SIMPLE, NULL);
config->priv->file = g_object_ref (file);
return config;
}
/**
* gfls_loader_config_simple_new_from_stream:
* @input_stream: a #GInputStream.
*
* Creates a new #GflsLoaderConfigSimple object with @input_stream for the input
* content.
*
* To load from stdin, a useful function is
* g_application_command_line_get_stdin().
*
* Returns: (transfer full): a new #GflsLoaderConfigSimple object.
* Since: 0.2
*/
GflsLoaderConfigSimple *
gfls_loader_config_simple_new_from_stream (GInputStream *input_stream)
{
GflsLoaderConfigSimple *config;
g_return_val_if_fail (G_IS_INPUT_STREAM (input_stream), NULL);
config = g_object_new (GFLS_TYPE_LOADER_CONFIG_SIMPLE, NULL);
config->priv->input_stream = g_object_ref (input_stream);
return config;
}
/**
* gfls_loader_config_simple_get_file:
* @config: a #GflsLoaderConfigSimple.
*
* Returns: (transfer none) (nullable): the #GFile of @config, or %NULL.
* Since: 0.2
*/
GFile *
gfls_loader_config_simple_get_file (GflsLoaderConfigSimple *config)
{
g_return_val_if_fail (GFLS_IS_LOADER_CONFIG_SIMPLE (config), NULL);
return config->priv->file;
}
/**
* gfls_loader_config_simple_get_stream:
* @config: a #GflsLoaderConfigSimple.
*
* Returns: (transfer none) (nullable): the #GInputStream of @config, or %NULL.
* Since: 0.2
*/
GInputStream *
gfls_loader_config_simple_get_stream (GflsLoaderConfigSimple *config)
{
g_return_val_if_fail (GFLS_IS_LOADER_CONFIG_SIMPLE (config), NULL);
return config->priv->input_stream;
}
07070100000020000081A400000000000000000000000167CC91EC00000806000000000000000000000000000000000000003500000000libgedit-gfls-0.3.0/gfls/gfls-loader-config-simple.h/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_LOADER_CONFIG_SIMPLE_H
#define GFLS_LOADER_CONFIG_SIMPLE_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <gio/gio.h>
G_BEGIN_DECLS
#define GFLS_TYPE_LOADER_CONFIG_SIMPLE (gfls_loader_config_simple_get_type ())
#define GFLS_LOADER_CONFIG_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GFLS_TYPE_LOADER_CONFIG_SIMPLE, GflsLoaderConfigSimple))
#define GFLS_LOADER_CONFIG_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GFLS_TYPE_LOADER_CONFIG_SIMPLE, GflsLoaderConfigSimpleClass))
#define GFLS_IS_LOADER_CONFIG_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GFLS_TYPE_LOADER_CONFIG_SIMPLE))
#define GFLS_IS_LOADER_CONFIG_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GFLS_TYPE_LOADER_CONFIG_SIMPLE))
#define GFLS_LOADER_CONFIG_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GFLS_TYPE_LOADER_CONFIG_SIMPLE, GflsLoaderConfigSimpleClass))
typedef struct _GflsLoaderConfigSimple GflsLoaderConfigSimple;
typedef struct _GflsLoaderConfigSimpleClass GflsLoaderConfigSimpleClass;
typedef struct _GflsLoaderConfigSimplePrivate GflsLoaderConfigSimplePrivate;
struct _GflsLoaderConfigSimple
{
GObject parent;
GflsLoaderConfigSimplePrivate *priv;
};
struct _GflsLoaderConfigSimpleClass
{
GObjectClass parent_class;
gpointer padding[12];
};
G_MODULE_EXPORT
GType gfls_loader_config_simple_get_type (void);
G_MODULE_EXPORT
GflsLoaderConfigSimple *gfls_loader_config_simple_new_from_file (GFile *file);
G_MODULE_EXPORT
GflsLoaderConfigSimple *gfls_loader_config_simple_new_from_stream (GInputStream *input_stream);
G_MODULE_EXPORT
GFile * gfls_loader_config_simple_get_file (GflsLoaderConfigSimple *config);
G_MODULE_EXPORT
GInputStream * gfls_loader_config_simple_get_stream (GflsLoaderConfigSimple *config);
G_END_DECLS
#endif /* GFLS_LOADER_CONFIG_SIMPLE_H */
07070100000021000081A400000000000000000000000167CC91EC00000255000000000000000000000000000000000000002E00000000libgedit-gfls-0.3.0/gfls/gfls-loader-config.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-loader-config.h"
/**
* SECTION:gfls-loader-config
* @Title: GflsLoaderConfig
* @Short_description: Loader configuration interface
*
* #GflsLoaderConfig is an interface that classes implement to store a loader
* configuration.
*
* Currently it is an empty interface, also called a “marker interface”.
*/
G_DEFINE_INTERFACE (GflsLoaderConfig, gfls_loader_config, G_TYPE_OBJECT)
static void
gfls_loader_config_default_init (GflsLoaderConfigInterface *interface)
{
}
07070100000022000081A400000000000000000000000167CC91EC000004B7000000000000000000000000000000000000002E00000000libgedit-gfls-0.3.0/gfls/gfls-loader-config.h/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_LOADER_CONFIG_H
#define GFLS_LOADER_CONFIG_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <glib-object.h>
#include <gmodule.h>
G_BEGIN_DECLS
#define GFLS_TYPE_LOADER_CONFIG (gfls_loader_config_get_type ())
#define GFLS_LOADER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GFLS_TYPE_LOADER_CONFIG, GflsLoaderConfig))
#define GFLS_IS_LOADER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GFLS_TYPE_LOADER_CONFIG))
#define GFLS_LOADER_CONFIG_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GFLS_TYPE_LOADER_CONFIG, GflsLoaderConfigInterface))
typedef struct _GflsLoaderConfig GflsLoaderConfig;
typedef struct _GflsLoaderConfigInterface GflsLoaderConfigInterface;
/**
* GflsLoaderConfigInterface:
* @parent_interface: The parent interface.
*
* Since: 0.2
*/
struct _GflsLoaderConfigInterface
{
GTypeInterface parent_interface;
};
G_MODULE_EXPORT
GType gfls_loader_config_get_type (void);
G_END_DECLS
#endif /* GFLS_LOADER_CONFIG_H */
07070100000023000081A400000000000000000000000167CC91EC00001A1D000000000000000000000000000000000000003800000000libgedit-gfls-0.3.0/gfls/gfls-unsaved-document-titles.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-config.h"
#include "gfls-unsaved-document-titles.h"
#include <glib/gi18n-lib.h>
/**
* SECTION:gfls-unsaved-document-titles
* @Title: GflsUnsavedDocumentTitles
* @Short_description: To give titles to unsaved documents
*
* #GflsUnsavedDocumentTitles is used to give titles to unsaved documents, such
* as "Unsaved Document N" with 'N' replaced by a number.
*
* This is for new documents that have never been saved before and reside in
* memory only. These documents have not yet an associated #GFile.
*
* Do not confuse it with documents with unsaved <emphasis>changes</emphasis>.
*/
#define FIRST_NUMBER (1)
struct _GflsUnsavedDocumentTitlesPrivate
{
/* Sorted list of owned 'gint*'. */
GList *allocated_numbers;
GflsUnsavedDocumentTitleCallback title_callback;
};
static GflsUnsavedDocumentTitles *default_instance;
G_DEFINE_TYPE_WITH_PRIVATE (GflsUnsavedDocumentTitles, gfls_unsaved_document_titles, G_TYPE_OBJECT)
static gint
compare_numbers (gconstpointer a,
gconstpointer b)
{
const gint *ptr_num_a;
const gint *ptr_num_b;
gint num_a;
gint num_b;
g_return_val_if_fail (a != NULL, 0);
g_return_val_if_fail (b != NULL, 0);
ptr_num_a = a;
ptr_num_b = b;
num_a = *ptr_num_a;
num_b = *ptr_num_b;
return num_a - num_b;
}
static gchar *
default_title_cb (gint num)
{
return g_strdup_printf (_("Unsaved Document %d"), num);
}
static void
gfls_unsaved_document_titles_finalize (GObject *object)
{
GflsUnsavedDocumentTitles *titles = GFLS_UNSAVED_DOCUMENT_TITLES (object);
if (default_instance == titles)
{
default_instance = NULL;
}
g_list_free_full (titles->priv->allocated_numbers, g_free);
G_OBJECT_CLASS (gfls_unsaved_document_titles_parent_class)->finalize (object);
}
static void
gfls_unsaved_document_titles_class_init (GflsUnsavedDocumentTitlesClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gfls_unsaved_document_titles_finalize;
}
static void
gfls_unsaved_document_titles_init (GflsUnsavedDocumentTitles *titles)
{
titles->priv = gfls_unsaved_document_titles_get_instance_private (titles);
titles->priv->title_callback = default_title_cb;
}
/**
* gfls_unsaved_document_titles_new:
*
* Returns: (transfer full): a new #GflsUnsavedDocumentTitles object.
* Since: 0.1
*/
GflsUnsavedDocumentTitles *
gfls_unsaved_document_titles_new (void)
{
return g_object_new (GFLS_TYPE_UNSAVED_DOCUMENT_TITLES, NULL);
}
/**
* gfls_unsaved_document_titles_get_default:
*
* Returns: (transfer none): the default instance of #GflsUnsavedDocumentTitles.
* Since: 0.1
*/
GflsUnsavedDocumentTitles *
gfls_unsaved_document_titles_get_default (void)
{
if (default_instance == NULL)
{
default_instance = gfls_unsaved_document_titles_new ();
}
return default_instance;
}
void
_gfls_unsaved_document_titles_unref_default_instance (void)
{
if (default_instance != NULL)
{
g_object_unref (default_instance);
}
/* default_instance is not set to NULL here, it is set to NULL in
* gfls_unsaved_document_titles_finalize() (i.e. when we are sure that
* the ref count reaches 0).
*/
}
/**
* gfls_unsaved_document_titles_allocate_number:
* @titles: a #GflsUnsavedDocumentTitles.
*
* Allocates a number for an unsaved document. When the document is saved on
* disk, you need to give back the number with
* gfls_unsaved_document_titles_release_number().
*
* The returned number is the lowest available value, starting at 1.
*
* Returns: the allocated number.
* Since: 0.1
*/
gint
gfls_unsaved_document_titles_allocate_number (GflsUnsavedDocumentTitles *titles)
{
gint num = FIRST_NUMBER;
GList *node;
gint *num_data;
g_return_val_if_fail (GFLS_IS_UNSAVED_DOCUMENT_TITLES (titles), 0);
node = titles->priv->allocated_numbers;
while (node != NULL)
{
const gint *node_data = node->data;
const gint allocated_num = *node_data;
if (num != allocated_num)
{
break;
}
num++;
node = node->next;
}
num_data = g_new (gint, 1);
*num_data = num;
titles->priv->allocated_numbers = g_list_insert_sorted (titles->priv->allocated_numbers,
num_data,
compare_numbers);
return num;
}
/**
* gfls_unsaved_document_titles_release_number:
* @titles: a #GflsUnsavedDocumentTitles.
* @number: the number to release.
*
* Call this function to give back @number to @titles, so that it becomes
* available for a next unsaved document. This is usually done when the document
* is saved on disk.
*
* Since: 0.1
*/
void
gfls_unsaved_document_titles_release_number (GflsUnsavedDocumentTitles *titles,
gint number)
{
GList *node;
g_return_if_fail (GFLS_IS_UNSAVED_DOCUMENT_TITLES (titles));
for (node = titles->priv->allocated_numbers; node != NULL; node = node->next)
{
const gint *node_data = node->data;
const gint allocated_num = *node_data;
if (allocated_num == number)
{
break;
}
}
if (node != NULL)
{
titles->priv->allocated_numbers = g_list_remove_link (titles->priv->allocated_numbers, node);
g_list_free_full (node, g_free);
}
}
/**
* gfls_unsaved_document_titles_get_title:
* @titles: a #GflsUnsavedDocumentTitles.
* @number: a number.
*
* Generates the title of an unsaved document. To customize the returned string,
* you can use gfls_unsaved_document_titles_set_title_callback().
*
* Returns: (transfer full): a suitable title for the unsaved document with the
* given @number.
* Since: 0.1
*/
gchar *
gfls_unsaved_document_titles_get_title (GflsUnsavedDocumentTitles *titles,
gint number)
{
g_return_val_if_fail (GFLS_IS_UNSAVED_DOCUMENT_TITLES (titles), NULL);
return titles->priv->title_callback (number);
}
/**
* gfls_unsaved_document_titles_set_title_callback: (skip)
* @titles: a #GflsUnsavedDocumentTitles.
* @title_callback: (nullable): a #GflsUnsavedDocumentTitleCallback.
*
* Sets a #GflsUnsavedDocumentTitleCallback function. To reset to the default
* setting, pass %NULL to @title_callback.
*
* The callback will be used by gfls_unsaved_document_titles_get_title().
*
* Examples:
* - "Unsaved Document N"
* - "Unsaved File N"
* - "Untitled Document N"
* - "New Document N"
* - Etc.
*
* Since: 0.1
*/
void
gfls_unsaved_document_titles_set_title_callback (GflsUnsavedDocumentTitles *titles,
GflsUnsavedDocumentTitleCallback title_callback)
{
g_return_if_fail (GFLS_IS_UNSAVED_DOCUMENT_TITLES (titles));
if (title_callback != NULL)
{
titles->priv->title_callback = title_callback;
}
else
{
titles->priv->title_callback = default_title_cb;
}
}
07070100000024000081A400000000000000000000000167CC91EC00000B84000000000000000000000000000000000000003800000000libgedit-gfls-0.3.0/gfls/gfls-unsaved-document-titles.h/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_UNSAVED_DOCUMENT_TITLES_H
#define GFLS_UNSAVED_DOCUMENT_TITLES_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <glib-object.h>
#include <gmodule.h>
G_BEGIN_DECLS
#define GFLS_TYPE_UNSAVED_DOCUMENT_TITLES (gfls_unsaved_document_titles_get_type ())
#define GFLS_UNSAVED_DOCUMENT_TITLES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GFLS_TYPE_UNSAVED_DOCUMENT_TITLES, GflsUnsavedDocumentTitles))
#define GFLS_UNSAVED_DOCUMENT_TITLES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GFLS_TYPE_UNSAVED_DOCUMENT_TITLES, GflsUnsavedDocumentTitlesClass))
#define GFLS_IS_UNSAVED_DOCUMENT_TITLES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GFLS_TYPE_UNSAVED_DOCUMENT_TITLES))
#define GFLS_IS_UNSAVED_DOCUMENT_TITLES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GFLS_TYPE_UNSAVED_DOCUMENT_TITLES))
#define GFLS_UNSAVED_DOCUMENT_TITLES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GFLS_TYPE_UNSAVED_DOCUMENT_TITLES, GflsUnsavedDocumentTitlesClass))
typedef struct _GflsUnsavedDocumentTitles GflsUnsavedDocumentTitles;
typedef struct _GflsUnsavedDocumentTitlesClass GflsUnsavedDocumentTitlesClass;
typedef struct _GflsUnsavedDocumentTitlesPrivate GflsUnsavedDocumentTitlesPrivate;
struct _GflsUnsavedDocumentTitles
{
GObject parent;
GflsUnsavedDocumentTitlesPrivate *priv;
};
struct _GflsUnsavedDocumentTitlesClass
{
GObjectClass parent_class;
gpointer padding[12];
};
/**
* GflsUnsavedDocumentTitleCallback:
* @num: the number.
*
* Type definition for a function that will be called to create a string
* containing @num, to give a name to a document not yet present on disk.
*
* Returns: (transfer full): the created title.
* Since: 0.1
*/
typedef gchar *(*GflsUnsavedDocumentTitleCallback) (gint num);
G_MODULE_EXPORT
GType gfls_unsaved_document_titles_get_type (void);
G_MODULE_EXPORT
GflsUnsavedDocumentTitles *
gfls_unsaved_document_titles_new (void);
G_MODULE_EXPORT
GflsUnsavedDocumentTitles *
gfls_unsaved_document_titles_get_default (void);
G_MODULE_EXPORT
gint gfls_unsaved_document_titles_allocate_number (GflsUnsavedDocumentTitles *titles);
G_MODULE_EXPORT
void gfls_unsaved_document_titles_release_number (GflsUnsavedDocumentTitles *titles,
gint number);
G_MODULE_EXPORT
gchar * gfls_unsaved_document_titles_get_title (GflsUnsavedDocumentTitles *titles,
gint number);
G_MODULE_EXPORT
void gfls_unsaved_document_titles_set_title_callback (GflsUnsavedDocumentTitles *titles,
GflsUnsavedDocumentTitleCallback title_callback);
G_GNUC_INTERNAL
void _gfls_unsaved_document_titles_unref_default_instance (void);
G_END_DECLS
#endif /* GFLS_UNSAVED_DOCUMENT_TITLES_H */
07070100000025000081A400000000000000000000000167CC91EC00000561000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/gfls/gfls-utf8.c/* SPDX-FileCopyrightText: 2023-2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "gfls-utf8.h"
/**
* SECTION:gfls-utf8
* @Title: GflsUtf8
* @Short_description: Functions for UTF-8 strings
*
* Additional functions for UTF-8 strings, to complement what is provided by
* GLib.
*/
/**
* gfls_utf8_find_very_long_line:
* @str: a UTF-8 nul-terminated string.
* @max_n_bytes_per_line: the maximum number of bytes per line, without counting
* the newline character(s).
*
* Finds if a line in @str exceeds @max_n_bytes_per_line.
*
* For performance reasons, @str is not checked whether it is a valid UTF-8
* string. So you must call for example g_utf8_validate() beforehand.
*
* Returns: a pointer to the beginning of the first very long line found, or
* %NULL if not found.
* Since: 0.3
*/
const gchar *
gfls_utf8_find_very_long_line (const gchar *str,
guint max_n_bytes_per_line)
{
guint cur_pos;
guint line_length = 0;
g_return_val_if_fail (str != NULL, NULL);
for (cur_pos = 0; str[cur_pos] != '\0'; cur_pos++)
{
gchar ch = str[cur_pos];
if (ch == '\n' || ch == '\r')
{
line_length = 0;
}
else
{
line_length++;
if (line_length > max_n_bytes_per_line)
{
guint line_start_pos = cur_pos - line_length + 1;
return str + line_start_pos;
}
}
}
return NULL;
}
07070100000026000081A400000000000000000000000167CC91EC000001D5000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/gfls/gfls-utf8.h/* SPDX-FileCopyrightText: 2023-2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_UTF8_H
#define GFLS_UTF8_H
#if !defined (GFLS_H_INSIDE) && !defined (GFLS_COMPILATION)
#error "Only <gfls/gfls.h> can be included directly."
#endif
#include <gmodule.h>
G_BEGIN_DECLS
G_MODULE_EXPORT
const gchar * gfls_utf8_find_very_long_line (const gchar *str,
guint max_n_bytes_per_line);
G_END_DECLS
#endif /* GFLS_UTF8_H */
07070100000027000081A400000000000000000000000167CC91EC00000233000000000000000000000000000000000000002000000000libgedit-gfls-0.3.0/gfls/gfls.h/* SPDX-FileCopyrightText: 2023-2025 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef GFLS_H
#define GFLS_H
#define GFLS_H_INSIDE
#include <gfls/gfls-enum-types.h>
#include <gfls/gfls-attribute-keys.h>
#include <gfls/gfls-error.h>
#include <gfls/gfls-init.h>
#include <gfls/gfls-input-stream.h>
#include <gfls/gfls-loader-basic.h>
#include <gfls/gfls-loader-config.h>
#include <gfls/gfls-loader-config-simple.h>
#include <gfls/gfls-unsaved-document-titles.h>
#include <gfls/gfls-utf8.h>
#undef GFLS_H_INSIDE
#endif /* GFLS_H */
07070100000028000081A400000000000000000000000167CC91EC00000B63000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/gfls/meson.buildgfls_public_headers = [
'gfls.h',
'gfls-attribute-keys.h',
'gfls-error.h',
'gfls-init.h',
'gfls-input-stream.h',
'gfls-loader-basic.h',
'gfls-loader-config.h',
'gfls-loader-config-simple.h',
'gfls-unsaved-document-titles.h',
'gfls-utf8.h',
]
gfls_public_c_files = [
'gfls-attribute-keys.c',
'gfls-error.c',
'gfls-init.c',
'gfls-input-stream.c',
'gfls-loader-basic.c',
'gfls-loader-config.c',
'gfls-loader-config-simple.c',
'gfls-unsaved-document-titles.c',
'gfls-utf8.c',
]
headers_install_dir = get_option('includedir') / '@0@-@1@/gfls/'.format(meson.project_name(), GFLS_API_VERSION)
install_headers(
gfls_public_headers,
install_dir: headers_install_dir
)
gfls_enum_types = GNOME.mkenums_simple(
'gfls-enum-types',
decorator: 'G_MODULE_EXPORT',
header_prefix: '#include <gmodule.h>',
sources: gfls_public_headers,
install_header: true,
install_dir: headers_install_dir
)
gfls_static_lib = static_library(
'libgedit-gfls-static',
[gfls_public_c_files,
gfls_enum_types],
pic: true, # gfls_static_lib is potentially linked in a shared library.
include_directories: ROOT_INCLUDE_DIR,
dependencies: GFLS_DEPS,
c_args: '-DGFLS_COMPILATION'
)
# For unit tests, to be able to test private functions.
GFLS_STATIC_DEP = declare_dependency(
include_directories: ROOT_INCLUDE_DIR,
link_with: gfls_static_lib,
sources: gfls_enum_types[1],
dependencies: GFLS_DEPS
)
symbol_map = 'symbol.map'
gfls_lib_link_args = c_compiler.get_supported_link_arguments([
'-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbol_map),
])
gfls_lib = library(
'gedit-gfls-@0@'.format(GFLS_API_VERSION),
dependencies: GFLS_DEPS,
link_args: gfls_lib_link_args,
link_depends: symbol_map,
# link_whole is not supported with MSVC, so we use extract_all_objects().
objects: gfls_static_lib.extract_all_objects(recursive: false),
soversion: 0,
install: true
)
GFLS_LIB_DEP = declare_dependency(
include_directories: ROOT_INCLUDE_DIR,
link_with: gfls_lib,
sources: gfls_enum_types[1],
dependencies: GFLS_DEPS
)
PKG_CONFIG.generate(gfls_lib,
filebase: '@0@-@1@'.format(meson.project_name(), GFLS_API_VERSION),
name: meson.project_name(),
description: 'File loading and saving',
subdirs: '@0@-@1@'.format(meson.project_name(), GFLS_API_VERSION),
libraries: GFLS_DEPS,
)
if get_option('gobject_introspection')
GNOME.generate_gir(
gfls_lib,
export_packages: '@0@-@1@'.format(meson.project_name(), GFLS_API_VERSION),
header: 'gfls/gfls.h',
identifier_prefix: 'Gfls',
include_directories: ROOT_INCLUDE_DIR,
includes: ['Gtk-3.0'],
install: true,
namespace: 'Gfls',
nsversion: GFLS_API_VERSION,
sources: [
gfls_public_headers,
gfls_public_c_files,
gfls_enum_types,
],
# Support for deps being built as subprojects:
dependencies: GFLS_DEPS,
)
endif
07070100000029000081A400000000000000000000000167CC91EC00000023000000000000000000000000000000000000002400000000libgedit-gfls-0.3.0/gfls/symbol.map{
global:
gfls_*;
local:
*;
};
0707010000002A000081A400000000000000000000000167CC91EC00000498000000000000000000000000000000000000002700000000libgedit-gfls-0.3.0/libgedit-gfls.doap<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:gnome="http://api.gnome.org/doap-extensions#"
xmlns="http://usefulinc.com/ns/doap#">
<name>libgedit-gfls</name>
<shortdesc xml:lang="en">Gedit Technology - File loading and saving</shortdesc>
<description xml:lang="en">
libgedit-gfls is part of Gedit Technology.
It is a module dedicated to file loading and saving for the needs of gedit and
other similar text editors.
</description>
<homepage rdf:resource="https://gitlab.gnome.org/World/gedit/libgedit-gfls" />
<download-page rdf:resource="https://download.gnome.org/sources/libgedit-gfls/" />
<bug-database rdf:resource="https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/issues" />
<programming-language>C</programming-language>
<maintainer>
<foaf:Person>
<foaf:name>Sébastien Wilmet</foaf:name>
<foaf:mbox rdf:resource="mailto:swilmet@mailfence.com" />
<gnome:userid>swilmet</gnome:userid>
</foaf:Person>
</maintainer>
</Project>
0707010000002B000081A400000000000000000000000167CC91EC00000CE2000000000000000000000000000000000000002000000000libgedit-gfls-0.3.0/meson.build# Convention:
# - Local variables in lower_case.
# - Global variables in UPPER_CASE.
# See: https://github.com/mesonbuild/meson/issues/2607
project(
'libgedit-gfls', 'c',
meson_version: '>= 0.64',
version: '0.3.0',
default_options: ['warning_level=2']
)
GNOME = import('gnome')
PKG_CONFIG = import('pkgconfig')
I18N = import('i18n')
FS = import('fs')
# API version, used for parallel installability.
GFLS_API_VERSION = '1'
GFLS_DEPS = [
dependency('gio-2.0', version: '>= 2.78'),
]
GTK3_DEP = dependency('gtk+-3.0', version: '>= 3.22', required: false)
# gfls-config.h
config_data = configuration_data()
GETTEXT_PACKAGE_NAME = '@0@-@1@'.format(meson.project_name(), GFLS_API_VERSION)
config_data.set_quoted('GETTEXT_PACKAGE', GETTEXT_PACKAGE_NAME)
config_data.set_quoted('GFLS_LOCALEDIR', get_option('prefix') / get_option('localedir'))
configure_file(
output: 'gfls-config.h',
configuration: config_data
)
# Misc
ROOT_INCLUDE_DIR = include_directories('.')
add_project_arguments(
'-DG_LOG_DOMAIN="@0@"'.format(meson.project_name()),
language: 'c'
)
#####
# CFLAGS
# Some flags are missing when using only the builtin warning_level meson option,
# even at the maximum level.
# The following warning_cflags suppose that warning_level=2.
c_compiler = meson.get_compiler('c')
warning_cflags = []
if c_compiler.get_id() == 'msvc'
# Use GLib's msvc_recommended_pragmas.h to filter out
# the warnings we don't really need to worry about,
# but do make the ones we want to be wary stand out
warning_cflags += [
'-FImsvc_recommended_pragmas.h',
]
else
# Try to mimic the AX_COMPILER_FLAGS Autotools macro.
warning_cflags += [
'-fno-strict-aliasing',
'-Wundef',
'-Wnested-externs',
'-Wwrite-strings',
'-Wpointer-arith',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wstrict-prototypes',
'-Wredundant-decls',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wdeclaration-after-statement',
'-Wformat=2',
'-Wold-style-definition',
'-Wcast-align',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wsign-compare',
'-Wstrict-aliasing',
'-Wshadow',
'-Winline',
'-Wpacked',
'-Wmissing-format-attribute',
'-Wmissing-noreturn',
'-Winit-self',
'-Wredundant-decls',
'-Wmissing-include-dirs',
'-Wunused-but-set-variable',
'-Warray-bounds',
'-Wimplicit-function-declaration',
'-Wreturn-type',
'-Wswitch-enum',
'-Wswitch-default',
'-Wduplicated-cond',
'-Wduplicated-branches',
'-Wlogical-op',
'-Wrestrict',
'-Wnull-dereference',
'-Wjump-misses-init',
'-Wdouble-promotion'
]
endif
supported_warning_cflags = c_compiler.get_supported_arguments(warning_cflags)
add_project_arguments(supported_warning_cflags, language: 'c')
##### end CFLAGS
subdir('po')
subdir('gfls')
if get_option('tests')
subdir('tests')
endif
if get_option('gtk_doc')
subdir('docs/reference')
endif
summary('API version', GFLS_API_VERSION)
summary('Prefix', get_option('prefix'))
summary('GObject Introspection', get_option('gobject_introspection'))
summary('API documentation', get_option('gtk_doc'))
summary('Build tests', get_option('tests'))
summary('Build GTK 3 tests', get_option('tests') and GTK3_DEP.found())
0707010000002C000081A400000000000000000000000167CC91EC00000185000000000000000000000000000000000000002600000000libgedit-gfls-0.3.0/meson_options.txtoption(
'gobject_introspection',
type: 'boolean', value: true,
description: 'Build GObject Introspection data (requires gobject-introspection)'
)
option(
'gtk_doc',
type: 'boolean', value: true,
description: 'Build API reference (requires gtk-doc)'
)
option(
'tests',
type: 'boolean', value: true,
description: 'Build tests (requires gtk3 for interactive GUI tests)'
)
0707010000002D000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000001700000000libgedit-gfls-0.3.0/po0707010000002E000081A400000000000000000000000167CC91EC0000007D000000000000000000000000000000000000001F00000000libgedit-gfls-0.3.0/po/LINGUAS# Set of available languages.
# Please keep this list sorted alphabetically.
be
da
de
hu
ka
pl
pt_BR
ru
sl
sr
sv
tr
uk
zh_CN
0707010000002F000081A400000000000000000000000167CC91EC00000118000000000000000000000000000000000000002300000000libgedit-gfls-0.3.0/po/POTFILES.in# List of source files containing translatable strings.
gfls/gfls-attribute-keys.c
gfls/gfls-error.c
gfls/gfls-init.c
gfls/gfls-input-stream.c
gfls/gfls-loader-basic.c
gfls/gfls-loader-config.c
gfls/gfls-loader-config-simple.c
gfls/gfls-unsaved-document-titles.c
gfls/gfls-utf8.c
07070100000030000081A400000000000000000000000167CC91EC00000000000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/po/POTFILES.skip07070100000031000081A400000000000000000000000167CC91EC0000062C000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/be.po# Belarusian translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# Yuras Shumovich <shumovichy@gmail.com, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2024-09-17 15:54+0000\n"
"PO-Revision-Date: 2024-09-17 23:45+0300\n"
"Last-Translator: Yuras Shumovich <shumovichy@gmail.com>\n"
"Language-Team: Belarusian <Belarusian>\n"
"Language: be\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 3.5\n"
#: gfls/gfls-loader-basic.c:108
msgid "The file is not encoded in UTF-8."
msgstr "Файл закадаваны не ў UTF-8."
#: gfls/gfls-loader-basic.c:118
msgid "The file contains a very long line."
msgstr "Файл змяшчае занадта доўгі радок."
#: gfls/gfls-loader-basic.c:164
msgid "Limit on the number of bytes to read reached."
msgstr "Дасягнута абмежаванне на колькасць байт для чытання."
#: gfls/gfls-loader-basic.c:259
msgid "The size of the file is too big."
msgstr "Памер файла занадта вялікі."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Незахаваны дакумент %d"
07070100000032000081A400000000000000000000000167CC91EC00000551000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/da.po# Danish translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# Alan Mortensen <alanmortensen.am@gmail.com>, 2024-25.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-02-03 13:57+0000\n"
"PO-Revision-Date: 2025-02-18 19:33+0100\n"
"Last-Translator: Alan Mortensen <alanmortensen.am@gmail.com>\n"
"Language-Team: Danish <Danish>\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.2\n"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Filen er for stor."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Grænsen for, hvor mange byte der skal læses, er nået."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "Indholdet er ikke kodet i UTF-8."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "Der findes en meget lang linje i indholdet."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Dokumentet %d ikke gemt"
07070100000033000081A400000000000000000000000167CC91EC00000573000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/de.po# German translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# Jürgen Benvenuti <gastornis@posteo.org>, 2024, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-02-03 13:57+0000\n"
"PO-Revision-Date: 2025-02-04 15:19+0100\n"
"Last-Translator: Jürgen Benvenuti <gastornis@posteo.org>\n"
"Language-Team: German <gnome-de@gnome.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.4\n"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Die Größe der Datei ist zu groß."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Grenze der Anzahl der zu lesenden Bytes wurde erreicht."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "Der Inhalt ist nicht in UTF-8 codiert."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "Der Inhalt enthält eine sehr lange Zeile."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Ungespeichertes Dokument %d"
07070100000034000081A400000000000000000000000167CC91EC00000561000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/hu.po# Hungarian translation for libgedit-gfls.
# Copyright (C) 2025 Free Software Foundation, Inc.
# This file is distributed under the same license as the libgedit-gfls package.
#
# Balázs Úr <ur.balazs at fsf dot hu>, 2025.
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/iss"
"ues\n"
"POT-Creation-Date: 2025-03-02 14:19+0000\n"
"PO-Revision-Date: 2025-03-07 01:14+0100\n"
"Last-Translator: Balázs Úr <ur.balazs at fsf dot hu>\n"
"Language-Team: Hungarian <openscope at fsf dot hu>\n"
"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 23.08.5\n"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "A fájl mérete túl nagy."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "A beolvasandó bájtok számának korlátja elérve."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "A tartalom nem UTF-8 kódolású."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "A tartalom egy nagyon hosszú sort tartalmaz."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Mentetlen dokumentum %d"
07070100000035000081A400000000000000000000000167CC91EC0000169C000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/ka.po# Georgian translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's authors
# This file is distributed under the same license as the libgedit-gfls package.
# Ekaterine Papava <papava.e@gtu.ge>, 2024-2025.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-01-13 02:09+0000\n"
"PO-Revision-Date: 2025-01-21 04:42+0100\n"
"Last-Translator: Ekaterine Papava <papava.e@gtu.ge>\n"
"Language-Team: Georgian <ka@li.org>\n"
"Language: ka\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.5\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s (%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "უნიკოდი"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "დასავლური"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "ცენტრალურ ევროპული"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "სამხრეთ ევროპული"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "ბალტიური"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "კირილიცა"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "არაბული"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "ბერძნული"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "ივრითი ვიზუალი"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "თურქული"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "სკანდინავიური"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "კელტური"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "რუმინული"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "სომხური"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "ჩინური ტრადიციული"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "კირილიცა/რუსული"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "იაპონური"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "კორეული"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "ჩინური გამარტივებული"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "ქართული"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "ივრითი"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "კირილიცა/უკრაინული"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "ვიეტნამური"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "ტაილანდური"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "ფაილის ზომა ძალიან დიდია."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "შეზღუდეთ ბაიტების რაოდენობა, რომ წაიკითხოთ."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "შემცველობა არ არის კოდირებული UTF-8- ში."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "შემცველობა შეიცავს ძალიან გრძელი ხაზს."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "შეუნახავი დოკუმენტი %d"
07070100000036000081A400000000000000000000000167CC91EC00000039000000000000000000000000000000000000002300000000libgedit-gfls-0.3.0/po/meson.buildI18N.gettext(
GETTEXT_PACKAGE_NAME,
preset: 'glib'
)
07070100000037000081A400000000000000000000000167CC91EC0000059B000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/pl.po# Polish translation for libgedit-gfls.
# Copyright © 2025 the libgedit-gfls authors.
# This file is distributed under the same license as the libgedit-gfls package.
# Piotr Drąg <piotrdrag@gmail.com>, 2025.
# Aviary.pl <community-poland@mozilla.org>, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-02-24 17:44+0000\n"
"PO-Revision-Date: 2025-03-02 15:18+0100\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Polish <community-poland@mozilla.org>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Rozmiar pliku jest za duży."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Osiągnięto ograniczenie liczby bajtów do odczytu."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "Treść nie jest zakodowana jako UTF-8."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "Treść zawiera bardzo długi wiersz."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Niezapisany dokument %d"
07070100000038000081A400000000000000000000000167CC91EC00001429000000000000000000000000000000000000002000000000libgedit-gfls-0.3.0/po/pt_BR.po# Brazilian Portuguese translation for libgedit-gfls.
# Copyright (C) 2025 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# Rafael Fontenelle <rafaelff@gnome.org>, 2024-2025.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-01-13 02:09+0000\n"
"PO-Revision-Date: 2025-01-15 00:23-0300\n"
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
"Language-Team: Brazilian Portuguese <https://br.gnome.org/traducao>\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"X-Generator: Gtranslator 47.1\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s (%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "Unicode"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "Ocidental"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "Centro europeu"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "Europa sulista"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "Báltico"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "Cirílico"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "Árabe"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "Grego"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "Hebraico visual"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "Turco"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "Nórdico"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "Céltico"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "Romeno"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "Armênio"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "Chinês tradicional"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "Cirílico/Russo"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "Japonês"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "Coreano"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "Chinês simplificado"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "Georgiano"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "Hebraico"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "Cirílico/Ucraniano"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "Vietinamita"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "Tailandês"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "O tamanho do arquivo é grande demais."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Foi alcançado o limite de número de bytes para leitura."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "O conteúdo não está codificado em UTF-8."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "O conteúdo contém uma linha muito longa."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Documento não salvo %d"
07070100000039000081A400000000000000000000000167CC91EC000015FF000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/ru.po# Russian translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# Sergej A. <asvmail.as@gmail.com>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-01-13 02:09+0000\n"
"PO-Revision-Date: 2025-01-16 22:34+1000\n"
"Last-Translator: Ser82-png <asvmail.as@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 3.0.1\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s (%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "Юникод"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "Западная"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "Центральноевропейская"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "Южноевропейская"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "Балтийская"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "Кириллица"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "Арабская"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "Греческая"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "Еврейская отображаемая"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "Турецкая"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "Северная"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "Кельтская"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "Румынская"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "Армянская"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "Китайская традиционная"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "Кириллица/Русская"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "Японская"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "Корейская"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "Китайская упрощённая"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "Грузинская"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "Еврейская"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "Кириллица/Украинская"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "Вьетнамская"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "Тайская"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Размер файла слишком большой."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Превышено ограничение на количество байт для чтения."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "Содержимое этого файла не в кодировке UTF-8."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "Содержимое имеет слишком длинную строку."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Несохранённый документ %d"
0707010000003A000081A400000000000000000000000167CC91EC000013FE000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/sl.po# Slovenian translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# Martin <miles@filmsi.net>, 2024,2025.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-01-13 02:09+0000\n"
"PO-Revision-Date: 2025-01-17 11:29+0100\n"
"Last-Translator: Martin Srebotnjak <miles@filmsi.net>\n"
"Language-Team: Slovenian <Slovenian>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
"n%100==4 ? 3 : 0) ;\n"
"X-Generator: Poedit 3.4.2\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s (%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "Unicode"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "Zahodno"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "Srednjeevropsko"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "Južnoevropsko"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "Baltsko"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "Cirilica"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "Arabsko"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "Grško"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "Hebrejsko predočeno"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "Turško"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "Nordijsko"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "Keltsko"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "Romunsko"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "Armensko"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "Tradicionalno kitajsko"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "Cirilica/rusko"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "Japonsko"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "Korejsko"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "Kitajsko poenostavljeno"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "Gruzijsko"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "Hebrejsko"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "Cirilica/ukrajinsko"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "Vietnamsko"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "Tajsko"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Datoteka je prevelika."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Dosežena je omejitev števila bajtov za branje."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "Vsebina ni kodirana v UTF-8."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "Vsebina vsebuje zelo dolgo vrstico."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Neshranjeni dokument %d"
0707010000003B000081A400000000000000000000000167CC91EC000014EB000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/sr.po# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-01-17 10:30+0000\n"
"PO-Revision-Date: 2025-01-26 08:23+0100\n"
"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
"Language-Team: \n"
"Language: sr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.5\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s (%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "Јуникод"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "Западни"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "Средње-европски"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "Јужно-европски"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "Балтички"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "Ћирилица"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "Арапски"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "Грчки"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "Јеврејски визуелни"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "Турски"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "Нордијски"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "Келтски"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "Румунски"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "Јерменски"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "Кинески традиционални"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "Ћирилица/руски"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "Јапански"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "Корејски"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "Кинески поједностављен"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "Грузијски"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "Јеврејски"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "Ћирилица/украјински"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "Вијетнамски"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "Тајландски"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Датотека је превелика."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Достигнуто је ограничење броја бајтова за читање."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "Садржај није кодиран у УТФ-8."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "Садржај садржи врло дуг ред."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Несачувани документ %d"
0707010000003C000081A400000000000000000000000167CC91EC000013F9000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/sv.po# Swedish translation for libgedit-gfls.
# Copyright © 2024-2025 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# Anders Jonsson <anders.jonsson@norsjovallen.se>, 2024, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-01-13 02:09+0000\n"
"PO-Revision-Date: 2025-01-22 19:43+0100\n"
"Last-Translator: Anders Jonsson <anders.jonsson@norsjovallen.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.5\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s (%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "Unicode"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "Västerländsk"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "Centraleuropeisk"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "Sydeuropeisk"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "Baltisk"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "Kyrillisk"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "Arabisk"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "Grekisk"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "Hebreisk visuell"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "Turkisk"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "Nordisk"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "Keltisk"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "Rumänsk"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "Armenisk"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "Traditionell kinesisk"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "Kyrillisk/rysk"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "Japansk"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "Koreansk"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "Förenklad kinesisk"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "Georgisk"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "Hebreisk"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "Kyrillisk/ukrainsk"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "Vietnamesisk"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "Thailändsk"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Filen är för stor."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Gräns för antal byte att läsa uppnådd."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "Innehållet är inte kodat i UTF-8."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "Innehållet innehåller en väldigt lång rad."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Osparat dokument %d"
0707010000003D000081A400000000000000000000000167CC91EC00000544000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/tr.po# Turkish translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
#
# Sabri Ünal <yakushabb@gmail.com>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-02-03 13:57+0000\n"
"PO-Revision-Date: 2025-02-03 19:24+0300\n"
"Last-Translator: Sabri Ünal <yakushabb@gmail.com>\n"
"Language-Team: Turkish <takim@gnome.org.tr>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.5\n"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Dosyanın boyutu çok büyük."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Okunacak bayt sayısı sınırına ulaşıldı."
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "İçerik UTF-8 olarak kodlanmamış."
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "İçerik çok uzun bir satır içeriyor."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Kaydedilmemiş Belge %d"
0707010000003E000081A400000000000000000000000167CC91EC00001678000000000000000000000000000000000000001D00000000libgedit-gfls-0.3.0/po/uk.po# Ukrainian translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
#
# Yuri Chornoivan <yurchor@ukr.net>, 2024, 2025.
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/is"
"sues\n"
"POT-Creation-Date: 2025-01-13 02:09+0000\n"
"PO-Revision-Date: 2025-01-13 10:24+0200\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n"
"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Lokalize 23.04.3\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s (%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "Юнікод"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "західноєвропейське"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "центральноєвропейське"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "південноєвропейське"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "балтійське"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "кирилиця"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "арабське"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "грецьке"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "іврит (візуальне)"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "турецьке"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "нордичне"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "кельтське"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "румунське"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "вірменське"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "традиційне китайське"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "кирилиця/російське"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "японське"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "корейське"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "спрощене китайське"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "грузинське"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "іврит"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "кирилиця/українське"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "в'єтнамське"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "тайське"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "Розмір файла є надто великим."
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "Перевищено обмеження кількості байтів для читання."
#: gfls/gfls-error.c:43
#| msgid "The file is not encoded in UTF-8."
msgid "The content is not encoded in UTF-8."
msgstr "Дані у цьому файлі не записано у кодуванні UTF-8."
#: gfls/gfls-error.c:51
#| msgid "The file contains a very long line."
msgid "The content contains a very long line."
msgstr "Файл містить надто довгий рядок."
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "Незбережений документ %d"
0707010000003F000081A400000000000000000000000167CC91EC000013E7000000000000000000000000000000000000002000000000libgedit-gfls-0.3.0/po/zh_CN.po# Chinese (China) translation for libgedit-gfls.
# Copyright (C) 2024 libgedit-gfls's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgedit-gfls package.
# lumingzh <lumingzh@qq.com>, 2024-2025.
#
msgid ""
msgstr ""
"Project-Id-Version: libgedit-gfls main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/"
"issues\n"
"POT-Creation-Date: 2025-01-13 02:09+0000\n"
"PO-Revision-Date: 2025-01-14 13:58+0800\n"
"Last-Translator: lumingzh <lumingzh@qq.com>\n"
"Language-Team: Chinese (China) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Gtranslator 47.1\n"
#. Translators: the first %s is a category, the second %s is the
#. * name.
#.
#: gfls/gfls-encoding.c:203
#, c-format
msgid "%s (%s)"
msgstr "%s(%s)"
#. UTF-8 first, so that it's the first encoding returned by
#. * tepl_encoding_iconv_get_all().
#.
#: gfls/gfls-encoding-manager-iconv.c:44 gfls/gfls-encoding-manager-iconv.c:61
#: gfls/gfls-encoding-manager-iconv.c:62 gfls/gfls-encoding-manager-iconv.c:63
#: gfls/gfls-encoding-manager-iconv.c:64 gfls/gfls-encoding-manager-iconv.c:65
#: gfls/gfls-encoding-manager-iconv.c:66 gfls/gfls-encoding-manager-iconv.c:67
msgid "Unicode"
msgstr "万国码"
#. FIXME GEOSTD8 ?
#: gfls/gfls-encoding-manager-iconv.c:46 gfls/gfls-encoding-manager-iconv.c:58
#: gfls/gfls-encoding-manager-iconv.c:86 gfls/gfls-encoding-manager-iconv.c:109
msgid "Western"
msgstr "西文"
#: gfls/gfls-encoding-manager-iconv.c:47 gfls/gfls-encoding-manager-iconv.c:87
#: gfls/gfls-encoding-manager-iconv.c:107
msgid "Central European"
msgstr "中欧"
#: gfls/gfls-encoding-manager-iconv.c:48
msgid "South European"
msgstr "南欧"
#: gfls/gfls-encoding-manager-iconv.c:49 gfls/gfls-encoding-manager-iconv.c:56
#: gfls/gfls-encoding-manager-iconv.c:114
msgid "Baltic"
msgstr "波罗的海语"
#: gfls/gfls-encoding-manager-iconv.c:50 gfls/gfls-encoding-manager-iconv.c:88
#: gfls/gfls-encoding-manager-iconv.c:95 gfls/gfls-encoding-manager-iconv.c:97
#: gfls/gfls-encoding-manager-iconv.c:98 gfls/gfls-encoding-manager-iconv.c:108
msgid "Cyrillic"
msgstr "西里尔语"
#: gfls/gfls-encoding-manager-iconv.c:51 gfls/gfls-encoding-manager-iconv.c:91
#: gfls/gfls-encoding-manager-iconv.c:113
msgid "Arabic"
msgstr "阿拉伯语"
#: gfls/gfls-encoding-manager-iconv.c:52 gfls/gfls-encoding-manager-iconv.c:110
msgid "Greek"
msgstr "希腊语"
#: gfls/gfls-encoding-manager-iconv.c:53
msgid "Hebrew Visual"
msgstr "可视希伯来语"
#: gfls/gfls-encoding-manager-iconv.c:54 gfls/gfls-encoding-manager-iconv.c:89
#: gfls/gfls-encoding-manager-iconv.c:111
msgid "Turkish"
msgstr "土耳其语"
#: gfls/gfls-encoding-manager-iconv.c:55
msgid "Nordic"
msgstr "北欧"
#: gfls/gfls-encoding-manager-iconv.c:57
msgid "Celtic"
msgstr "凯尔特语"
#: gfls/gfls-encoding-manager-iconv.c:59
msgid "Romanian"
msgstr "罗马尼亚语"
#: gfls/gfls-encoding-manager-iconv.c:69
msgid "Armenian"
msgstr "亚美尼亚语"
#: gfls/gfls-encoding-manager-iconv.c:70 gfls/gfls-encoding-manager-iconv.c:71
#: gfls/gfls-encoding-manager-iconv.c:79
msgid "Chinese Traditional"
msgstr "繁体中文"
#: gfls/gfls-encoding-manager-iconv.c:72
msgid "Cyrillic/Russian"
msgstr "西里尔文/俄语"
#: gfls/gfls-encoding-manager-iconv.c:74 gfls/gfls-encoding-manager-iconv.c:75
#: gfls/gfls-encoding-manager-iconv.c:76 gfls/gfls-encoding-manager-iconv.c:93
#: gfls/gfls-encoding-manager-iconv.c:101
msgid "Japanese"
msgstr "日语"
#: gfls/gfls-encoding-manager-iconv.c:78 gfls/gfls-encoding-manager-iconv.c:94
#: gfls/gfls-encoding-manager-iconv.c:96 gfls/gfls-encoding-manager-iconv.c:104
msgid "Korean"
msgstr "朝鲜语"
#: gfls/gfls-encoding-manager-iconv.c:81 gfls/gfls-encoding-manager-iconv.c:82
#: gfls/gfls-encoding-manager-iconv.c:83
msgid "Chinese Simplified"
msgstr "简体中文"
#: gfls/gfls-encoding-manager-iconv.c:84
msgid "Georgian"
msgstr "格鲁吉亚语"
#: gfls/gfls-encoding-manager-iconv.c:90 gfls/gfls-encoding-manager-iconv.c:112
msgid "Hebrew"
msgstr "希伯来语"
#: gfls/gfls-encoding-manager-iconv.c:99
msgid "Cyrillic/Ukrainian"
msgstr "西里尔文/乌克兰语"
#: gfls/gfls-encoding-manager-iconv.c:102
#: gfls/gfls-encoding-manager-iconv.c:105
#: gfls/gfls-encoding-manager-iconv.c:115
msgid "Vietnamese"
msgstr "越南语"
#: gfls/gfls-encoding-manager-iconv.c:103
msgid "Thai"
msgstr "泰语"
#: gfls/gfls-error.c:27
msgid "The size of the file is too big."
msgstr "该文件太大了。"
#: gfls/gfls-error.c:35
msgid "Limit on the number of bytes to read reached."
msgstr "已达到字节数读取限制。"
#: gfls/gfls-error.c:43
msgid "The content is not encoded in UTF-8."
msgstr "该内容不是 UTF-8 编码。"
#: gfls/gfls-error.c:51
msgid "The content contains a very long line."
msgstr "该内容包含一个非常长的文本行。"
#: gfls/gfls-unsaved-document-titles.c:61
#, c-format
msgid "Unsaved Document %d"
msgstr "未保存文档 %d"
07070100000040000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000001A00000000libgedit-gfls-0.3.0/tests07070100000041000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000002C00000000libgedit-gfls-0.3.0/tests/interactive-tests07070100000042000081A400000000000000000000000167CC91EC00001874000000000000000000000000000000000000003700000000libgedit-gfls-0.3.0/tests/interactive-tests/gfls-gui.c/* SPDX-FileCopyrightText: 2023 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <gtk/gtk.h>
#include <locale.h>
#include <gfls/gfls.h>
/* 100 MiB */
#define FILE_SIZE_HARD_LIMIT (100 * 1024 * 1024)
/* Number of bytes per line. 80 is for testing purposes ;-) */
#define VERY_LONG_LINE_LIMIT (80)
typedef struct
{
GtkApplicationWindow *window;
GtkTextView *view;
GtkSpinButton *file_size_limit_spin_button;
GFile *file;
} ProgramData;
static ProgramData *
program_data_new (void)
{
return g_new0 (ProgramData, 1);
}
static void
program_data_free (ProgramData *program_data)
{
if (program_data != NULL)
{
g_clear_object (&program_data->file);
g_free (program_data);
}
}
static GtkWidget *
create_file_size_limit_spin_button (ProgramData *program_data)
{
GtkGrid *hgrid;
GtkWidget *label;
g_assert (program_data->file_size_limit_spin_button == NULL);
hgrid = GTK_GRID (gtk_grid_new ());
gtk_grid_set_column_spacing (hgrid, 6);
label = gtk_label_new ("File size limit:");
gtk_container_add (GTK_CONTAINER (hgrid), label);
program_data->file_size_limit_spin_button =
GTK_SPIN_BUTTON (gtk_spin_button_new_with_range (0.0, FILE_SIZE_HARD_LIMIT, 1.0));
gtk_container_add (GTK_CONTAINER (hgrid), GTK_WIDGET (program_data->file_size_limit_spin_button));
return GTK_WIDGET (hgrid);
}
static gsize
get_file_size_limit (ProgramData *program_data)
{
gint value;
value = gtk_spin_button_get_value_as_int (program_data->file_size_limit_spin_button);
g_return_val_if_fail (value >= 0, 0);
return value;
}
static void
set_text_buffer_content (ProgramData *program_data,
GBytes *bytes)
{
const gchar *text;
gsize n_bytes;
GtkTextBuffer *buffer;
text = g_bytes_get_data (bytes, &n_bytes);
buffer = gtk_text_view_get_buffer (program_data->view);
gtk_text_buffer_set_text (buffer, text, n_bytes);
}
static void
load_file_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GFile *file = G_FILE (source_object);
ProgramData *program_data = user_data;
GBytes *bytes;
GError *error = NULL;
bytes = gfls_loader_basic_load_finish (file, result, &error);
if (error != NULL)
{
g_printerr ("%s\n", error->message);
g_clear_error (&error);
g_bytes_unref (bytes);
return;
}
set_text_buffer_content (program_data, bytes);
g_bytes_unref (bytes);
}
static void
load_file (ProgramData *program_data)
{
gfls_loader_basic_load_async (program_data->file,
get_file_size_limit (program_data),
VERY_LONG_LINE_LIMIT,
G_PRIORITY_DEFAULT,
NULL,
load_file_cb,
program_data);
}
static void
open_file_chooser_response_cb (GtkFileChooserNative *open_file_chooser,
gint response_id,
ProgramData *program_data)
{
if (response_id == GTK_RESPONSE_ACCEPT)
{
gchar *parse_name;
g_clear_object (&program_data->file);
program_data->file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (open_file_chooser));
parse_name = g_file_get_parse_name (program_data->file);
g_print ("Open file: %s\n", parse_name);
g_free (parse_name);
load_file (program_data);
}
g_object_unref (open_file_chooser);
}
static void
open_file_button_clicked_cb (GtkButton *open_file_button,
ProgramData *program_data)
{
GtkFileChooserNative *file_chooser;
file_chooser = gtk_file_chooser_native_new ("Open File",
GTK_WINDOW (program_data->window),
GTK_FILE_CHOOSER_ACTION_OPEN,
NULL, NULL);
g_signal_connect (file_chooser,
"response",
G_CALLBACK (open_file_chooser_response_cb),
program_data);
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (file_chooser), TRUE);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (file_chooser));
}
static GtkWidget *
create_open_file_button (ProgramData *program_data)
{
GtkButton *open_file_button;
open_file_button = GTK_BUTTON (gtk_button_new_with_label ("Open File"));
g_signal_connect (open_file_button,
"clicked",
G_CALLBACK (open_file_button_clicked_cb),
program_data);
return GTK_WIDGET (open_file_button);
}
static GtkWidget *
create_side_panel (ProgramData *program_data)
{
GtkGrid *vgrid;
vgrid = GTK_GRID (gtk_grid_new ());
gtk_orientable_set_orientation (GTK_ORIENTABLE (vgrid), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (vgrid, 6);
gtk_container_add (GTK_CONTAINER (vgrid), create_file_size_limit_spin_button (program_data));
gtk_container_add (GTK_CONTAINER (vgrid), create_open_file_button (program_data));
return GTK_WIDGET (vgrid);
}
static GtkWidget *
create_view (ProgramData *program_data)
{
GtkWidget *scrolled_window;
g_assert (program_data->view == NULL);
program_data->view = GTK_TEXT_VIEW (gtk_text_view_new ());
gtk_text_view_set_monospace (program_data->view, TRUE);
g_object_set (program_data->view,
"expand", TRUE,
NULL);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (program_data->view));
return scrolled_window;
}
static void
activate_cb (GApplication *g_app,
ProgramData *program_data)
{
GtkGrid *hgrid;
g_assert (program_data->window == NULL);
program_data->window = GTK_APPLICATION_WINDOW (gtk_application_window_new (GTK_APPLICATION (g_app)));
gtk_window_set_default_size (GTK_WINDOW (program_data->window), 800, 600);
hgrid = GTK_GRID (gtk_grid_new ());
gtk_container_add (GTK_CONTAINER (hgrid), create_side_panel (program_data));
gtk_container_add (GTK_CONTAINER (hgrid), create_view (program_data));
gtk_container_add (GTK_CONTAINER (program_data->window), GTK_WIDGET (hgrid));
gtk_widget_show_all (GTK_WIDGET (program_data->window));
}
int
main (int argc,
char **argv)
{
GtkApplication *app;
ProgramData *program_data;
int exit_status;
setlocale (LC_ALL, "");
gfls_init ();
app = gtk_application_new (NULL, G_APPLICATION_DEFAULT_FLAGS);
program_data = program_data_new ();
g_signal_connect (app,
"activate",
G_CALLBACK (activate_cb),
program_data);
exit_status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
program_data_free (program_data);
gfls_finalize ();
return exit_status;
}
07070100000043000081A400000000000000000000000167CC91EC00000CA0000000000000000000000000000000000000003B00000000libgedit-gfls-0.3.0/tests/interactive-tests/gfls-program.c/* SPDX-FileCopyrightText: 2023 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <gio/gio.h>
#include <locale.h>
typedef struct
{
GFile *file;
} ProgramData;
static ProgramData *
program_data_new (void)
{
return g_new0 (ProgramData, 1);
}
static void
program_data_free (ProgramData *program_data)
{
if (program_data != NULL)
{
g_clear_object (&program_data->file);
g_free (program_data);
}
}
static void
quit_program (void)
{
g_application_release (g_application_get_default ());
}
static void
query_info_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GFile *file = G_FILE (source_object);
GFileInfo *info;
GError *error = NULL;
info = g_file_query_info_finish (file, result, &error);
if (error != NULL)
{
g_printerr ("Failed to query file informations: %s\n", error->message);
g_clear_error (&error);
goto out;
}
if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_TYPE))
{
GFileType type;
type = g_file_info_get_file_type (info);
if (type == G_FILE_TYPE_REGULAR)
{
g_print ("Regular file.\n");
}
else
{
g_print ("The file is not a regular file.\n");
}
}
if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
{
const gchar *display_name;
display_name = g_file_info_get_display_name (info);
g_print ("Display name: %s\n", display_name);
}
if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE))
{
goffset n_bytes;
n_bytes = g_file_info_get_size (info);
g_print ("File size in bytes: %" G_GOFFSET_FORMAT "\n", n_bytes);
}
out:
g_clear_object (&info);
quit_program ();
}
static void
launch_program (ProgramData *program_data)
{
g_application_hold (g_application_get_default ());
g_file_query_info_async (program_data->file,
G_FILE_ATTRIBUTE_STANDARD_TYPE ","
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME ","
G_FILE_ATTRIBUTE_STANDARD_SIZE,
G_FILE_QUERY_INFO_NONE,
G_PRIORITY_DEFAULT,
NULL,
query_info_cb,
NULL);
}
static gint
app_command_line_cb (GApplication *app,
GApplicationCommandLine *command_line,
gpointer user_data)
{
ProgramData *program_data = user_data;
gchar **argv;
gint argc;
gint exit_status = EXIT_SUCCESS;
argv = g_application_command_line_get_arguments (command_line, &argc);
if (argc != 2)
{
g_application_command_line_printerr (command_line,
"Usage: %s <input_file>\n",
argv[0]);
exit_status = EXIT_FAILURE;
goto out;
}
program_data->file = g_application_command_line_create_file_for_arg (command_line, argv[1]);
launch_program (program_data);
out:
g_strfreev (argv);
return exit_status;
}
int
main (int argc,
char **argv)
{
GApplication *app;
ProgramData *program_data;
int exit_status;
setlocale (LC_ALL, "");
app = g_application_new (NULL, G_APPLICATION_HANDLES_COMMAND_LINE);
program_data = program_data_new ();
g_signal_connect (app,
"command-line",
G_CALLBACK (app_command_line_cb),
program_data);
exit_status = g_application_run (app, argc, argv);
g_object_unref (app);
program_data_free (program_data);
return exit_status;
}
07070100000044000081A400000000000000000000000167CC91EC000015DB000000000000000000000000000000000000004A00000000libgedit-gfls-0.3.0/tests/interactive-tests/gfls-test-race-read-content.c/* SPDX-FileCopyrightText: 2023 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <gio/gio.h>
#include <locale.h>
/* Purpose of this test program
* ============================
*
* To test the following race condition:
* (1) Read a first block of bytes from a file (with GIO).
* (2) Launch a timeout function (long enough to manually alter the file).
* (3) With another program, alter the content of the file. E.g. with:
* $ echo foobar > file
* (4) When the timeout callback function is called, continue to read the file.
*
* And see what happens, how the programs behave, if errors are reported, etc.
*
* Result
* ------
*
* Absolutely no errors are reported. Even when closing the GFileInputStream.
*
* Solution
* --------
*
* Rely on the etag values provided by GIO to know if the file has been
* externally modified. Worst case this is detected upon saving the file (show
* an infobar at that moment).
*
* It can be desired to be able to open a file that is continuously modified by
* another program, e.g. a log file.
*/
/* Read a string of 80 chars and nul-terminate it.
* This is for testing purposes, so a short value is chosen.
*/
#define BUFFER_SIZE (81)
typedef struct
{
GFile *file;
GFileInputStream *input_stream;
guint8 buffer[BUFFER_SIZE];
} ProgramData;
static void read_next_chunk (ProgramData *program_data);
static ProgramData *
program_data_new (void)
{
ProgramData *program_data;
program_data = g_new (ProgramData, 1);
program_data->file = NULL;
program_data->input_stream = NULL;
/* Don't zero the buffer, it will anyway be nul-terminated manually. */
return program_data;
}
static void
program_data_free (ProgramData *program_data)
{
if (program_data != NULL)
{
g_clear_object (&program_data->file);
g_clear_object (&program_data->input_stream);
g_free (program_data);
}
}
static void
quit_program (void)
{
g_application_release (g_application_get_default ());
}
static void
close_file_input_stream (ProgramData *program_data)
{
GError *error = NULL;
g_print ("Closing file input stream.\n");
g_input_stream_close (G_INPUT_STREAM (program_data->input_stream), NULL, &error);
if (error != NULL)
{
g_printerr ("Failed to close the file input stream: %s\n", error->message);
g_clear_error (&error);
}
}
static gboolean
timeout_cb (gpointer user_data)
{
ProgramData *program_data = user_data;
read_next_chunk (program_data);
return G_SOURCE_REMOVE;
}
static void
read_next_chunk_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
ProgramData *program_data = user_data;
GError *error = NULL;
gssize n_bytes_read;
n_bytes_read = g_input_stream_read_finish (G_INPUT_STREAM (program_data->input_stream), result, &error);
if (error != NULL)
{
g_printerr ("Failed to read the next chunk of content: %s\n", error->message);
g_clear_error (&error);
quit_program ();
return;
}
if (n_bytes_read == 0)
{
g_print ("Finished reading.\n");
close_file_input_stream (program_data);
quit_program ();
return;
}
g_assert (n_bytes_read > 0);
g_assert (n_bytes_read < BUFFER_SIZE);
program_data->buffer[n_bytes_read] = '\0';
g_print ("Next chunk read:\n%s\n", program_data->buffer);
g_timeout_add_seconds (15, timeout_cb, program_data);
}
static void
read_next_chunk (ProgramData *program_data)
{
g_input_stream_read_async (G_INPUT_STREAM (program_data->input_stream),
program_data->buffer,
BUFFER_SIZE - 1, /* -1 to keep one byte to nul-terminate the string. */
G_PRIORITY_DEFAULT,
NULL,
read_next_chunk_cb,
program_data);
}
static void
file_read_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GFile *file = G_FILE (source_object);
ProgramData *program_data = user_data;
GError *error = NULL;
g_assert (program_data->input_stream == NULL);
program_data->input_stream = g_file_read_finish (file, result, &error);
if (error != NULL)
{
g_printerr ("Failed to open file for reading: %s\n", error->message);
g_clear_error (&error);
quit_program ();
return;
}
read_next_chunk (program_data);
}
static void
launch_program (ProgramData *program_data)
{
g_application_hold (g_application_get_default ());
g_file_read_async (program_data->file,
G_PRIORITY_DEFAULT,
NULL,
file_read_cb,
program_data);
}
static gint
app_command_line_cb (GApplication *app,
GApplicationCommandLine *command_line,
gpointer user_data)
{
ProgramData *program_data = user_data;
gchar **argv;
gint argc;
gint exit_status = EXIT_SUCCESS;
argv = g_application_command_line_get_arguments (command_line, &argc);
if (argc != 2)
{
g_application_command_line_printerr (command_line,
"Usage: %s <input_file>\n",
argv[0]);
exit_status = EXIT_FAILURE;
goto out;
}
program_data->file = g_application_command_line_create_file_for_arg (command_line, argv[1]);
launch_program (program_data);
out:
g_strfreev (argv);
return exit_status;
}
int
main (int argc,
char **argv)
{
GApplication *app;
ProgramData *program_data;
int exit_status;
setlocale (LC_ALL, "");
app = g_application_new (NULL, G_APPLICATION_HANDLES_COMMAND_LINE);
program_data = program_data_new ();
g_signal_connect (app,
"command-line",
G_CALLBACK (app_command_line_cb),
program_data);
exit_status = g_application_run (app, argc, argv);
g_object_unref (app);
program_data_free (program_data);
return exit_status;
}
07070100000045000081A400000000000000000000000167CC91EC00000138000000000000000000000000000000000000003800000000libgedit-gfls-0.3.0/tests/interactive-tests/meson.buildexecutable(
'gfls-program',
'gfls-program.c',
dependencies: GFLS_DEPS,
)
executable(
'gfls-test-race-read-content',
'gfls-test-race-read-content.c',
dependencies: GFLS_DEPS,
)
if GTK3_DEP.found()
executable(
'gfls-gui',
'gfls-gui.c',
dependencies: [GFLS_LIB_DEP, GTK3_DEP],
)
endif
07070100000046000081A400000000000000000000000167CC91EC00000031000000000000000000000000000000000000002600000000libgedit-gfls-0.3.0/tests/meson.buildsubdir('interactive-tests')
subdir('unit-tests')
07070100000047000041ED00000000000000000000000267CC91EC00000000000000000000000000000000000000000000002500000000libgedit-gfls-0.3.0/tests/unit-tests07070100000048000081A400000000000000000000000167CC91EC0000011A000000000000000000000000000000000000003100000000libgedit-gfls-0.3.0/tests/unit-tests/meson.buildunit_tests = [
'test-attribute-keys',
'test-input-stream',
'test-unsaved-document-titles',
'test-utf8',
]
foreach test_name : unit_tests
test_exe = executable(
test_name,
test_name + '.c',
dependencies: GFLS_LIB_DEP
)
test(test_name, test_exe)
endforeach
07070100000049000081A400000000000000000000000167CC91EC000003AD000000000000000000000000000000000000003B00000000libgedit-gfls-0.3.0/tests/unit-tests/test-attribute-keys.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <gfls/gfls.h>
static void
test_basics (void)
{
GflsAttributeKeys *keys = gfls_attribute_keys_new ();
gchar *result;
result = gfls_attribute_keys_to_string (keys);
g_assert_null (result);
gfls_attribute_keys_add (keys, "standard::display-name");
result = gfls_attribute_keys_to_string (keys);
g_assert_cmpstr (result, ==, "standard::display-name");
g_free (result);
gfls_attribute_keys_add (keys, "access::*");
result = gfls_attribute_keys_to_string (keys);
g_assert_cmpstr (result, ==, "standard::display-name,access::*");
g_free (result);
g_object_unref (keys);
}
int
main (int argc,
char **argv)
{
int exit_status;
gfls_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/AttributeKeys/basics", test_basics);
exit_status = g_test_run ();
gfls_finalize ();
return exit_status;
}
0707010000004A000081A400000000000000000000000167CC91EC000009F8000000000000000000000000000000000000003900000000libgedit-gfls-0.3.0/tests/unit-tests/test-input-stream.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <gfls/gfls.h>
typedef struct
{
/* To run the async operation. */
GMainLoop *main_loop;
/* To check against the result of gfls_input_stream_read_finish(): */
gsize result_size;
guint result_is_truncated : 1;
} TestData;
static GInputStream *
create_input_stream (gsize size)
{
gchar *str;
GBytes *bytes;
GInputStream *input_stream;
str = g_strnfill (size, 'A');
bytes = g_bytes_new_take (str, size);
input_stream = g_memory_input_stream_new_from_bytes (bytes);
g_bytes_unref (bytes);
return input_stream;
}
static void
read_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GInputStream *input_stream = G_INPUT_STREAM (source_object);
TestData *data = user_data;
GBytes *bytes;
gboolean is_truncated = FALSE;
GError *error = NULL;
bytes = gfls_input_stream_read_finish (input_stream, result, &is_truncated, &error);
g_assert_no_error (error);
g_assert_cmpint (is_truncated, ==, data->result_is_truncated);
g_assert_nonnull (bytes);
g_assert_cmpint (g_bytes_get_size (bytes), ==, data->result_size);
g_bytes_unref (bytes);
g_main_loop_quit (data->main_loop);
}
static void
check_read (gsize input_stream_real_size,
gsize input_stream_expected_size,
gsize max_size,
gsize result_size,
gboolean result_is_truncated)
{
GInputStream *input_stream;
TestData data;
input_stream = create_input_stream (input_stream_real_size);
data.main_loop = g_main_loop_new (NULL, FALSE);
data.result_size = result_size;
data.result_is_truncated = result_is_truncated != FALSE;
gfls_input_stream_read_async (input_stream,
input_stream_expected_size,
max_size,
G_PRIORITY_DEFAULT,
NULL,
read_cb,
&data);
g_main_loop_run (data.main_loop);
g_object_unref (input_stream);
}
static void
test_read (void)
{
check_read (0, 0, 0, 0, FALSE);
check_read (0, 1, 0, 0, FALSE);
check_read (1, 0, 100, 1, FALSE);
check_read (100, 50, 200, 100, FALSE);
check_read (100, 100, 200, 100, FALSE);
check_read (100, 100, 100, 100, FALSE);
/* Truncated */
check_read (1, 0, 0, 0, TRUE);
check_read (2, 2, 0, 0, TRUE);
check_read (100, 50, 99, 99, TRUE);
}
int
main (int argc,
char **argv)
{
int exit_status;
gfls_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/InputStream/read", test_read);
exit_status = g_test_run ();
gfls_finalize ();
return exit_status;
}
0707010000004B000081A400000000000000000000000167CC91EC00000745000000000000000000000000000000000000004400000000libgedit-gfls-0.3.0/tests/unit-tests/test-unsaved-document-titles.c/* SPDX-FileCopyrightText: 2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <gfls/gfls.h>
static void
test_allocate_and_release_numbers (void)
{
GflsUnsavedDocumentTitles *titles;
gint num_a;
gint num_b;
gint num_c;
titles = gfls_unsaved_document_titles_get_default ();
num_a = gfls_unsaved_document_titles_allocate_number (titles);
num_b = gfls_unsaved_document_titles_allocate_number (titles);
g_assert_cmpint (num_a, ==, 1);
g_assert_cmpint (num_b, ==, 2);
gfls_unsaved_document_titles_release_number (titles, num_a);
num_a = 0;
num_c = gfls_unsaved_document_titles_allocate_number (titles);
g_assert_cmpint (num_c, ==, 1);
}
static gchar *
my_title_cb (gint num)
{
return g_strdup_printf ("My Dear New Document %d", num);
}
static void
test_title (void)
{
GflsUnsavedDocumentTitles *titles;
gchar *title_a;
gchar *title_b;
gchar *my_title;
titles = gfls_unsaved_document_titles_new ();
title_a = gfls_unsaved_document_titles_get_title (titles, 1);
gfls_unsaved_document_titles_set_title_callback (titles, my_title_cb);
title_b = gfls_unsaved_document_titles_get_title (titles, 1);
my_title = my_title_cb (1);
g_assert_cmpstr (title_b, ==, my_title);
g_free (title_b);
g_free (my_title);
gfls_unsaved_document_titles_set_title_callback (titles, NULL);
title_b = gfls_unsaved_document_titles_get_title (titles, 1);
g_assert_cmpstr (title_a, ==, title_b);
g_free (title_a);
g_free (title_b);
g_object_unref (titles);
}
int
main (int argc,
char **argv)
{
int exit_status;
gfls_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/UnsavedDocumentTitles/allocate_and_release_numbers", test_allocate_and_release_numbers);
g_test_add_func ("/UnsavedDocumentTitles/title", test_title);
exit_status = g_test_run ();
gfls_finalize ();
return exit_status;
}
0707010000004C000081A400000000000000000000000167CC91EC0000083C000000000000000000000000000000000000003100000000libgedit-gfls-0.3.0/tests/unit-tests/test-utf8.c/* SPDX-FileCopyrightText: 2023-2024 - Sébastien Wilmet
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <gfls/gfls.h>
static void
check_find_very_long_line (const gchar *str,
guint max_n_bytes_per_line,
gint expected_found_at_pos)
{
const gchar *result;
result = gfls_utf8_find_very_long_line (str, max_n_bytes_per_line);
if (expected_found_at_pos < 0)
{
g_assert_null (result);
}
else
{
gint found_at_pos;
g_assert_nonnull (result);
found_at_pos = result - str;
g_assert_cmpint (found_at_pos, ==, expected_found_at_pos);
}
}
static void
test_find_very_long_line (void)
{
/* Without newline chars */
check_find_very_long_line ("", 0, -1);
check_find_very_long_line ("a", 0, 0);
check_find_very_long_line ("", 1, -1);
check_find_very_long_line ("a", 1, -1);
check_find_very_long_line ("ab", 1, 0);
check_find_very_long_line ("é", 1, 0);
check_find_very_long_line ("é", 2, -1);
/* With \n */
check_find_very_long_line ("\n\n\n", 0, -1);
check_find_very_long_line ("\na\n", 0, 1);
check_find_very_long_line ("\na", 0, 1);
check_find_very_long_line ("a\nb\nc\n", 1, -1);
check_find_very_long_line ("a\nb\nc", 1, -1);
check_find_very_long_line ("a\nbc\n", 1, 2);
check_find_very_long_line ("a\nbcd\n", 1, 2);
check_find_very_long_line ("a\nbcd\n", 2, 2);
check_find_very_long_line ("a\nbcd", 2, 2);
check_find_very_long_line ("é\nSé", 2, 3);
check_find_very_long_line ("é\nSé", 3, -1);
check_find_very_long_line ("é\nSé\n", 3, -1);
/* Quick test with \r */
check_find_very_long_line ("\r\r\r", 0, -1);
check_find_very_long_line ("\n\r\n\r\n\r", 0, -1);
check_find_very_long_line ("\r\n\r\n\r\n", 0, -1);
check_find_very_long_line ("a\rb\nc\rd", 1, -1);
check_find_very_long_line ("a\ré", 1, 2);
check_find_very_long_line ("a\ré", 2, -1);
}
int
main (int argc,
char **argv)
{
int exit_status;
gfls_init ();
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/utf8/find_very_long_line", test_find_very_long_line);
exit_status = g_test_run ();
gfls_finalize ();
return exit_status;
}
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!321 blocks