Compare commits

..

62 Commits

Author SHA1 Message Date
Matthias Clasen
f672a788f9 Add a fallback for unconverted backends
If the monitor vfuncs are not implemented in a display class,
fall back to providing a single monitor object representing
the entire screen. This is not meant to be 'good enough', it
is just to provide some implementation until the last backends
implement the monitor vfuncs. When that is the case, the
fallback should be removed.
2016-04-25 09:09:21 -04:00
Руслан Ижбулатов
a4a5a4807f Implement GdkWin32Monitor subclass of GdkMonitor 2016-04-25 06:59:47 -04:00
Matthias Clasen
d2d09fe40d inspector: Fix a unit mismatch
We are showing the refresh rate in Hertz, don't label it as mHz.
2016-04-20 13:59:28 -04:00
Matthias Clasen
4aed4cf40a Emit GdkMonitor::invalidate when a monitor is removed
We do this in the frontend, so backends don't have to do anything
special.
2016-04-11 21:06:27 -04:00
Matthias Clasen
194d73f432 Add a GdkMonitor::invalidate signal
This can be used to track when a monitor object is dropped by the
backend, without having to listen to display signals.
2016-04-11 20:57:43 -04:00
Matthias Clasen
6aa3d4cb37 window: Stop using gdk_screen_get_n_monitors 2016-04-10 23:52:00 -04:00
Matthias Clasen
b10ac55551 settings: Stop comparing screen numbers
There is only one screen.
2016-04-10 23:45:36 -04:00
Matthias Clasen
d4c187ffc7 window: Stop using screen width/height 2016-04-10 23:45:36 -04:00
Matthias Clasen
70cbbb148f treeview: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-10 23:45:36 -04:00
Matthias Clasen
7c1e9588b3 label: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-10 23:43:34 -04:00
Matthias Clasen
a1f86d0878 combobox: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-10 23:42:57 -04:00
Matthias Clasen
df19d99ebd gtk: Convert to new monitor api
Use the GdkDisplay monitor api instead of the GdkScreen one.
2016-04-10 23:01:10 -04:00
Matthias Clasen
1b86a7647b menu: Add new monitor api
This will work better with the new monitor api in gdk.
2016-04-10 22:59:53 -04:00
Matthias Clasen
df589e3cf6 x11: Fix include guards in gdkx11monitor.h 2016-04-06 07:24:55 -04:00
Matthias Clasen
31bf2677ba wayland: Fix include guards for gdkwaylanddmonitor.h 2016-04-06 07:24:33 -04:00
Matthias Clasen
fd586f7ade x11: Add gdk_x11_monitor_get_output 2016-04-05 16:53:04 -04:00
Matthias Clasen
ec0b81e1eb broadway: Move monitor to its own files 2016-04-05 07:32:33 -04:00
Matthias Clasen
e4e3d5c389 wayland: Minor cleanups 2016-04-05 07:17:18 -04:00
Matthias Clasen
f18e5d1ccb x11: Move monitor to its own files 2016-04-05 07:16:56 -04:00
Matthias Clasen
05b023980a wayland: Add api to get wl_outputs 2016-04-04 23:23:42 -04:00
Matthias Clasen
b348de178e wayland: Split off monitor into separate files 2016-04-04 23:15:42 -04:00
Matthias Clasen
acb0f796a0 docs: Adapt to api change 2016-04-04 23:04:03 -04:00
Matthias Clasen
7201a76a62 inspector: Adapt to api change 2016-04-04 23:03:46 -04:00
Matthias Clasen
62a1c0a8b4 broadway: Adapt to api change 2016-04-04 23:03:30 -04:00
Matthias Clasen
bbe69dbd4b x11: Adapt to api change 2016-04-04 23:03:03 -04:00
Matthias Clasen
589c7dd779 wayland: Adapt to api change 2016-04-04 23:02:41 -04:00
Matthias Clasen
a4929f0d28 Redo display monitor api once more
Don't return an array.
2016-04-04 23:02:06 -04:00
Matthias Clasen
4775aa24c7 notify for ::workarea changes
The workarea generally changes whenever the geometry is modified.
2016-04-03 23:38:08 -04:00
Matthias Clasen
e1a2f9bde7 More docs 2016-04-03 23:37:56 -04:00
Matthias Clasen
ef0ae6464f Add docs 2016-04-03 23:28:07 -04:00
Matthias Clasen
b7f3da23d1 x11: Fix hi-dpi handling 2016-04-03 22:38:29 -04:00
Matthias Clasen
7901fbfcf5 x11: fill in refresh rate 2016-04-03 20:23:17 -04:00
Matthias Clasen
73735acb29 Update todo 2016-04-03 20:03:02 -04:00
Matthias Clasen
ab76987099 x11: Implement workarea vfunc 2016-04-03 20:01:58 -04:00
Matthias Clasen
de2837056a Move some monitor apis to GdkDisplay 2016-04-03 20:01:20 -04:00
Matthias Clasen
0f37375c45 Implement workarea with a vfunc 2016-04-03 19:59:12 -04:00
Matthias Clasen
d3b2830a95 x11: Bring back fullscreen-on-all-monitors support
It is unfortunate the EWMH requires Xinerama here - lets do this
without the caching that was previously there, I don't think it is
needed.
2016-04-03 16:53:32 -04:00
Matthias Clasen
bdb891c015 inspector: Show primary too 2016-04-03 10:50:35 -04:00
Matthias Clasen
8ecf370601 inspector: Some code reorganization
Move the helper functions in the general tab around, and make them
more uniform.
2016-04-03 10:49:57 -04:00
Matthias Clasen
7a00f361f3 x11: Convert to new monitor api 2016-04-03 02:51:38 -04:00
Matthias Clasen
146fdaf2b8 x11: Drop Xinerama
It may come back after the monitor conversion.
2016-04-03 02:51:38 -04:00
Matthias Clasen
f0c8a78c67 broadway: Port to new monitor api 2016-04-03 02:48:39 -04:00
Matthias Clasen
b91c27c6f1 Fix up arrayification 2016-04-03 02:48:39 -04:00
Matthias Clasen
7aabbd39d9 inspector: Show more information for monitors 2016-04-03 02:48:38 -04:00
Matthias Clasen
12337c9751 inspector: Rename some variables 2016-04-02 19:48:50 -04:00
Matthias Clasen
a267c20531 inspector: Show better monitor label
We can now show the manufacturer as well.
2016-04-02 19:22:36 -04:00
Matthias Clasen
08fef8929e Add primary as convenience api 2016-04-02 19:06:28 -04:00
Matthias Clasen
ab4c086baf Some major reshuffling
Switch to array-based api in GdkDisplay, add monitor vfuncs in GdkDisplay,
and do away with the monitor vfuncs in GdkScreen.
2016-04-02 19:00:31 -04:00
Matthias Clasen
d04d12e0b5 Some more renaming 2016-04-02 17:16:16 -04:00
Matthias Clasen
b224d1df61 Add subpixel layout 2016-04-02 17:16:15 -04:00
Matthias Clasen
ad8483caad Add refresh rate 2016-04-02 17:14:48 -04:00
Matthias Clasen
7c81188f65 A bunch more renaming 2016-04-02 17:13:44 -04:00
Matthias Clasen
26fa5b6906 wayland: Remove unused field 2016-04-02 17:12:59 -04:00
Matthias Clasen
2196be62e3 Fixup for properties
Construct-only properties must be writable.
2016-04-02 14:44:32 -04:00
Matthias Clasen
cd2553c5c3 Rename physical size fields to _mm 2016-04-02 14:43:59 -04:00
Matthias Clasen
544d706e9e rename scale to scale_factor 2016-04-02 14:32:07 -04:00
Matthias Clasen
d021874ea3 More TODO 2016-04-02 11:37:31 -04:00
Matthias Clasen
80811e74f7 Add a TODO 2016-04-02 11:31:14 -04:00
Matthias Clasen
1c0a93b3f8 screen: Implement monitor apis generically
Implement all the monitor-related GdkScreen apis based on
gdk_display_list_monitors.
2016-04-02 10:23:40 -04:00
Matthias Clasen
c0228940bd wayland: Implement monitor objects 2016-04-02 10:23:31 -04:00
Matthias Clasen
10606363fd Add gdk_display_list_monitors
This follows our general direction of moving functionality
from GdkScreen to GdkDisplay.
2016-04-02 10:23:23 -04:00
Matthias Clasen
71b4a82f0d Fist cut at GdkMonitor
Add a simple object representing a monitor.
2016-04-02 10:23:13 -04:00
4801 changed files with 785107 additions and 840785 deletions

1
.gitignore vendored
View File

@@ -1 +0,0 @@
/subprojects/*/

View File

@@ -1,124 +0,0 @@
stages:
- build
- flatpak
# - deploy
.cache-paths: &cache-paths
paths:
- _ccache/
- subprojects/gdk-pixbuf/
- subprojects/glib/
- subprojects/graphene/
- subprojects/libepoxy/
- subprojects/pango/
fedora-x86_64: &fedora-x86_64-defaults
image: registry.gitlab.gnome.org/gnome/gtk/master:v8
stage: build
script:
- bash -x ./.gitlab-ci/test-docker.sh
artifacts:
when: always
reports:
junit:
- "${CI_PROJECT_DIR}/_build/report.xml"
name: "gtk-${CI_COMMIT_REF_NAME}"
paths:
- "${CI_PROJECT_DIR}/_build/meson-logs"
- "${CI_PROJECT_DIR}/_build/report.xml"
- "${CI_PROJECT_DIR}/_build/report.html"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png"
cache:
key: "$CI_JOB_NAME"
<<: *cache-paths
fedora-x86_64-staticlibs:
variables:
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
<<: *fedora-x86_64-defaults
.mingw-defaults: &mingw-defaults
stage: build
tags:
- win32
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
cache:
key: "%CI_JOB_NAME%"
<<: *cache-paths
msys2-mingw32:
variables:
MSYSTEM: "MINGW32"
CHERE_INVOKING: "yes"
<<: *mingw-defaults
.flatpak-defaults: &flatpak-defaults
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
stage: flatpak
artifacts:
paths:
- "${APPID}-dev.flatpak"
expire_in: 1 day
script:
- bash -x ./.gitlab-ci/flatpak-build.sh "${APPID}"
# Manual jobs, for branches and MRs
.flatpak-manual: &flatpak-manual
<<: *flatpak-defaults
when: manual
# Only build Flatpak bundles automatically on master
.flatpak-master: &flatpak-master
<<: *flatpak-defaults
only:
- master
flatpak-manual:demo:
variables:
APPID: org.gtk.Demo4
<<: *flatpak-manual
flatpak-master:demo:
variables:
APPID: org.gtk.Demo4
<<: *flatpak-master
flatpak-manual:widget-factory:
variables:
APPID: org.gtk.WidgetFactory4
<<: *flatpak-manual
flatpak-master:widget-factory:
variables:
APPID: org.gtk.WidgetFactory4
<<: *flatpak-master
flatpak-manual:icon-browser:
variables:
APPID: org.gtk.IconBrowser4
<<: *flatpak-manual
flatpak-master:icon-browser:
variables:
APPID: org.gtk.IconBrowser4
<<: *flatpak-master
#pages:
# image: registry.gitlab.gnome.org/gnome/gtk/master:v6
# stage: deploy
# script:
# - meson -Dgtk_doc=true _build .
# - ninja -C _build
# - ninja -C _build gdk4-doc gsk4-doc gtk4-doc
# - mkdir -p public/
# - mv _build/docs/reference/gtk/html/ public/gtk/
# - mv _build/docs/reference/gdk/html/ public/gdk/
# - mv _build/docs/reference/gsk/html/ public/gsk/
# artifacts:
# paths:
# - public
# only:
# - master

View File

@@ -1,87 +0,0 @@
FROM fedora:31
RUN dnf -y install \
adwaita-icon-theme \
atk-devel \
at-spi2-atk-devel \
avahi-gobject-devel \
cairo-devel \
cairo-gobject-devel \
ccache \
colord-devel \
cups-devel \
dbus-daemon \
dejavu-sans-mono-fonts \
desktop-file-utils \
diffutils \
elfutils-libelf-devel \
fribidi-devel \
gcc \
gcc-c++ \
gdk-pixbuf2-devel \
gdk-pixbuf2-modules \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-headers \
gobject-introspection-devel \
graphene-devel \
gstreamer1-devel \
gstreamer1-plugins-good \
gstreamer1-plugins-bad-free-devel \
gstreamer1-plugins-base-devel \
gtk-doc \
hicolor-icon-theme \
iso-codes \
itstool \
json-glib-devel \
lcov \
libattr-devel \
libepoxy-devel \
libffi-devel \
libmount-devel \
librsvg2 \
libselinux-devel \
libXcomposite-devel \
libXcursor-devel \
libXcursor-devel \
libXdamage-devel \
libXfixes-devel \
libXi-devel \
libXinerama-devel \
libxkbcommon-devel \
libXrandr-devel \
libXrender-devel \
libXtst-devel \
libxslt \
mesa-dri-drivers \
mesa-libEGL-devel \
mesa-libwayland-egl-devel \
ninja-build \
pango-devel \
pcre-devel \
python3 \
python3-jinja2 \
python3-pip \
python3-wheel \
redhat-rpm-config \
sassc \
systemtap-sdt-devel \
vulkan-devel \
wayland-devel \
wayland-protocols-devel \
which \
xorg-x11-server-Xvfb \
&& dnf clean all
RUN pip3 install meson==0.50.1
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user
WORKDIR /home/user
ENV LANG C.UTF-8

View File

@@ -1,44 +0,0 @@
#!/bin/bash
set -e
appid=$1
builddir=app
repodir=repo
flatpak-builder \
--stop-at=gtk \
${builddir} \
build-aux/flatpak/${appid}.json
flatpak-builder \
--run ${builddir} build-aux/flatpak/${appid}.json \
meson \
--prefix /app \
--libdir /app/lib \
--buildtype debug \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dprint-backends=file \
-Dbuild-tests=false \
-Dbuild-examples=false \
-Dintrospection=false \
-Ddemos=true \
_build .
flatpak-builder \
--run ${builddir} build-aux/flatpak/${appid}.json \
ninja -C _build install
flatpak-builder \
--finish-only \
--repo=${repodir} \
${builddir} \
build-aux/flatpak/${appid}.json
flatpak build-bundle \
${repodir} \
${appid}-dev.flatpak \
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
${appid}

View File

@@ -1,363 +0,0 @@
#!/usr/bin/env python3
# Turns a Mason testlog.json file into an HTML report
#
# Copyright 2019 GNOME Foundation
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Emmanuele Bassi
import argparse
import datetime
import json
import os
import sys
from jinja2 import Template
REPORT_TEMPLATE = '''
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ report.project_name }} Test Report</title>
<meta charset="utf-8" />
<style type="text/css">
body {
background: white;
color: #333;
font-family: 'Cantarell', sans-serif;
}
h1 {
color: #333333;
font-size: 1.9em;
font-weight: normal;
margin-bottom: 1em;
border-bottom: 1px solid #333333;
}
header {
position: fixed;
padding-bottom: 12px;
margin-bottom: 24px;
background: rgba(255, 255, 255, 0.85);
box-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
z-index: 500;
left: 0;
top: 0;
width: 100%;
color: rgba(0, 0, 0, 0.3);
transform: translateY(0px);
transition: .2s background-color, color;
box-sizing: border-box;
display: block;
visibility: visible;
text-align: center;
}
article {
padding-top: 200px;
margin: 2em;
}
div.report-meta {
width: auto;
border: 1px solid #ccc;
padding: .5em 2em;
color: #3c3c3c;
}
span.result {
font-weight: bold;
}
span.pass {
color: rgb(51, 209, 122);
}
span.skip {
color: rgb(255, 163, 72);
}
span.fail {
color: rgb(224, 27, 36);
}
span.xfail {
color: rgb(163, 71, 186);
}
div.result {
border-top: 1px solid #c0c0c0;
padding-top: 1em;
padding-bottom: 1em;
width: 100%;
}
div.result h4 {
border-bottom: 1px solid #c0c0c0;
margin-bottom: 0.7em;
}
pre {
color: #fafafa;
background-color: black;
border-radius: 6px;
box-shadow: 0px 5px 8px 0px rgba(0, 0, 0, 0.25);
font-family: monospace;
line-height: 1.2em;
border: none;
padding: 10px 1em;
font-size: 0.9em;
overflow: auto;
white-space: pre;
word-break: normal;
word-wrap: normal;
}
ul.passed li {
display: inline;
}
ul.passed li:after {
content: ",";
}
ul.passed li:last-child:after {
content: "";
}
ul.images {
padding-bottom: 1em;
}
ul.images li {
display: inline;
}
</style>
</head>
<body>
<header>
<h1>{{ report.project_name }} :: Test Reports</h1>
<div class="report-meta">
<p><strong>Branch:</strong> {{ report.branch_name }}</p>
<p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
{% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
</div>
</header>
<article>
<section>
<div class="summary">
<h3><a name="summary">Summary</a></h3>
<ul>
<li><strong>Total units:</strong> {{ report.total_units }}</li>
<li><strong>Passed:</strong> <a href="#passed">{{ report.total_successes }}</a></li>
<li><strong>Failed:</strong> <a href="#failures">{{ report.total_failures }}</a></li>
</ul>
</div>
</section>
{% for suite_result in report.results_list %}
<section>
<div class="result">
<h3><a name="results">Suite: {{ suite_result.suite_name }}</a></h3>
<ul>
<li><strong>Units:</strong> {{ suite_result.n_units }}</li>
<li><strong>Passed:</strong> {{ suite_result.n_successes }}</li>
<li><strong>Failed:</strong> {{ suite_result.n_failures }}</li>
</ul>
<div class="successes">
<h4><a name="passed">Passed</a></h4>
<ul class="passed">
{% for success in suite_result.successes if success.result == 'OK' %}
<li>{{ success.name }} - result: <span class="result pass">{{ success.result }}</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
<h4><a name="skipped">Skipped</a></h4>
<ul>
{% for success in suite_result.successes if success.result == 'SKIP' %}
<li>{{ success.name }} - result: <span class="result skip">{{ success.result }}</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
<h4><a name="expected-fail">Expected failures</a></h4>
<ul>
{% for success in suite_result.successes if success.result == 'EXPECTEDFAIL' %}
<li><a name="{{ success.name }}">{{ success.name }}</a> - result: <span class="result xfail">{{ success.result }}</span><br/>
{% if success.stdout %}
Output: <pre>{{ success.stdout }}</pre>
{% endif %}
{% if success.image_data is defined %}
<ul class="images">
<li><img alt="ref" src="{{ success.image_data.ref }}" /></li>
<li><img alt="out" src="{{ success.image_data.out }}" /></li>
<li><img alt="diff" src="{{ success.image_data.diff }}" /></li>
</ul>
{% endif %}
</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
</div>
<div class="failures">
<h4><a name="failed">Failed</a></h4>
<ul class="failed">
{% for failure in suite_result.failures if failure.result == 'FAIL' %}
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
{% if failure.stdout %}
Output: <pre>{{ failure.stdout }}</pre>
{% endif %}
{% if failure.image_data is defined %}
<ul class="images">
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
<li><img alt="out" src="{{ failure.image_data.out }}" /></li>
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
</ul>
{% endif %}
</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
<h4><a name="timed-out">Timed out</a></h4>
<ul class="failed">
{% for failure in suite_result.failures if failure.result == 'TIMEOUT' %}
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
{% if failure.stdout %}
Output: <pre>{{ failure.stdout }}</pre>
{% endif %}
</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
</div>
</div>
</section>
{% endfor %}
</article>
</body>
</html>
'''
aparser = argparse.ArgumentParser(description='Turns a Meson test log into an HTML report')
aparser.add_argument('--project-name', metavar='NAME',
help='The project name',
default='Unknown')
aparser.add_argument('--job-id', metavar='ID',
help='The job ID for the report',
default=None)
aparser.add_argument('--branch', metavar='NAME',
help='Branch of the project being tested',
default='master')
aparser.add_argument('--output', metavar='FILE',
help='The output HTML file, stdout by default',
type=argparse.FileType('w', encoding='UTF-8'),
default=sys.stdout)
aparser.add_argument('--reftest-suite', metavar='NAME',
help='The name of the reftests suite',
default='reftest')
aparser.add_argument('--reftest-output-dir', metavar='DIR',
help='The output directory for reftests data',
default=None)
aparser.add_argument('infile', metavar='FILE',
help='The input testlog.json, stdin by default',
type=argparse.FileType('r', encoding='UTF-8'),
default=sys.stdin)
args = aparser.parse_args()
outfile = args.output
suites = {}
for line in args.infile:
data = json.loads(line)
(full_suite, unit_name) = data['name'].split(' / ')
(project_name, suite_name) = full_suite.split(':')
unit = {
'project-name': project_name,
'suite': suite_name,
'name': unit_name,
'duration': data['duration'],
'returncode': data['returncode'],
'result': data['result'],
'stdout': data['stdout'],
}
if args.reftest_output_dir is not None and suite_name == args.reftest_suite:
filename = unit_name.split(' ')[1]
basename = os.path.splitext(filename)[0]
image_data = {
'ref': os.path.join(args.reftest_output_dir, '{}.ref.png'.format(basename)),
'out': os.path.join(args.reftest_output_dir, '{}.out.png'.format(basename)),
'diff': os.path.join(args.reftest_output_dir, '{}.diff.png'.format(basename)),
}
unit['image_data'] = image_data
units = suites.setdefault(full_suite, [])
units.append(unit)
report = {}
report['date'] = datetime.datetime.utcnow()
report['locale_date'] = report['date'].strftime("%c")
report['project_name'] = args.project_name
report['job_id'] = args.job_id
report['branch_name'] = args.branch
report['total_successes'] = 0
report['total_failures'] = 0
report['total_units'] = 0
report['results_list'] = []
for name, units in suites.items():
(project_name, suite_name) = name.split(':')
print('Processing {} suite {}:'.format(project_name, suite_name))
def if_failed(unit):
if unit['result'] in ['FAIL', 'TIMEOUT']:
return True
return False
def if_succeded(unit):
if unit['result'] in ['OK', 'EXPECTEDFAIL', 'SKIP']:
return True
return False
successes = list(filter(if_succeded, units))
failures = list(filter(if_failed, units))
n_units = len(units)
n_successes = len(successes)
n_failures = len(failures)
report['total_units'] += n_units
report['total_successes'] += n_successes
report['total_failures'] += n_failures
print(' - {}: {} total, {} pass, {} fail'.format(suite_name, n_units, n_successes, n_failures))
suite_report = {
'suite_name': suite_name,
'n_units': n_units,
'successes': successes,
'n_successes': n_successes,
'failures': failures,
'n_failures': n_failures,
}
report['results_list'].append(suite_report)
template = Template(REPORT_TEMPLATE)
outfile.write(template.render({'report': report}))

View File

@@ -1,109 +0,0 @@
#!/usr/bin/env python3
# Turns a Meson testlog.json file into a JUnit XML report
#
# Copyright 2019 GNOME Foundation
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Emmanuele Bassi
import argparse
import datetime
import json
import os
import sys
import xml.etree.ElementTree as ET
aparser = argparse.ArgumentParser(description='Turns a Meson test log into a JUnit report')
aparser.add_argument('--project-name', metavar='NAME',
help='The project name',
default='unknown')
aparser.add_argument('--job-id', metavar='ID',
help='The job ID for the report',
default='Unknown')
aparser.add_argument('--branch', metavar='NAME',
help='Branch of the project being tested',
default='master')
aparser.add_argument('--output', metavar='FILE',
help='The output file, stdout by default',
type=argparse.FileType('w', encoding='UTF-8'),
default=sys.stdout)
aparser.add_argument('infile', metavar='FILE',
help='The input testlog.json, stdin by default',
type=argparse.FileType('r', encoding='UTF-8'),
default=sys.stdin)
args = aparser.parse_args()
outfile = args.output
testsuites = ET.Element('testsuites')
testsuites.set('id', '{}/{}'.format(args.job_id, args.branch))
testsuites.set('package', args.project_name)
testsuites.set('timestamp', datetime.datetime.utcnow().isoformat(timespec='minutes'))
suites = {}
for line in args.infile:
data = json.loads(line)
(full_suite, unit_name) = data['name'].split(' / ')
(project_name, suite_name) = full_suite.split(':')
duration = data['duration']
return_code = data['returncode']
log = data['stdout']
unit = {
'suite': suite_name,
'name': unit_name,
'duration': duration,
'returncode': return_code,
'stdout': log,
}
units = suites.setdefault(suite_name, [])
units.append(unit)
for name, units in suites.items():
print('Processing suite {} (units: {})'.format(name, len(units)))
def if_failed(unit):
if unit['returncode'] != 0:
return True
return False
def if_succeded(unit):
if unit['returncode'] == 0:
return True
return False
successes = list(filter(if_succeded, units))
failures = list(filter(if_failed, units))
print(' - {}: {} pass, {} fail'.format(name, len(successes), len(failures)))
testsuite = ET.SubElement(testsuites, 'testsuite')
testsuite.set('name', '{}/{}'.format(args.project_name, name))
testsuite.set('tests', str(len(units)))
testsuite.set('errors', str(len(failures)))
testsuite.set('failures', str(len(failures)))
for unit in successes:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
testcase.set('name', unit['name'])
testcase.set('time', str(unit['duration']))
for unit in failures:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
testcase.set('name', unit['name'])
testcase.set('time', str(unit['duration']))
failure = ET.SubElement(testcase, 'failure')
failure.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
failure.set('name', unit['name'])
failure.set('type', 'error')
failure.text = unit['stdout']
output = ET.tostring(testsuites, encoding='unicode')
outfile.write(output)

View File

@@ -1,11 +0,0 @@
#!/bin/bash
set -e
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v7"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .
sudo docker run --rm --security-opt label=disable \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash

View File

@@ -1,55 +0,0 @@
#!/bin/bash
set -e
srcdir=$(pwd)
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
ccache --zero-stats
ccache --show-stats
export CCACHE_DISABLE=true
meson \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dbroadway-backend=true \
-Dvulkan=yes \
--werror \
${EXTRA_MESON_FLAGS:-} \
_build $srcdir
unset CCACHE_DISABLE
cd _build
ninja
ccache --show-stats
set +e
xvfb-run -a -s "-screen 0 1024x768x24" \
meson test \
--timeout-multiplier 2 \
--print-errorlogs \
--suite=gtk \
--no-suite=gtk:a11y
# Save the exit code
exit_code=$?
# We always want to run the report generators
$srcdir/.gitlab-ci/meson-junit-report.py \
--project-name=gtk \
--job-id="${CI_JOB_NAME}" \
--output=report.xml \
meson-logs/testlog.json
$srcdir/.gitlab-ci/meson-html-report.py \
--project-name=GTK \
--job-id="${CI_JOB_NAME}" \
--reftest-output-dir="testsuite/reftests/output" \
--output=report.html \
meson-logs/testlog.json
exit $exit_code

View File

@@ -1,58 +0,0 @@
#!/bin/bash
set -e
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export MSYS2_ARCH="i686"
else
export MSYS2_ARCH="x86_64"
fi
# Update everything
pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
base-devel \
git \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkg-config \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-meson \
mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \
mingw-w64-$MSYS2_ARCH-atk \
mingw-w64-$MSYS2_ARCH-cairo \
mingw-w64-$MSYS2_ARCH-gdk-pixbuf2 \
mingw-w64-$MSYS2_ARCH-glib2 \
mingw-w64-$MSYS2_ARCH-graphene \
mingw-w64-$MSYS2_ARCH-json-glib \
mingw-w64-$MSYS2_ARCH-libepoxy \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-fribidi \
mingw-w64-$MSYS2_ARCH-gst-plugins-bad \
mingw-w64-$MSYS2_ARCH-shared-mime-info
# https://gitlab.gnome.org/GNOME/gtk/issues/2243
wget "https://gitlab.gnome.org/creiter/gitlab-ci-win32-runner/raw/master/pango/mingw-w64-$MSYS2_ARCH-pango-1.44.7-1-any.pkg.tar.xz"
pacman --noconfirm -U "mingw-w64-$MSYS2_ARCH-pango-1.44.7-1-any.pkg.tar.xz"
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# Build
ccache --zero-stats
ccache --show-stats
export CCACHE_DISABLE=true
meson \
-Dx11-backend=false \
-Dwayland-backend=false \
-Dwin32-backend=true \
-Dvulkan=no \
--werror \
_build
unset CCACHE_DISABLE
ninja -C _build
ccache --show-stats

View File

@@ -1,36 +0,0 @@
## Steps to reproduce
1. ...
2. ...
3. ...
<!--
You should try and reproduce with the demos applications available
under the `demos` directory, or the test programs in the `tests` directory.
Alternatively, please attach a *small and self-contained* example
*written in C* that exhibits the issue.
-->
## Current behavior
<!--
Please describe the current behaviour
-->
## Expected outcome
<!--
Please describe the expected outcome
-->
## Version information
<!--
- Which version of GTK you are using
- What operating system and version
- For Linux, which distribution
- If you built GTK yourself, the list of options used to configure the build
-->
## Additional information
<!--
- Screenshots or screen recordings are useful for visual errors
- Please report any warning or message printed on the terminal
-->

View File

@@ -1,34 +0,0 @@
## Steps to reproduce
1. ...
2. ...
3. ...
<!--
You should try and reproduce with the demos applications available
under the `demos` directory, or the test programs in the `tests` directory.
Alternatively, please attach a *small and self-contained* example that
exhibits the issue.
-->
## Version information
<!--
- Which version of GTK you are using
- What operating system and version
- for Linux, which distribution
- If you built GTK yourself, the list of options used to configure the build
-->
## Warnings
<!--
- If the application generates warning messages before crashing please
report them here
-->
## Backtrace
<!--
- Attaching a stack trace obtained using GDB is appreciated; follow the
instructions on the wiki:
https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces
-->

View File

@@ -1,266 +0,0 @@
# Contribution guidelines
Thank you for considering contributing to the GTK project!
These guidelines are meant for new contributors, regardless of their level
of proficiency; following them allows the maintainers of the GTK project to
more effectively evaluate your contribution, and provide prompt feedback to
you. Additionally, by following these guidelines you clearly communicate
that you respect the time and effort that the people developing GTK put into
managing the project.
GTK is a complex free software GUI toolkit, and it would not exist without
contributions from the free and open source software community. There are
many things that we value:
- bug reporting and fixing
- documentation and examples
- tests
- new features
Please, do not use the issue tracker for support questions. If you have
questions on how to use GTK effectively, you can use:
- the `#gtk` IRC channel on irc.gnome.org
- the [gtk](https://mail.gnome.org/mailman/listinfo/gtk-list) mailing list,
for general questions on GTK
- the [gtk-app-devel](https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list)
mailing list, for questions on application development with GTK
- the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list, for questions on developing GTK itself
You can also look at the GTK tag on [Stack
Overflow](https://stackoverflow.com/questions/tagged/gtk).
The issue tracker is meant to be used for actionable issues only.
## How to report bugs
### Security issues
You should not open a new issue for security related questions.
When in doubt, send an email to the [security](mailto:security@gnome.org)
mailing list.
### Bug reports
If you're reporting a bug make sure to list:
0. which version of GTK are you using?
0. which operating system are you using?
0. the necessary steps to reproduce the issue
0. the expected outcome
0. a description of the behavior; screenshots are also welcome
0. a small, self-contained example exhibiting the behavior; if this
is not available, try reproducing the issue using the GTK examples
or interactive tests
If the issue includes a crash, you should also include:
0. the eventual warnings printed on the terminal
0. a backtrace, obtained with tools such as GDB or LLDB
For small issues, such as:
- spelling/grammar fixes in the documentation
- typo correction
- comment clean ups
- changes to metadata files (CI, `.gitignore`)
- build system changes
- source tree clean ups and reorganizations
You should directly open a merge request instead of filing a new issue.
### Features and enhancements
Feature discussion can be open ended and require high bandwidth channels; if
you are proposing a new feature on the issue tracker, make sure to make
an actionable proposal, and list:
0. what you're trying to achieve
0. prior art, in other toolkits or applications
0. design and theming changes
If you're proposing the integration of new features it helps to have
multiple applications using shared or similar code, especially if they have
iterated over it various times.
Each feature should also come fully documented, and with tests.
## Your first contribution
### Prerequisites
If you want to contribute to the GTK project, you will need to have the
development tools appropriate for your operating system, including:
- Python 3.x
- Meson
- Ninja
- Gettext (19.7 or newer)
- a [C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
Up-to-date instructions about developing GNOME applications and libraries
can be found on [the GNOME Developer Center](https://developer.gnome.org).
The GTK project uses GitLab for code hosting and for tracking issues. More
information about using GitLab can be found [on the GNOME
wiki](https://wiki.gnome.org/GitLab).
### Dependencies
In order to get GTK from Git installed on your system, you need to have the
required versions of all the software dependencies required by GTK; typically,
this means a recent version of GLib, Cairo, Pango, and ATK, as well as the
platform-specific dependencies for the windowing system you are using (Wayland,
X11, Windows, or macOS).
The core dependencies for GTK are:
- [GLib, GObject, and GIO](https://gitlab.gnome.org/GNOME/glib)
- [Cairo](http://cairographics.org)
- [Pango](https://gitlab.gnome.org/GNOME/pango)
- [GdkPixbuf](https://gitlab.gnome.org/GNOME/gdk-pixbuf)
- [Epoxy](https://github.com/anholt/libepoxy)
- [ATK](https://gitlab.gnome.org/GNOME/atk)
- [Graphene](https://github.com/ebassi/graphene)
GTK will attempt to download and build some of these dependencies if it
cannot find them on your system.
Additionally, you may want to look at projects that create a development
environment for you, like [jhbuild](https://wiki.gnome.org/HowDoI/Jhbuild)
and [gvsbuild](https://github.com/wingtk/gvsbuild).
### Getting started
You should start by forking the GTK repository from the GitLab web UI, and
cloning from your fork:
```sh
$ git clone https://gitlab.gnome.org/yourusername/gtk.git
$ cd gtk
```
**Note**: if you plan to push changes to back to the main repository and
have a GNOME account, you can skip the fork, and use the following instead:
```sh
$ git clone git@gitlab.gnome.org:GNOME/gtk.git
$ cd gtk
```
To compile the Git version of GTK on your system, you will need to
configure your build using Meson:
```sh
$ meson _builddir .
$ cd _builddir
$ ninja
```
Typically, you should work on your own branch:
```sh
$ git checkout -b your-branch
```
Once you've finished working on the bug fix or feature, push the branch
to the Git repository and open a new merge request, to let the GTK
maintainers review your contribution.
### Code reviews
Each contribution is reviewed by the core developers of the GTK project.
The [CODEOWNERS](./docs/CODEOWNERS) document contains the list of core
contributors to GTK and the areas for which they are responsible; you
should ensure to receive their review and signoff on your changes.
### Commit messages
The expected format for git commit messages is as follows:
```plain
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too
brief.
Closes #1234
```
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Consider the commit
message as an email sent to the developers (or yourself, six months
down the line) detailing **why** you changed something. There's no need
to specify the **how**: the changes can be inlined.
- When committing code on behalf of others use the `--author` option, e.g.
`git commit -a --author "Joe Coder <joe@coder.org>"` and `--signoff`.
- If your commit is addressing an issue, use the
[GitLab syntax](https://docs.gitlab.com/ce/user/project/issues/automatic_issue_closing.html)
to automatically close the issue when merging the commit with the upstream
repository:
```plain
Closes #1234
Fixes #1234
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1234
```
- If you have a merge request with multiple commits and none of them
completely fixes an issue, you should add a reference to the issue in
the commit message, e.g. `Bug: #1234`, and use the automatic issue
closing syntax in the description of the merge request.
### Commit access to the GTK repository
GTK is part of the GNOME infrastructure. At the current time, any
person with write access to the GNOME repository can merge changes to
GTK. This is a good thing, in that it encourages many people to work
on GTK, and progress can be made quickly. However, GTK is a fairly
large and complicated project on which many other things depend, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK that has been built up over the years, we'd like to ask
people committing to GTK to follow a few rules:
0. Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've been
working on GTK for a while it probably isn't necessary to ask. But when
in doubt, ask. Even if your change is correct, somebody may know a
better way to do things. If you are making changes to GTK, you should
be subscribed to the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list; this is a good place to ask about intended changes.
The `#gtk` IRC channel on irc.gnome.org is also a good place to find GTK
developers to discuss changes, but if you live outside of the EU/US time
zones, an email to the gtk-devel mailing list is the most certain and
preferred method.
0. Ask _first_.
0. Always write a meaningful commit message. Changes without a sufficient
commit message will be reverted.
0. Never push to the `master` branch, or any stable branches, directly; you
should always go through a merge request, to ensure that the code is
tested on the CI infrastructure at the very least. A merge request is
also the proper place to get a comprehensive code review from the core
developers of GTK.
If you have been contributing to GTK for a while and you don't have commit
access to the repository, you may ask to obtain it following the [GNOME account
process](https://wiki.gnome.org/AccountsTeam/NewAccounts).

64
HACKING Normal file
View File

@@ -0,0 +1,64 @@
If you want to hack on the GTK+ project, you'll need to have
the following packages installed:
- GNU autoconf 2.62
- GNU automake 1.11
- GNU libtool 2.2
- indent (GNU indent 1.9.1 is known good)
- GNU gettext 10.40
These should be available by ftp from ftp.gnu.org or any of the
fine GNU mirrors. Beta software can be found at alpha.gnu.org.
Up-to-date instructions about developing GNOME applications and libraries
can be found here:
http://library.gnome.org/devel/
Information about using git with GNOME can be found here:
https://wiki.gnome.org/Git
In order to get GIT GTK+ installed on your system, you need to have
the most recent GIT versions of GLib, Pango, and ATK installed as well.
The installation process of these libraries is similar to that of GTK+,
but needs to be fulfilled prior to installation of GTK+.
If at all possible, please use GIT to get the latest development version of
gtk+ and glib. You can do the following to get glib and gtk+ from GIT:
$ git clone git://git.gnome.org/glib
$ git clone git://git.gnome.org/pango
$ git clone git://git.gnome.org/atk
$ git clone git://git.gnome.org/gtk+
Note: if you plan to push changes to back to the master repository and
have a gnome account, you want to use the following instead:
$ git clone ssh://<username>@git.gnome.org/git/gtk+
To compile the GIT version of GTK+ on your system, you will need to take
several steps to setup the tree for compilation. You can do all these
steps at once by running:
gtk+$ ./autogen.sh
Basically this does the following for you:
gtk+$ aclocal; automake; autoconf
The above commands create the `configure' script. Now you
run the `configure' script in `gtk+/' to create all Makefiles.
More information about that in `INSTALL'.
Before running `autogen.sh' or `configure', make sure you have libtool
in your path.
Note that autogen.sh runs configure for you. If you wish to pass
options like `--prefix=/usr' to `configure' you can give those options
to `autogen.sh' and they will be passed on to `configure'.
For information about submitting patches and pushing changes
to GIT, see the `README' and `README.commits' files. In particular,
don't, under any circumstances, push anything to GIT before
reading and understanding `README.commmits'.

42
INSTALL.in Normal file
View File

@@ -0,0 +1,42 @@
Prerequisites
=============
GTK+ requires the following packages:
- The GLib, Pango, GdkPixbuf, ATK and cairo libraries, available at
the same location as GTK+. GTK+ @GTK_VERSION@ requires at least
GLib @GLIB_REQUIRED_VERSION@, Pango @PANGO_REQUIRED_VERSION@,
GdkPixbuf @GDK_PIXBUF_REQUIRED_VERSION@, ATK @ATK_REQUIRED_VERSION@
and cairo @CAIRO_REQUIRED_VERSION@.
- libepoxy, for cross-platform OpenGL support.
It can be found here: https://github.com/anholt/libepoxy
- Each GDK backend has its own backend-specific requirements. For
the X11 backend, X11 R6 and XInput version 2 (as well as a number
of other extensions) are required. The Wayland backend requires
(obviously) the Wayland libraries.
- gobject-introspection @INTROSPECTION_REQUIRED_VERSION@ or newer.
Simple install procedure
========================
% tar xf gtk+-@GTK_VERSION@.tar.xz # unpack the sources
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK+
[ Become root if necessary ]
% make install # install GTK+
The Details
===========
Complete information about installing GTK+ and related libraries
can be found in the file:
docs/reference/gtk/html/gtk-building.html
Or online at:
http://library.gnome.org/devel/gtk/stable/gtk-building.html

12
MAINTAINERS Normal file
View File

@@ -0,0 +1,12 @@
Matthias Clasen
E-mail: mclasen@redhat.com
Userid: matthiasc
Tim Janik
E-mail: timj@gtk.org
Userid: timj
Note that a lot of people are contributing to GTK+, and some parts of it
are technically maintained by other people. The people listed above are
meant as contacts for administrative questions such as cvs accounts. Other
questions are best directed to the mailing list gtk-devel-list@gnome.org.

116
Makefile.am Normal file
View File

@@ -0,0 +1,116 @@
## Makefile.am for GTK+
include $(top_srcdir)/Makefile.decl
SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
EXTRA_DIST += \
autogen.sh \
HACKING \
README \
README.in \
INSTALL \
INSTALL.in \
NEWS.pre-1-0 \
README.commits \
README.win32 \
config.h.win32 \
makefile.msc \
gtk-zip.sh.in \
sanitize-la.sh \
po/README.translators \
po/po2tbl.sed.in \
make-pot
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \
$(srcdir)/m4/gtk-doc.m4 \
$(srcdir)/INSTALL \
$(srcdir)/README \
$(srcdir)/gtk-doc.make \
$(srcdir)/ChangeLog
## Copy .pc files to target-specific names
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc gtk+-mir-3.0.pc: gtk+-3.0.pc
rm -f $@ && \
cp gtk+-3.0.pc $@
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc gdk-mir-3.0.pc: gdk-3.0.pc
rm -f $@ && \
cp gdk-3.0.pc $@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gdk-3.0.pc gtk+-3.0.pc gail-3.0.pc
pkgconfig_DATA += ${GDK_BACKENDS:%=gtk+-%-3.0.pc}
pkgconfig_DATA += ${GDK_BACKENDS:%=gdk-%-3.0.pc}
if OS_UNIX
pkgconfig_DATA += gtk+-unix-print-3.0.pc
endif
DISTCLEANFILES = \
gtk+-unix-print-3.0.pc \
gtk+-3.0.pc \
gtk+-x11-3.0.pc \
gtk+-win32-3.0.pc \
gtk+-quartz-3.0.pc \
gtk+-broadway-3.0.pc \
gtk+-wayland-3.0.pc \
gtk+-mir-3.0.pc \
gdk-3.0.pc \
gdk-x11-3.0.pc \
gdk-win32-3.0.pc \
gdk-quartz-3.0.pc \
gdk-broadway-3.0.pc \
gdk-wayland-3.0.pc \
gdk-mir-3.0.pc \
gail-3.0.pc \
config.lt
distclean-local:
if test "$(srcdir)" = "."; then :; else \
rm -f ChangeLog; \
fi
ChangeLog:
$(AM_V_GEN) if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git $(top_builddir)/build-aux/missing git log GTK_2_16_0^^.. --stat) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
.PHONY: ChangeLog
uninstall-local:
rm -f $(DESTDIR)$(pkgconfigdir)/gtk+-3.0.pc
AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
--disable-doc-cross-references \
--enable-man \
--disable-maintainer-mode \
--enable-introspection \
--enable-installed-tests
GITIGNOREFILES = \
po-properties/Makefile.in.in \
po-properties/Makefile.in \
po-properties/Makefile \
po-properties/*.gmo \
po-properties/*.mo \
po-properties/POTFILES \
po-properties/stamp-it \
po-properties/.intltool-merge-cache
-include $(top_srcdir)/git.mk

96
Makefile.decl Normal file
View File

@@ -0,0 +1,96 @@
# GTK+ - The GIMP Toolkit
GTESTER = gtester -k # in $PATH for non-GLIB packages
GTESTER_REPORT = gtester-report # in $PATH for non-GLIB packages
# initialize variables for unconditional += appending
EXTRA_DIST =
TEST_PROGS =
### testing rules
# Xvfb based test rules
XVFB = Xvfb -ac -noreset -screen 0 1024x768x16
XIDS = 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 \
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 \
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 \
1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 \
9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 \
9995 9996 9997 9998 9999
if USE_X11
SKIP_GDKTARGET = \
false
else
SKIP_GDKTARGET = \
echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
endif
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
XVFB_START = \
${XVFB} -help 2>/dev/null 1>&2 \
&& XID=`for id in $(XIDS) ; do test -e /tmp/.X$$id-lock || { echo $$id; exit 0; }; done; exit 1` \
&& { ${XVFB} :$$XID -nolisten tcp -auth /dev/null >/dev/null 2>&1 & \
trap "kill -15 $$! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } \
|| { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } \
&& DISPLAY=:$$XID && export DISPLAY
# call as: $(XVFB_START) && someprogram
# test: run all tests in cwd and subdirs
test: test-cwd test-recurse
# test-cwd: run tests in cwd
test-cwd: ${TEST_PROGS}
@$(SKIP_GDKTARGET) || test -z "${TEST_PROGS}" || { \
$(XVFB_START) && { set -e; $(TESTS_ENVIRONMENT) G_TEST_SRCDIR="${abs_srcdir}" G_TEST_BUILDDIR="${abs_builddir}" ${GTESTER} --verbose ${TEST_PROGS}; }; \
}
# test-recurse: run tests in subdirs
test-recurse:
@ for subdir in $(SUBDIRS) ; do \
test "$$subdir" = "." -o "$$subdir" = "po" -o "$$subdir" = "po-properties" || \
( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) test ) || exit $? ; \
done
# test-report: run tests in subdirs and generate report
# perf-report: run tests in subdirs with -m perf and generate report
# full-report: like test-report: with -m perf and -m slow
test-report perf-report full-report: ${TEST_PROGS}
@ ignore_logdir=true ; \
if test -z "$$GTESTER_LOGDIR" ; then \
GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
ignore_logdir=false ; \
fi ; \
for subdir in $(SUBDIRS) ; do \
test "$$subdir" = "." -o "$$subdir" = "po" -o "$$subdir" = "po-properties" || \
( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
done ; \
$(SKIP_GDKTARGET) || test -z "${TEST_PROGS}" || { \
case $@ in \
test-report) test_options="-k";; \
perf-report) test_options="-k -m=perf";; \
full-report) test_options="-k -m=perf -m=slow";; \
esac ; \
$(XVFB_START) && { \
set -e; \
if test -z "$$GTESTER_LOGDIR" ; then \
G_TEST_SRCDIR="${abs_srcdir}" G_TEST_BUILDDIR="${abs_builddir}" ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
elif test -n "${TEST_PROGS}" ; then \
G_TEST_SRCDIR="${abs_srcdir}" G_TEST_BUILDDIR="${abs_builddir}" ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
fi ; \
}; \
}; \
$$ignore_logdir || { \
echo '<?xml version="1.0"?>' > $@.xml ; \
echo '<report-collection>' >> $@.xml ; \
for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
done ; \
echo >> $@.xml ; \
echo '</report-collection>' >> $@.xml ; \
rm -rf "$$GTESTER_LOGDIR"/ ; \
${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
}
.PHONY: test test-cwd test-recurse test-report perf-report full-report
# run make test-cwd as part of make check
check-local: test-cwd

9445
NEWS

File diff suppressed because it is too large Load Diff

View File

@@ -1,903 +0,0 @@
Overview of Changes in GTK+ 2.0.0
=================================
* GtkTreeView fixes [Jonathan Blandford, Kristian Rietveld, Darin Adler]
* Build fixes [Anders Carlsson, Tor Lillqvist, Manish Singh]
* Bug fixes. [Thomas Leonard, Owen Taylor]
Overview of Changes in GTK+ 2.0.0 rc1
=====================================
* GtkTreeView fixes [Kristian Rietveld, Jonathan Blandford, Richard Hult]
* Text widget fixes [Havoc Pennington]
* Efficiency fixes when using Xft [Owen Taylor]
* Key handling fixes and other fixes for Win32 [Hans Breuer, Tor Lillqvist]
* Try to fix key handling without XKEYBOARD extension [Owen]
* Documentation fixes and improvements
[Matthias Clasen, Alexey Malyshev, Akira Tagoh, Vitaly Tishkov]
* Widget drawing improvements [Soeren Sandmann]
* Allow cycling between multiple menu bars with <Control>Tab [Owen]
* Try to build libraries with only shared library dependencies on Xft to
deal with transition to Xft2 [Owen]
* Portability fixes [Owen, Miroslaw Dobrzanski-Neumann]
* Don't use red as the default cursor color [Owen]
* Bug fixes, bug fixes, bug fixes.
Other contributors: Darin Adler, Jacob Berkman, Kevin Breit, Hans Breuer,
Anders Carlsson, Damon Chaplin, Finlay Dobbie, Jody Goldberg,
Andreas J. Guelzow, Scott Guilbeaux, Vlad Harchev, James Henstridge,
Tim Janik, Satyajit Kanungo, Charles Kerr, Sergey Kuzminov, Miles Lane,
Alexander Larsson, Paolo Maggi, Skip Montaro, Jan Mynarik, Sven Neumann,
Padraig O'Briain, Narayani Pattipati, Mark Patton, Havoc Pennington,
Ettore Perazzoli, Guillermo S. Romero, Manish Singh, Morten Welinder
Overview of Changes in GTK+ 1.3.15
==================================
* New stock and improved icon images
[Tuomas Kuosmanen, Jakub Steiner, Anders Carlsson]
* Widget drawing improvements for check and radio buttons,
spinbuttons [Soeren Sandmann]
* Clean up module search path algorithm, use GTK_PATH [Owen Taylor]
* Add GtkSetting for font name. [Richard Hestilow]
* Much improved key matching code, accelerators work independent
of group [Owen]
* Make mnemonics work for embedded GtkPlug widgets [Owen]
* Keynav improvements for GtkTreeView [Kristian Rietveld]
* Fix gtk_tree_view_scroll_to_cell() [Jonathan Blandford]
* Rename gtk_tree_view_get_iter_root() and gtk_tree_path_new_root()
to gtk_tree_view_get_iter_first() and gtk_tree_path_new_first(),
add compatibility macros.
* GtkTreeView bug fixes [Kristian, Anders, Damon Chaplin]
* GtkTextView bug fixes [Havoc Pennington]
* Pad class structures for future binary compatibility [Owen]
* Tutorial improvements [Sven Neumann, Matthias Clasen]
* Fixes for MULTIPLE selection target [Gregory Merchan, Owen]
* Fix problems with initial widget size [Owen]
* AIX compilation fixes [Miroslaw Dobrzanski-Neumann]
* Win32 fixes [Hans Breuer, Tor Lillqvist]
* Miscellaneous bug fixes
Other contributors: David L. Cooper, Eric Fischer, Jody Goldberg,
Satajyit Kanungo, Thomas Leonard, Mark Patton, Manish Singh,
Nicolas Setton
Overview of Changes in GTK+ 1.3.14
==================================
* Keyboard focus improvements [Owen Taylor]
* Code cleanup [Matthias Clasen, Manish Singh, Darin Adler]
* Fix accidentally exported variables [Mark McLoughlin]
* GtkTreeView fixes [Jonathan Blandford, Kristian Rietveld, John Harper, Darin]
* Default to yellow tooltips [Owen]
* RC file fixes for reloading, priorities [Owen, Matthias]
* GtkMenu behavior improvements and bug fixes [Owen, Arnaud Charlet]
* GtkTextView fixes [Havoc Pennington, Daniel Elstner, Dennis Bjorklund]
* Improve keynav for paned widgets, tooltips, spin buttons, notebooks,
scrolled windows [Soeren Sandmann, Padraig, Owen]
* Add Emacs/Default key themes [Owen]
* Win32 fixes [Hans Breuer, Tor Lillqvist]
* Ethiopic input methods [Daniel Yacob]
* Opaque paned window resizing [Soeren]
* Tweak table expansion behavior [Tim Janik]
* Fix GtkCalendar focus drawing [Bill Haneman]
* Allow themeable cursor thickness [Bill]
* Start of fixing of tutorial for GTK+-2.0 [Matthias]
* Add a ::adjust-bounds signal to GtkRange to allow spreadsheet style
scrollbars. [Jody Goldberg]
* Add the ability to turn on multiple selection for GtkFileSel [Manish]
* Bug fixes
Other contributors: Jacob Berkman, Padraig O'Briain, Anders Carlsson,
Johan Dahlin, Richard Hult, Stefan Kost, Alex Larsson, Thomas Leonard,
Paolo Maggi, Alexey Malyshev, Federico Mena Quintero, Skip Montaro,
Sven Neumann, Havoc Pennington, Laszlo Peter, Christian Rose, Joe Shaw,
Kevin Vandersloot, Morten Welinder, Peter Williams
Overview of Changes in GTK+ 1.3.13
==================================
* Tree view fixes. [Kristian Rietveld, Jonathan Blandford, Anders Carlsson]
* Tree view support for low-vision themes [Bill Haneman]
* Text view bug fixes. [Havoc Pennington]
* Win32 fixes and improvements. [Tor Lillqvist, Hans Breuer,
Archaeopteryx Software]
* Documentation improvements [Matthias Clasen, Havoc Pennington]
* Accelerate alpha compositing using RENDER extension if present,
and optimize the non-RENDER case a lot. [Owen Taylor]
* Add support for "optional keybindings" (action signal returns FALSE) [Owen]
* Fixed the infamous changing directory deletes filename bug
[Owen and a cast of thousands]
* Add mouse cursor hiding for text widgets [Anders Carlsson]
* Simple Hangul input module [Yusuke Tabata]
* Removed the scary startup warning.
* GdkPixbuf pixel handling fixes [Owen, Michael Hore, Jim Cape]
* Converted GtkFileSelection and GtkFontSelection to use GtKTreeView widgets
instead of the deprecated GtkCList [Owen]
* gtkhsv.h was installed by mistake, fixed that. [reported by Ross Burton]
* gdk_pixbuf_render_to_drawable() now also handles alpha pixbufs.
* Made Gtkimage draw GtkPixmap, GtkImage, GdkPixbuf insensitive, prelighted,
etc. [Havoc, Owen]
* Marked gtk_item_factory_path_from_widget() G_CONST_RETURN. [Matt Wilson]
* gtk_image_menu_item_new_from_stock() now falls back to
new_with_mnemonic, for consistency with gtk_button_new_from_stock()
[Havoc Pennington]
* GdkModifierType is now consistently used for modifier mask parameters
[Mark Patton]
* gtk_widget_set_accel_path() is now publically exported.
Other contributors: Darin Adler, Jeffrey Baker, Damon Chaplin, Brian Cameron,
Murray Cumming, James Henstridge, Jacob Berkman, Arnaud Charlet, Jeff Franks,
Jeff Garzik, Jody Goldberg, Diego Gonzalez, Melvin Hadasht, Raja Harinath,
Tim Janik, Mike Kestner, Mathieu Lacage, Alex Larsson, Ryan Lovett,
Mark McLoughlin, Sven Neumann, Padraig O'Briain, Xavier Ordoquy, Chris Phelps,
Detlef Reichl, Guillermo S. Romero, Federico Mena Quintero, Manish Singh,
HideToshi Tajima, Vitaly Tishkov, Jon Trowbridge, Sergey Vlasov.
Overview of Changes in GTK+ 1.3.12
==================================
* Fix problems with PNG saving [Michael Natterer]
* Cleanups of deprecated usages [Sebastian Wilhelmi]
* Win32 fixes [Tor Lillqvist]
* Documentation improvements [Matthias Clasen, Havoc Pennington,
Vitaly Tishkov]
* Frame buffer port fixes [Manish Singh]
* GtkTextView bug fixes [Havoc Pennington, Chris Phelps]
* Menu behavior improvements [Kristian Rietveld]
* Make focus line width configurable, focus color work on
dark themes. [Bill Haneman, Owen Taylor]
* Add state argument to gtk_paint_focus() [Bill]
* Added incremental revalidation to tree view, for better apparent speed
[Jonathan Blandford]
* Remove useless gtk_tree_view_column_cell_event() [Jonathan]
* Display XIM status in a separate window [HideToshi Tajima]
* Add GDK_DEBUG=nograbs to disable pointer, keyboard grabs [Jacob Berkman]
* Add menu of Unicode control characters to GtkEntry, GtkTextView
[Dov Grobgeld, Havoc]
* Pass key releases along to input methods [Owen]
* Many bug fixes
Other contributors: Darin Adler, Fabrice Bellet, Chris Blizzard,
Hans Breuer, Anders Carlsson, Damon Chaplin, Murray Cumming, Jeff Franks,
James Henstridge, Tim Janik, Alex Larsson, George Lebl, Kjartan, Maraas,
Sven Neumann, Seth Nickell, Padraig O'Briain, Soeren Sandmann, Manish Singh,
Matt Wilson
Overview of Changes in GTK+ 1.3.11
==================================
* Massive rework of accelerator API and implementation (Tim Janik)
* Major fixes to resizing and redrawing to eliminate hysteresis
and optimize. (Owen Taylor, Soeren Sandmann)
* Make many widgets NO_WINDOW to improve appearance and reduce
drawing overhead (Owen)
* Text view fixes (Havoc Pennington)
* Make child widgets in GtkTextView work (Havoc)
* GtkTreeModelSort fixage (Jonathan Blandford, Kristian Rietveld)
* Clean up GtkTreeView drag and drop support (Owen)
* Misc tree view fixes and improvements (Jonathan, Kristian, Anders, Matt Wilson)
* Add gtk_window_get/set_focus(), gtk_window_set_default() as public
functions (Owen, Damian Ivereigh)
* Fixes to GtkPlug/GtkSocket (Michael Meeks, Owen)
* Change button ordering in standard dialogs to correspond to
GNOME usability project proposal (Gregory Merchan)
* Add support for context sensitivity in input methods (Owen)
* Hook up gtk_im_context_set_use_preedit() (Hidetoshi Tajima)
* Fix gdk_window_scroll() and other aspects of big windows (Owen)
* Remove need for X connection for class initialization (Jacob Berkman)
* Propagate key events to parents of focused widget (Owen)
* Don't export normal GTK+ marshalers, export deprecated compat marshalers (Owen)
* Many Win32 Fixes and improvements (Hans Breuer, Tor Lillqvist)
* Bug and documentation fixing (Matthias Clasen, Anders Carlsson,
Jacob Berkman, others.)
Other Contributors:
Darin Adler, Marius Andreiana, Erwann Chenede, Murray Cumming, Janet Davis,
Daniel Egger, Daniel Elstner, Jeff Franks, Alex Larsson, George Lebl,
Sergey Kuzminov, Eric Lemings, Arkadiusz Miskiewicz, Padraig O'Briain, Sven Neumann,
Kristian Rietveld, Nicolas Setton, Manish Singh, Vitaly Tishkov, Sebastian Wilhelmi,
Michael Natterer
Overview of Changes in GTK+ 1.3.10
==================================
* GtkTextView fixes [Havoc Pennington]
* GtkTreeView fixes and improvements [Jonathan Blandford, Kristian,
Manish Singh, Joshua Pritikin, Oleg Maiboroda, James Henstridge]
* gtkdemo improvements [Kristian Rietveld]
* Drag and drop fixes to generic code and widgets
[Owen Taylor, Damian Ivereigh]
* Documentation improvement [Havoc Pennington, Matthias Clasen]
* Spelling fixes [Jacob Berkman]
* Move signals to the GtkEditable interface [Kristian]
* Further stock image improvements [Jakub Steiner]
* Support text chunks for the PGN loader, add gdk_pixbuf_get_option()
[Sven Neumann]
* Rename gdk_pixbuf_new_from_stream back to new_from_inline [Owen]
* Automatically call setlocale(), unless explicitly disabled [Owen]
* Property addition to various widgets [Michael Meeks, Owen]
* Support building with automake-1.4 [James]
* Make GtkRadioButton groups act as a single focus point [Owen]
* Move gdk_window_lookup etc. to be cross-platform [Matthias]
* Draw spinbuttons variably sized [Kristian]
* Separate GdkAtom out from X atoms for compatibility with future
multihead changes [Owen]
* Require gdk_threads_init() to be explicitly called instead
of piggybacking off of g_thread_init(). [Owen]
* Improvements to text-view/label/entry popup menus [Damian, Jacob, Owen]
* Bug fixes and cleanup [Matthias, others]
Other Contributors:
Mark McLoughin, Mikael Hermansson, Soeren Sandmann, Anders Carlsson,
Tim Janik, Murray Cumming, Hidetoshi Tajima, Padraig O'Briain,
Hans Breuer, Vitaly Tishkov, Dov Grobgeld
Overview of Changes in GTK+ 1.3.9
=================================
* Add editable text cells to GtkTreeView.
Keynav, drawing fixes in GtkTreeView [Jonathan Blandford]
* Text widget no longer always has a \n in it. [Havoc Pennington]
* Text widget bug fixes [Havoc, Dov Grobgeld, Hidetoshi Tajima]
* Allow -1 for width/height in gdk_pixbuf_render_*(). [Matthias Clasen]
* Minor fix for major resizing problems in recent releases [Owen Taylor]
* Restore ability to set _set properties to TRUE for
GtkCellRendererText, GtkTextTag [Owen]
* Cursor drawing improvements [Owen]
* Win32 fixes [Hans Breuer]
* Mark various functions as deprecated or private.
* Misc bug fixes, portability fixes, and cleanups.
Other Contributors:
Vitaly Tishkov, Christian Rose, Frank Belew, Jeff Franks, Sven Neumann,
Kristian Rietveld, Vitaly Tishkov, Joshua N. Pritikin, Matt Wilson,
James Henstridge, Detlef Reichl
Overview of Changes in GTK+ 1.3.8
=================================
* GtkTreeView and GtkTreeModel API cleanups/improvements [Jrb]
* GtkOptionMenu scrollwheel support [Alex]
* GtkModule search paths [Owen]
* Documenatation updates [Havoc,Jrb]
* Major Gdk cleanup [Owen]
* Miscellaneous other fixes/cleanups
Other Contributors:
Joshua N Pritikin, Padraig O'Briain, Jakub Steiner, Matthias Clasen,
Matt Wilson, James Henstridge
Overview of Changes in GTK+ 1.3.7
=================================
* Many Pixbuf (loader) improvements [Matthias Clasen, Soeren Sandmann]
* Added publically installed utility gdk-pixbuf-csource to generate
inlined pixbufs in C source code [Tim Janik]
* Optional movement of button children on press [Soeren, Owen Taylor]
* Interactive searching in GtkTreeView [Kristian Rietveld]
* Sorting/ordering improvements for GtkTreeView [Kris, Jonathan Blandford]
* Animation of expander motion for GtkTreeView [Anders Carlsson]
* Lots of misc GtkTreeView fixes and improvements [Jonathan]
* New/improved stock icons [Jakub Steiner]
* Code and API rework for window resizing [Havoc Pennington]
* Converted accel groups to GObject [James Henstridge]
* More property support improvements
* Add facility for "secondary" buttons in
GtkButtonBox/GtkDialog [Gregory Merchan]
* Disentangled child visability from MAPPED state [Owen]
* Plug/Socket improvements and port to the XEMBED protocol [Owen]
* Added priorities for styles in RC files,
support multiple parse contents [Owen]
* Made GdkVisual and GdkDevice GObjects [Alexander Larsson]
* Key binding improvements [Havoc]
* Added GtkWidget::event-after signal since normal event handling
is now aborted as soon as a handler returned TRUE [Tim]
* Dnd fixes and improved icon support [Owen]
* Removed GtkPacker widget
* Fixing missing paired getters/setters [Kris]
* Nuked remaining GtkArg cruft, implemented container/child properties [Tim]
* Added window grab groups [Owen]
* Many frame buffer improvements [Alex]
* Win32 fixes and improvements [Hans Breuer]
* Warning fixes [Darin Adler]
* Miscellaneous bug and API fixes [Matthias et. al]
Other Contributors:
Joshua N Pritikin, Hidetoshi Tajima, Manish Singh, ERDI Gergo, Jens Finke,
Chema Celorio, Lee Mallabone, Vitaly Tishkov, Sebastian Wilhelmi,
Nicola Girardi, Sven Neumann, Padraig O'Briain, Michael Natterer,
Suresh Chandrasekharan, Jonas Borgström, Jay Cox, Michael Meeks,
Mathias Hasselmann, Peter Williams, Thomas Broyer, Kjartan Maraas,
Joel Becker, Jeff Franks, Brian Cameron, Skip Montanaro
Overview of Changes in GTK+ 1.3.6
=================================
* Properly renders strikethrough text
* win32 fixes
* Added "scale" property to GtkTextTag and GtkCellRendererText to do
relative font scaling
* Added "format_value" signal to GtkScale to reformat value text
* framebuffer fixes
* Property support added to lots of widgets
* Many GtkTreeView new features and API/implementation fixes
* Lots of new_with_mnemonic() convenience functions
* Change GtkImageMenuItem API to be more consistent/useful
* Added lots of new stock items/icons
* Rewrote GtkRange/GtkScale/GtkScrollbar, includes support for
enabling/disabling extra scrollbar stepper arrows in gtkrc so NeXT
themes won't need broken hacks
* Convenience API for GtkRange similar to the one added to GtkSpinButton
a while back
* Make menubar/toolbar work properly with xthickness/ythickness of 1 or 0,
and move some attributes from program settings to user settings.
Allows nice 1-pixel-bevel themes.
* Moved ::focus virtual function from GtkContainer to GtkWidget
* Plenty of bug fixes
Overview of Changes in GTK+ 1.3.5
=================================
* New default theme based on Raleigh theme for 1.2.x.
* Dependency on the ATK library added as a step to
providing accessibility-enabling interfaces
* XEMBED-based GtkPlug/GtkSocket now basically works.
* Drag and drop of column headers in GtkTreeView
* GtkColorSelector work: hooks for saving and propagating palette, UI tweaks,
and API sanitation
* Key binding fixes
* Configurable padding/spacing in a lot of places
* Invisible text in GtkTextView fixed
* SHM segments now created with a mode of 0600
* Bug fixes
Overview of Changes in GTK+ 1.3.4
=================================
* Win32 fixes
* GtkTreeView improvements and fixes
* Fix glib-2.0.m4
* Miscellaneous bug fixes
Overview of Changes in GTK+ 1.3.3
=================================
[ 5600 lines of ChangeLog ]
* API cleanups
* Win32 work (Tor, Hans Breuer)
* Focus improvements (Owen)
* Frame buffer improvements (Alex)
* Work on GtkTextView (Havoc)
* Much work on GtkTreeView (Jonathan)
* Selectable labels (Havoc)
* Converted many arguments to properties (Lee Mallabone, John Margaglione)
* Add exact regions to GdkExposeEvent, propagate it. (Alex)
* Added ability to have resize grips in status bars (etc.) using
_NET_WM_MOVERESIZE protocol. (Havoc)
* Added mnemnonic mechanism to make setting underline accelerators
much easier. (Alex)
* Add per-style property mechanism to allow themes to change
geometry parameters. (Tim)
* Added global settings mechanisms for settings such as double-click
time. (Tim, Owen)
* Various support functions for new and old WM properties (Havoc, Alex)
* Add TRUE-stops-returns for boolean-returning signals (Ron Steinke)
Overview of Changes in GTK+ 1.3.2
=================================
GTK Core:
* New stock-icon and stock-item system. Use themeable pixbufs in
dialogs, buttons, etc. [Havoc]
* Theme engines reworked to use derivation and new object system. [Owen]
* Added GtkClipboard object for simple selection handling. [Owen]
* Make GtkEditable an interface, move implementation to GtkOldEditable for
compat. [Owen]
* Better handling of default directionality. [Robert]
* Use GSignal as backend for GtkSignal and other GObject stuff. [Tim]
* Move theme engines to GTypePlugin. [Owen]
GDK:
* Beginning of implementation of client parts of new window manager spec. [Owen]
* Make gdk_drawable_get_image() work with backing store. [Havoc]
Widgets:
* New text widget [Havoc]
- Adjustable tab handling.
- Ability to have scrolling side areas in new text widget for tabs/line numbers.
- Many cleanups and small improvements.
* Improvements to submenu navigation [Nils Barth/David Santiago] and
scrolling menus. [Alex]
* Simplification of progress bar API. [Havoc]
* Make GtkImage a generic image-display widget. [Havoc]
* New GtkTreeView tree widget. Model/view architecture, flexible rendering,
large datasets, etc. [Jonathan]
* New GtkMessageBox widget for message display. [Havoc]
* Allow labels to have contents set from XML-like markup language. [Havoc]
* Make dialogs derive from GtkDialog and use stock buttons. [Havoc]
Internationalization:
* Proper character set conversion for clipboard/selection. [Owen]
* New input method system via loadable modules; support on-the-spot
preedit in GtkEntry and new text widget; allow switching input methods
on the fly; include modules for XIM and demo Cyrillic-transliteration
module. [Owen]
* VIQR, Thai, and Inuktitut input methods. [Robert]
* Convert po files to UTF-8. [Robert]
gdk-pixbuf:
* Full-alpha compositing for gdk-pixbuf on drawable. [Havoc]
* Add simple saving to gdk-pixbuf. [David Welton/Havoc]
* Add improved error handling with GError to gdk-pixbuf. [Havoc]
Ports:
* Much work on Win32 Port. [Tor/Hans]
* Much work on Linux-FB Port. [Elliot/Alex]
Misc:
* Start of new gtk-demo demo program. [Owen/Jonathan]
* Bug fixes and more bug fixes.
Overview of Changes in GTK+ 1.3.1:
* GTK+ now uses the Pango library for text manipulation. All
strings in GTK+ now are in Unicode, languages written
from right-to-left, and complex-text languages are now supported.
* The gdk-pixbuf library for image loading and manipulation is
has been integrated with GTK+.
* The GTK+ object system has mostly been moved to GLib, separating
it from the GUI code. Many significant enhancements have been
made as part of this.
* A new text widget is now included. This started as a port
of the Tk text widget, and includes such features of the Tk
text widget as tags, marks, and unicode text support. It
has been enhanced to support model-view operation and the
full power of Pango.
* The GDK library has been extensively revised to support multiple
windowing systems. The only fully functional backend in 1.3.1
is the X11 backend, however, ports to Win32, Linux-framebuffer,
Nano-X, BeOS, and MacOS exist in various states of completion,
and at least some of these will be finished and integrated in
before the final GTK+-2.0 release.
* 32-bit coordinates are now supported throughout GDK and GTK+
(they are emulated where not supported by the windowing system.)
* Many minor bug fixes and enhancements. Incompatible changes
are documented in docs/Changes-2.0.txt
Overview of Changes in GTK+ 1.2.8:
* GNU Make 3.79 bug workaround
* FAQ and tutorial updates and improvements
* Miscellaneous bug fixes: CList, Calendar, rc-files, FontSelection
Overview of Changes in GTK+ 1.2.7:
* More header cleanups.
* Fixed activation bug for insensitive widgets.
* Locale fixes to RC file parsing code.
* Miscellaneous bugfixes for Item Factory, CList, CTree, X Selections,
HScale, VScale, Pixmap, Viewport, OptionMenu, Entry and Notebook.
* Upgrade to libtool 1.3.4.
Overview of Changes in GTK+ 1.2.6:
* container queue_resize fixes
* gtk[vh]scale: minor fixups
* rename idle to idle_id in testgtk to avoid conflicts with
broken libs
* More consistent naming of gtkrc files
* Added language support: ro, uk
Overview of Changes in GTK+ 1.2.5:
* more GtkCTree and GtkWindow bug fixes.
* more redraw/resize queue fixes, better expose event
discarding code.
* more miscellaneous bugs fixed
* new configure.in option --disable-rebuilds to completely disable
rebuilds of autogenerated sources.
* check for 5.002 now, to avoid failing autogeneration build rules due
to old perl versions.
* fonts (and fontsets) are cached now.
* more autogeneration make rules and dependency fixups, we should be
save with autogeneration up to make -j12 now ;)
* new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the
GtkWindow on every size change.
* major rework of window manager hints handling code, fixed a bunch of
races with the new resizing code.
* the new wm hints and resizing code is absolutely perfect and bug free now,
it only lacks testing ;)
* fixed up various rc style memory problems.
* gtk_widget_modify_style() now properly changes the style of realized widgets
and references the style passed into it. if people worked around this bug,
this will introduce a slight memory leak in their code.
The code should typically look like:
GtkRcStyle *rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* fix problems with positioning menus offscreen.
* GtkText fixes for some crashes and drawing errors.
* Better handling for unexpected window destroys in GDK and GTK+.
This should make it possible to use a GtkPlug and catch the
case where its parent socket is randomly killed.
* FAQ updates.
* FileSelection i18n patches, RadioButton fixups.
* many translation improvements.
* miscellaneous other bugs fixed.
Overview of Changes in GTK+ 1.2.4:
* DnD improvements (drags can be canceled with Esc now).
* suppressed configure event reordering in Gdk.
* rewrite of Gtk's configure event handling.
* major improvements for the object argument system (Elena Devdariani).
* major bugfixes for threading, GtkNotebook, GtkItemFactory, GtkCList and
GtkCTree.
* tutorial/FAQ updates, new file generation.txt on autogenerated sources.
* configure's --with-glib= is "officially" unsupported.
* upgrade to libtool 1.3.3.
* various buglets fixed.
Overview of Changes in GTK+ 1.2.3:
* Upgrade to libtool 1.3
* Check for dgettext (for systems with old versions of GNU Gettext)
* Many bug fixes (see ChangeLog for details)
Overview of Changes in GTK+ 1.2.2:
* Improved Dnd behaviour with Motif applications.
* Bug fixes for the Gtk selection code.
* Minor bug fixes to the Gdk Atom cache and Dnd code (with --display option).
* Bug fixes and leak plugs for the Gdk IM code.
* Added gtk_object_get() facility to retrieve object arguments easily.
The var args list expects ("arg-name", &value) pairs.
* Fixed mapping for GdkInputCondition<->GIOCondition, this should fix
problems where closed pipes were no longer signaling GDK_INPUT_READ on
systems with a native poll().
* Some cleanups to GtkLabel's memory allocation code (shouldn't leak memory
anymore).
* We don't attempt to lookup xpm color "None" anymore, this should prevent
eXodus (commercial X windows server) from popping up a color dialog every
time a transparent pixmap is created.
* Fixed bug where Gtk timeout/idle handlers would execute without the global
Gdk lock being held.
* Other minor bug fixes.
Overview of Changes in GTK+ 1.2.1:
* Many Bug fixes have been applied to the menu and accelerator code.
* GtkItemFactory can "adopt" foreign menu items now and manage their
accelerator installation. This is often required to get GtkItemFactory
like accelerator propagation between different windows with the same
menu hierarchy and for centralized parsing and saving of accelerators.
* GtkCList/GtkCTree buttons should always display correctly now.
* Miscellaneous other bug fixes.
What's New in GTK+ 1.2.0 (since 1.0.x):
* New widgets: GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree,
GtkInvisible, GtkCalendar, GtkLayout, GtkPlug, GtkSocket
* Many new features and robustness for existing widgets
* Theme support
* New DND implementation
* Internationalization of standard dialogs
* New key binding system
* Tearoff menus and menu accelerators
* Wide character support for entry and text
* Resizing code has been overhauled
* Queued redraws of partial areas
* Far better support for object arguments
* Speed optimizations
* Runtime loading of dynamic modules
* Support for GLib log domains
* Tutorial improvements
* A bug fix or two
Overview of Changes in GTK+ 1.1.16:
* Major fixes and improvements for handlebox
* A change to the way widget->requisition works. Now,
widget->requisition is always what the widget requested,
unmodified by the usize. See Changes-1.2.txt for details.
This correct various bugs with gtk_widget_set_usize().
* Fixes for XIM on X11R5 systems
* Don't allow cut-and-paste of text in password-style entries
* --enable-debug is now on by default for the development release.
(When compiling for "production", use --enable-debug=minimum)
* Handle systems where Helvetica is not present more gracefully
* Fixes for memory leaks
* CList and CTree fixes
* Bug fixes for drawing problems.
* Miscellaneous bug fixes to GtkLabel, GtkCList, GtkCTree,
GtkColorsel, Focusing, DND
* Tutorial improvements
Overview of Changes in GTK+ 1.1.15:
* Tutorial Updates
* Added --libs gthread to gtk-config
* Bug fixes
What is new in GTK+ 1.1.14:
* Additions to docs/Changes-1.2.txt
* Just warn when loading theme engine fails
* CLAMP GtkScale digits to a meaningful range
* GTK_LOCALDIR is now defined in a better fashion
* New functions (feature freeze, we know...):
gtk_menu_set_title()
gtk_toggle_button_get_active()
* Some locale fixups in gtkrc code
* Fixes to make gtk_radio_button_set_group() keep only
one radio button in the group active
* Foreign windows are now always treated as viewable; this fixes
a problem where updating didn't occur properly in GtkPlug
* DND fixes for 64 bit architectures, and for specifying operations
with modifier keys.
* Major revisions to GtkLayout: avoid having to create window
for NO_WINDOW children, adjust allocations of children as
scrolled so queued draws work, and a resize is queued instead
of allocating directly in a put() or move()
What is new in GTK+ 1.1.13:
* Dnd and selection bug fixes and memory purification.
* Widget sensitivity fixups.
* Tooltips windows are now named "gtk-tooltips" so rc file rules
can match tooltips windows. Fixed interaction of tooltips and NO_WINDOW
widgets.
* Spin buttons now update their values upon value retrieval.
* Overhaul of the resizing vs. redrawing logic to reduce redrawing needs
a lot. Gtk makes full use of the draw_area coalescing code now, which
got minorly improved as well.
* Containers map their Gdk windows after their children now to reduce
expose event generation.
* Gdk event queue fixups, this solves the double-click problems people were
recently having.
* Account for the fact that GSource's are only properly reentrant from
within dispatch(), thus we don't do Gdk event processing from within
check() or prepare() anymore.
* Rc files feature a bg_pixmap value of "<none>" now.
* Improved session management support in Gdk.
* Automatic disabling of NLS if no gettext is found should work now.
* Removed deprecated functions, docs/Changes-1.2.txt gives an overview.
* Gtk+ development now requires GNU autoconf 2.13, GNU automake 1.4
and GNU libtool 1.2d.
* More bug fixes all over the place.
What is new in GTK+ 1.1.12:
* Korean translation added
* Fixed memory leaks
* A few other bug fixes
What is new in GTK+ 1.1.11:
* Dutch, Japanese, Swedish, Polish, and Norwegian translations
* Removed deprecated _interp variants: gtk_container_foreach_interp,
gtk_idle_add_interp, gtk_timeout_add_interp, gtk_signal_connect_interp
* Lots of cast corrections
* Many fixes
What is new in GTK+ 1.1.9:
* Check for broken glibc 2.0 mb functions and avoid them
* Label and Entry display fixes
* Move main thread back to GDK, for locking when translating events
* Bug fixes
What is new in GTK+ 1.1.8:
* Added support for gettext and the localization of the standard
dialogs.
* Added line-wrapping for the label, and JUSTIFY_FILL
* Support reordering via drag and drop in CList and CTree.
* Replaced GtkDrawWindow widget with a GTK_USER_DRAW flag
* Extended gtkpaned API to support minimum sizes and proportional
resizing.
* Changed the handling of shared memory segments so as to
remove the need for GTK+ to set up signal handlers.
* Re-implemented event loop in terms of the event loop
that has been added to GLib 1.1.8
* Added 'grab_focus' signal to allow keyboard accelerators
for entries.
* Load locale specific RC files if present.
* Bug fixes.
What is new in GTK+ 1.1.7:
* Fixed memory mis-allocation in default files code
* Various event handling fixes
* Wide character support for entry and text
* Destroy widgets _after_ propagating unrealize signals through
widget hierarchy
* Only build XIM-support if available
* Tutorial and examples updates
* Added gtk_drag_source_unset()
What is new in GTK+ 1.1.6:
* The signal system now features emission hooks with special semantics,
refer to the ChangeLog for this.
* Minor? speedups and memory reductions to the emission handling of the
signal system.
* _interp() function variants are deprecated now. the corresponding *_full()
variants are provided for a long time now.
* Dnd abort timeout increased to 10 minutes.
* GtkScrolledWindow inherits from GtkBin now.
* GTK_POLICY_NEVER is implemented for scrolled windows now.
* Lots of API clean ups.
* Incremental freezing abilities.
* Integrated widgets from the GNOME tree: GtkLayout, GtkPlug and GtkSocket.
* New window functions for transient relationship, default size, and
geometry hints
* Default rc files are now read in (<sysconfdir/etc/gtkrc and ~/.gtkrc)
GTK_RC_FILES environment variable and functions are provided to configure
this behavior
* Read doc/Changes-1.2.txt to properly adapt your code.
* Bug Fixes.
What is new in GTK+ 1.1.5:
* Theme integration
* Widget style modification is now handled through GtkRcStyles
* GtkPixmaps now grey out pixmaps when insensitive
* Notebook enhancements
* Shadow configurability for menubars and handleboxes
* DND enhancements
* gtkfilesel now supports automounters better
* Implementation of expose compression
* Queued redraws of partial areas
* Scrolledwindow (+Viewport) source incompatibilities, children that are added
to a scrolled window don't get an automatic viewport anymore. a convenience
function gtk_scrolled_window_add_with_viewport() is supplied for this task
* Deprecated functions will now issue a message, informing the programmer about
the use of this function. These functions will get removed in future versions
* Non-functional functions got removed entirely
* gtk_widget_new() and gtk_object_new() will now auto-construct new objects.
A new function gtk_object_default_construct() is provided now which should
be called after every gtk_type_new() to perform the auto-construction
* Improved argument support of several widgets
* Bug Fixes
What is new in GTK+ 1.1.3:
* GtkCList/GtkCTree now have the ability to:
- hide/show individual columns
- disable/enable column resizing
- set min and max for column widths
- set expander style of the ctree
- set/get row and cell styles
- set spacing between tree expander and cell contents in ctree
- toggle auto_resize for columns
* Must enhanced DND support, removed old DND code
* Idle functions are now implemented via GHook, giving a slight speed
improvement
* An environment variable GTK_MODULES which takes a colon separated
list of module names GTK+ will now automatically load at gtk_init() startup
* GtkFontSel now has support for an extra 'base' filter
* New function gdk_window_set_root_origin to get the real geometry taking
into account window manager offsets
* New function gtk_text_set_line_wrap to toggle line wrapping
* New function gtk_widget_add_events which safely adds additional
events to a widget's event mask
* New function gdk_event_get_time to get the timestamp from a generic
event
* New widget GtkCalendar
* New widget GtkInvisible - InputOnly offscreen windows used for reliable
pointer grabs and selection handling in DND code
* New functions gtk_object_remove_no_notify[_by_id] to remove a certain
data portion without invocation of its destroy notifier
* gtk_spin_button_construct is now deprecated, use gtk_spin_button_configure
instead
* gtk_clist_set_border is now deprecated, use gtk_clist_set_shadow_type
instead
* Removed functions gtk_object_set_data_destroy[_by_id]
* Documentation additions/updates
* HTML and plain text files are now included in the distribution
* Bug fixes, typeness corrections, and general fixups
What is new in GTK+ 1.1.2:
* Gtk+ is now featuring runtime loading of dynamic modules via the
--gtk-modules= command line switch. such modules have to export a
G_MODULE_EXPORT void gtk_module_init (gint *argc, gchar ***argv);
function which will be invoked to initialize the module. since such
modules may create new widget types, they are always resident.
* The tutorial has been updated again.
* Changes to menus including tearoff menus and accelerators.
* Better support for modal dialogs.
* Removed CAN_FOCUS by default from scrollbars and button children of toolbar.
* More improvements and fixes for GtkCList and GtkCTree (i.e. row sorting).
* GtkCTree rows can be unselectable now.
* The GtkCTree API has undergone major renames (see ChangeLog entry from Lars
Hamann on Tue Aug 18 00:29:13 1998).
* A bunch of varargs functions changed to get va_lists working on systems that
implement va_lists as arrays.
* Improvements to the gdkrgb code.
* Improvements to Gdk color handling so we greatly reduce server traffic and
don't leak colors anymore.
* Improved internal widget tree iterators (the GtkContainer::foreach signal
vanished because of this).
* Option menus can have the keyboard focus now.
* More fixups to the text widget.
* GtkFileSelection should behave much more nicely in combination with AFS now.
* Support for label underlining.
* Support for GLib 1.1.3 log domains.
* Documentation improvements.
* Configuration fixes on various platforms.
* Miscellaneous fixes to XInput support.
* Build with shared library dependencies on Linux
* Fix for a major bug in the type systems memory allocation code that could
cause random crashes.
* Libtool update to version 1.2b.
* Lots of bugfixes and cleanups again ;)
What is new in GTK+ 1.1.1:
* Tutorial updates and additions.
* Key binding support for GtkListItems and GtkList.
* Extended selection mode and autoscrolling for GtkLists.
* A GtkCtree now operates on GtkCTreeNode* structures rather than GList*.
* GtkCTreeNodes can now be created from GNode trees.
* Bug fixes for GtkNotebook, GtkCList, GtkCombo and GdkWindow reparentation.
What is new in GTK+ 1.1.0:
* New widget GtkFontSelector.
* New featureful progress bar.
* New container widget GtkPacker.
* New object GtkItemFactory, GtkMenuFactory is deprecated.
* New key binding system, configurable via rcfiles, similar to styles.
* New widget GtkCTree with drag selections and keyboard movement and
and horizontal scrolling. Features also implemented for GtkCList.
* Significant speedups to widget creation and destruction through caching
colormap and visual queries to the XServer.
* Speedups for type creation and especially gtk_type_is_a() checks.
* Speedups in signal lookup, creation and emissions and connection handling.
* Minor speedups with object data allocation and destruction.
* Additions to the signal handling API (e.g. *_emitv).
* Support for rc-file reparsing.
* Resizing logic is now implemented on container widget basis, rather than
for toplevel GtkWindows only.
* Buttons support relief styles now.
* Some widgets are now allocated through memchunks to behave more memory wise.
* Newly included file gtkfeatures.h which defines compatibility macros to
test for certain API features upon program compilation.
* Child arguments support for container widgets.
* Far better support for object arguments, revamp of the underlying
mechanism for speed and reusability. Child/object arguments don't
need to be preceded by the "GtkType::" portion anymore.
* Removed GtkAcceleratorTable in favour of GtkAccelGroup, accelerator display
is now performed by a new widget GtkAccelLabel.
* Overhaul of the resizing code. Resizing behaviour can now be specified
on GtkContainer basis, so the underlying algorithm isn't only available
for GtkWindows.
* GtkTables are now fully resizable.
* The GtkType system now supports an additional base class initialization
function.
* GtkStyles and key bindings can now be looked up depending on the base
types of a widget, through a new keyword `class' in rc files.
* GtkButton derives from GtkBin (finally).
* More descriptive error messages on rc parsing.
* Runtime information is available to query enum/flag definition values.
* Upgrade to libtool-1.2
* Legions of bug fixes, memory leaks, segfaults, of-by-something errors...
including those that already went into the 1.0.x branch.
* A big bunch of features and cosmetic fixups that just got lost in
the masses of changesonfigure problem when cross-compiling

File diff suppressed because it is too large Load Diff

72
README.commits Normal file
View File

@@ -0,0 +1,72 @@
GTK+ is part of the GNOME git repository. At the current time, any
person with write access to the GNOME repository, can make changes to
GTK+. This is a good thing, in that it encourages many people to work
on GTK+, and progress can be made quickly. However, GTK+ is a fairly
large and complicated package that many other things depend on, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK+ that has been built up over the years, we'd like to ask
people committing to GTK+ to follow a few rules:
0) Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've
been working on GTK+ for a while it probably isn't necessary
to ask. But when in doubt, ask. Even if your change is correct,
somebody may know a better way to do things.
If you are making changes to GTK+, you should be subscribed
to gtk-devel-list@gnome.org. (Subscription address:
gtk-devel-list-request@gnome.org.) This is a good place to ask
about intended changes.
#gtk+ on GIMPNet (irc.gimp.org, irc.us.gimp.org, irc.eu.gimp.org, ...)
is also a good place to find GTK+ developers to discuss changes with,
however, email to gtk-devel-list is the most certain and preferred
method.
1) Ask _first_.
2) With git, we no longer maintain a ChangeLog file, but you are expected
to produce a meaningful commit message. Changes without a sufficient
commit message will be reverted. See below for the expected format
of commit messages.
Notes:
* When developing larger features or complicated bug fixes, it is
advisable to work in a branch in your own cloned GTK+ repository.
You may even consider making your repository publically available
so that others can easily test and review your changes.
* The expected format for git commit messages is as follows:
=== begin example commit ===
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too brief.
=== end example commit ===
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Normally, for patches
sent to a mailing list it's copied from there.
- When committing code on behalf of others use the --author option, e.g.
git commit -a --author "Joe Coder <joe@coder.org>" and --signoff.
Owen Taylor
13 Aug 1998
17 Apr 2001
Matthias Clasen
31 Mar 2009

358
README.in Normal file
View File

@@ -0,0 +1,358 @@
General Information
===================
This is GTK+ version @GTK_VERSION@. GTK+ is a multi-platform toolkit for
creating graphical user interfaces. Offering a complete set of widgets,
GTK+ is suitable for projects ranging from small one-off projects to
complete application suites.
GTK+ is free software and part of the GNU Project. However, the
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without any
license fees or royalties.
The official download locations are:
ftp://ftp.gtk.org/pub/gtk
http://download.gnome.org/sources/gtk+
The official web site is:
http://www.gtk.org/
Information about mailing lists can be found at
http://www.gtk.org/mailing-lists.php
Installation
============
See the file 'INSTALL'
How to report bugs
==================
Bugs should be reported to the GNOME bug tracking system.
(http://bugzilla.gnome.org, product glib.) You will need
to create an account for yourself.
In the bug report please include:
* Information about your system. For instance:
- What operating system and version
- For Linux, what version of the C library
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with one of the test programs that are built
in the tests/ subdirectory, that will be most convenient. Otherwise,
please include a short test program that exhibits the behavior.
As a last resort, you can also provide a pointer to a larger piece
of software that can be downloaded.
* If the bug was a crash, the exact text that was printed out
when the crash occurred.
* Further information such as stack traces may be useful, but
is not necessary.
Patches
=======
Patches should also be submitted to bugzilla.gnome.org. If the
patch fixes an existing bug, add the patch as an attachment
to that bug report.
Otherwise, enter a new bug report that describes the patch,
and attach the patch to that bug report.
Patches should be in unified diff form. (The -up option to GNU diff)
Even better are git-formatted patches. (Use git format-patch)
Release notes for 3.20
======================
* The way theming works in GTK+ has been reworked fundamentally, to
implement many more CSS features and make themes more expressive.
As a result, custom CSS that is shipped with applications and third-
party themes will need adjustments. Widgets now use element names much
more than style classes; type names are no longer used in style matching.
Every widget now documents the element names it has and the style classes
it uses. The GTK+ inspector can also help with finding this information.
* GTK+ now uses internal subobjects (also known as gadgets) for allocating
and drawing widget parts. Applications that subclass GTK+ widgets may see
warnings if they override the size_allocate vfunc and don't chain up.
The proper way to subclass is to chain up in size_allocate. If you do not
want to do that for some reason, you have to override the draw vfunc as
well.
* Several fixes for window sizing and window placement with client-side
decorations may affect applications that are saving and restoring window
sizes. The recommended best practice for this which is known to work with
client-side and server-side decorations and with older and newer versions
of GTK+ is to use gtk_window_get_size() to save window sizes and
gtk_window_set_default_size() to restore it.
See https://wiki.gnome.org/HowDoI/SaveWindowState for a detailed example.
* GtkDrawingArea used to implicitly render the theme background before
calling the ::draw handler. This is no longer the case. If you rely
on having a theme-provided background, call gtk_render_background()
from your ::draw handler.
* The GtkFileChooser interface prerequisite changed from GtkWidget
to GObject, allowing non-widget implementations of this interface.
This is a minor change in ABI, as applications are no longer guaranteed
that a GtkFileChooser also supports all GtkWidget methods. However, all
previously existing implementations still derive from GtkWidget, so no
existing code should break.
* The way in which GtkLevelBar determines the offset to apply was a bit
inconsistent in the past; this has been fixed. Applications that are using
custom offsets should double-check that their levels look as expected.
Release notes for 3.18
======================
* The GtkListBox model support that was introduced in 3.16 has been
changed to no longer call gtk_widget_show_all on rows created by
the create_widget_func. You need to manage the visibility of child
widgets yourself in your create_widget_func.
* The alpha component of foreground colors that are applied to
GtkCellRendererText is no longer ignored. If you don't want your
text to be translucent, use opaque colors.
Release notes for 3.16
======================
* GTK+ now includes an OpenGL rendering widget. To support GL on various
platforms, GTK+ uses libepoxy.
* GTK+ no longer uses gtk-update-icon-cache during its build. The
--enable-gtk2-dependency configure option has been removed.
* The introspection annotations for the x and y parameters of
GtkMenuPositionFunc have been corrected from 'out' to 'inout'.
If you are using such a function from language-bindings, this
may require adjustments.
* The lookup order for actions that are activated via keyboard
accelerators has been changed to start at the currently focused
widget. If your application is making use fo nested action groups
via gtk_widget_insert_action_group, you may want to check that
this change does not upset your accelerators.
* The GtkScrollable interface has gained a new vfunc, get_border,
that is used to position overshoot and undershoot indications that
are drawn over the content by GtkScrolledWindow. Unless your scrollable
has non-scrolling parts similar to treeview headers, there is no need
to implement this vfunc.
* The GtkSearchEntry widget has gained a number of new signals that
are emitted when certain key sequences are seen. In particular, it
now handles the Escape key and emits ::stop-search. Applications that
expect to handle Escape themselves will need to be updated.
Release notes for 3.14
======================
* A new state, GTK_STATE_FLAG_CHECKED, has been added for checked states
of radio and check buttons and menuitems. Applications that are using
GTK+ styles without widgets will need adjustments.
* Adwaita is now the default theme on all platforms.
* The icon theme code has become a little pickier about sizes and is not
automatically scaling icons beyond the limits defined in the icon theme
unless explicitly asked to do so with GTK_ICON_LOOKUP_FORCE_SIZE.
* GTK+ now includes an interactive debugger which can be activated with
the keyboard shortcuts Ctrl-Shift-d or Ctrl-Shift-i. If these shortcuts
interfere with application keybindings, they can be disabled with the
setting org.gtk.Settings.Debug.enable-inspector-keybinding.
* Most widgets have been ported to use the new gesture framework internally
for event handling. Traditional event handlers in derived widgets are still
being called.
* Using GTK+ under X11 without the X Render extension has been observed
to be problematic. This combination is using code paths in cairo and
graphics drivers which are rarely tested and likely buggy.
* GtkTextView is now using a pixel-cache internally, and is drawing
a background underneath the text. This can cause problems for applications
which assumed that they could draw things below and above the text
by chaining up in the ::draw implementation of their GtkTextView subclass.
As a short-term workaround, you can make the application apply a
custom theme to the text view with a transparent background. For
a proper fix, use the new ::draw_layer vfunc.
Release notes for 3.12
======================
* GtkWidget had a hack where if opacity is 0.999 we set up an opacity
group when rendering the widget. This is no longer needed in 3.10,
and GtkStack doesn't use it anymore. It has been removed in 3.12.
GdStack is using it, so applications should be ported from GdStack
to GtkStack in 3.12.
* GtkHeaderBar in 3.10 was not ordering its pack-end children in
the right way. This has been fixed in 3.12. Applications which
pack multiple widgets at the end of a headerbar will have to
be updated.
* gtk_text_view_add_child_in_window has changed behaviour a bit.
It now always positions the child in buffer coordinates, where
it used to inconsistently scroll with the buffer but then go
reposition to a window-relative position on redraw.
* A number of container widgets have been made more compliant with
the uniform CSS rendering model by making them render backgrounds
and borders. This may require some adjustments in applications that
were making assumptions about containers never rendering backgrounds.
Release notes for 3.10
======================
* GDK has been changed to allow only a single screen per display.
Only the X11 backend had multiple screens before, and multi-screen
setups (not multi-monitor!) are very rare nowadays. If you really
need multiple X screens, open them as separate displays.
* The behavior of GtkBox::expand has been changed to never propagate
up. Previously, this was happening inconsistently. If you want the
expand to propagate, use the GtkWidget h/v expand properties.
If you experience sizing problems with widgets in ported code,
carefully check the expand and fill flags of your boxes.
* GtkBin no longer provides default implementations for
get_height_for_width, subclasses now have to provide their own
implementation if they need height-for-width functionality.
* Widget state propagation has been changed. Historically, all of
active, prelight, selected, insensitive, inconsistent and backdrop
have been propagated to children. This has now been restricted
to just the insensitive and backdrop states. This mostly affects
theming.
* The way widget drawing happens has changed. Earlier versions handled
one expose event per GdkWindow, each with a separate cairo_t. Now we
only handle the expose event on the toplevel and reuse the same
cairo_t (with the right translation and clipping) for the entire
widget hierarchy, recursing down via the GtkWidget::draw signal.
Having all rendering in the same call tree allows effects like
opacity and offscreen rendering of entire widget sub-hierarchies.
Generally this should not require any changes in widgets, but
code looking at e.g. the current expose event may see different
behavior than before.
* The Gtk+ scrolling implementation has changed. gdk_window_scroll()
and gdk_window_move_region() no longer copy the region on the
window, but rather invalidate the entire scrolled region. This is
slightly slower, but allowed us to implement a offscreen surface
scrolling method which better fits modern hardware. Most scrolling
widgets in Gtk+ have been converted to use this model for scrolling,
but external widgets implementing scrolling using GdkWindow may see
some slowdown.
Release notes for 3.8
=====================
* GtkIconInfo has changed from being a boxed type to a GObject. This
is technically an ABI change, but basically all existing code
will keep working if its used as a boxed type, and its not
possible to instantiate GtkIconInfos outside Gtk, so this is not
expected to be a big problem.
Release notes for 3.6
=====================
* The accessibility bridge code that exports accessible objects
on the bus is now used by default; atk-bridge has been converted
into a library that GTK+ links against. To void the linking,
pass --without-atk-bridge when configuring GTK+.
* GDK threading support has been deprecated. It is recommended to
use g_idle_add(), g_main_context_invoke() and similar funtions
to make all GTK+ calls from the main thread.
* GTK+ now follows the XDG Base Directory specification for
user configuration and data files. In detail,
* $XDG_CONFIG_HOME/gtk-3.0/custom-papers is the new location
for $HOME/.gtk-custom-papers
* $XDG_CONFIG_HOME/gtk-3.0/bookmarks is the new location
for $HOME/.gtk-bookmarks
* $XDG_DATA_HOME/themes is preferred over $HOME/.themes
* $XDG_DATA_HOME/icons is preferred over $HOME/.icons.
Existing files from the old location will still be read
if the new location does not exist.
* $HOME/.gtk-3.0 is no longer in the default module load path.
If you want to load modules from there, add it to the GTK_PATH
environment variable.
Release notes for 3.4
=====================
* Scroll events have been separated from button events, and smooth
scrolling has been added with a separate event mask. Widgets now
need to have either GDK_SCROLL_MASK or GDK_SMOOTH_SCROLL_MASK in
their event mask to receive scroll events. In addition, the
GdkScrollDirection enumeration has gained a new member,
GDK_SCROLL_SMOOTH, so switch statements will have to be amended
to cover this case.
* GTK+ now uses <Primary> instead of <Control> in keyboard accelerators,
for improved cross-platform handling. This should not affect
applications, unless they parse or create these accelerator
manually.
* The tacit assumption that the Alt key corresponds to the MOD1
modifier under X11 is now a hard requirement.
* The beagle search backend for the file chooser has been dropped.
Tracker is the only supported search backend on Linux now.
* GtkNotebook has been changed to destroy its action widgets when
it gets destroyed itself. If your application is using action
widgets in notebooks, you may have to adjust your code to take
this into account.
* GtkApplication no longer uses the gtk mainloop wrappers, so
it is no longer possible to use gtk_main_quit() to stop it.
* The -uninstalled variants of the pkg-config files have been dropped.
* Excessive dependencies have been culled from Requires: lines
in .pc files. Dependent modules may have to declare dependencies
that there were getting 'for free' in the past.
Release notes for 3.2
=====================
* The accessible implementations for GTK+ widgets have been integrated
into libgtk itself, and the gail module does not exist anymore. This
change should not affect applications very much.
Release notes for 3.0
=====================
* GTK+ 3 is a major new version of GTK+, which is parallel installable
with GTK+ 2.x. For information about porting applications from GTK+ 2.x
to GTK+ 3, see the file:
docs/reference/gtk/html/migrating.html
Or online at:
http://library.gnome.org/devel/gtk/3.0/migrating.html
* Note that the library sonames in this release have been changed from
libgtk-3.0 and libgdk-3.0 to libgtk-3 and libgdk-3, to prevent the
library versions from going backwards, compared to the 2.90/91/99
releases. Applications will have to be recompiled.

159
README.md
View File

@@ -1,159 +0,0 @@
GTK — The GTK toolkit
=====================
[![Build Status](https://gitlab.gnome.org/GNOME/gtk/badges/master/build.svg)](https://gitlab.gnome.org/GNOME/gtk/pipelines)
General information
-------------------
GTK is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK is suitable for projects ranging
from small one-off projects to complete application suites.
GTK is free software and part of the GNU Project. However, the
licensing terms for GTK, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without any
license fees or royalties.
The official download location
- https://download.gnome.org/sources/gtk+
The official web site
- https://www.gtk.org
The official developers blog
- https://blog.gtk.org
Information about mailing lists can be found at
- http://www.gtk.org/mailing-lists.php
Nightly documentation can be found at
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk/
Building and installing
-----------------------
In order to build GTK you will need:
- [a C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
- [Python 3](https://www.python.org/)
- [Meson](http://mesonbuild.com)
- [Ninja](https://ninja-build.org)
You will also need various dependencies, based on the platform you are
building for:
- [GLib](https://download.gnome.org/sources/glib)
- [GdkPixbuf](https://download.gnome.org/sources/gdk-pixbuf)
- [GObject-Introspection](https://download.gnome.org/sources/gobject-introspection)
- [Cairo](https://www.cairographics.org)
- [Pango](https://download.gnome.org/sources/pango)
- [Epoxy](https://github.com/anholt/libepoxy)
- [Graphene](https://github.com/ebassi/graphene)
- [ATK](https://download.gnome.org/sources/atk)
- [Xkb-common](https://github.com/xkbcommon/libxkbcommon)
If you are building the X11 backend, you will also need:
- Xlib, and the following X extensions:
- xrandr
- xrender
- xi
- xext
- xfixes
- xcursor
- xdamage
- xcomposite
- [atk-bridge-2.0](https://download.gnome.org/sources/at-spi2-atk)
If you are building the Wayland backend, you will also need:
- Wayland-client
- Wayland-protocols
- Wayland-cursor
- Wayland-EGL
Once you have all the necessary dependencies, you can build GTK by using
Meson:
```sh
$ meson _build .
$ cd _build
$ ninja
```
You can run the test suite using:
```sh
$ meson test
```
And, finally, you can install GTK using:
```
$ sudo ninja install
```
Complete information about installing GTK+ and related libraries
can be found in the file:
```
docs/reference/gtk/html/gtk-building.html
```
Or [online](https://developer.gnome.org/gtk4/stable/gtk-building.html)
How to report bugs
------------------
Bugs should be reported on the [issues page](https://gitlab.gnome.org/GNOME/gtk/issues/new).
In the bug report please include:
* Information about your system. For instance:
- which version of GTK you are using
- what operating system and version
- for Linux, which distribution
- if you built GTK, the list of options used to configure the build
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with one of the demo applications that are
built in the demos/ subdirectory, on one of the test programs that
are built in the tests/ subdirectory, that will be most convenient.
Otherwise, please include a short test program that exhibits the
behavior. As a last resort, you can also provide a pointer to a
larger piece of software that can be downloaded.
* If the bug was a crash, the exact text that was printed out
when the crash occurred.
* Further information such as stack traces may be useful, but
is not necessary.
Release notes
-------------
The release notes for GTK are part of the migration guide in the API
reference. See:
- [3.x release notes](https://developer.gnome.org/gtk3/unstable/gtk-migrating-2-to-3.html)
- [4.x release notes](https://developer.gnome.org/gtk4/unstable/gtk-migrating-3-to-4.html)
Licensing terms
---------------
GTK is released under the terms of the GNU Lesser General Public License,
version 2.1 or, at your option, any later version, as published by the Free
Software Foundation.
Please, see the `COPYING` file for further information.

206
README.win32 Normal file
View File

@@ -0,0 +1,206 @@
The Win32 backend in GTK+ is not as stable or correct as the X11 one.
For prebuilt runtime and developer packages see
http://ftp.gnome.org/pub/gnome/binaries/win32/
Building GTK+ on Win32
======================
First you obviously need developer packages for the compile-time
dependencies: GDK-Pixbuf, Pango, atk, glib, gettext-runtime, libiconv at least.
See http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .
For people compiling GTK+ with Visual C++ 2005 or later, it is
recommended that the same compiler is used for at least GDK-Pixbuf,
Pango, atk and glib so that crashes and errors caused by different CRTs
can be avoided. The VS 2008 project files and/or VS Makefiles are
either already available or will be available in the next stable release.
Unfortunately compiling with Microsoft's compilers versions 2003 or earlier
is not supported as compiling the latest stable GLib (which *is* required for
building this GTK+ release) requires features from newer compilers
and/or Platform SDKs
After installing the dependencies, there are two ways to build GTK+
for win32.
1) GNU tools, ./configure && make install
-----------------------------------------
This requires you have mingw and MSYS.
Use the configure script, and the resulting Makefiles (which use
libtool and gcc to do the compilation). I use this myself, but it can
be hard to setup correctly.
The full script I run to build GTK+ 2.16 unpacked from a source
distribution is as below. This is from bulding GTK+ 2.16.5. I don't
use any script like this to build the development branch, as I don't
distribute any binaries from development branches.
# This is a shell script that calls functions and scripts from
# tml@iki.fi's personal work env<6E>ronment. It is not expected to be
# usable unmodified by others, and is included only for reference.
MOD=gtk+
VER=2.16.5
REV=1
ARCH=win32
THIS=${MOD}_${VER}-${REV}_${ARCH}
RUNZIP=${MOD}_${VER}-${REV}_${ARCH}.zip
DEVZIP=${MOD}-dev_${VER}-${REV}_${ARCH}.zip
HEX=`echo $THIS | md5sum | cut -d' ' -f1`
TARGET=c:/devel/target/$HEX
usedev
usemsvs6
(
set -x
DEPS=`latest --arch=${ARCH} glib atk cairo pango libpng zlib libtiff jpeg`
PROXY_LIBINTL=`latest --arch=${ARCH} proxy-libintl`
PKG_CONFIG_PATH=
for D in $DEPS; do
PATH=/devel/dist/${ARCH}/$D/bin:$PATH
[ -d /devel/dist/${ARCH}/$D/lib/pkgconfig ] && PKG_CONFIG_PATH=/devel/dist/${ARCH}/$D/lib/pkgconfig:$PKG_CONFIG_PATH
done
LIBPNG=`latest --arch=${ARCH} libpng`
ZLIB=`latest --arch=${ARCH} zlib`
LIBTIFF=`latest --arch=${ARCH} libtiff`
JPEG=`latest --arch=${ARCH} jpeg`
patch -p0 <<'EOF'
EOF
lt_cv_deplibs_check_method='pass_all' \
CC='gcc -mtune=pentium3 -mthreads' \
CPPFLAGS="-I/devel/dist/${ARCH}/${LIBPNG}/include \
-I/devel/dist/${ARCH}/${ZLIB}/include \
-I/devel/dist/${ARCH}/${LIBTIFF}/include \
-I/devel/dist/${ARCH}/${JPEG}/include \
-I/devel/dist/${ARCH}/${PROXY_LIBINTL}/include" \
LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \
-L/devel/dist/${ARCH}/${ZLIB}/lib \
-L/devel/dist/${ARCH}/${LIBTIFF}/lib \
-L/devel/dist/${ARCH}/${JPEG}/lib \
-L/devel/dist/${ARCH}/${PROXY_LIBINTL}/lib -Wl,--exclude-libs=libintl.a \
-Wl,--enable-auto-image-base" \
LIBS=-lintl \
CFLAGS=-O2 \
./configure \
--enable-win32-backend \
--disable-gdiplus \
--with-included-immodules \
--without-libjasper \
--enable-debug=yes \
--enable-explicit-deps=no \
--disable-gtk-doc \
--disable-static \
--prefix=$TARGET &&
libtoolcacheize &&
rm gtk/gtk.def &&
(PATH="$PWD/gdk-pixbuf/.libs:/devel/target/$HEX/bin:$PATH" make -j3 install || (rm .libtool-cache* && PATH="/devel/target/$HEX/bin:$PATH" make -j3 install)) &&
PATH="/devel/target/$HEX/bin:$PATH" gdk-pixbuf-query-loaders >/devel/target/$HEX/etc/gtk-2.0/gdk-pixbuf.loaders &&
grep -v -E 'Automatically generated|Created by|LoaderDir =' <$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp &&
mv $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
grep -v -E 'Automatically generated|Created by|ModulesPath =' <$TARGET/etc/gtk-2.0/gtk.immodules >$TARGET/etc/gtk-2.0/gtk.immodules.temp &&
mv $TARGET/etc/gtk-2.0/gtk.immodules.temp $TARGET/etc/gtk-2.0/gtk.immodules &&
./gtk-zip.sh &&
mv /tmp/${MOD}-${VER}.zip /tmp/$RUNZIP &&
mv /tmp/${MOD}-dev-${VER}.zip /tmp/$DEVZIP
) 2>&1 | tee /devel/src/tml/packaging/$THIS.log
(cd /devel && zip /tmp/$DEVZIP src/tml/packaging/$THIS.{sh,log}) &&
manifestify /tmp/$RUNZIP /tmp/$DEVZIP
You should not just copy the above blindly. There are some things in
the script that are very specific to *my* build setup on *my* current
machine. For instance the "latest" command, the "usedev" and
"usemsvs6" shell functions, the /devel/dist folder. The above script
is really just meant for reference, to give an idea. You really need
to understand what things like PKG_CONFIG_PATH are and set them up
properly after installing the dependencies before building GTK+.
As you see above, after running configure, one can just say "make
install", like on Unix. A post-build fix is needed, running
gdk-pixbuf-query-loaders once more to get a correct gdk-pixbuf.loaders
file.
For a 64-bit build you need to remove the gtk/gtk.def file and let it
be regenerated by the makefilery. This is because the 64-bit GTK dll
has a slightly different list of exported function names. This is on
purpose and not a bug. The API is the same at the source level, and
the same #defines of some function names to actually have a _utf8
suffix is used (just to keep the header simpler). But the
corresponding non-suffixed function to maintain ABI stability are not
needed in the 64-bit case (because there are no older EXEs around that
would require such for ABI stability).
2) Microsoft's tools
--------------------
Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in gdk and gtk. Be prepared to manually edit various
makefile.msc files, and the makefile snippets in build/win32.
There are also VS 2008/2010 solution and project files to build GTK+, which
are maintained by Chun-wei Fan. They should build GTK+ out of the box,
provided that the afore-mentioned dependencies are installed. They will
build GDK with the Win32 backend, GTK+ itself (with GAIL/a11y built in),
the GAIL-Util library and the gtk-demo program.
Please refer to the following GNOME Live! page for a more detailed ouline
on the process of building the GTK+ stack and its dependencies with Visual
C++:
https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
Alternative 1 also generates Microsoft import libraries (.lib), if you
have lib.exe available. It might also work for cross-compilation from
Unix.
I (Tor) use method 1 myself. Hans Breuer has been taking care of the MSVC
makefiles. At times, we disagree a bit about various issues, and for
instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
Using GTK+ on Win32
===================
To use GTK+ on Win32, you also need either one of the above mentioned
compilers. Other compilers might work, but don't count on it. Look for
prebuilt developer packages (DLLs, import libraries, headers) on the
above website.
Multi-threaded use of GTK+ on Win32
===================================
Multi-threaded GTK+ programs might work on Windows in special simple
cases, but not in general. Sorry. If you have all GTK+ and GDK calls
in the same thread, it might work. Otherwise, probably not at
all. Possible ways to fix this are being investigated.
Wintab
======
The tablet support uses the Wintab API. The Wintab development kit is
no longer required. The wintab.h header file is bundled with GTK+
sources. Unfortunately it seems that only Wacom tablets come with
support for the Wintab API nowadays.
--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>
--Updated by Fan, Chun-wei <fanc999@yahoo.com.tw>

79
acinclude.m4 Normal file
View File

@@ -0,0 +1,79 @@
# autoconf 2.13 / 2.50 compatibility macro
# GLIB_AC_DIVERT_BEFORE_HELP(STUFF)
# ---------------------------------
# Put STUFF early enough so that they are available for $ac_help expansion.
# Handle both classic (<= v2.13) and modern autoconf
AC_DEFUN([GLIB_AC_DIVERT_BEFORE_HELP],
[ifdef([m4_divert_text], [m4_divert_text([NOTICE],[$1])],
[ifdef([AC_DIVERT], [AC_DIVERT([NOTICE],[$1])],
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
$1
AC_DIVERT_POP()])])])
# GTK_ADD_LIB(VAR,LIBNAME)
# ---------------------------------
# Helper macro to add a -lBlah to a variable, avoiding repeats
# Note that this needs to be quoted when used in an enclosing macro
AC_DEFUN([GTK_ADD_LIB],
[ case "$$1 " in
*-l$2[[\ \ ]]*) ;;
*) $1="-l$2 $$1" ;;
esac
])
# Checks the location of the XML Catalog
# Usage:
# JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# Defines XMLCATALOG and XML_CATALOG_FILE substitutions
AC_DEFUN([JH_PATH_XML_CATALOG],
[
# check for the presence of the XML catalog
AC_ARG_WITH([xml-catalog],
AC_HELP_STRING([--with-xml-catalog=CATALOG],
[path to xml catalog to use]),,
[with_xml_catalog=/etc/xml/catalog])
jh_found_xmlcatalog=true
XML_CATALOG_FILE="$with_xml_catalog"
AC_SUBST([XML_CATALOG_FILE])
AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
if test -f "$XML_CATALOG_FILE"; then
AC_MSG_RESULT([found])
else
jh_found_xmlcatalog=false
AC_MSG_RESULT([not found])
fi
# check for the xmlcatalog program
AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
if test "x$XMLCATALOG" = xno; then
jh_found_xmlcatalog=false
fi
if $jh_found_xmlcatalog; then
ifelse([$1],,[:],[$1])
else
ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2])
fi
])
# Checks if a particular URI appears in the XML catalog
# Usage:
# JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
AC_DEFUN([JH_CHECK_XML_CATALOG],
[
AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
if $jh_found_xmlcatalog && \
AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
AC_MSG_RESULT([found])
ifelse([$3],,,[$3
])dnl
else
AC_MSG_RESULT([not found])
ifelse([$4],,
[AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],
[$4])
fi
])

View File

@@ -1,62 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_H__
#define __ATK_H__
#define __ATK_H_INSIDE__
#include <atk/atktypes.h>
#include <atk/atkobject.h>
#include <atk/atkaction.h>
#include <atk/atkcomponent.h>
#include <atk/atkdocument.h>
#include <atk/atkeditabletext.h>
#include <atk/atkenums.h>
#include <atk/atkgobjectaccessible.h>
#include <atk/atkhyperlink.h>
#include <atk/atkhyperlinkimpl.h>
#include <atk/atkhypertext.h>
#include <atk/atkimage.h>
#include <atk/atknoopobject.h>
#include <atk/atknoopobjectfactory.h>
#include <atk/atkobjectfactory.h>
#include <atk/atkplug.h>
#include <atk/atkrange.h>
#include <atk/atkregistry.h>
#include <atk/atkrelation.h>
#include <atk/atkrelationset.h>
#include <atk/atkselection.h>
#include <atk/atksocket.h>
#include <atk/atkstate.h>
#include <atk/atkstateset.h>
#include <atk/atkstreamablecontent.h>
#include <atk/atktable.h>
#include <atk/atktablecell.h>
#include <atk/atktext.h>
#include <atk/atkutil.h>
#include <atk/atkvalue.h>
#include <atk/atkwindow.h>
#include <atk/atkenumtypes.h>
#undef __ATK_H_INSIDE__
#endif /* __ATK_H__ */

View File

@@ -1,286 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkaction.h"
/**
* SECTION:atkaction
* @Short_description: The ATK interface provided by UI components
* which the user can activate/interact with.
* @Title:AtkAction
*
* #AtkAction should be implemented by instances of #AtkObject classes
* with which the user can interact directly, i.e. buttons,
* checkboxes, scrollbars, e.g. components which are not "passive"
* providers of UI information.
*
* Exceptions: when the user interaction is already covered by another
* appropriate interface such as #AtkEditableText (insert/delete text,
* etc.) or #AtkValue (set value) then these actions should not be
* exposed by #AtkAction as well.
*
* Though most UI interactions on components should be invocable via
* keyboard as well as mouse, there will generally be a close mapping
* between "mouse actions" that are possible on a component and the
* AtkActions. Where mouse and keyboard actions are redundant in
* effect, #AtkAction should expose only one action rather than
* exposing redundant actions if possible. By convention we have been
* using "mouse centric" terminology for #AtkAction names.
*
*/
GType
atk_action_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkActionIface),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkAction", &tinfo, 0);
}
return type;
}
/**
* atk_action_do_action:
* @action: a #GObject instance that implements AtkActionIface
* @i: the action index corresponding to the action to be performed
*
* Perform the specified action on the object.
*
* Returns: %TRUE if success, %FALSE otherwise
*
**/
gboolean
atk_action_do_action (AtkAction *obj,
gint i)
{
AtkActionIface *iface;
g_return_val_if_fail (ATK_IS_ACTION (obj), FALSE);
iface = ATK_ACTION_GET_IFACE (obj);
if (iface->do_action)
return (iface->do_action) (obj, i);
else
return FALSE;
}
/**
* atk_action_get_n_actions:
* @action: a #GObject instance that implements AtkActionIface
*
* Gets the number of accessible actions available on the object.
* If there are more than one, the first one is considered the
* "default" action of the object.
*
* Returns: a the number of actions, or 0 if @action does not
* implement this interface.
**/
gint
atk_action_get_n_actions (AtkAction *obj)
{
AtkActionIface *iface;
g_return_val_if_fail (ATK_IS_ACTION (obj), 0);
iface = ATK_ACTION_GET_IFACE (obj);
if (iface->get_n_actions)
return (iface->get_n_actions) (obj);
else
return 0;
}
/**
* atk_action_get_description:
* @action: a #GObject instance that implements AtkActionIface
* @i: the action index corresponding to the action to be performed
*
* Returns a description of the specified action of the object.
*
* Returns: (nullable): a description string, or %NULL if @action does
* not implement this interface.
**/
const gchar*
atk_action_get_description (AtkAction *obj,
gint i)
{
AtkActionIface *iface;
g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
iface = ATK_ACTION_GET_IFACE (obj);
if (iface->get_description)
return (iface->get_description) (obj, i);
else
return NULL;
}
/**
* atk_action_get_name:
* @action: a #GObject instance that implements AtkActionIface
* @i: the action index corresponding to the action to be performed
*
* Returns a non-localized string naming the specified action of the
* object. This name is generally not descriptive of the end result
* of the action, but instead names the 'interaction type' which the
* object supports. By convention, the above strings should be used to
* represent the actions which correspond to the common point-and-click
* interaction techniques of the same name: i.e.
* "click", "press", "release", "drag", "drop", "popup", etc.
* The "popup" action should be used to pop up a context menu for the
* object, if one exists.
*
* For technical reasons, some toolkits cannot guarantee that the
* reported action is actually 'bound' to a nontrivial user event;
* i.e. the result of some actions via atk_action_do_action() may be
* NIL.
*
* Returns: (nullable): a name string, or %NULL if @action does not
* implement this interface.
**/
const gchar*
atk_action_get_name (AtkAction *obj,
gint i)
{
AtkActionIface *iface;
g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
iface = ATK_ACTION_GET_IFACE (obj);
if (iface->get_name)
return (iface->get_name) (obj, i);
else
return NULL;
}
/**
* atk_action_get_localized_name:
* @action: a #GObject instance that implements AtkActionIface
* @i: the action index corresponding to the action to be performed
*
* Returns the localized name of the specified action of the object.
*
* Returns: (nullable): a name string, or %NULL if @action does not
* implement this interface.
**/
const gchar*
atk_action_get_localized_name (AtkAction *obj,
gint i)
{
AtkActionIface *iface;
g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
iface = ATK_ACTION_GET_IFACE (obj);
if (iface->get_localized_name)
return (iface->get_localized_name) (obj, i);
else
return NULL;
}
/**
* atk_action_get_keybinding:
* @action: a #GObject instance that implements AtkActionIface
* @i: the action index corresponding to the action to be performed
*
* Gets the keybinding which can be used to activate this action, if one
* exists. The string returned should contain localized, human-readable,
* key sequences as they would appear when displayed on screen. It must
* be in the format "mnemonic;sequence;shortcut".
*
* - The mnemonic key activates the object if it is presently enabled onscreen.
* This typically corresponds to the underlined letter within the widget.
* Example: "n" in a traditional "New..." menu item or the "a" in "Apply" for
* a button.
* - The sequence is the full list of keys which invoke the action even if the
* relevant element is not currently shown on screen. For instance, for a menu
* item the sequence is the keybindings used to open the parent menus before
* invoking. The sequence string is colon-delimited. Example: "Alt+F:N" in a
* traditional "New..." menu item.
* - The shortcut, if it exists, will invoke the same action without showing
* the component or its enclosing menus or dialogs. Example: "Ctrl+N" in a
* traditional "New..." menu item.
*
* Example: For a traditional "New..." menu item, the expected return value
* would be: "N;Alt+F:N;Ctrl+N" for the English locale and "N;Alt+D:N;Strg+N"
* for the German locale. If, hypothetically, this menu item lacked a mnemonic,
* it would be represented by ";;Ctrl+N" and ";;Strg+N" respectively.
*
* Returns: (nullable): the keybinding which can be used to activate
* this action, or %NULL if there is no keybinding for this action.
*
**/
const gchar*
atk_action_get_keybinding (AtkAction *obj,
gint i)
{
AtkActionIface *iface;
g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
iface = ATK_ACTION_GET_IFACE (obj);
if (iface->get_keybinding)
return (iface->get_keybinding) (obj, i);
else
return NULL;
}
/**
* atk_action_set_description:
* @action: a #GObject instance that implements AtkActionIface
* @i: the action index corresponding to the action to be performed
* @desc: the description to be assigned to this action
*
* Sets a description of the specified action of the object.
*
* Returns: a gboolean representing if the description was successfully set;
**/
gboolean
atk_action_set_description (AtkAction *obj,
gint i,
const gchar *desc)
{
AtkActionIface *iface;
g_return_val_if_fail (ATK_IS_ACTION (obj), FALSE);
iface = ATK_ACTION_GET_IFACE (obj);
if (iface->set_description)
return (iface->set_description) (obj, i, desc);
else
return FALSE;
}

View File

@@ -1,130 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_ACTION_H__
#define __ATK_ACTION_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atktypes.h>
G_BEGIN_DECLS
/*
*/
#define ATK_TYPE_ACTION (atk_action_get_type ())
#define ATK_IS_ACTION(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_ACTION)
#define ATK_ACTION(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_ACTION, AtkAction)
#define ATK_ACTION_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_ACTION, AtkActionIface))
#ifndef _TYPEDEF_ATK_ACTION_
#define _TYPEDEF_ATK_ACTION_
typedef struct _AtkAction AtkAction;
#endif
typedef struct _AtkActionIface AtkActionIface;
/**
* AtkActionIface:
* @do_action:
* @get_n_actions:
* @get_description:
* @get_name:
* @get_keybinding:
* @set_description:
* @get_localized_name:
*
* The #AtkAction interface should be supported by any object that can
* perform one or more actions. The interface provides the standard
* mechanism for an assistive technology to determine what those actions
* are as well as tell the object to perform them. Any object that can
* be manipulated should support this interface.
*/
struct _AtkActionIface
{
/*< private >*/
GTypeInterface parent;
/*< public >*/
gboolean (*do_action) (AtkAction *action,
gint i);
gint (*get_n_actions) (AtkAction *action);
const gchar* (*get_description) (AtkAction *action,
gint i);
const gchar* (*get_name) (AtkAction *action,
gint i);
const gchar* (*get_keybinding) (AtkAction *action,
gint i);
gboolean (*set_description) (AtkAction *action,
gint i,
const gchar *desc);
const gchar* (*get_localized_name)(AtkAction *action,
gint i);
};
GDK_AVAILABLE_IN_ALL
GType atk_action_get_type (void);
/*
* These are the function which would be called by an application with
* the argument being a AtkObject object cast to (AtkAction).
*
* The function will just check that * the corresponding
* function pointer is not NULL and will call it.
*
* The "real" implementation of the function for accessible will be
* provided in a support library
*/
GDK_AVAILABLE_IN_ALL
gboolean atk_action_do_action (AtkAction *action,
gint i);
GDK_AVAILABLE_IN_ALL
gint atk_action_get_n_actions (AtkAction *action);
GDK_AVAILABLE_IN_ALL
const gchar* atk_action_get_description (AtkAction *action,
gint i);
GDK_AVAILABLE_IN_ALL
const gchar* atk_action_get_name (AtkAction *action,
gint i);
GDK_AVAILABLE_IN_ALL
const gchar* atk_action_get_keybinding (AtkAction *action,
gint i);
GDK_AVAILABLE_IN_ALL
gboolean atk_action_set_description (AtkAction *action,
gint i,
const gchar *desc);
/* NEW in ATK 1.1: */
GDK_AVAILABLE_IN_ALL
const gchar* atk_action_get_localized_name (AtkAction *action,
gint i);
/*
* Additional GObject properties exported by AtkAction:
* "accessible_action"
* (an accessible action, or the list of actions, has changed)
*/
G_END_DECLS
#endif /* __ATK_ACTION_H__ */

View File

@@ -1,598 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkcomponent.h"
/**
* SECTION:atkcomponent
* @Short_description: The ATK interface provided by UI components
* which occupy a physical area on the screen.
* which the user can activate/interact with.
* @Title:AtkComponent
*
* #AtkComponent should be implemented by most if not all UI elements
* with an actual on-screen presence, i.e. components which can be
* said to have a screen-coordinate bounding box. Virtually all
* widgets will need to have #AtkComponent implementations provided
* for their corresponding #AtkObject class. In short, only UI
* elements which are *not* GUI elements will omit this ATK interface.
*
* A possible exception might be textual information with a
* transparent background, in which case text glyph bounding box
* information is provided by #AtkText.
*/
enum {
BOUNDS_CHANGED,
LAST_SIGNAL
};
static void atk_component_base_init (AtkComponentIface *class);
static gboolean atk_component_real_contains (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
static AtkObject* atk_component_real_ref_accessible_at_point (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
static void atk_component_real_get_position (AtkComponent *component,
gint *x,
gint *y,
AtkCoordType coord_type);
static void atk_component_real_get_size (AtkComponent *component,
gint *width,
gint *height);
static guint atk_component_signals[LAST_SIGNAL] = { 0 };
GType
atk_component_get_type (void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo tinfo =
{
sizeof (AtkComponentIface),
(GBaseInitFunc) atk_component_base_init,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkComponent", &tinfo, 0);
}
return type;
}
static void
atk_component_base_init (AtkComponentIface *class)
{
static gboolean initialized = FALSE;
if (! initialized)
{
class->ref_accessible_at_point = atk_component_real_ref_accessible_at_point;
class->contains = atk_component_real_contains;
class->get_position = atk_component_real_get_position;
class->get_size = atk_component_real_get_size;
/**
* AtkComponent::bounds-changed:
* @atkcomponent: the object which received the signal.
* @arg1: The AtkRectangle giving the new position and size.
*
* The 'bounds-changed" signal is emitted when the bposition or
* size of the component changes.
*/
atk_component_signals[BOUNDS_CHANGED] =
g_signal_new ("bounds_changed",
ATK_TYPE_COMPONENT,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkComponentIface, bounds_changed),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
ATK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE);
initialized = TRUE;
}
}
/**
* atk_component_contains:
* @component: the #AtkComponent
* @x: x coordinate
* @y: y coordinate
* @coord_type: specifies whether the coordinates are relative to the screen
* or to the components top level window
*
* Checks whether the specified point is within the extent of the @component.
*
* Toolkit implementor note: ATK provides a default implementation for
* this virtual method. In general there are little reason to
* re-implement it.
*
* Returns: %TRUE or %FALSE indicating whether the specified point is within
* the extent of the @component or not
**/
gboolean
atk_component_contains (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->contains)
return (iface->contains) (component, x, y, coord_type);
else
return FALSE;
}
/**
* atk_component_ref_accessible_at_point:
* @component: the #AtkComponent
* @x: x coordinate
* @y: y coordinate
* @coord_type: specifies whether the coordinates are relative to the screen
* or to the components top level window
*
* Gets a reference to the accessible child, if one exists, at the
* coordinate point specified by @x and @y.
*
* Returns: (nullable) (transfer full): a reference to the accessible
* child, if one exists
**/
AtkObject*
atk_component_ref_accessible_at_point (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), NULL);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->ref_accessible_at_point)
return (iface->ref_accessible_at_point) (component, x, y, coord_type);
else
return NULL;
}
/**
* atk_component_get_extents:
* @component: an #AtkComponent
* @x: (out) (optional): address of #gint to put x coordinate
* @y: (out) (optional): address of #gint to put y coordinate
* @width: (out) (optional): address of #gint to put width
* @height: (out) (optional): address of #gint to put height
* @coord_type: specifies whether the coordinates are relative to the screen
* or to the components top level window
*
* Gets the rectangle which gives the extent of the @component.
*
* If the extent can not be obtained (e.g. a non-embedded plug or missing
* support), all of x, y, width, height are set to -1.
*
**/
void
atk_component_get_extents (AtkComponent *component,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type)
{
AtkComponentIface *iface = NULL;
gint local_x, local_y, local_width, local_height;
gint *real_x, *real_y, *real_width, *real_height;
g_return_if_fail (ATK_IS_COMPONENT (component));
if (x)
real_x = x;
else
real_x = &local_x;
if (y)
real_y = y;
else
real_y = &local_y;
if (width)
real_width = width;
else
real_width = &local_width;
if (height)
real_height = height;
else
real_height = &local_height;
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->get_extents)
(iface->get_extents) (component, real_x, real_y, real_width, real_height, coord_type);
else
{
*real_x = -1;
*real_y = -1;
*real_width = -1;
*real_height = -1;
}
}
/**
* atk_component_get_layer:
* @component: an #AtkComponent
*
* Gets the layer of the component.
*
* Returns: an #AtkLayer which is the layer of the component
**/
AtkLayer
atk_component_get_layer (AtkComponent *component)
{
AtkComponentIface *iface;
g_return_val_if_fail (ATK_IS_COMPONENT (component), ATK_LAYER_INVALID);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->get_layer)
return (iface->get_layer) (component);
else
return ATK_LAYER_WIDGET;
}
/**
* atk_component_get_mdi_zorder:
* @component: an #AtkComponent
*
* Gets the zorder of the component. The value G_MININT will be returned
* if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW.
*
* Returns: a gint which is the zorder of the component, i.e. the depth at
* which the component is shown in relation to other components in the same
* container.
**/
gint
atk_component_get_mdi_zorder (AtkComponent *component)
{
AtkComponentIface *iface;
g_return_val_if_fail (ATK_IS_COMPONENT (component), G_MININT);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->get_mdi_zorder)
return (iface->get_mdi_zorder) (component);
else
return G_MININT;
}
/**
* atk_component_get_alpha:
* @component: an #AtkComponent
*
* Returns the alpha value (i.e. the opacity) for this
* @component, on a scale from 0 (fully transparent) to 1.0
* (fully opaque).
*
* Returns: An alpha value from 0 to 1.0, inclusive.
* Since: 1.12
**/
gdouble
atk_component_get_alpha (AtkComponent *component)
{
AtkComponentIface *iface;
g_return_val_if_fail (ATK_IS_COMPONENT (component), G_MININT);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->get_alpha)
return (iface->get_alpha) (component);
else
return (gdouble) 1.0;
}
/**
* atk_component_grab_focus:
* @component: an #AtkComponent
*
* Grabs focus for this @component.
*
* Returns: %TRUE if successful, %FALSE otherwise.
**/
gboolean
atk_component_grab_focus (AtkComponent *component)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->grab_focus)
return (iface->grab_focus) (component);
else
return FALSE;
}
/**
* atk_component_set_extents:
* @component: an #AtkComponent
* @x: x coordinate
* @y: y coordinate
* @width: width to set for @component
* @height: height to set for @component
* @coord_type: specifies whether the coordinates are relative to the screen
* or to the components top level window
*
* Sets the extents of @component.
*
* Returns: %TRUE or %FALSE whether the extents were set or not
**/
gboolean
atk_component_set_extents (AtkComponent *component,
gint x,
gint y,
gint width,
gint height,
AtkCoordType coord_type)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->set_extents)
return (iface->set_extents) (component, x, y, width, height, coord_type);
else
return FALSE;
}
/**
* atk_component_set_position:
* @component: an #AtkComponent
* @x: x coordinate
* @y: y coordinate
* @coord_type: specifies whether the coordinates are relative to the screen
* or to the component's top level window
*
* Sets the position of @component.
*
* Contrary to atk_component_scroll_to, this does not trigger any scrolling,
* this just moves @component in its parent.
*
* Returns: %TRUE or %FALSE whether or not the position was set or not
**/
gboolean
atk_component_set_position (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->set_position)
return (iface->set_position) (component, x, y, coord_type);
else
return FALSE;
}
/**
* atk_component_set_size:
* @component: an #AtkComponent
* @width: width to set for @component
* @height: height to set for @component
*
* Set the size of the @component in terms of width and height.
*
* Returns: %TRUE or %FALSE whether the size was set or not
**/
gboolean
atk_component_set_size (AtkComponent *component,
gint x,
gint y)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->set_size)
return (iface->set_size) (component, x, y);
else
return FALSE;
}
/**
* atk_component_scroll_to:
* @component: an #AtkComponent
* @type: specify where the object should be made visible.
*
* Makes @component visible on the screen by scrolling all necessary parents.
*
* Contrary to atk_component_set_position, this does not actually move
* @component in its parent, this only makes the parents scroll so that the
* object shows up on the screen, given its current position within the parents.
*
* Returns: whether scrolling was successful.
*
* Since: 2.30
*/
gboolean
atk_component_scroll_to (AtkComponent *component,
AtkScrollType type)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->scroll_to)
return (iface->scroll_to) (component, type);
return FALSE;
}
/**
* atk_component_scroll_to_point:
* @component: an #AtkComponent
* @coords: specify whether coordinates are relative to the screen or to the
* parent object.
* @x: x-position where to scroll to
* @y: y-position where to scroll to
*
* Move the top-left of @component to a given position of the screen by
* scrolling all necessary parents.
*
* Returns: whether scrolling was successful.
*
* Since: 2.30
*/
gboolean
atk_component_scroll_to_point (AtkComponent *component,
AtkCoordType coords,
gint x,
gint y)
{
AtkComponentIface *iface = NULL;
g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE);
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->scroll_to_point)
return (iface->scroll_to_point) (component, coords, x, y);
return FALSE;
}
static gboolean
atk_component_real_contains (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type)
{
gint real_x, real_y, width, height;
real_x = real_y = width = height = 0;
atk_component_get_extents (component, &real_x, &real_y, &width, &height, coord_type);
if ((x >= real_x) &&
(x < real_x + width) &&
(y >= real_y) &&
(y < real_y + height))
return TRUE;
else
return FALSE;
}
static AtkObject*
atk_component_real_ref_accessible_at_point (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type)
{
gint count, i;
count = atk_object_get_n_accessible_children (ATK_OBJECT (component));
for (i = 0; i < count; i++)
{
AtkObject *obj;
obj = atk_object_ref_accessible_child (ATK_OBJECT (component), i);
if (obj != NULL)
{
if (atk_component_contains (ATK_COMPONENT (obj), x, y, coord_type))
{
return obj;
}
else
{
g_object_unref (obj);
}
}
}
return NULL;
}
static void
atk_component_real_get_position (AtkComponent *component,
gint *x,
gint *y,
AtkCoordType coord_type)
{
gint width, height;
atk_component_get_extents (component, x, y, &width, &height, coord_type);
}
static void
atk_component_real_get_size (AtkComponent *component,
gint *width,
gint *height)
{
gint x, y;
AtkCoordType coord_type;
/*
* Pick one coordinate type; it does not matter for size
*/
coord_type = ATK_XY_WINDOW;
atk_component_get_extents (component, &x, &y, width, height, coord_type);
}
static AtkRectangle *
atk_rectangle_copy (const AtkRectangle *rectangle)
{
AtkRectangle *result = g_new (AtkRectangle, 1);
*result = *rectangle;
return result;
}
GType
atk_rectangle_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("AtkRectangle",
(GBoxedCopyFunc)atk_rectangle_copy,
(GBoxedFreeFunc)g_free);
return our_type;
}

View File

@@ -1,232 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_COMPONENT_H__
#define __ATK_COMPONENT_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atktypes.h>
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_COMPONENT (atk_component_get_type ())
#define ATK_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
#define ATK_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
#define ATK_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
#ifndef _TYPEDEF_ATK_COMPONENT_
#define _TYPEDEF_ATK_COMPONENT_
typedef struct _AtkComponent AtkComponent;
#endif
typedef struct _AtkComponentIface AtkComponentIface;
typedef struct _AtkRectangle AtkRectangle;
/**
* AtkRectangle:
* @x: X coordinate of the left side of the rectangle.
* @y: Y coordinate of the top side of the rectangle.
* @width: width of the rectangle.
* @height: height of the rectangle.
*
* A data structure for holding a rectangle. Those coordinates are
* relative to the component top-level parent.
*/
struct _AtkRectangle
{
gint x;
gint y;
gint width;
gint height;
};
GDK_AVAILABLE_IN_ALL
GType atk_rectangle_get_type (void);
#define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
/**
* AtkComponentIface:
* @add_focus_handler: This virtual function is deprecated since 2.9.4
* and it should not be overriden. See atk_component_add_focus_handler()
* for more information.
* @get_position: This virtual function is deprecated since 2.12 and
* it should not be overriden. Use @AtkComponentIface.get_extents instead.
* @get_size: This virtual function is deprecated since 2.12 and it
* should not be overriden. Use @AtkComponentIface.get_extents instead.
* @remove_focus_handler: This virtual function is deprecated since
* 2.9.4 and it should not be overriden. See atk_component_remove_focus_handler()
* for more information.
* @contains:
* @ref_accessible_at_point:
* @get_extents:
* @grab_focus:
* @set_extents:
* @set_position:
* @set_size:
* @get_layer:
* @get_mdi_zorder:
* @bounds_changed:
* @get_alpha:
* @scroll_to:
* @scroll_to_point:
*
* The AtkComponent interface should be supported by any object that is
* rendered on the screen. The interface provides the standard mechanism
* for an assistive technology to determine and set the graphical
* representation of an object.
*/
struct _AtkComponentIface
{
/*< private >*/
GTypeInterface parent;
/*< public >*/
gboolean (* contains) (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
AtkObject* (* ref_accessible_at_point) (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
void (* get_extents) (AtkComponent *component,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type);
void (* get_position) (AtkComponent *component,
gint *x,
gint *y,
AtkCoordType coord_type);
void (* get_size) (AtkComponent *component,
gint *width,
gint *height);
gboolean (* grab_focus) (AtkComponent *component);
void (* remove_focus_handler) (AtkComponent *component,
guint handler_id);
gboolean (* set_extents) (AtkComponent *component,
gint x,
gint y,
gint width,
gint height,
AtkCoordType coord_type);
gboolean (* set_position) (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
gboolean (* set_size) (AtkComponent *component,
gint width,
gint height);
AtkLayer (* get_layer) (AtkComponent *component);
gint (* get_mdi_zorder) (AtkComponent *component);
/*
* signal handlers
*/
void (* bounds_changed) (AtkComponent *component,
AtkRectangle *bounds);
gdouble (* get_alpha) (AtkComponent *component);
/*
* Scrolls this object so it becomes visible on the screen.
*
* scroll_to lets the implementation compute an appropriate target
* position on the screen, with type used as a positioning hint.
*
* scroll_to_point lets the client specify a precise target position
* on the screen for the top-left of the object.
*
* Since ATK 2.30
*/
gboolean (*scroll_to) (AtkComponent *component,
AtkScrollType type);
gboolean (*scroll_to_point) (AtkComponent *component,
AtkCoordType coords,
gint x,
gint y);
};
GDK_AVAILABLE_IN_ALL
GType atk_component_get_type (void);
/* convenience functions */
GDK_AVAILABLE_IN_ALL
gboolean atk_component_contains (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_component_ref_accessible_at_point(AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
GDK_AVAILABLE_IN_ALL
void atk_component_get_extents (AtkComponent *component,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type);
GDK_AVAILABLE_IN_ALL
AtkLayer atk_component_get_layer (AtkComponent *component);
GDK_AVAILABLE_IN_ALL
gint atk_component_get_mdi_zorder (AtkComponent *component);
GDK_AVAILABLE_IN_ALL
gboolean atk_component_grab_focus (AtkComponent *component);
GDK_AVAILABLE_IN_ALL
gboolean atk_component_set_extents (AtkComponent *component,
gint x,
gint y,
gint width,
gint height,
AtkCoordType coord_type);
GDK_AVAILABLE_IN_ALL
gboolean atk_component_set_position (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type);
GDK_AVAILABLE_IN_ALL
gboolean atk_component_set_size (AtkComponent *component,
gint width,
gint height);
GDK_AVAILABLE_IN_ALL
gdouble atk_component_get_alpha (AtkComponent *component);
GDK_AVAILABLE_IN_ALL
gboolean atk_component_scroll_to (AtkComponent *component,
AtkScrollType type);
GDK_AVAILABLE_IN_ALL
gboolean atk_component_scroll_to_point (AtkComponent *component,
AtkCoordType coords,
gint x,
gint y);
G_END_DECLS
#endif /* __ATK_COMPONENT_H__ */

View File

@@ -1,324 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkdocument.h"
/**
* SECTION:atkdocument
* @Short_description: The ATK interface which represents the toplevel
* container for document content.
* @Title:AtkDocument
*
* The AtkDocument interface should be supported by any object whose
* content is a representation or view of a document. The AtkDocument
* interface should appear on the toplevel container for the document
* content; however AtkDocument instances may be nested (i.e. an
* AtkDocument may be a descendant of another AtkDocument) in those
* cases where one document contains "embedded content" which can
* reasonably be considered a document in its own right.
*
*/
enum {
LOAD_COMPLETE,
RELOAD,
LOAD_STOPPED,
PAGE_CHANGED,
LAST_SIGNAL
};
static void atk_document_base_init (AtkDocumentIface *class);
static guint atk_document_signals[LAST_SIGNAL] = {0};
GType
atk_document_get_type (void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo tinfo =
{
sizeof (AtkDocumentIface),
(GBaseInitFunc) atk_document_base_init,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkDocument", &tinfo, 0);
}
return type;
}
static void
atk_document_base_init (AtkDocumentIface *class)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* AtkDocument::load-complete:
* @atkdocument: the object which received the signal.
*
* The 'load-complete' signal is emitted when a pending load of
* a static document has completed. This signal is to be
* expected by ATK clients if and when AtkDocument implementors
* expose ATK_STATE_BUSY. If the state of an AtkObject which
* implements AtkDocument does not include ATK_STATE_BUSY, it
* should be safe for clients to assume that the AtkDocument's
* static contents are fully loaded into the container.
* (Dynamic document contents should be exposed via other
* signals.)
*/
atk_document_signals[LOAD_COMPLETE] =
g_signal_new ("load_complete",
ATK_TYPE_DOCUMENT,
G_SIGNAL_RUN_LAST,
0,
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* AtkDocument::reload:
* @atkdocument: the object which received the signal.
*
* The 'reload' signal is emitted when the contents of a
* document is refreshed from its source. Once 'reload' has
* been emitted, a matching 'load-complete' or 'load-stopped'
* signal should follow, which clients may await before
* interrogating ATK for the latest document content.
*/
atk_document_signals[RELOAD] =
g_signal_new ("reload",
ATK_TYPE_DOCUMENT,
G_SIGNAL_RUN_LAST,
0,
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* AtkDocument::load-stopped:
* @atkdocument: the object which received the signal.
*
* The 'load-stopped' signal is emitted when a pending load of
* document contents is cancelled, paused, or otherwise
* interrupted by the user or application logic. It should not
* however be emitted while waiting for a resource (for instance
* while blocking on a file or network read) unless a
* user-significant timeout has occurred.
*/
atk_document_signals[LOAD_STOPPED] =
g_signal_new ("load_stopped",
ATK_TYPE_DOCUMENT,
G_SIGNAL_RUN_LAST,
0,
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* AtkDocument::page-changed:
* @atkdocument: the object on which the signal was emitted
* @page_number: the new page number. If this value is unknown
* or not applicable, -1 should be provided.
*
* The 'page-changed' signal is emitted when the current page of
* a document changes, e.g. pressing page up/down in a document
* viewer.
*
* Since: 2.12
*/
atk_document_signals[PAGE_CHANGED] =
g_signal_new ("page_changed",
ATK_TYPE_DOCUMENT,
G_SIGNAL_RUN_LAST,
0,
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1, G_TYPE_INT);
initialized = TRUE;
}
}
/**
* atk_document_get_attributes: (virtual get_document_attributes)
* @document: a #GObject instance that implements AtkDocumentIface
*
* Gets an AtkAttributeSet which describes document-wide
* attributes as name-value pairs.
*
* Since: 1.12
*
* Returns: (transfer none): An AtkAttributeSet containing the explicitly
* set name-value-pair attributes associated with this document
* as a whole.
**/
AtkAttributeSet *
atk_document_get_attributes (AtkDocument *document)
{
AtkDocumentIface *iface;
g_return_val_if_fail (ATK_IS_DOCUMENT (document), NULL);
iface = ATK_DOCUMENT_GET_IFACE (document);
if (iface->get_document_attributes)
{
return (iface->get_document_attributes) (document);
}
else
{
return NULL;
}
}
/**
* atk_document_get_attribute_value: (virtual get_document_attribute_value)
* @document: a #GObject instance that implements AtkDocumentIface
* @attribute_name: a character string representing the name of the attribute
* whose value is being queried.
*
* Retrieves the value of the given @attribute_name inside @document.
*
* Returns: (nullable): a string value associated with the named
* attribute for this document, or %NULL if a value for
* @attribute_name has not been specified for this document.
*
* Since: 1.12
*/
const gchar *
atk_document_get_attribute_value (AtkDocument *document,
const gchar *attribute_name)
{
AtkDocumentIface *iface;
g_return_val_if_fail (ATK_IS_DOCUMENT (document), NULL);
iface = ATK_DOCUMENT_GET_IFACE (document);
if (iface->get_document_attribute_value)
{
return (iface->get_document_attribute_value) (document, attribute_name);
}
else
{
return NULL;
}
}
/**
* atk_document_set_attribute_value: (virtual set_document_attribute)
* @document: a #GObject instance that implements #AtkDocumentIface
* @attribute_name: a character string representing the name of the attribute
* whose value is being set.
* @attribute_value: a string value to be associated with @attribute_name.
*
* Sets the value for the given @attribute_name inside @document.
*
* Since: 1.12
*
* Returns: %TRUE if @attribute_value is successfully associated
* with @attribute_name for this @document, and %FALSE if if the
* document does not allow the attribute to be modified
*/
gboolean
atk_document_set_attribute_value (AtkDocument *document,
const gchar *attribute_name,
const gchar *attribute_value)
{
AtkDocumentIface *iface;
g_return_val_if_fail (ATK_IS_DOCUMENT (document), FALSE);
iface = ATK_DOCUMENT_GET_IFACE (document);
if (iface->set_document_attribute)
{
return (iface->set_document_attribute) (document, attribute_name, attribute_value);
}
else
{
return FALSE;
}
}
/**
* atk_document_get_current_page_number:
* @document: the #AtkDocument
*
* Retrieves the current page number inside @document.
*
* Returns: the current page number inside @document, or -1 if
* not implemented, not know by the implementor, or irrelevant.
*
* Since: 2.12
*/
gint
atk_document_get_current_page_number (AtkDocument *document)
{
AtkDocumentIface *iface;
g_return_val_if_fail (ATK_IS_DOCUMENT (document), FALSE);
iface = ATK_DOCUMENT_GET_IFACE (document);
if (iface->get_current_page_number)
{
return (iface->get_current_page_number) (document);
}
else
{
return -1;
}
}
/**
* atk_document_get_page_count:
* @document: the #AtkDocument
*
* Retrieves the total number of pages inside @document.
*
* Returns: total page count of @document, or -1 if not implemented,
* not know by the implementor or irrelevant.
*
* Since: 2.12
*/
gint
atk_document_get_page_count (AtkDocument *document)
{
AtkDocumentIface *iface;
g_return_val_if_fail (ATK_IS_DOCUMENT (document), FALSE);
iface = ATK_DOCUMENT_GET_IFACE (document);
if (iface->get_page_count)
{
return (iface->get_page_count) (document);
}
else
{
return -1;
}
}

View File

@@ -1,103 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_DOCUMENT_H__
#define __ATK_DOCUMENT_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
/*
* The AtkDocument interface should be supported by any object that is a container
* for 'document content' as opposed to a collection of user interface elements.
*
*/
#define ATK_TYPE_DOCUMENT (atk_document_get_type ())
#define ATK_IS_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_DOCUMENT)
#define ATK_DOCUMENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_DOCUMENT, AtkDocument)
#define ATK_DOCUMENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_DOCUMENT, AtkDocumentIface))
#ifndef _TYPEDEF_ATK_DOCUMENT_
#define _TYPEDEF_ATK_DOCUMENT_
typedef struct _AtkDocument AtkDocument;
#endif
typedef struct _AtkDocumentIface AtkDocumentIface;
/**
* AtkDocumentIface:
* @get_document_type: gets a string indicating the document
* type. This virtual function is deprecated since 2.12 and it
* should not be overriden.
* @get_document: a #GObject instance that implements
* AtkDocumentIface. This virtual method is deprecated since 2.12
* and it should not be overriden.
* @get_document_locale: gets locale. This virtual function is
* deprecated since 2.7.90 and it should not be overriden.
* @get_document_attributes: gets an AtkAttributeSet which describes
* document-wide attributes as name-value pairs.
* @get_document_attribute_value: returns a string value assocciated
* with the named attribute for this document, or NULL
* @set_document_attribute: sets the value of an attribute. Returns
* TRUE on success, FALSE otherwise
* @get_current_page_number: gets the current page number. Since 2.12
* @get_page_count: gets the page count of the document. Since 2.12
*/
struct _AtkDocumentIface
{
GTypeInterface parent;
const gchar* ( *get_document_type) (AtkDocument *document);
gpointer ( *get_document) (AtkDocument *document);
const gchar* ( *get_document_locale) (AtkDocument *document);
AtkAttributeSet * ( *get_document_attributes) (AtkDocument *document);
const gchar* ( *get_document_attribute_value) (AtkDocument *document,
const gchar *attribute_name);
gboolean ( *set_document_attribute) (AtkDocument *document,
const gchar *attribute_name,
const gchar *attribute_value);
gint ( *get_current_page_number) (AtkDocument *document);
gint ( *get_page_count) (AtkDocument *document);
};
GDK_AVAILABLE_IN_ALL
GType atk_document_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkAttributeSet* atk_document_get_attributes (AtkDocument *document);
GDK_AVAILABLE_IN_ALL
const gchar* atk_document_get_attribute_value (AtkDocument *document,
const gchar *attribute_name);
GDK_AVAILABLE_IN_ALL
gboolean atk_document_set_attribute_value (AtkDocument *document,
const gchar *attribute_name,
const gchar *attribute_value);
GDK_AVAILABLE_IN_ALL
gint atk_document_get_current_page_number (AtkDocument *document);
GDK_AVAILABLE_IN_ALL
gint atk_document_get_page_count (AtkDocument *document);
G_END_DECLS
#endif /* __ATK_DOCUMENT_H__ */

View File

@@ -1,237 +0,0 @@
/* ATK - The Accessibility Toolkit for GTK+
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkeditabletext.h"
/**
* SECTION:atkeditabletext
* @Short_description: The ATK interface implemented by components
* containing user-editable text content.
* @Title:AtkEditableText
*
* #AtkEditableText should be implemented by UI components which
* contain text which the user can edit, via the #AtkObject
* corresponding to that component (see #AtkObject).
*
* #AtkEditableText is a subclass of #AtkText, and as such, an object
* which implements #AtkEditableText is by definition an #AtkText
* implementor as well.
*
* See also: #AtkText
*/
GType
atk_editable_text_get_type (void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo tinfo =
{
sizeof (AtkEditableTextIface),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkEditableText", &tinfo, 0);
}
return type;
}
/**
*atk_editable_text_set_run_attributes:
*@text: an #AtkEditableText
*@attrib_set: an #AtkAttributeSet
*@start_offset: start of range in which to set attributes
*@end_offset: end of range in which to set attributes
*
*Sets the attributes for a specified range. See the ATK_ATTRIBUTE
*macros (such as #ATK_ATTRIBUTE_LEFT_MARGIN) for examples of attributes
*that can be set. Note that other attributes that do not have corresponding
*ATK_ATTRIBUTE macros may also be set for certain text widgets.
*
*Returns: %TRUE if attributes successfully set for the specified
*range, otherwise %FALSE
**/
gboolean
atk_editable_text_set_run_attributes (AtkEditableText *text,
AtkAttributeSet *attrib_set,
gint start_offset,
gint end_offset)
{
AtkEditableTextIface *iface;
g_return_val_if_fail (ATK_IS_EDITABLE_TEXT (text), FALSE);
iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
if (iface->set_run_attributes)
{
return (*(iface->set_run_attributes)) (text, attrib_set, start_offset, end_offset);
}
else
{
return FALSE;
}
}
/**
* atk_editable_text_set_text_contents:
* @text: an #AtkEditableText
* @string: string to set for text contents of @text
*
* Set text contents of @text.
**/
void
atk_editable_text_set_text_contents (AtkEditableText *text,
const gchar *string)
{
AtkEditableTextIface *iface;
g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
if (iface->set_text_contents)
(*(iface->set_text_contents)) (text, string);
}
/**
* atk_editable_text_insert_text:
* @text: an #AtkEditableText
* @string: the text to insert
* @length: the length of text to insert, in bytes
* @position: The caller initializes this to
* the position at which to insert the text. After the call it
* points at the position after the newly inserted text.
*
* Insert text at a given position.
**/
void
atk_editable_text_insert_text (AtkEditableText *text,
const gchar *string,
gint length,
gint *position)
{
AtkEditableTextIface *iface;
g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
if (iface->insert_text)
(*(iface->insert_text)) (text, string, length, position);
}
/**
* atk_editable_text_copy_text:
* @text: an #AtkEditableText
* @start_pos: start position
* @end_pos: end position
*
* Copy text from @start_pos up to, but not including @end_pos
* to the clipboard.
**/
void
atk_editable_text_copy_text (AtkEditableText *text,
gint start_pos,
gint end_pos)
{
AtkEditableTextIface *iface;
g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
if (iface->copy_text)
(*(iface->copy_text)) (text, start_pos, end_pos);
}
/**
* atk_editable_text_cut_text:
* @text: an #AtkEditableText
* @start_pos: start position
* @end_pos: end position
*
* Copy text from @start_pos up to, but not including @end_pos
* to the clipboard and then delete from the widget.
**/
void
atk_editable_text_cut_text (AtkEditableText *text,
gint start_pos,
gint end_pos)
{
AtkEditableTextIface *iface;
g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
if (iface->cut_text)
(*(iface->cut_text)) (text, start_pos, end_pos);
}
/**
* atk_editable_text_delete_text:
* @text: an #AtkEditableText
* @start_pos: start position
* @end_pos: end position
*
* Delete text @start_pos up to, but not including @end_pos.
**/
void
atk_editable_text_delete_text (AtkEditableText *text,
gint start_pos,
gint end_pos)
{
AtkEditableTextIface *iface;
g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
if (iface->delete_text)
(*(iface->delete_text)) (text, start_pos, end_pos);
}
/**
* atk_editable_text_paste_text:
* @text: an #AtkEditableText
* @position: position to paste
*
* Paste text from clipboard to specified @position.
**/
void
atk_editable_text_paste_text (AtkEditableText *text,
gint position)
{
AtkEditableTextIface *iface;
g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
if (iface->paste_text)
(*(iface->paste_text)) (text, position);
}

View File

@@ -1,108 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_EDITABLE_TEXT_H__
#define __ATK_EDITABLE_TEXT_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
/*
* AtkEditableText is used to support access in an "accessibility" context
* to editing features of editable text widgets.
*/
#define ATK_TYPE_EDITABLE_TEXT (atk_editable_text_get_type ())
#define ATK_IS_EDITABLE_TEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_EDITABLE_TEXT)
#define ATK_EDITABLE_TEXT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_EDITABLE_TEXT, AtkEditableText)
#define ATK_EDITABLE_TEXT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_EDITABLE_TEXT, AtkEditableTextIface))
#ifndef _TYPEDEF_ATK_EDITABLE_TEXT_
#define _TYPEDEF_ATK_EDITABLE_TEXT_
typedef struct _AtkEditableText AtkEditableText;
#endif
typedef struct _AtkEditableTextIface AtkEditableTextIface;
struct _AtkEditableTextIface
{
GTypeInterface parent_interface;
gboolean (* set_run_attributes) (AtkEditableText *text,
AtkAttributeSet *attrib_set,
gint start_offset,
gint end_offset);
void (* set_text_contents) (AtkEditableText *text,
const gchar *string);
void (* insert_text) (AtkEditableText *text,
const gchar *string,
gint length,
gint *position);
void (* copy_text) (AtkEditableText *text,
gint start_pos,
gint end_pos);
void (* cut_text) (AtkEditableText *text,
gint start_pos,
gint end_pos);
void (* delete_text) (AtkEditableText *text,
gint start_pos,
gint end_pos);
void (* paste_text) (AtkEditableText *text,
gint position);
};
GDK_AVAILABLE_IN_ALL
GType atk_editable_text_get_type (void);
GDK_AVAILABLE_IN_ALL
gboolean atk_editable_text_set_run_attributes (AtkEditableText *text,
AtkAttributeSet *attrib_set,
gint start_offset,
gint end_offset);
GDK_AVAILABLE_IN_ALL
void atk_editable_text_set_text_contents (AtkEditableText *text,
const gchar *string);
GDK_AVAILABLE_IN_ALL
void atk_editable_text_insert_text (AtkEditableText *text,
const gchar *string,
gint length,
gint *position);
GDK_AVAILABLE_IN_ALL
void atk_editable_text_copy_text (AtkEditableText *text,
gint start_pos,
gint end_pos);
GDK_AVAILABLE_IN_ALL
void atk_editable_text_cut_text (AtkEditableText *text,
gint start_pos,
gint end_pos);
GDK_AVAILABLE_IN_ALL
void atk_editable_text_delete_text (AtkEditableText *text,
gint start_pos,
gint end_pos);
GDK_AVAILABLE_IN_ALL
void atk_editable_text_paste_text (AtkEditableText *text,
gint position);
G_END_DECLS
#endif /* __ATK_EDITABLE_TEXT_H__ */

View File

@@ -1,870 +0,0 @@
#pragma once
#include <glib-object.h>
G_BEGIN_DECLS
/**
* AtkHyperlinkStateFlags:
* @ATK_HYPERLINK_IS_INLINE: Link is inline
*
* Describes the type of link
*/
typedef enum
{
ATK_HYPERLINK_IS_INLINE = 1 << 0
} AtkHyperlinkStateFlags;
/**
*AtkStateType:
*@ATK_STATE_INVALID: Indicates an invalid state - probably an error condition.
*@ATK_STATE_ACTIVE: Indicates a window is currently the active window, or an object is the active subelement within a container or table. ATK_STATE_ACTIVE should not be used for objects which have ATK_STATE_FOCUSABLE or ATK_STATE_SELECTABLE: Those objects should use ATK_STATE_FOCUSED and ATK_STATE_SELECTED respectively. ATK_STATE_ACTIVE is a means to indicate that an object which is not focusable and not selectable is the currently-active item within its parent container.
*@ATK_STATE_ARMED: Indicates that the object is 'armed', i.e. will be activated by if a pointer button-release event occurs within its bounds. Buttons often enter this state when a pointer click occurs within their bounds, as a precursor to activation. ATK_STATE_ARMED has been deprecated since ATK-2.16 and should not be used in newly-written code.
*@ATK_STATE_BUSY: Indicates the current object is busy, i.e. onscreen representation is in the process of changing, or the object is temporarily unavailable for interaction due to activity already in progress. This state may be used by implementors of Document to indicate that content loading is underway. It also may indicate other 'pending' conditions; clients may wish to interrogate this object when the ATK_STATE_BUSY flag is removed.
*@ATK_STATE_CHECKED: Indicates this object is currently checked, for instance a checkbox is 'non-empty'.
*@ATK_STATE_DEFUNCT: Indicates that this object no longer has a valid backing widget (for instance, if its peer object has been destroyed)
*@ATK_STATE_EDITABLE: Indicates that this object can contain text, and that the
* user can change the textual contents of this object by editing those contents
* directly. For an object which is expected to be editable due to its type, but
* which cannot be edited due to the application or platform preventing the user
* from doing so, that object's #AtkStateSet should lack ATK_STATE_EDITABLE and
* should contain ATK_STATE_READ_ONLY.
*@ATK_STATE_ENABLED: Indicates that this object is enabled, i.e. that it currently reflects some application state. Objects that are "greyed out" may lack this state, and may lack the STATE_SENSITIVE if direct user interaction cannot cause them to acquire STATE_ENABLED. See also: ATK_STATE_SENSITIVE
*@ATK_STATE_EXPANDABLE: Indicates this object allows progressive disclosure of its children
*@ATK_STATE_EXPANDED: Indicates this object its expanded - see ATK_STATE_EXPANDABLE above
*@ATK_STATE_FOCUSABLE: Indicates this object can accept keyboard focus, which means all events resulting from typing on the keyboard will normally be passed to it when it has focus
*@ATK_STATE_FOCUSED: Indicates this object currently has the keyboard focus
*@ATK_STATE_HORIZONTAL: Indicates the orientation of this object is horizontal; used, for instance, by objects of ATK_ROLE_SCROLL_BAR. For objects where vertical/horizontal orientation is especially meaningful.
*@ATK_STATE_ICONIFIED: Indicates this object is minimized and is represented only by an icon
*@ATK_STATE_MODAL: Indicates something must be done with this object before the user can interact with an object in a different window
*@ATK_STATE_MULTI_LINE: Indicates this (text) object can contain multiple lines of text
*@ATK_STATE_MULTISELECTABLE: Indicates this object allows more than one of its children to be selected at the same time, or in the case of text objects, that the object supports non-contiguous text selections.
*@ATK_STATE_OPAQUE: Indicates this object paints every pixel within its rectangular region.
*@ATK_STATE_PRESSED: Indicates this object is currently pressed.
*@ATK_STATE_RESIZABLE: Indicates the size of this object is not fixed
*@ATK_STATE_SELECTABLE: Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that can be selected
*@ATK_STATE_SELECTED: Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected
*@ATK_STATE_SENSITIVE: Indicates this object is sensitive, e.g. to user interaction.
* STATE_SENSITIVE usually accompanies STATE_ENABLED for user-actionable controls,
* but may be found in the absence of STATE_ENABLED if the current visible state of the
* control is "disconnected" from the application state. In such cases, direct user interaction
* can often result in the object gaining STATE_SENSITIVE, for instance if a user makes
* an explicit selection using an object whose current state is ambiguous or undefined.
* @see STATE_ENABLED, STATE_INDETERMINATE.
*@ATK_STATE_SHOWING: Indicates this object, the object's parent, the object's parent's parent, and so on,
* are all 'shown' to the end-user, i.e. subject to "exposure" if blocking or obscuring objects do not interpose
* between this object and the top of the window stack.
*@ATK_STATE_SINGLE_LINE: Indicates this (text) object can contain only a single line of text
*@ATK_STATE_STALE: Indicates that the information returned for this object may no longer be
* synchronized with the application state. This is implied if the object has STATE_TRANSIENT,
* and can also occur towards the end of the object peer's lifecycle. It can also be used to indicate that
* the index associated with this object has changed since the user accessed the object (in lieu of
* "index-in-parent-changed" events).
*@ATK_STATE_TRANSIENT: Indicates this object is transient, i.e. a snapshot which may not emit events when its
* state changes. Data from objects with ATK_STATE_TRANSIENT should not be cached, since there may be no
* notification given when the cached data becomes obsolete.
*@ATK_STATE_VERTICAL: Indicates the orientation of this object is vertical
*@ATK_STATE_VISIBLE: Indicates this object is visible, e.g. has been explicitly marked for exposure to the user.
* **note**: %ATK_STATE_VISIBLE is no guarantee that the object is actually unobscured on the screen, only
* that it is 'potentially' visible, barring obstruction, being scrolled or clipped out of the
* field of view, or having an ancestor container that has not yet made visible.
* A widget is potentially onscreen if it has both %ATK_STATE_VISIBLE and %ATK_STATE_SHOWING.
* The absence of %ATK_STATE_VISIBLE and %ATK_STATE_SHOWING is semantically equivalent to saying
* that an object is 'hidden'. See also %ATK_STATE_TRUNCATED, which applies if an object with
* %ATK_STATE_VISIBLE and %ATK_STATE_SHOWING set lies within a viewport which means that its
* contents are clipped, e.g. a truncated spreadsheet cell or
* an image within a scrolling viewport. Mostly useful for screen-review and magnification
* algorithms.
*@ATK_STATE_MANAGES_DESCENDANTS: Indicates that "active-descendant-changed" event
* is sent when children become 'active' (i.e. are selected or navigated to onscreen).
* Used to prevent need to enumerate all children in very large containers, like tables.
* The presence of STATE_MANAGES_DESCENDANTS is an indication to the client.
* that the children should not, and need not, be enumerated by the client.
* Objects implementing this state are expected to provide relevant state
* notifications to listening clients, for instance notifications of visibility
* changes and activation of their contained child objects, without the client
* having previously requested references to those children.
*@ATK_STATE_INDETERMINATE: Indicates that the value, or some other quantifiable
* property, of this AtkObject cannot be fully determined. In the case of a large
* data set in which the total number of items in that set is unknown (e.g. 1 of
* 999+), implementors should expose the currently-known set size (999) along
* with this state. In the case of a check box, this state should be used to
* indicate that the check box is a tri-state check box which is currently
* neither checked nor unchecked.
*@ATK_STATE_TRUNCATED: Indicates that an object is truncated, e.g. a text value in a speradsheet cell.
*@ATK_STATE_REQUIRED: Indicates that explicit user interaction with an object is required by the user interface, e.g. a required field in a "web-form" interface.
*@ATK_STATE_INVALID_ENTRY: Indicates that the object has encountered an error condition due to failure of input validation. For instance, a form control may acquire this state in response to invalid or malformed user input.
*@ATK_STATE_SUPPORTS_AUTOCOMPLETION: Indicates that the object in question implements some form of ¨typeahead¨ or
* pre-selection behavior whereby entering the first character of one or more sub-elements
* causes those elements to scroll into view or become selected. Subsequent character input
* may narrow the selection further as long as one or more sub-elements match the string.
* This state is normally only useful and encountered on objects that implement Selection.
* In some cases the typeahead behavior may result in full or partial ¨completion¨ of
* the data in the input field, in which case these input events may trigger text-changed
* events from the AtkText interface. This state supplants @ATK_ROLE_AUTOCOMPLETE.
*@ATK_STATE_SELECTABLE_TEXT:Indicates that the object in question supports text selection. It should only be exposed on objects which implement the Text interface, in order to distinguish this state from @ATK_STATE_SELECTABLE, which infers that the object in question is a selectable child of an object which implements Selection. While similar, text selection and subelement selection are distinct operations.
*@ATK_STATE_DEFAULT: Indicates that the object is the "default" active component, i.e. the object which is activated by an end-user press of the "Enter" or "Return" key. Typically a "close" or "submit" button.
*@ATK_STATE_ANIMATED: Indicates that the object changes its appearance dynamically as an inherent part of its presentation. This state may come and go if an object is only temporarily animated on the way to a 'final' onscreen presentation.
* **note**: some applications, notably content viewers, may not be able to detect
* all kinds of animated content. Therefore the absence of this state should not
* be taken as definitive evidence that the object's visual representation is
* static; this state is advisory.
*@ATK_STATE_VISITED: Indicates that the object (typically a hyperlink) has already been 'activated', and/or its backing data has already been downloaded, rendered, or otherwise "visited".
*@ATK_STATE_CHECKABLE: Indicates this object has the potential to be
* checked, such as a checkbox or toggle-able table cell. @Since:
* ATK-2.12
*@ATK_STATE_HAS_POPUP: Indicates that the object has a popup context
* menu or sub-level menu which may or may not be showing. This means
* that activation renders conditional content. Note that ordinary
* tooltips are not considered popups in this context. @Since: ATK-2.12
*@ATK_STATE_HAS_TOOLTIP: Indicates this object has a tooltip. @Since: ATK-2.16
*@ATK_STATE_READ_ONLY: Indicates that a widget which is ENABLED and SENSITIVE
* has a value which can be read, but not modified, by the user. Note that this
* state should only be applied to widget types whose value is normally directly
* user modifiable, such as check boxes, radio buttons, spin buttons, text input
* fields, and combo boxes, as a means to convey that the expected interaction
* with that widget is not possible. When the expected interaction with a
* widget does not include modification by the user, as is the case with
* labels and containers, ATK_STATE_READ_ONLY should not be applied. See also
* ATK_STATE_EDITABLE. @Since: ATK-2-16
*@ATK_STATE_LAST_DEFINED: Not a valid state, used for finding end of enumeration
*
*The possible types of states of an object
**/
typedef enum
{
ATK_STATE_INVALID,
ATK_STATE_ACTIVE,
ATK_STATE_ARMED,
ATK_STATE_BUSY,
ATK_STATE_CHECKED,
ATK_STATE_DEFUNCT,
ATK_STATE_EDITABLE,
ATK_STATE_ENABLED,
ATK_STATE_EXPANDABLE,
ATK_STATE_EXPANDED,
ATK_STATE_FOCUSABLE,
ATK_STATE_FOCUSED,
ATK_STATE_HORIZONTAL,
ATK_STATE_ICONIFIED,
ATK_STATE_MODAL,
ATK_STATE_MULTI_LINE,
ATK_STATE_MULTISELECTABLE,
ATK_STATE_OPAQUE,
ATK_STATE_PRESSED,
ATK_STATE_RESIZABLE,
ATK_STATE_SELECTABLE,
ATK_STATE_SELECTED,
ATK_STATE_SENSITIVE,
ATK_STATE_SHOWING,
ATK_STATE_SINGLE_LINE,
ATK_STATE_STALE,
ATK_STATE_TRANSIENT,
ATK_STATE_VERTICAL,
ATK_STATE_VISIBLE,
ATK_STATE_MANAGES_DESCENDANTS,
ATK_STATE_INDETERMINATE,
ATK_STATE_TRUNCATED,
ATK_STATE_REQUIRED,
ATK_STATE_INVALID_ENTRY,
ATK_STATE_SUPPORTS_AUTOCOMPLETION,
ATK_STATE_SELECTABLE_TEXT,
ATK_STATE_DEFAULT,
ATK_STATE_ANIMATED,
ATK_STATE_VISITED,
ATK_STATE_CHECKABLE,
ATK_STATE_HAS_POPUP,
ATK_STATE_HAS_TOOLTIP,
ATK_STATE_READ_ONLY,
ATK_STATE_LAST_DEFINED
} AtkStateType;
/**
* AtkScrollType:
* @ATK_SCROLL_TOP_LEFT: Scroll the object vertically and horizontally to bring
* its top left corner to the top left corner of the window.
* @ATK_SCROLL_BOTTOM_RIGHT: Scroll the object vertically and horizontally to
* bring its bottom right corner to the bottom right corner of the window.
* @ATK_SCROLL_TOP_EDGE: Scroll the object vertically to bring its top edge to
* the top edge of the window.
* @ATK_SCROLL_BOTTOM_EDGE: Scroll the object vertically to bring its bottom
* edge to the bottom edge of the window.
* @ATK_SCROLL_LEFT_EDGE: Scroll the object vertically and horizontally to bring
* its left edge to the left edge of the window.
* @ATK_SCROLL_RIGHT_EDGE: Scroll the object vertically and horizontally to
* bring its right edge to the right edge of the window.
* @ATK_SCROLL_ANYWHERE: Scroll the object vertically and horizontally so that
* as much as possible of the object becomes visible. The exact placement is
* determined by the application.
*
* Specifies where an object should be placed on the screen when using scroll_to.
*/
typedef enum {
ATK_SCROLL_TOP_LEFT,
ATK_SCROLL_BOTTOM_RIGHT,
ATK_SCROLL_TOP_EDGE,
ATK_SCROLL_BOTTOM_EDGE,
ATK_SCROLL_LEFT_EDGE,
ATK_SCROLL_RIGHT_EDGE,
ATK_SCROLL_ANYWHERE
} AtkScrollType;
/**
*AtkRelationType:
*@ATK_RELATION_NULL: Not used, represens "no relationship" or an error condition.
*@ATK_RELATION_CONTROLLED_BY: Indicates an object controlled by one or more target objects.
*@ATK_RELATION_CONTROLLER_FOR: Indicates an object is an controller for one or more target objects.
*@ATK_RELATION_LABEL_FOR: Indicates an object is a label for one or more target objects.
*@ATK_RELATION_LABELLED_BY: Indicates an object is labelled by one or more target objects.
*@ATK_RELATION_MEMBER_OF: Indicates an object is a member of a group of one or more target objects.
*@ATK_RELATION_NODE_CHILD_OF: Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell.
*@ATK_RELATION_FLOWS_TO: Indicates that the object has content that flows logically to another
* AtkObject in a sequential way, (for instance text-flow).
*@ATK_RELATION_FLOWS_FROM: Indicates that the object has content that flows logically from
* another AtkObject in a sequential way, (for instance text-flow).
*@ATK_RELATION_SUBWINDOW_OF: Indicates a subwindow attached to a component but otherwise has no connection in the UI heirarchy to that component.
*@ATK_RELATION_EMBEDS: Indicates that the object visually embeds
* another object's content, i.e. this object's content flows around
* another's content.
*@ATK_RELATION_EMBEDDED_BY: Reciprocal of %ATK_RELATION_EMBEDS, indicates that
* this object's content is visualy embedded in another object.
*@ATK_RELATION_POPUP_FOR: Indicates that an object is a popup for another object.
*@ATK_RELATION_PARENT_WINDOW_OF: Indicates that an object is a parent window of another object.
*@ATK_RELATION_DESCRIBED_BY: Reciprocal of %ATK_RELATION_DESCRIPTION_FOR. Indicates that one
* or more target objects provide descriptive information about this object. This relation
* type is most appropriate for information that is not essential as its presentation may
* be user-configurable and/or limited to an on-demand mechanism such as an assistive
* technology command. For brief, essential information such as can be found in a widget's
* on-screen label, use %ATK_RELATION_LABELLED_BY. For an on-screen error message, use
* %ATK_RELATION_ERROR_MESSAGE. For lengthy extended descriptive information contained in
* an on-screen object, consider using %ATK_RELATION_DETAILS as assistive technologies may
* provide a means for the user to navigate to objects containing detailed descriptions so
* that their content can be more closely reviewed.
*@ATK_RELATION_DESCRIPTION_FOR: Reciprocal of %ATK_RELATION_DESCRIBED_BY. Indicates that this
* object provides descriptive information about the target object(s). See also
* %ATK_RELATION_DETAILS_FOR and %ATK_RELATION_ERROR_FOR.
*@ATK_RELATION_NODE_PARENT_OF: Indicates an object is a cell in a treetable and is expanded to display other cells in the same column.
*@ATK_RELATION_DETAILS: Reciprocal of %ATK_RELATION_DETAILS_FOR. Indicates that this object
* has a detailed or extended description, the contents of which can be found in the target
* object(s). This relation type is most appropriate for information that is sufficiently
* lengthy as to make navigation to the container of that information desirable. For less
* verbose information suitable for announcement only, see %ATK_RELATION_DESCRIBED_BY. If
* the detailed information describes an error condition, %ATK_RELATION_ERROR_FOR should be
* used instead. @Since: ATK-2.26.
*@ATK_RELATION_DETAILS_FOR: Reciprocal of %ATK_RELATION_DETAILS. Indicates that this object
* provides a detailed or extended description about the target object(s). See also
* %ATK_RELATION_DESCRIPTION_FOR and %ATK_RELATION_ERROR_FOR. @Since: ATK-2.26.
*@ATK_RELATION_ERROR_MESSAGE: Reciprocal of %ATK_RELATION_ERROR_FOR. Indicates that this object
* has one or more errors, the nature of which is described in the contents of the target
* object(s). Objects that have this relation type should also contain %ATK_STATE_INVALID_ENTRY
* in their #AtkStateSet. @Since: ATK-2.26.
*@ATK_RELATION_ERROR_FOR: Reciprocal of %ATK_RELATION_ERROR_MESSAGE. Indicates that this object
* contains an error message describing an invalid condition in the target object(s). @Since:
* ATK_2.26.
*@ATK_RELATION_LAST_DEFINED: Not used, this value indicates the end of the enumeration.
*
*Describes the type of the relation
**/
typedef enum
{
ATK_RELATION_NULL = 0,
ATK_RELATION_CONTROLLED_BY,
ATK_RELATION_CONTROLLER_FOR,
ATK_RELATION_LABEL_FOR,
ATK_RELATION_LABELLED_BY,
ATK_RELATION_MEMBER_OF,
ATK_RELATION_NODE_CHILD_OF,
ATK_RELATION_FLOWS_TO,
ATK_RELATION_FLOWS_FROM,
ATK_RELATION_SUBWINDOW_OF,
ATK_RELATION_EMBEDS,
ATK_RELATION_EMBEDDED_BY,
ATK_RELATION_POPUP_FOR,
ATK_RELATION_PARENT_WINDOW_OF,
ATK_RELATION_DESCRIBED_BY,
ATK_RELATION_DESCRIPTION_FOR,
ATK_RELATION_NODE_PARENT_OF,
ATK_RELATION_DETAILS,
ATK_RELATION_DETAILS_FOR,
ATK_RELATION_ERROR_MESSAGE,
ATK_RELATION_ERROR_FOR,
ATK_RELATION_LAST_DEFINED
} AtkRelationType;
/**
*AtkTextAttribute:
*@ATK_TEXT_ATTR_INVALID: Invalid attribute, like bad spelling or grammar.
*@ATK_TEXT_ATTR_LEFT_MARGIN: The pixel width of the left margin
*@ATK_TEXT_ATTR_RIGHT_MARGIN: The pixel width of the right margin
*@ATK_TEXT_ATTR_INDENT: The number of pixels that the text is indented
*@ATK_TEXT_ATTR_INVISIBLE: Either "true" or "false" indicating whether text is visible or not
*@ATK_TEXT_ATTR_EDITABLE: Either "true" or "false" indicating whether text is editable or not
*@ATK_TEXT_ATTR_PIXELS_ABOVE_LINES: Pixels of blank space to leave above each newline-terminated line.
*@ATK_TEXT_ATTR_PIXELS_BELOW_LINES: Pixels of blank space to leave below each newline-terminated line.
*@ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP: Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph).
*@ATK_TEXT_ATTR_BG_FULL_HEIGHT: "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character.
*@ATK_TEXT_ATTR_RISE: Number of pixels that the characters are risen above the baseline. See also ATK_TEXT_ATTR_TEXT_POSITION.
*@ATK_TEXT_ATTR_UNDERLINE: "none", "single", "double", "low", or "error"
*@ATK_TEXT_ATTR_STRIKETHROUGH: "true" or "false" whether the text is strikethrough
*@ATK_TEXT_ATTR_SIZE: The size of the characters in points. eg: 10
*@ATK_TEXT_ATTR_SCALE: The scale of the characters. The value is a string representation of a double
*@ATK_TEXT_ATTR_WEIGHT: The weight of the characters.
*@ATK_TEXT_ATTR_LANGUAGE: The language used
*@ATK_TEXT_ATTR_FAMILY_NAME: The font family name
*@ATK_TEXT_ATTR_BG_COLOR: The background color. The value is an RGB value of the format "%u,%u,%u"
*@ATK_TEXT_ATTR_FG_COLOR:The foreground color. The value is an RGB value of the format "%u,%u,%u"
*@ATK_TEXT_ATTR_BG_STIPPLE: "true" if a #GdkBitmap is set for stippling the background color.
*@ATK_TEXT_ATTR_FG_STIPPLE: "true" if a #GdkBitmap is set for stippling the foreground color.
*@ATK_TEXT_ATTR_WRAP_MODE: The wrap mode of the text, if any. Values are "none", "char", "word", or "word_char".
*@ATK_TEXT_ATTR_DIRECTION: The direction of the text, if set. Values are "none", "ltr" or "rtl"
*@ATK_TEXT_ATTR_JUSTIFICATION: The justification of the text, if set. Values are "left", "right", "center" or "fill"
*@ATK_TEXT_ATTR_STRETCH: The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" or "ultra_expanded"
*@ATK_TEXT_ATTR_VARIANT: The capitalization variant of the text, if set. Values are "normal" or "small_caps"
*@ATK_TEXT_ATTR_STYLE: The slant style of the text, if set. Values are "normal", "oblique" or "italic"
*@ATK_TEXT_ATTR_TEXT_POSITION: The vertical position with respect to the baseline. Values are "baseline", "super", or "sub". Note that a super or sub text attribute refers to position with respect to the baseline of the prior character.
*@ATK_TEXT_ATTR_LAST_DEFINED: not a valid text attribute, used for finding end of enumeration
*
* Describes the text attributes supported
**/
typedef enum
{
ATK_TEXT_ATTR_INVALID = 0,
ATK_TEXT_ATTR_LEFT_MARGIN,
ATK_TEXT_ATTR_RIGHT_MARGIN,
ATK_TEXT_ATTR_INDENT,
ATK_TEXT_ATTR_INVISIBLE,
ATK_TEXT_ATTR_EDITABLE,
ATK_TEXT_ATTR_PIXELS_ABOVE_LINES,
ATK_TEXT_ATTR_PIXELS_BELOW_LINES,
ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP,
ATK_TEXT_ATTR_BG_FULL_HEIGHT,
ATK_TEXT_ATTR_RISE,
ATK_TEXT_ATTR_UNDERLINE,
ATK_TEXT_ATTR_STRIKETHROUGH,
ATK_TEXT_ATTR_SIZE,
ATK_TEXT_ATTR_SCALE,
ATK_TEXT_ATTR_WEIGHT,
ATK_TEXT_ATTR_LANGUAGE,
ATK_TEXT_ATTR_FAMILY_NAME,
ATK_TEXT_ATTR_BG_COLOR,
ATK_TEXT_ATTR_FG_COLOR,
ATK_TEXT_ATTR_BG_STIPPLE,
ATK_TEXT_ATTR_FG_STIPPLE,
ATK_TEXT_ATTR_WRAP_MODE,
ATK_TEXT_ATTR_DIRECTION,
ATK_TEXT_ATTR_JUSTIFICATION,
ATK_TEXT_ATTR_STRETCH,
ATK_TEXT_ATTR_VARIANT,
ATK_TEXT_ATTR_STYLE,
ATK_TEXT_ATTR_TEXT_POSITION,
ATK_TEXT_ATTR_LAST_DEFINED
} AtkTextAttribute;
/**
*AtkTextBoundary:
*@ATK_TEXT_BOUNDARY_CHAR: Boundary is the boundary between characters
* (including non-printing characters)
*@ATK_TEXT_BOUNDARY_WORD_START: Boundary is the start (i.e. first character) of a word.
*@ATK_TEXT_BOUNDARY_WORD_END: Boundary is the end (i.e. last
* character) of a word.
*@ATK_TEXT_BOUNDARY_SENTENCE_START: Boundary is the first character in a sentence.
*@ATK_TEXT_BOUNDARY_SENTENCE_END: Boundary is the last (terminal)
* character in a sentence; in languages which use "sentence stop"
* punctuation such as English, the boundary is thus the '.', '?', or
* similar terminal punctuation character.
*@ATK_TEXT_BOUNDARY_LINE_START: Boundary is the initial character of the content or a
* character immediately following a newline, linefeed, or return character.
*@ATK_TEXT_BOUNDARY_LINE_END: Boundary is the linefeed, or return
* character.
*
* Text boundary types used for specifying boundaries for regions of text.
* This enumeration is deprecated since 2.9.4 and should not be used. Use
* AtkTextGranularity with #atk_text_get_string_at_offset instead.
**/
typedef enum {
ATK_TEXT_BOUNDARY_CHAR,
ATK_TEXT_BOUNDARY_WORD_START,
ATK_TEXT_BOUNDARY_WORD_END,
ATK_TEXT_BOUNDARY_SENTENCE_START,
ATK_TEXT_BOUNDARY_SENTENCE_END,
ATK_TEXT_BOUNDARY_LINE_START,
ATK_TEXT_BOUNDARY_LINE_END
} AtkTextBoundary;
/**
*AtkTextGranularity:
*@ATK_TEXT_GRANULARITY_CHAR: Granularity is defined by the boundaries between characters
* (including non-printing characters)
*@ATK_TEXT_GRANULARITY_WORD: Granularity is defined by the boundaries of a word,
* starting at the beginning of the current word and finishing at the beginning of
* the following one, if present.
*@ATK_TEXT_GRANULARITY_SENTENCE: Granularity is defined by the boundaries of a sentence,
* starting at the beginning of the current sentence and finishing at the beginning of
* the following one, if present.
*@ATK_TEXT_GRANULARITY_LINE: Granularity is defined by the boundaries of a line,
* starting at the beginning of the current line and finishing at the beginning of
* the following one, if present.
*@ATK_TEXT_GRANULARITY_PARAGRAPH: Granularity is defined by the boundaries of a paragraph,
* starting at the beginning of the current paragraph and finishing at the beginning of
* the following one, if present.
*
* Text granularity types used for specifying the granularity of the region of
* text we are interested in.
**/
typedef enum {
ATK_TEXT_GRANULARITY_CHAR,
ATK_TEXT_GRANULARITY_WORD,
ATK_TEXT_GRANULARITY_SENTENCE,
ATK_TEXT_GRANULARITY_LINE,
ATK_TEXT_GRANULARITY_PARAGRAPH
} AtkTextGranularity;
/**
*AtkTextClipType:
*@ATK_TEXT_CLIP_NONE: No clipping to be done
*@ATK_TEXT_CLIP_MIN: Text clipped by min coordinate is omitted
*@ATK_TEXT_CLIP_MAX: Text clipped by max coordinate is omitted
*@ATK_TEXT_CLIP_BOTH: Only text fully within mix/max bound is retained
*
*Describes the type of clipping required.
**/
typedef enum {
ATK_TEXT_CLIP_NONE,
ATK_TEXT_CLIP_MIN,
ATK_TEXT_CLIP_MAX,
ATK_TEXT_CLIP_BOTH
} AtkTextClipType;
/**
*AtkKeyEventType:
*@ATK_KEY_EVENT_PRESS: specifies a key press event
*@ATK_KEY_EVENT_RELEASE: specifies a key release event
*@ATK_KEY_EVENT_LAST_DEFINED: Not a valid value; specifies end of enumeration
*
*Specifies the type of a keyboard evemt.
**/
typedef enum
{
ATK_KEY_EVENT_PRESS,
ATK_KEY_EVENT_RELEASE,
ATK_KEY_EVENT_LAST_DEFINED
} AtkKeyEventType;
/**
*AtkCoordType:
*@ATK_XY_SCREEN: specifies xy coordinates relative to the screen
*@ATK_XY_WINDOW: specifies xy coordinates relative to the widget's
* top-level window
*@ATK_XY_PARENT: specifies xy coordinates relative to the widget's
* immediate parent. Since: 2.30
*
*Specifies how xy coordinates are to be interpreted. Used by functions such
*as atk_component_get_position() and atk_text_get_character_extents()
**/
typedef enum {
ATK_XY_SCREEN,
ATK_XY_WINDOW,
ATK_XY_PARENT
}AtkCoordType;
/**
*AtkRole:
*@ATK_ROLE_INVALID: Invalid role
*@ATK_ROLE_ACCEL_LABEL: A label which represents an accelerator
*@ATK_ROLE_ALERT: An object which is an alert to the user. Assistive Technologies typically respond to ATK_ROLE_ALERT by reading the entire onscreen contents of containers advertising this role. Should be used for warning dialogs, etc.
*@ATK_ROLE_ANIMATION: An object which is an animated image
*@ATK_ROLE_ARROW: An arrow in one of the four cardinal directions
*@ATK_ROLE_CALENDAR: An object that displays a calendar and allows the user to select a date
*@ATK_ROLE_CANVAS: An object that can be drawn into and is used to trap events
*@ATK_ROLE_CHECK_BOX: A choice that can be checked or unchecked and provides a separate indicator for the current state
*@ATK_ROLE_CHECK_MENU_ITEM: A menu item with a check box
*@ATK_ROLE_COLOR_CHOOSER: A specialized dialog that lets the user choose a color
*@ATK_ROLE_COLUMN_HEADER: The header for a column of data
*@ATK_ROLE_COMBO_BOX: A collapsible list of choices the user can select from
*@ATK_ROLE_DATE_EDITOR: An object whose purpose is to allow a user to edit a date
*@ATK_ROLE_DESKTOP_ICON: An inconifed internal frame within a DESKTOP_PANE
*@ATK_ROLE_DESKTOP_FRAME: A pane that supports internal frames and iconified versions of those internal frames
*@ATK_ROLE_DIAL: An object whose purpose is to allow a user to set a value
*@ATK_ROLE_DIALOG: A top level window with title bar and a border
*@ATK_ROLE_DIRECTORY_PANE: A pane that allows the user to navigate through and select the contents of a directory
*@ATK_ROLE_DRAWING_AREA: An object used for drawing custom user interface elements
*@ATK_ROLE_FILE_CHOOSER: A specialized dialog that lets the user choose a file
*@ATK_ROLE_FILLER: A object that fills up space in a user interface
*@ATK_ROLE_FONT_CHOOSER: A specialized dialog that lets the user choose a font
*@ATK_ROLE_FRAME: A top level window with a title bar, border, menubar, etc.
*@ATK_ROLE_GLASS_PANE: A pane that is guaranteed to be painted on top of all panes beneath it
*@ATK_ROLE_HTML_CONTAINER: A document container for HTML, whose children represent the document content
*@ATK_ROLE_ICON: A small fixed size picture, typically used to decorate components
*@ATK_ROLE_IMAGE: An object whose primary purpose is to display an image
*@ATK_ROLE_INTERNAL_FRAME: A frame-like object that is clipped by a desktop pane
*@ATK_ROLE_LABEL: An object used to present an icon or short string in an interface
*@ATK_ROLE_LAYERED_PANE: A specialized pane that allows its children to be drawn in layers, providing a form of stacking order
*@ATK_ROLE_LIST: An object that presents a list of objects to the user and allows the user to select one or more of them
*@ATK_ROLE_LIST_ITEM: An object that represents an element of a list
*@ATK_ROLE_MENU: An object usually found inside a menu bar that contains a list of actions the user can choose from
*@ATK_ROLE_MENU_BAR: An object usually drawn at the top of the primary dialog box of an application that contains a list of menus the user can choose from
*@ATK_ROLE_MENU_ITEM: An object usually contained in a menu that presents an action the user can choose
*@ATK_ROLE_OPTION_PANE: A specialized pane whose primary use is inside a DIALOG
*@ATK_ROLE_PAGE_TAB: An object that is a child of a page tab list
*@ATK_ROLE_PAGE_TAB_LIST: An object that presents a series of panels (or page tabs), one at a time, through some mechanism provided by the object
*@ATK_ROLE_PANEL: A generic container that is often used to group objects
*@ATK_ROLE_PASSWORD_TEXT: A text object uses for passwords, or other places where the text content is not shown visibly to the user
*@ATK_ROLE_POPUP_MENU: A temporary window that is usually used to offer the user a list of choices, and then hides when the user selects one of those choices
*@ATK_ROLE_PROGRESS_BAR: An object used to indicate how much of a task has been completed
*@ATK_ROLE_PUSH_BUTTON: An object the user can manipulate to tell the application to do something
*@ATK_ROLE_RADIO_BUTTON: A specialized check box that will cause other radio buttons in the same group to become unchecked when this one is checked
*@ATK_ROLE_RADIO_MENU_ITEM: A check menu item which belongs to a group. At each instant exactly one of the radio menu items from a group is selected
*@ATK_ROLE_ROOT_PANE: A specialized pane that has a glass pane and a layered pane as its children
*@ATK_ROLE_ROW_HEADER: The header for a row of data
*@ATK_ROLE_SCROLL_BAR: An object usually used to allow a user to incrementally view a large amount of data.
*@ATK_ROLE_SCROLL_PANE: An object that allows a user to incrementally view a large amount of information
*@ATK_ROLE_SEPARATOR: An object usually contained in a menu to provide a visible and logical separation of the contents in a menu
*@ATK_ROLE_SLIDER: An object that allows the user to select from a bounded range
*@ATK_ROLE_SPLIT_PANE: A specialized panel that presents two other panels at the same time
*@ATK_ROLE_SPIN_BUTTON: An object used to get an integer or floating point number from the user
*@ATK_ROLE_STATUSBAR: An object which reports messages of minor importance to the user
*@ATK_ROLE_TABLE: An object used to represent information in terms of rows and columns
*@ATK_ROLE_TABLE_CELL: A cell in a table
*@ATK_ROLE_TABLE_COLUMN_HEADER: The header for a column of a table
*@ATK_ROLE_TABLE_ROW_HEADER: The header for a row of a table
*@ATK_ROLE_TEAR_OFF_MENU_ITEM: A menu item used to tear off and reattach its menu
*@ATK_ROLE_TERMINAL: An object that represents an accessible terminal. (Since: 0.6)
*@ATK_ROLE_TEXT: An interactive widget that supports multiple lines of text and
* optionally accepts user input, but whose purpose is not to solicit user input.
* Thus ATK_ROLE_TEXT is appropriate for the text view in a plain text editor
* but inappropriate for an input field in a dialog box or web form. For widgets
* whose purpose is to solicit input from the user, see ATK_ROLE_ENTRY and
* ATK_ROLE_PASSWORD_TEXT. For generic objects which display a brief amount of
* textual information, see ATK_ROLE_STATIC.
*@ATK_ROLE_TOGGLE_BUTTON: A specialized push button that can be checked or unchecked, but does not provide a separate indicator for the current state
*@ATK_ROLE_TOOL_BAR: A bar or palette usually composed of push buttons or toggle buttons
*@ATK_ROLE_TOOL_TIP: An object that provides information about another object
*@ATK_ROLE_TREE: An object used to represent hierarchical information to the user
*@ATK_ROLE_TREE_TABLE: An object capable of expanding and collapsing rows as well as showing multiple columns of data. (Since: 0.7)
*@ATK_ROLE_UNKNOWN: The object contains some Accessible information, but its role is not known
*@ATK_ROLE_VIEWPORT: An object usually used in a scroll pane
*@ATK_ROLE_WINDOW: A top level window with no title or border.
*@ATK_ROLE_HEADER: An object that serves as a document header. (Since: 1.1.1)
*@ATK_ROLE_FOOTER: An object that serves as a document footer. (Since: 1.1.1)
*@ATK_ROLE_PARAGRAPH: An object which is contains a paragraph of text content. (Since: 1.1.1)
*@ATK_ROLE_RULER: An object which describes margins and tab stops, etc. for text objects which it controls (should have CONTROLLER_FOR relation to such). (Since: 1.1.1)
*@ATK_ROLE_APPLICATION: The object is an application object, which may contain @ATK_ROLE_FRAME objects or other types of accessibles. The root accessible of any application's ATK hierarchy should have ATK_ROLE_APPLICATION. (Since: 1.1.4)
*@ATK_ROLE_AUTOCOMPLETE: The object is a dialog or list containing items for insertion into an entry widget, for instance a list of words for completion of a text entry. (Since: 1.3)
*@ATK_ROLE_EDITBAR: The object is an editable text object in a toolbar. (Since: 1.5)
*@ATK_ROLE_EMBEDDED: The object is an embedded container within a document or panel. This role is a grouping "hint" indicating that the contained objects share a context. (Since: 1.7.2)
*@ATK_ROLE_ENTRY: The object is a component whose textual content may be entered or modified by the user, provided @ATK_STATE_EDITABLE is present. (Since: 1.11)
*@ATK_ROLE_CHART: The object is a graphical depiction of quantitative data. It may contain multiple subelements whose attributes and/or description may be queried to obtain both the quantitative data and information about how the data is being presented. The LABELLED_BY relation is particularly important in interpreting objects of this type, as is the accessible-description property. (Since: 1.11)
*@ATK_ROLE_CAPTION: The object contains descriptive information, usually textual, about another user interface element such as a table, chart, or image. (Since: 1.11)
*@ATK_ROLE_DOCUMENT_FRAME: The object is a visual frame or container which contains a view of document content. Document frames may occur within another Document instance, in which case the second document may be said to be embedded in the containing instance. HTML frames are often ROLE_DOCUMENT_FRAME. Either this object, or a singleton descendant, should implement the Document interface. (Since: 1.11)
*@ATK_ROLE_HEADING: The object serves as a heading for content which follows it in a document. The 'heading level' of the heading, if availabe, may be obtained by querying the object's attributes.
*@ATK_ROLE_PAGE: The object is a containing instance which encapsulates a page of information. @ATK_ROLE_PAGE is used in documents and content which support a paginated navigation model. (Since: 1.11)
*@ATK_ROLE_SECTION: The object is a containing instance of document content which constitutes a particular 'logical' section of the document. The type of content within a section, and the nature of the section division itself, may be obtained by querying the object's attributes. Sections may be nested. (Since: 1.11)
*@ATK_ROLE_REDUNDANT_OBJECT: The object is redundant with another object in the hierarchy, and is exposed for purely technical reasons. Objects of this role should normally be ignored by clients. (Since: 1.11)
*@ATK_ROLE_FORM: The object is a container for form controls, for instance as part of a
* web form or user-input form within a document. This role is primarily a tag/convenience for
* clients when navigating complex documents, it is not expected that ordinary GUI containers will
* always have ATK_ROLE_FORM. (Since: 1.12.0)
*@ATK_ROLE_LINK: The object is a hypertext anchor, i.e. a "link" in a
* hypertext document. Such objects are distinct from 'inline'
* content which may also use the Hypertext/Hyperlink interfaces
* to indicate the range/location within a text object where
* an inline or embedded object lies. (Since: 1.12.1)
*@ATK_ROLE_INPUT_METHOD_WINDOW: The object is a window or similar viewport
* which is used to allow composition or input of a 'complex character',
* in other words it is an "input method window." (Since: 1.12.1)
*@ATK_ROLE_TABLE_ROW: A row in a table. (Since: 2.1.0)
*@ATK_ROLE_TREE_ITEM: An object that represents an element of a tree. (Since: 2.1.0)
*@ATK_ROLE_DOCUMENT_SPREADSHEET: A document frame which contains a spreadsheet. (Since: 2.1.0)
*@ATK_ROLE_DOCUMENT_PRESENTATION: A document frame which contains a presentation or slide content. (Since: 2.1.0)
*@ATK_ROLE_DOCUMENT_TEXT: A document frame which contains textual content, such as found in a word processing application. (Since: 2.1.0)
*@ATK_ROLE_DOCUMENT_WEB: A document frame which contains HTML or other markup suitable for display in a web browser. (Since: 2.1.0)
*@ATK_ROLE_DOCUMENT_EMAIL: A document frame which contains email content to be displayed or composed either in plain text or HTML. (Since: 2.1.0)
*@ATK_ROLE_COMMENT: An object found within a document and designed to present a comment, note, or other annotation. In some cases, this object might not be visible until activated. (Since: 2.1.0)
*@ATK_ROLE_LIST_BOX: A non-collapsible list of choices the user can select from. (Since: 2.1.0)
*@ATK_ROLE_GROUPING: A group of related widgets. This group typically has a label. (Since: 2.1.0)
*@ATK_ROLE_IMAGE_MAP: An image map object. Usually a graphic with multiple hotspots, where each hotspot can be activated resulting in the loading of another document or section of a document. (Since: 2.1.0)
*@ATK_ROLE_NOTIFICATION: A transitory object designed to present a message to the user, typically at the desktop level rather than inside a particular application. (Since: 2.1.0)
*@ATK_ROLE_INFO_BAR: An object designed to present a message to the user within an existing window. (Since: 2.1.0)
*@ATK_ROLE_LEVEL_BAR: A bar that serves as a level indicator to, for instance, show the strength of a password or the state of a battery. (Since: 2.7.3)
*@ATK_ROLE_TITLE_BAR: A bar that serves as the title of a window or a
* dialog. (Since: 2.12)
*@ATK_ROLE_BLOCK_QUOTE: An object which contains a text section
* that is quoted from another source. (Since: 2.12)
*@ATK_ROLE_AUDIO: An object which represents an audio element. (Since: 2.12)
*@ATK_ROLE_VIDEO: An object which represents a video element. (Since: 2.12)
*@ATK_ROLE_DEFINITION: A definition of a term or concept. (Since: 2.12)
*@ATK_ROLE_ARTICLE: A section of a page that consists of a
* composition that forms an independent part of a document, page, or
* site. Examples: A blog entry, a news story, a forum post. (Since: 2.12)
*@ATK_ROLE_LANDMARK: A region of a web page intended as a
* navigational landmark. This is designed to allow Assistive
* Technologies to provide quick navigation among key regions within a
* document. (Since: 2.12)
*@ATK_ROLE_LOG: A text widget or container holding log content, such
* as chat history and error logs. In this role there is a
* relationship between the arrival of new items in the log and the
* reading order. The log contains a meaningful sequence and new
* information is added only to the end of the log, not at arbitrary
* points. (Since: 2.12)
*@ATK_ROLE_MARQUEE: A container where non-essential information
* changes frequently. Common usages of marquee include stock tickers
* and ad banners. The primary difference between a marquee and a log
* is that logs usually have a meaningful order or sequence of
* important content changes. (Since: 2.12)
*@ATK_ROLE_MATH: A text widget or container that holds a mathematical
* expression. (Since: 2.12)
*@ATK_ROLE_RATING: A widget whose purpose is to display a rating,
* such as the number of stars associated with a song in a media
* player. Objects of this role should also implement
* AtkValue. (Since: 2.12)
*@ATK_ROLE_TIMER: An object containing a numerical counter which
* indicates an amount of elapsed time from a start point, or the time
* remaining until an end point. (Since: 2.12)
*@ATK_ROLE_DESCRIPTION_LIST: An object that represents a list of
* term-value groups. A term-value group represents a individual
* description and consist of one or more names
* (ATK_ROLE_DESCRIPTION_TERM) followed by one or more values
* (ATK_ROLE_DESCRIPTION_VALUE). For each list, there should not be
* more than one group with the same term name. (Since: 2.12)
*@ATK_ROLE_DESCRIPTION_TERM: An object that represents a term or phrase
* with a corresponding definition. (Since: 2.12)
*@ATK_ROLE_DESCRIPTION_VALUE: An object that represents the
* description, definition or value of a term. (Since: 2.12)
*@ATK_ROLE_STATIC: A generic non-container object whose purpose is to display a
* brief amount of information to the user and whose role is known by the
* implementor but lacks semantic value for the user. Examples in which
* %ATK_ROLE_STATIC is appropriate include the message displayed in a message box
* and an image used as an alternative means to display text. %ATK_ROLE_STATIC
* should not be applied to widgets which are traditionally interactive, objects
* which display a significant amount of content, or any object which has an
* accessible relation pointing to another object. Implementors should expose the
* displayed information through the accessible name of the object. If doing so seems
* inappropriate, it may indicate that a different role should be used. For
* labels which describe another widget, see %ATK_ROLE_LABEL. For text views, see
* %ATK_ROLE_TEXT. For generic containers, see %ATK_ROLE_PANEL. For objects whose
* role is not known by the implementor, see %ATK_ROLE_UNKNOWN. (Since: 2.16)
*@ATK_ROLE_MATH_FRACTION: An object that represents a mathematical fraction.
* (Since: 2.16)
*@ATK_ROLE_MATH_ROOT: An object that represents a mathematical expression
* displayed with a radical. (Since: 2.16)
*@ATK_ROLE_SUBSCRIPT: An object that contains text that is displayed as a
* subscript. (Since: 2.16)
*@ATK_ROLE_SUPERSCRIPT: An object that contains text that is displayed as a
* superscript. (Since: 2.16)
*@ATK_ROLE_FOOTNOTE: An object that contains the text of a footnote. (Since: 2.26)
*@ATK_ROLE_CONTENT_DELETION: Content previously deleted or proposed to be
* deleted, e.g. in revision history or a content view providing suggestions
* from reviewers. (Since: 2.34)
*@ATK_ROLE_CONTENT_INSERTION: Content previously inserted or proposed to be
* inserted, e.g. in revision history or a content view providing suggestions
* from reviewers. (Since: 2.34)
*@ATK_ROLE_MARK: A run of content that is marked or highlighted, such as for
* reference purposes, or to call it out as having a special purpose. If the
* marked content has an associated section in the document elaborating on the
* reason for the mark, then %ATK_RELATION_DETAILS should be used on the mark
* to point to that associated section. In addition, the reciprocal relation
* %ATK_RELATION_DETAILS_FOR should be used on the associated content section
* to point back to the mark. (Since: 2.36)
*@ATK_ROLE_SUGGESTION: A container for content that is called out as a proposed
* change from the current version of the document, such as by a reviewer of the
* content. This role should include either %ATK_ROLE_CONTENT_DELETION and/or
* %ATK_ROLE_CONTENT_INSERTION children, in any order, to indicate what the
* actual change is. (Since: 2.36)
*@ATK_ROLE_LAST_DEFINED: not a valid role, used for finding end of the enumeration
*
* Describes the role of an object
*
* These are the built-in enumerated roles that UI components can have
* in ATK. Other roles may be added at runtime, so an AtkRole >=
* %ATK_ROLE_LAST_DEFINED is not necessarily an error.
*/
typedef enum
{
ATK_ROLE_INVALID = 0,
ATK_ROLE_ACCEL_LABEL, /*<nick=accelerator-label>*/
ATK_ROLE_ALERT,
ATK_ROLE_ANIMATION,
ATK_ROLE_ARROW,
ATK_ROLE_CALENDAR,
ATK_ROLE_CANVAS,
ATK_ROLE_CHECK_BOX,
ATK_ROLE_CHECK_MENU_ITEM,
ATK_ROLE_COLOR_CHOOSER,
ATK_ROLE_COLUMN_HEADER,
ATK_ROLE_COMBO_BOX,
ATK_ROLE_DATE_EDITOR,
ATK_ROLE_DESKTOP_ICON,
ATK_ROLE_DESKTOP_FRAME,
ATK_ROLE_DIAL,
ATK_ROLE_DIALOG,
ATK_ROLE_DIRECTORY_PANE,
ATK_ROLE_DRAWING_AREA,
ATK_ROLE_FILE_CHOOSER,
ATK_ROLE_FILLER,
ATK_ROLE_FONT_CHOOSER,
ATK_ROLE_FRAME,
ATK_ROLE_GLASS_PANE,
ATK_ROLE_HTML_CONTAINER,
ATK_ROLE_ICON,
ATK_ROLE_IMAGE,
ATK_ROLE_INTERNAL_FRAME,
ATK_ROLE_LABEL,
ATK_ROLE_LAYERED_PANE,
ATK_ROLE_LIST,
ATK_ROLE_LIST_ITEM,
ATK_ROLE_MENU,
ATK_ROLE_MENU_BAR,
ATK_ROLE_MENU_ITEM,
ATK_ROLE_OPTION_PANE,
ATK_ROLE_PAGE_TAB,
ATK_ROLE_PAGE_TAB_LIST,
ATK_ROLE_PANEL,
ATK_ROLE_PASSWORD_TEXT,
ATK_ROLE_POPUP_MENU,
ATK_ROLE_PROGRESS_BAR,
ATK_ROLE_PUSH_BUTTON,
ATK_ROLE_RADIO_BUTTON,
ATK_ROLE_RADIO_MENU_ITEM,
ATK_ROLE_ROOT_PANE,
ATK_ROLE_ROW_HEADER,
ATK_ROLE_SCROLL_BAR,
ATK_ROLE_SCROLL_PANE,
ATK_ROLE_SEPARATOR,
ATK_ROLE_SLIDER,
ATK_ROLE_SPLIT_PANE,
ATK_ROLE_SPIN_BUTTON,
ATK_ROLE_STATUSBAR,
ATK_ROLE_TABLE,
ATK_ROLE_TABLE_CELL,
ATK_ROLE_TABLE_COLUMN_HEADER,
ATK_ROLE_TABLE_ROW_HEADER,
ATK_ROLE_TEAR_OFF_MENU_ITEM,
ATK_ROLE_TERMINAL,
ATK_ROLE_TEXT,
ATK_ROLE_TOGGLE_BUTTON,
ATK_ROLE_TOOL_BAR,
ATK_ROLE_TOOL_TIP,
ATK_ROLE_TREE,
ATK_ROLE_TREE_TABLE,
ATK_ROLE_UNKNOWN,
ATK_ROLE_VIEWPORT,
ATK_ROLE_WINDOW,
ATK_ROLE_HEADER,
ATK_ROLE_FOOTER,
ATK_ROLE_PARAGRAPH,
ATK_ROLE_RULER,
ATK_ROLE_APPLICATION,
ATK_ROLE_AUTOCOMPLETE,
ATK_ROLE_EDITBAR, /*<nick=edit-bar>*/
ATK_ROLE_EMBEDDED,
ATK_ROLE_ENTRY,
ATK_ROLE_CHART,
ATK_ROLE_CAPTION,
ATK_ROLE_DOCUMENT_FRAME,
ATK_ROLE_HEADING,
ATK_ROLE_PAGE,
ATK_ROLE_SECTION,
ATK_ROLE_REDUNDANT_OBJECT,
ATK_ROLE_FORM,
ATK_ROLE_LINK,
ATK_ROLE_INPUT_METHOD_WINDOW,
ATK_ROLE_TABLE_ROW,
ATK_ROLE_TREE_ITEM,
ATK_ROLE_DOCUMENT_SPREADSHEET,
ATK_ROLE_DOCUMENT_PRESENTATION,
ATK_ROLE_DOCUMENT_TEXT,
ATK_ROLE_DOCUMENT_WEB,
ATK_ROLE_DOCUMENT_EMAIL,
ATK_ROLE_COMMENT,
ATK_ROLE_LIST_BOX,
ATK_ROLE_GROUPING,
ATK_ROLE_IMAGE_MAP,
ATK_ROLE_NOTIFICATION,
ATK_ROLE_INFO_BAR,
ATK_ROLE_LEVEL_BAR,
ATK_ROLE_TITLE_BAR,
ATK_ROLE_BLOCK_QUOTE,
ATK_ROLE_AUDIO,
ATK_ROLE_VIDEO,
ATK_ROLE_DEFINITION,
ATK_ROLE_ARTICLE,
ATK_ROLE_LANDMARK,
ATK_ROLE_LOG,
ATK_ROLE_MARQUEE,
ATK_ROLE_MATH,
ATK_ROLE_RATING,
ATK_ROLE_TIMER,
ATK_ROLE_DESCRIPTION_LIST,
ATK_ROLE_DESCRIPTION_TERM,
ATK_ROLE_DESCRIPTION_VALUE,
ATK_ROLE_STATIC,
ATK_ROLE_MATH_FRACTION,
ATK_ROLE_MATH_ROOT,
ATK_ROLE_SUBSCRIPT,
ATK_ROLE_SUPERSCRIPT,
ATK_ROLE_FOOTNOTE,
ATK_ROLE_CONTENT_DELETION,
ATK_ROLE_CONTENT_INSERTION,
ATK_ROLE_MARK,
ATK_ROLE_SUGGESTION,
ATK_ROLE_LAST_DEFINED
} AtkRole;
/**
*AtkLayer:
*@ATK_LAYER_INVALID: The object does not have a layer
*@ATK_LAYER_BACKGROUND: This layer is reserved for the desktop background
*@ATK_LAYER_CANVAS: This layer is used for Canvas components
*@ATK_LAYER_WIDGET: This layer is normally used for components
*@ATK_LAYER_MDI: This layer is used for layered components
*@ATK_LAYER_POPUP: This layer is used for popup components, such as menus
*@ATK_LAYER_OVERLAY: This layer is reserved for future use.
*@ATK_LAYER_WINDOW: This layer is used for toplevel windows.
*
* Describes the layer of a component
*
* These enumerated "layer values" are used when determining which UI
* rendering layer a component is drawn into, which can help in making
* determinations of when components occlude one another.
**/
typedef enum
{
ATK_LAYER_INVALID,
ATK_LAYER_BACKGROUND,
ATK_LAYER_CANVAS,
ATK_LAYER_WIDGET,
ATK_LAYER_MDI,
ATK_LAYER_POPUP,
ATK_LAYER_OVERLAY,
ATK_LAYER_WINDOW
} AtkLayer;
/**
* AtkValueType:
*
* Default types for a given value. Those are defined in order to
* easily get localized strings to describe a given value or a given
* subrange, using atk_value_type_get_localized_name().
*
*/
typedef enum
{
ATK_VALUE_VERY_WEAK,
ATK_VALUE_WEAK,
ATK_VALUE_ACCEPTABLE,
ATK_VALUE_STRONG,
ATK_VALUE_VERY_STRONG,
ATK_VALUE_VERY_LOW,
ATK_VALUE_LOW,
ATK_VALUE_MEDIUM,
ATK_VALUE_HIGH,
ATK_VALUE_VERY_HIGH,
ATK_VALUE_VERY_BAD,
ATK_VALUE_BAD,
ATK_VALUE_GOOD,
ATK_VALUE_VERY_GOOD,
ATK_VALUE_BEST,
ATK_VALUE_LAST_DEFINED
}AtkValueType;
G_END_DECLS

View File

@@ -1,38 +0,0 @@
/*** BEGIN file-header ***/
#include "config.h"
#include "atktypes.h"
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType
@enum_name@_get_type (void)
{
static volatile gsize g_define_type_id__volatile;
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
GType g_define_type_id =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
/*** END value-tail ***/

View File

@@ -1,26 +0,0 @@
/*** BEGIN file-header ***/
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#pragma once
#include <glib-object.h>
G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GDK_AVAILABLE_IN_ALL
GType @enum_name@_get_type (void);
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
/*** END value-header ***/
/*** BEGIN file-tail ***/
G_END_DECLS
/*** END file-tail ***/

View File

@@ -1,206 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <atk/atkgobjectaccessible.h>
#include <atk/atkregistry.h>
#include <atk/atkutil.h>
/**
* SECTION:atkgobjectaccessible
* @Short_description: This object class is derived from AtkObject and
* can be used as a basis implementing accessible objects.
* @Title:AtkGObjectAccessible
*
* This object class is derived from AtkObject. It can be used as a
* basis for implementing accessible objects for GObjects which are
* not derived from GtkWidget. One example of its use is in providing
* an accessible object for GnomeCanvasItem in the GAIL library.
*/
static void atk_gobject_accessible_class_init (AtkGObjectAccessibleClass *klass);
static void atk_real_gobject_accessible_initialize (AtkObject *atk_obj,
gpointer data);
static void atk_gobject_accessible_object_gone_cb (gpointer data);
static GQuark quark_accessible_object = 0;
static GQuark quark_object = 0;
static gpointer parent_class = NULL;
GType
atk_gobject_accessible_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (AtkGObjectAccessibleClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) atk_gobject_accessible_class_init,
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (AtkGObjectAccessible),
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (ATK_TYPE_OBJECT,
"AtkGObjectAccessible", &tinfo, 0);
}
return type;
}
/**
* atk_gobject_accessible_for_object:
* @obj: a #GObject
*
* Gets the accessible object for the specified @obj.
*
* Returns: (transfer none): a #AtkObject which is the accessible object for
* the @obj
**/
AtkObject*
atk_gobject_accessible_for_object (GObject *obj)
{
AtkObject* accessible;
g_return_val_if_fail (G_IS_OBJECT (obj), NULL);
/* See if we have a cached accessible for this object */
accessible = quark_accessible_object ? g_object_get_qdata (obj, quark_accessible_object) : NULL;
if (!accessible)
{
AtkObjectFactory *factory;
AtkRegistry *default_registry;
default_registry = atk_get_default_registry ();
factory = atk_registry_get_factory (default_registry,
G_OBJECT_TYPE (obj));
accessible = atk_object_factory_create_accessible (factory,
obj);
if (!ATK_IS_GOBJECT_ACCESSIBLE (accessible))
{
/*
* The AtkObject which was created was not a AtkGObjectAccessible
*/
g_object_weak_ref (obj,
(GWeakNotify) g_object_unref,
accessible);
if (!quark_accessible_object)
quark_accessible_object = g_quark_from_static_string ("accessible-object");
}
g_object_set_qdata (obj, quark_accessible_object, accessible);
}
return accessible;
}
/**
* atk_gobject_accessible_get_object:
* @obj: a #AtkGObjectAccessible
*
* Gets the GObject for which @obj is the accessible object.
*
* Returns: (transfer none): a #GObject which is the object for which @obj is
* the accessible object
**/
GObject *
atk_gobject_accessible_get_object (AtkGObjectAccessible *obj)
{
g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (obj), NULL);
return g_object_get_qdata (G_OBJECT (obj), quark_object);
}
static void
atk_real_gobject_accessible_initialize (AtkObject *atk_obj,
gpointer data)
{
AtkGObjectAccessible *atk_gobj;
atk_gobj = ATK_GOBJECT_ACCESSIBLE (atk_obj);
g_object_set_qdata (G_OBJECT (atk_gobj), quark_object, data);
atk_obj->layer = ATK_LAYER_WIDGET;
g_object_weak_ref (data,
(GWeakNotify) atk_gobject_accessible_object_gone_cb,
atk_gobj);
}
static void
atk_gobject_accessible_object_gone_cb (gpointer data)
{
GObject *object;
g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (data));
object = atk_gobject_accessible_get_object (data);
if (object)
g_object_set_qdata (object, quark_accessible_object, NULL);
g_object_set_qdata (G_OBJECT (data), quark_object, NULL);
atk_object_notify_state_change (ATK_OBJECT (data), ATK_STATE_DEFUNCT,
TRUE);
g_object_unref (data);
}
static void
atk_gobject_accessible_dispose (GObject *atk_obj)
{
GObject *obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (atk_obj));
if (obj) {
g_object_set_qdata (obj, quark_accessible_object, NULL);
g_object_weak_unref (obj,
(GWeakNotify) atk_gobject_accessible_object_gone_cb,
atk_obj);
g_object_set_qdata (atk_obj, quark_object, NULL);
atk_object_notify_state_change (ATK_OBJECT (atk_obj), ATK_STATE_DEFUNCT,
TRUE);
}
G_OBJECT_CLASS (parent_class)->dispose (atk_obj);
}
static void
atk_gobject_accessible_class_init (AtkGObjectAccessibleClass *klass)
{
AtkObjectClass *class;
GObjectClass *object_class;
class = ATK_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
class->initialize = atk_real_gobject_accessible_initialize;
object_class = G_OBJECT_CLASS (klass);
object_class->dispose = atk_gobject_accessible_dispose;
if (!quark_accessible_object)
quark_accessible_object = g_quark_from_static_string ("accessible-object");
quark_object = g_quark_from_static_string ("object-for-accessible");
}

View File

@@ -1,68 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_GOBJECT_ACCESSIBLE_H__
#define __ATK_GOBJECT_ACCESSIBLE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
/*
* The AtkGObjectAccessible class is provided as a basis for implementing
* accessibility support for objects which are not GTK+ widgets
*/
#define ATK_TYPE_GOBJECT_ACCESSIBLE (atk_gobject_accessible_get_type ())
#define ATK_GOBJECT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_GOBJECT_ACCESSIBLE, AtkGObjectAccessible))
#define ATK_GOBJECT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_GOBJECT_ACCESSIBLE, AtkGObjectAccessibleClass))
#define ATK_IS_GOBJECT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_GOBJECT_ACCESSIBLE))
#define ATK_IS_GOBJECT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_GOBJECT_ACCESSIBLE))
#define ATK_GOBJECT_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_GOBJECT_ACCESSIBLE, AtkGObjectAccessibleClass))
typedef struct _AtkGObjectAccessible AtkGObjectAccessible;
typedef struct _AtkGObjectAccessibleClass AtkGObjectAccessibleClass;
struct _AtkGObjectAccessible
{
AtkObject parent;
};
GDK_AVAILABLE_IN_ALL
GType atk_gobject_accessible_get_type (void);
struct _AtkGObjectAccessibleClass
{
AtkObjectClass parent_class;
AtkFunction pad1;
AtkFunction pad2;
};
GDK_AVAILABLE_IN_ALL
AtkObject *atk_gobject_accessible_for_object (GObject *obj);
GDK_AVAILABLE_IN_ALL
GObject *atk_gobject_accessible_get_object (AtkGObjectAccessible *obj);
G_END_DECLS
#endif /* __ATK_GOBJECT_ACCESSIBLE_H__ */

View File

@@ -1,373 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkhyperlink.h"
#include <glib/gi18n-lib.h>
/**
* SECTION:atkhyperlink
* @Short_description: An ATK object which encapsulates a link or set
* of links in a hypertext document.
* @Title:AtkHyperlink
*
* An ATK object which encapsulates a link or set of links (for
* instance in the case of client-side image maps) in a hypertext
* document. It may implement the AtkAction interface. AtkHyperlink
* may also be used to refer to inline embedded content, since it
* allows specification of a start and end offset within the host
* AtkHypertext object.
*/
enum
{
LINK_ACTIVATED,
LAST_SIGNAL
};
enum
{
PROP_0, /* gobject convention */
PROP_NUMBER_ANCHORS,
PROP_END_INDEX,
PROP_START_INDEX,
PROP_LAST
};
static void atk_hyperlink_class_init (AtkHyperlinkClass *klass);
static void atk_hyperlink_init (AtkHyperlink *link,
AtkHyperlinkClass *klass);
static void atk_hyperlink_real_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void atk_hyperlink_action_iface_init (AtkActionIface *iface);
static guint atk_hyperlink_signals[LAST_SIGNAL] = { 0, };
static gpointer parent_class = NULL;
GType
atk_hyperlink_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo typeInfo =
{
sizeof (AtkHyperlinkClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) atk_hyperlink_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (AtkHyperlink),
0,
(GInstanceInitFunc) atk_hyperlink_init,
} ;
static const GInterfaceInfo action_info =
{
(GInterfaceInitFunc) atk_hyperlink_action_iface_init,
(GInterfaceFinalizeFunc) NULL,
NULL
};
type = g_type_register_static (G_TYPE_OBJECT, "AtkHyperlink", &typeInfo, 0) ;
g_type_add_interface_static (type, ATK_TYPE_ACTION, &action_info);
}
return type;
}
static void
atk_hyperlink_class_init (AtkHyperlinkClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
gobject_class->get_property = atk_hyperlink_real_get_property;
klass->link_activated = NULL;
g_object_class_install_property (gobject_class,
PROP_NUMBER_ANCHORS,
g_param_spec_int ("number-of-anchors",
_("Number of Anchors"),
_("The number of anchors associated with the AtkHyperlink object"),
0,
G_MAXINT,
0,
G_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_END_INDEX,
g_param_spec_int ("end-index",
_("End index"),
_("The end index of the AtkHyperlink object"),
0,
G_MAXINT,
0,
G_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_START_INDEX,
g_param_spec_int ("start-index",
_("Start index"),
_("The start index of the AtkHyperlink object"),
0,
G_MAXINT,
0,
G_PARAM_READABLE));
/**
* AtkHyperlink::link-activated:
* @atkhyperlink: the object which received the signal.
*
* The signal link-activated is emitted when a link is activated.
*/
atk_hyperlink_signals[LINK_ACTIVATED] =
g_signal_new ("link_activated",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkHyperlinkClass, link_activated),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
}
static void
atk_hyperlink_init (AtkHyperlink *link,
AtkHyperlinkClass *klass)
{
}
static void
atk_hyperlink_real_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
AtkHyperlink* link;
link = ATK_HYPERLINK (object);
switch (prop_id)
{
case PROP_NUMBER_ANCHORS:
g_value_set_int (value, atk_hyperlink_get_n_anchors (link));
break;
case PROP_END_INDEX:
g_value_set_int (value, atk_hyperlink_get_end_index (link));
break;
case PROP_START_INDEX:
g_value_set_int (value, atk_hyperlink_get_start_index (link));
break;
default:
break;
}
}
/**
* atk_hyperlink_get_uri:
* @link_: an #AtkHyperlink
* @i: a (zero-index) integer specifying the desired anchor
*
* Get a the URI associated with the anchor specified
* by @i of @link_.
*
* Multiple anchors are primarily used by client-side image maps.
*
* Returns: a string specifying the URI
**/
gchar*
atk_hyperlink_get_uri (AtkHyperlink *link,
gint i)
{
AtkHyperlinkClass *klass;
g_return_val_if_fail (ATK_IS_HYPERLINK (link), NULL);
klass = ATK_HYPERLINK_GET_CLASS (link);
if (klass->get_uri)
return (klass->get_uri) (link, i);
else
return NULL;
}
/**
* atk_hyperlink_get_object:
* @link_: an #AtkHyperlink
* @i: a (zero-index) integer specifying the desired anchor
*
* Returns the item associated with this hyperlinks nth anchor.
* For instance, the returned #AtkObject will implement #AtkText
* if @link_ is a text hyperlink, #AtkImage if @link_ is an image
* hyperlink etc.
*
* Multiple anchors are primarily used by client-side image maps.
*
* Returns: (transfer none): an #AtkObject associated with this hyperlinks
* i-th anchor
**/
AtkObject*
atk_hyperlink_get_object (AtkHyperlink *link,
gint i)
{
AtkHyperlinkClass *klass;
g_return_val_if_fail (ATK_IS_HYPERLINK (link), NULL);
klass = ATK_HYPERLINK_GET_CLASS (link);
if (klass->get_object)
return (klass->get_object) (link, i);
else
return NULL;
}
/**
* atk_hyperlink_get_end_index:
* @link_: an #AtkHyperlink
*
* Gets the index with the hypertext document at which this link ends.
*
* Returns: the index with the hypertext document at which this link ends
**/
gint
atk_hyperlink_get_end_index (AtkHyperlink *link)
{
AtkHyperlinkClass *klass;
g_return_val_if_fail (ATK_IS_HYPERLINK (link), 0);
klass = ATK_HYPERLINK_GET_CLASS (link);
if (klass->get_end_index)
return (klass->get_end_index) (link);
else
return 0;
}
/**
* atk_hyperlink_get_start_index:
* @link_: an #AtkHyperlink
*
* Gets the index with the hypertext document at which this link begins.
*
* Returns: the index with the hypertext document at which this link begins
**/
gint
atk_hyperlink_get_start_index (AtkHyperlink *link)
{
AtkHyperlinkClass *klass;
g_return_val_if_fail (ATK_IS_HYPERLINK (link), 0);
klass = ATK_HYPERLINK_GET_CLASS (link);
if (klass->get_start_index)
return (klass->get_start_index) (link);
else
return 0;
}
/**
* atk_hyperlink_is_valid:
* @link_: an #AtkHyperlink
*
* Since the document that a link is associated with may have changed
* this method returns %TRUE if the link is still valid (with
* respect to the document it references) and %FALSE otherwise.
*
* Returns: whether or not this link is still valid
**/
gboolean
atk_hyperlink_is_valid (AtkHyperlink *link)
{
AtkHyperlinkClass *klass;
g_return_val_if_fail (ATK_IS_HYPERLINK (link), FALSE);
klass = ATK_HYPERLINK_GET_CLASS (link);
if (klass->is_valid)
return (klass->is_valid) (link);
else
return FALSE;
}
/**
* atk_hyperlink_is_inline:
* @link_: an #AtkHyperlink
*
* Indicates whether the link currently displays some or all of its
* content inline. Ordinary HTML links will usually return
* %FALSE, but an inline &lt;src&gt; HTML element will return
* %TRUE.
*
* Returns: whether or not this link displays its content inline.
*
**/
gboolean
atk_hyperlink_is_inline (AtkHyperlink *link)
{
AtkHyperlinkClass *klass;
g_return_val_if_fail (ATK_IS_HYPERLINK (link), FALSE);
klass = ATK_HYPERLINK_GET_CLASS (link);
if (klass->link_state)
return (klass->link_state (link) & ATK_HYPERLINK_IS_INLINE);
else
return FALSE;
}
/**
* atk_hyperlink_get_n_anchors:
* @link_: an #AtkHyperlink
*
* Gets the number of anchors associated with this hyperlink.
*
* Returns: the number of anchors associated with this hyperlink
**/
gint
atk_hyperlink_get_n_anchors (AtkHyperlink *link)
{
AtkHyperlinkClass *klass;
g_return_val_if_fail (ATK_IS_HYPERLINK (link), 0);
klass = ATK_HYPERLINK_GET_CLASS (link);
if (klass->get_n_anchors)
return (klass->get_n_anchors) (link);
else
return 0;
}
static void atk_hyperlink_action_iface_init (AtkActionIface *iface)
{
/*
* We do nothing here
*
* When we come to derive a class from AtkHyperlink we will provide an
* implementation of the AtkAction interface.
*/
}

View File

@@ -1,101 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_HYPERLINK_H__
#define __ATK_HYPERLINK_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkaction.h>
#include <atk/atkobject.h>
G_BEGIN_DECLS
/*
* AtkHyperlink encapsulates a link or set of links in a hypertext document.
*
* It implements the AtkAction interface.
*/
#define ATK_TYPE_HYPERLINK (atk_hyperlink_get_type ())
#define ATK_HYPERLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_HYPERLINK, AtkHyperlink))
#define ATK_HYPERLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_HYPERLINK, AtkHyperlinkClass))
#define ATK_IS_HYPERLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_HYPERLINK))
#define ATK_IS_HYPERLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_HYPERLINK))
#define ATK_HYPERLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_HYPERLINK, AtkHyperlinkClass))
typedef struct _AtkHyperlink AtkHyperlink;
typedef struct _AtkHyperlinkClass AtkHyperlinkClass;
struct _AtkHyperlink
{
GObject parent;
};
struct _AtkHyperlinkClass
{
GObjectClass parent;
gchar* (* get_uri) (AtkHyperlink *link_,
gint i);
AtkObject* (* get_object) (AtkHyperlink *link_,
gint i);
gint (* get_end_index) (AtkHyperlink *link_);
gint (* get_start_index) (AtkHyperlink *link_);
gboolean (* is_valid) (AtkHyperlink *link_);
gint (* get_n_anchors) (AtkHyperlink *link_);
guint (* link_state) (AtkHyperlink *link_);
gboolean (* is_selected_link) (AtkHyperlink *link_);
/* Signals */
void ( *link_activated) (AtkHyperlink *link_);
AtkFunction pad1;
};
GDK_AVAILABLE_IN_ALL
GType atk_hyperlink_get_type (void);
GDK_AVAILABLE_IN_ALL
gchar* atk_hyperlink_get_uri (AtkHyperlink *link_,
gint i);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_hyperlink_get_object (AtkHyperlink *link_,
gint i);
GDK_AVAILABLE_IN_ALL
gint atk_hyperlink_get_end_index (AtkHyperlink *link_);
GDK_AVAILABLE_IN_ALL
gint atk_hyperlink_get_start_index (AtkHyperlink *link_);
GDK_AVAILABLE_IN_ALL
gboolean atk_hyperlink_is_valid (AtkHyperlink *link_);
GDK_AVAILABLE_IN_ALL
gboolean atk_hyperlink_is_inline (AtkHyperlink *link_);
GDK_AVAILABLE_IN_ALL
gint atk_hyperlink_get_n_anchors (AtkHyperlink *link_);
G_END_DECLS
#endif /* __ATK_HYPERLINK_H__ */

View File

@@ -1,108 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2006 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include "atkhyperlinkimpl.h"
/**
* SECTION:atkhyperlinkimpl
* @Short_description: An interface from which the AtkHyperlink
* associated with an AtkObject may be obtained.
* @Title:AtkHyperlinImpl
*
* AtkHyperlinkImpl allows AtkObjects to refer to their associated
* AtkHyperlink instance, if one exists. AtkHyperlinkImpl differs
* from AtkHyperlink in that AtkHyperlinkImpl is an interface, whereas
* AtkHyperlink is a object type. The AtkHyperlinkImpl interface
* allows a client to query an AtkObject for the availability of an
* associated AtkHyperlink instance, and obtain that instance. It is
* thus particularly useful in cases where embedded content or inline
* content within a text object is present, since the embedding text
* object implements AtkHypertext and the inline/embedded objects are
* exposed as children which implement AtkHyperlinkImpl, in addition
* to their being obtainable via AtkHypertext:getLink followed by
* AtkHyperlink:getObject.
*
* The AtkHyperlinkImpl interface should be supported by objects
* exposed within the hierarchy as children of an AtkHypertext
* container which correspond to "links" or embedded content within
* the text. HTML anchors are not, for instance, normally exposed
* this way, but embedded images and components which appear inline in
* the content of a text object are. The AtkHyperlinkIface interface
* allows a means of determining which children are hyperlinks in this
* sense of the word, and for obtaining their corresponding
* AtkHyperlink object, from which the embedding range, URI, etc. can
* be obtained.
*
* To some extent this interface exists because, for historical
* reasons, AtkHyperlink was defined as an object type, not an
* interface. Thus, in order to interact with AtkObjects via
* AtkHyperlink semantics, a new interface was required.
*/
GType
atk_hyperlink_impl_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkHyperlinkImplIface),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkHyperlinkImpl", &tinfo, 0);
}
return type;
}
/**
* atk_hyperlink_impl_get_hyperlink:
* @impl: a #GObject instance that implements AtkHyperlinkImplIface
*
* Gets the hyperlink associated with this object.
*
* Returns: (transfer full): an AtkHyperlink object which points to this
* implementing AtkObject.
*
* Since: 1.12
**/
AtkHyperlink *
atk_hyperlink_impl_get_hyperlink (AtkHyperlinkImpl *impl)
{
AtkHyperlinkImplIface *iface;
g_return_val_if_fail (impl != NULL, NULL);
g_return_val_if_fail (ATK_IS_HYPERLINK_IMPL (impl), NULL);
iface = ATK_HYPERLINK_IMPL_GET_IFACE (impl);
if (iface->get_hyperlink)
{
return (iface->get_hyperlink) (impl);
}
return NULL;
}

View File

@@ -1,67 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_HYPERLINK_IMPL_H__
#define __ATK_HYPERLINK_IMPL_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkhyperlink.h>
G_BEGIN_DECLS
#define ATK_TYPE_HYPERLINK_IMPL (atk_hyperlink_impl_get_type ())
#define ATK_IS_HYPERLINK_IMPL(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_HYPERLINK_IMPL)
#define ATK_HYPERLINK_IMPL(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_HYPERLINK_IMPL, AtkHyperlinkImpl)
#define ATK_HYPERLINK_IMPL_GET_IFACE(obj) G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_HYPERLINK_IMPL, AtkHyperlinkImplIface)
#ifndef _TYPEDEF_ATK_HYPERLINK_IMPL_
#define _TYPEDEF_ATK_HYPERLINK_IMPL__
/**
* AtkHyperlinkImpl:
*
* A queryable interface which allows AtkHyperlink instances
* associated with an AtkObject to be obtained. AtkHyperlinkImpl
* corresponds to AT-SPI's Hyperlink interface, and differs from
* AtkHyperlink in that AtkHyperlink is an object type, rather than an
* interface, and thus cannot be directly queried. FTW
*/
typedef struct _AtkHyperlinkImpl AtkHyperlinkImpl;
#endif
typedef struct _AtkHyperlinkImplIface AtkHyperlinkImplIface;
struct _AtkHyperlinkImplIface
{
GTypeInterface parent;
AtkHyperlink* (* get_hyperlink) (AtkHyperlinkImpl *impl);
};
GDK_AVAILABLE_IN_ALL
GType atk_hyperlink_impl_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkHyperlink *atk_hyperlink_impl_get_hyperlink (AtkHyperlinkImpl *impl);
G_END_DECLS
#endif /* __ATK_HYPERLINK_IMPL_H__ */

View File

@@ -1,181 +0,0 @@
/* ATK - The Accessibility Toolkit for GTK+
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkhypertext.h"
/**
* SECTION:atkhypertext
* @Short_description: The ATK interface which provides standard
* mechanism for manipulating hyperlinks.
* @Title:AtkHypertext
*
* An interface used for objects which implement linking between
* multiple resource or content locations, or multiple 'markers'
* within a single document. A Hypertext instance is associated with
* one or more Hyperlinks, which are associated with particular
* offsets within the Hypertext's included content. While this
* interface is derived from Text, there is no requirement that
* Hypertext instances have textual content; they may implement Image
* as well, and Hyperlinks need not have non-zero text offsets.
*/
enum {
LINK_SELECTED,
LAST_SIGNAL
};
static void atk_hypertext_base_init (AtkHypertextIface *class);
static guint atk_hypertext_signals[LAST_SIGNAL] = { 0 };
GType
atk_hypertext_get_type (void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo tinfo =
{
sizeof (AtkHypertextIface),
(GBaseInitFunc) atk_hypertext_base_init,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkHypertext", &tinfo, 0);
}
return type;
}
static void
atk_hypertext_base_init (AtkHypertextIface *class)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* AtkHypertext::link-selected:
* @atkhypertext: the object which received the signal.
* @arg1: the index of the hyperlink which is selected
*
* The "link-selected" signal is emitted by an AtkHyperText
* object when one of the hyperlinks associated with the object
* is selected.
*/
atk_hypertext_signals[LINK_SELECTED] =
g_signal_new ("link_selected",
ATK_TYPE_HYPERTEXT,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkHypertextIface, link_selected),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE,
1, G_TYPE_INT);
initialized = TRUE;
}
}
/**
* atk_hypertext_get_link:
* @hypertext: an #AtkHypertext
* @link_index: an integer specifying the desired link
*
* Gets the link in this hypertext document at index
* @link_index
*
* Returns: (transfer none): the link in this hypertext document at
* index @link_index
**/
AtkHyperlink*
atk_hypertext_get_link (AtkHypertext *hypertext,
gint link_index)
{
AtkHypertextIface *iface;
g_return_val_if_fail (ATK_IS_HYPERTEXT (hypertext), NULL);
if (link_index < 0)
return NULL;
iface = ATK_HYPERTEXT_GET_IFACE (hypertext);
if (iface->get_link)
return (*(iface->get_link)) (hypertext, link_index);
else
return NULL;
}
/**
* atk_hypertext_get_n_links:
* @hypertext: an #AtkHypertext
*
* Gets the number of links within this hypertext document.
*
* Returns: the number of links within this hypertext document
**/
gint
atk_hypertext_get_n_links (AtkHypertext *hypertext)
{
AtkHypertextIface *iface;
g_return_val_if_fail (ATK_IS_HYPERTEXT (hypertext), 0);
iface = ATK_HYPERTEXT_GET_IFACE (hypertext);
if (iface->get_n_links)
return (*(iface->get_n_links)) (hypertext);
else
return 0;
}
/**
* atk_hypertext_get_link_index:
* @hypertext: an #AtkHypertext
* @char_index: a character index
*
* Gets the index into the array of hyperlinks that is associated with
* the character specified by @char_index.
*
* Returns: an index into the array of hyperlinks in @hypertext,
* or -1 if there is no hyperlink associated with this character.
**/
gint
atk_hypertext_get_link_index (AtkHypertext *hypertext,
gint char_index)
{
AtkHypertextIface *iface;
g_return_val_if_fail (ATK_IS_HYPERTEXT (hypertext), -1);
if (char_index < 0)
return -1;
iface = ATK_HYPERTEXT_GET_IFACE (hypertext);
if (iface->get_link_index)
return (*(iface->get_link_index)) (hypertext, char_index);
else
return -1;
}

View File

@@ -1,77 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_HYPERTEXT_H__
#define __ATK_HYPERTEXT_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkhyperlink.h>
G_BEGIN_DECLS
/*
* The AtkHypertext interface provides standard mechanisms for manipulating
* hyperlinks.
*/
#define ATK_TYPE_HYPERTEXT (atk_hypertext_get_type ())
#define ATK_IS_HYPERTEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_HYPERTEXT)
#define ATK_HYPERTEXT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_HYPERTEXT, AtkHypertext)
#define ATK_HYPERTEXT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_HYPERTEXT, AtkHypertextIface))
#ifndef _TYPEDEF_ATK_HYPERTEXT_
#define _TYPEDEF_ATK_HYPERTEXT_
typedef struct _AtkHypertext AtkHypertext;
#endif
typedef struct _AtkHypertextIface AtkHypertextIface;
struct _AtkHypertextIface
{
GTypeInterface parent;
AtkHyperlink*(* get_link) (AtkHypertext *hypertext,
gint link_index);
gint (* get_n_links) (AtkHypertext *hypertext);
gint (* get_link_index) (AtkHypertext *hypertext,
gint char_index);
/*
* signal handlers
*/
void (* link_selected) (AtkHypertext *hypertext,
gint link_index);
};
GDK_AVAILABLE_IN_ALL
GType atk_hypertext_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkHyperlink* atk_hypertext_get_link (AtkHypertext *hypertext,
gint link_index);
GDK_AVAILABLE_IN_ALL
gint atk_hypertext_get_n_links (AtkHypertext *hypertext);
GDK_AVAILABLE_IN_ALL
gint atk_hypertext_get_link_index (AtkHypertext *hypertext,
gint char_index);
G_END_DECLS
#endif /* __ATK_HYPERTEXT_H__ */

View File

@@ -1,246 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkimage.h"
/**
* SECTION:atkimage
* @Short_description: The ATK Interface implemented by components
* which expose image or pixmap content on-screen.
* @Title:AtkImage
*
* #AtkImage should be implemented by #AtkObject subtypes on behalf of
* components which display image/pixmap information onscreen, and
* which provide information (other than just widget borders, etc.)
* via that image content. For instance, icons, buttons with icons,
* toolbar elements, and image viewing panes typically should
* implement #AtkImage.
*
* #AtkImage primarily provides two types of information: coordinate
* information (useful for screen review mode of screenreaders, and
* for use by onscreen magnifiers), and descriptive information. The
* descriptive information is provided for alternative, text-only
* presentation of the most significant information present in the
* image.
*/
GType
atk_image_get_type (void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo tinfo =
{
sizeof (AtkImageIface),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkImage", &tinfo, 0);
}
return type;
}
/**
* atk_image_get_image_description:
* @image: a #GObject instance that implements AtkImageIface
*
* Get a textual description of this image.
*
* Returns: a string representing the image description
**/
const gchar*
atk_image_get_image_description (AtkImage *image)
{
AtkImageIface *iface;
g_return_val_if_fail (ATK_IS_IMAGE (image), NULL);
iface = ATK_IMAGE_GET_IFACE (image);
if (iface->get_image_description)
{
return (iface->get_image_description) (image);
}
else
{
return NULL;
}
}
/**
* atk_image_get_image_size:
* @image: a #GObject instance that implements AtkImageIface
* @width: (out) (optional): filled with the image width, or -1 if the value cannot be obtained.
* @height: (out) (optional): filled with the image height, or -1 if the value cannot be obtained.
*
* Get the width and height in pixels for the specified image.
* The values of @width and @height are returned as -1 if the
* values cannot be obtained (for instance, if the object is not onscreen).
*
* If the size can not be obtained (e.g. missing support), x and y are set
* to -1.
**/
void
atk_image_get_image_size (AtkImage *image,
int *width,
int *height)
{
AtkImageIface *iface;
gint local_width, local_height;
gint *real_width, *real_height;
g_return_if_fail (ATK_IS_IMAGE (image));
if (width)
real_width = width;
else
real_width = &local_width;
if (height)
real_height = height;
else
real_height = &local_height;
iface = ATK_IMAGE_GET_IFACE (image);
if (iface->get_image_size)
{
iface->get_image_size (image, real_width, real_height);
}
else
{
*real_width = -1;
*real_height = -1;
}
}
/**
* atk_image_set_image_description:
* @image: a #GObject instance that implements AtkImageIface
* @description: a string description to set for @image
*
* Sets the textual description for this image.
*
* Returns: boolean TRUE, or FALSE if operation could
* not be completed.
**/
gboolean
atk_image_set_image_description (AtkImage *image,
const gchar *description)
{
AtkImageIface *iface;
g_return_val_if_fail (ATK_IS_IMAGE (image), FALSE);
iface = ATK_IMAGE_GET_IFACE (image);
if (iface->set_image_description)
{
return (iface->set_image_description) (image, description);
}
else
{
return FALSE;
}
}
/**
* atk_image_get_image_position:
* @image: a #GObject instance that implements AtkImageIface
* @x: (out) (optional): address of #gint to put x coordinate position; otherwise, -1 if value cannot be obtained.
* @y: (out) (optional): address of #gint to put y coordinate position; otherwise, -1 if value cannot be obtained.
* @coord_type: specifies whether the coordinates are relative to the screen
* or to the components top level window
*
* Gets the position of the image in the form of a point specifying the
* images top-left corner.
*
* If the position can not be obtained (e.g. missing support), x and y are set
* to -1.
**/
void
atk_image_get_image_position (AtkImage *image,
gint *x,
gint *y,
AtkCoordType coord_type)
{
AtkImageIface *iface;
gint local_x, local_y;
gint *real_x, *real_y;
g_return_if_fail (ATK_IS_IMAGE (image));
if (x)
real_x = x;
else
real_x = &local_x;
if (y)
real_y = y;
else
real_y = &local_y;
iface = ATK_IMAGE_GET_IFACE (image);
if (iface->get_image_position)
{
(iface->get_image_position) (image, real_x, real_y, coord_type);
}
else
{
*real_x = -1;
*real_y = -1;
}
}
/**
* atk_image_get_image_locale:
* @image: An #AtkImage
*
* Retrieves the locale identifier associated to the #AtkImage.
*
* Since: 1.12
*
* Returns: (nullable): a string corresponding to the POSIX
* `LC_MESSAGES` locale used by the image description, or
* %NULL if the image does not specify a locale.
*
*/
const gchar*
atk_image_get_image_locale (AtkImage *image)
{
AtkImageIface *iface;
g_return_val_if_fail (ATK_IS_IMAGE (image), NULL);
iface = ATK_IMAGE_GET_IFACE (image);
if (iface->get_image_locale)
{
return (iface->get_image_locale) (image);
}
else
{
return NULL;
}
}

View File

@@ -1,89 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_IMAGE_H__
#define __ATK_IMAGE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atktypes.h>
G_BEGIN_DECLS
/*
* The AtkImage interface should be supported by any object that has an
* associated image. This interface provides the standard mechanism for
* an assistive technology to get descriptive information about images.
*/
#define ATK_TYPE_IMAGE (atk_image_get_type ())
#define ATK_IS_IMAGE(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_IMAGE)
#define ATK_IMAGE(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_IMAGE, AtkImage)
#define ATK_IMAGE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_IMAGE, AtkImageIface))
#ifndef _TYPEDEF_ATK_IMAGE_
#define _TYPEDEF_ATK_IMAGE_
typedef struct _AtkImage AtkImage;
#endif
typedef struct _AtkImageIface AtkImageIface;
struct _AtkImageIface
{
GTypeInterface parent;
void ( *get_image_position) (AtkImage *image,
gint *x,
gint *y,
AtkCoordType coord_type);
const gchar* ( *get_image_description) (AtkImage *image);
void ( *get_image_size) (AtkImage *image,
gint *width,
gint *height);
gboolean ( *set_image_description) (AtkImage *image,
const gchar *description);
const gchar* ( *get_image_locale) (AtkImage *image);
};
GDK_AVAILABLE_IN_ALL
GType atk_image_get_type (void);
GDK_AVAILABLE_IN_ALL
const gchar* atk_image_get_image_description (AtkImage *image);
GDK_AVAILABLE_IN_ALL
void atk_image_get_image_size (AtkImage *image,
gint *width,
gint *height);
GDK_AVAILABLE_IN_ALL
gboolean atk_image_set_image_description (AtkImage *image,
const gchar *description);
GDK_AVAILABLE_IN_ALL
void atk_image_get_image_position (AtkImage *image,
gint *x,
gint *y,
AtkCoordType coord_type);
GDK_AVAILABLE_IN_ALL
const gchar* atk_image_get_image_locale (AtkImage *image);
G_END_DECLS
#endif /* __ATK_IMAGE_H__ */

View File

@@ -1,29 +0,0 @@
# see glib-genmarshal(1) for a detailed description of the file format,
# possible parameter types are:
# VOID indicates no return type, or no extra
# parameters. if VOID is used as the parameter
# list, no additional parameters may be present.
# BOOLEAN for boolean types (gboolean)
# CHAR for signed char types (gchar)
# UCHAR for unsigned char types (guchar)
# INT for signed integer types (gint)
# UINT for unsigned integer types (guint)
# LONG for signed long integer types (glong)
# ULONG for unsigned long integer types (gulong)
# ENUM for enumeration types (gint)
# FLAGS for flag enumeration types (guint)
# FLOAT for single-precision float types (gfloat)
# DOUBLE for double-precision float types (gdouble)
# STRING for string types (gchar*)
# PARAM for GParamSpec or derived types (GParamSpec*)
# BOXED for boxed (anonymous but reference counted) types (GBoxed*)
# POINTER for anonymous pointer types (gpointer)
# OBJECT for GObject or derived types (GObject*)
# NONE deprecated alias for VOID
# BOOL deprecated alias for BOOLEAN
VOID:INT,INT
VOID:INT,INT,STRING
VOID:INT,INT,INT,STRING
VOID:STRING,BOOLEAN
VOID:DOUBLE,STRING

View File

@@ -1,208 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atk.h"
#include "atknoopobject.h"
/**
* SECTION:atknoopobject
* @Short_description: An AtkObject which purports to implement all ATK interfaces.
* @Title:AtkNoOpObject
*
* An AtkNoOpObject is an AtkObject which purports to implement all
* ATK interfaces. It is the type of AtkObject which is created if an
* accessible object is requested for an object type for which no
* factory type is specified.
*
*/
static void atk_no_op_object_class_init (AtkNoOpObjectClass *klass);
static gpointer parent_class = NULL;
GType
atk_no_op_object_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (AtkObjectClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) atk_no_op_object_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (AtkNoOpObject), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
static const GInterfaceInfo atk_component_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_action_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_editable_text_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_image_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_selection_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_table_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_table_cell_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_text_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_hypertext_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_value_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_document_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_window_info =
{
(GInterfaceInitFunc) NULL,
(GInterfaceFinalizeFunc) NULL,
NULL
};
type = g_type_register_static (ATK_TYPE_OBJECT,
"AtkNoOpObject", &tinfo, 0);
g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
&atk_component_info);
g_type_add_interface_static (type, ATK_TYPE_ACTION,
&atk_action_info);
g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT,
&atk_editable_text_info);
g_type_add_interface_static (type, ATK_TYPE_IMAGE,
&atk_image_info);
g_type_add_interface_static (type, ATK_TYPE_SELECTION,
&atk_selection_info);
g_type_add_interface_static (type, ATK_TYPE_TABLE,
&atk_table_info);
g_type_add_interface_static (type, ATK_TYPE_TABLE_CELL,
&atk_table_cell_info);
g_type_add_interface_static (type, ATK_TYPE_TEXT,
&atk_text_info);
g_type_add_interface_static (type, ATK_TYPE_HYPERTEXT,
&atk_hypertext_info);
g_type_add_interface_static (type, ATK_TYPE_VALUE,
&atk_value_info);
g_type_add_interface_static (type, ATK_TYPE_DOCUMENT,
&atk_document_info);
g_type_add_interface_static (type, ATK_TYPE_WINDOW,
&atk_window_info);
}
return type;
}
static void
atk_no_op_object_class_init (AtkNoOpObjectClass *klass)
{
parent_class = g_type_class_peek_parent (klass);
}
/**
* atk_no_op_object_new:
* @obj: a #GObject
*
* Provides a default (non-functioning stub) #AtkObject.
* Application maintainers should not use this method.
*
* Returns: a default (non-functioning stub) #AtkObject
**/
AtkObject*
atk_no_op_object_new (GObject *obj)
{
AtkObject *accessible;
g_return_val_if_fail (obj != NULL, NULL);
accessible = g_object_new (ATK_TYPE_NO_OP_OBJECT, NULL);
g_return_val_if_fail (accessible != NULL, NULL);
accessible->role = ATK_ROLE_INVALID;
accessible->layer = ATK_LAYER_INVALID;
return accessible;
}

View File

@@ -1,59 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
#ifndef __ATK_NO_OP_OBJECT_H__
#define __ATK_NO_OP_OBJECT_H__
G_BEGIN_DECLS
#define ATK_TYPE_NO_OP_OBJECT (atk_no_op_object_get_type ())
#define ATK_NO_OP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_NO_OP_OBJECT, AtkNoOpObject))
#define ATK_NO_OP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_NO_OP_OBJECT, AtkNoOpObjectClass))
#define ATK_IS_NO_OP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_NO_OP_OBJECT))
#define ATK_IS_NO_OP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_NO_OP_OBJECT))
#define ATK_NO_OP_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_NO_OP_OBJECT, AtkNoOpObjectClass))
typedef struct _AtkNoOpObject AtkNoOpObject;
typedef struct _AtkNoOpObjectClass AtkNoOpObjectClass;
struct _AtkNoOpObject
{
AtkObject parent;
};
GDK_AVAILABLE_IN_ALL
GType atk_no_op_object_get_type (void);
struct _AtkNoOpObjectClass
{
AtkObjectClass parent_class;
};
GDK_AVAILABLE_IN_ALL
AtkObject *atk_no_op_object_new (GObject *obj);
G_END_DECLS
#endif /* __ATK_NO_OP_OBJECT_H__ */

View File

@@ -1,116 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkobject.h"
#include "atknoopobject.h"
#include "atknoopobjectfactory.h"
/**
* SECTION:atknoopobjectfactory
* @Short_description: The AtkObjectFactory which creates an AtkNoOpObject.
* @Title:AtkNoOpObjectFactory
*
* The AtkObjectFactory which creates an AtkNoOpObject. An instance of
* this is created by an AtkRegistry if no factory type has not been
* specified to create an accessible object of a particular type.
*/
static void atk_no_op_object_factory_class_init (
AtkNoOpObjectFactoryClass *klass);
static AtkObject* atk_no_op_object_factory_create_accessible (
GObject *obj);
static GType atk_no_op_object_factory_get_accessible_type (void);
static gpointer parent_class = NULL;
GType
atk_no_op_object_factory_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo tinfo =
{
sizeof (AtkNoOpObjectFactoryClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) atk_no_op_object_factory_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (AtkNoOpObjectFactory), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (
ATK_TYPE_OBJECT_FACTORY,
"AtkNoOpObjectFactory" , &tinfo, 0);
}
return type;
}
static void
atk_no_op_object_factory_class_init (AtkNoOpObjectFactoryClass *klass)
{
AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
class->create_accessible = atk_no_op_object_factory_create_accessible;
class->get_accessible_type = atk_no_op_object_factory_get_accessible_type;
}
/**
* atk_no_op_object_factory_new:
*
* Creates an instance of an #AtkObjectFactory which generates primitive
* (non-functioning) #AtkObjects.
*
* Returns: an instance of an #AtkObjectFactory
**/
AtkObjectFactory*
atk_no_op_object_factory_new (void)
{
GObject *factory;
factory = g_object_new (ATK_TYPE_NO_OP_OBJECT_FACTORY, NULL);
g_return_val_if_fail (factory != NULL, NULL);
return ATK_OBJECT_FACTORY (factory);
}
static AtkObject*
atk_no_op_object_factory_create_accessible (GObject *obj)
{
AtkObject *accessible;
accessible = atk_no_op_object_new (obj);
return accessible;
}
static GType
atk_no_op_object_factory_get_accessible_type (void)
{
return ATK_TYPE_NO_OP_OBJECT;
}

View File

@@ -1,59 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_NO_OP_OBJECT_FACTORY_H__
#define __ATK_NO_OP_OBJECT_FACTORY_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobjectfactory.h>
G_BEGIN_DECLS
#define ATK_TYPE_NO_OP_OBJECT_FACTORY (atk_no_op_object_factory_get_type ())
#define ATK_NO_OP_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_NO_OP_OBJECT_FACTORY, AtkNoOpObjectFactory))
#define ATK_NO_OP_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_NO_OP_OBJECT_FACTORY, AtkNoOpObjectFactoryClass))
#define ATK_IS_NO_OP_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_NO_OP_OBJECT_FACTORY))
#define ATK_IS_NO_OP_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_NO_OP_OBJECT_FACTORY))
#define ATK_NO_OP_OBJECT_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ( (obj), ATK_TYPE_NO_OP_OBJECT_FACTORY, AtkNoOpObjectFactoryClass))
typedef struct _AtkNoOpObjectFactory AtkNoOpObjectFactory;
typedef struct _AtkNoOpObjectFactoryClass AtkNoOpObjectFactoryClass;
struct _AtkNoOpObjectFactory
{
AtkObjectFactory parent;
};
struct _AtkNoOpObjectFactoryClass
{
AtkObjectFactoryClass parent_class;
};
GDK_AVAILABLE_IN_ALL
GType atk_no_op_object_factory_get_type(void);
GDK_AVAILABLE_IN_ALL
AtkObjectFactory *atk_no_op_object_factory_new(void);
G_END_DECLS
#endif /* __ATK_NO_OP_OBJECT_FACTORY_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,389 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_OBJECT_H__
#define __ATK_OBJECT_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atktypes.h>
#include <atk/atkstate.h>
G_BEGIN_DECLS
/**
* AtkAttributeSet:
*
* This is a singly-linked list (a #GSList) of #AtkAttribute. It is
* used by atk_text_get_run_attributes(),
* atk_text_get_default_attributes(),
* atk_editable_text_set_run_attributes(),
* atk_document_get_attributes() and atk_object_get_attributes()
**/
typedef GSList AtkAttributeSet;
/**
* AtkAttribute:
* @name: The attribute name.
* @value: the value of the attribute, represented as a string.
*
* AtkAttribute is a string name/value pair representing a generic
* attribute. This can be used to expose additional information from
* an accessible object as a whole (see atk_object_get_attributes())
* or an document (see atk_document_get_attributes()). In the case of
* text attributes (see atk_text_get_default_attributes()),
* #AtkTextAttribute enum defines all the possible text attribute
* names. You can use atk_text_attribute_get_name() to get the string
* name from the enum value. See also atk_text_attribute_for_name()
* and atk_text_attribute_get_value() for more information.
*
* A string name/value pair representing a generic attribute.
**/
typedef struct _AtkAttribute AtkAttribute;
struct _AtkAttribute {
gchar* name;
gchar* value;
};
#define ATK_TYPE_OBJECT (atk_object_get_type ())
#define ATK_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_OBJECT, AtkObject))
#define ATK_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_OBJECT, AtkObjectClass))
#define ATK_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_OBJECT))
#define ATK_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_OBJECT))
#define ATK_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_OBJECT, AtkObjectClass))
#define ATK_TYPE_IMPLEMENTOR (atk_implementor_get_type ())
#define ATK_IS_IMPLEMENTOR(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_IMPLEMENTOR)
#define ATK_IMPLEMENTOR(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_IMPLEMENTOR, AtkImplementor)
#define ATK_IMPLEMENTOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_IMPLEMENTOR, AtkImplementorIface))
typedef struct _AtkImplementor AtkImplementor; /* dummy typedef */
typedef struct _AtkImplementorIface AtkImplementorIface;
typedef struct _AtkObject AtkObject;
typedef struct _AtkObjectClass AtkObjectClass;
typedef struct _AtkRelationSet AtkRelationSet;
typedef struct _AtkStateSet AtkStateSet;
/**
* AtkPropertyValues:
* @property_name: The name of the ATK property which has changed.
* @old_value: NULL. This field is not used anymore.
* @new_value: The new value of the named property.
*
* Note: @old_value field of #AtkPropertyValues will not contain a
* valid value. This is a field defined with the purpose of contain
* the previous value of the property, but is not used anymore.
*
**/
struct _AtkPropertyValues
{
const gchar *property_name;
GValue old_value;
GValue new_value;
};
typedef struct _AtkPropertyValues AtkPropertyValues;
/**
* AtkFunction:
* @user_data: custom data defined by the user
*
* An AtkFunction is a function definition used for padding which has
* been added to class and interface structures to allow for expansion
* in the future.
*
* Returns: not used
*/
typedef gboolean (*AtkFunction) (gpointer user_data);
/*
* For most properties the old_value field of AtkPropertyValues will
* not contain a valid value.
*
* Currently, the only property for which old_value is used is
* accessible-state; for instance if there is a focus state the
* property change handler will be called for the object which lost the focus
* with the old_value containing an AtkState value corresponding to focused
* and the property change handler will be called for the object which
* received the focus with the new_value containing an AtkState value
* corresponding to focused.
*/
struct _AtkObject
{
GObject parent;
gchar *description;
gchar *name;
AtkObject *accessible_parent;
AtkRole role;
AtkRelationSet *relation_set;
AtkLayer layer;
};
/**
* AtkObjectClass:
* @connect_property_change_handler: specifies a function to be called
* when a property changes value. This virtual function is
* deprecated since 2.12 and it should not be overriden. Connect
* directly to property-change or notify signal instead.
* @remove_property_change_handler: removes a property changed handler
* as returned by @connect_property_change_handler. This virtual
* function is deprecated sice 2.12 and it should not be overriden.
* @focus_event: The signal handler which is executed when there is a
* focus event for an object. This virtual function is deprecated
* since 2.9.4 and it should not be overriden. Use
* the #AtkObject::state-change "focused" signal instead.
*/
struct _AtkObjectClass
{
GObjectClass parent;
/*
* Gets the accessible name of the object
*/
const gchar* (* get_name) (AtkObject *accessible);
/*
* Gets the accessible description of the object
*/
const gchar* (* get_description) (AtkObject *accessible);
/*
* Gets the accessible parent of the object
*/
AtkObject* (*get_parent) (AtkObject *accessible);
/*
* Gets the number of accessible children of the object
*/
gint (* get_n_children) (AtkObject *accessible);
/*
* Returns a reference to the specified accessible child of the object.
* The accessible children are 0-based so the first accessible child is
* at index 0, the second at index 1 and so on.
*/
AtkObject* (* ref_child) (AtkObject *accessible,
gint i);
/*
* Gets the 0-based index of this object in its parent; returns -1 if the
* object does not have an accessible parent.
*/
gint (* get_index_in_parent) (AtkObject *accessible);
/*
* Gets the RelationSet associated with the object
*/
AtkRelationSet* (* ref_relation_set) (AtkObject *accessible);
/*
* Gets the role of the object
*/
AtkRole (* get_role) (AtkObject *accessible);
AtkLayer (* get_layer) (AtkObject *accessible);
gint (* get_mdi_zorder) (AtkObject *accessible);
/*
* Gets the state set of the object
*/
AtkStateSet* (* ref_state_set) (AtkObject *accessible);
/*
* Sets the accessible name of the object
*/
void (* set_name) (AtkObject *accessible,
const gchar *name);
/*
* Sets the accessible description of the object
*/
void (* set_description) (AtkObject *accessible,
const gchar *description);
/*
* Sets the accessible parent of the object
*/
void (* set_parent) (AtkObject *accessible,
AtkObject *parent);
/*
* Sets the accessible role of the object
*/
void (* set_role) (AtkObject *accessible,
AtkRole role);
/*
* Removes a property change handler which was specified using
* connect_property_change_handler
*/
void (* remove_property_change_handler) (AtkObject
*accessible,
guint
handler_id);
void (* initialize) (AtkObject *accessible,
gpointer data);
/*
* The signal handler which is executed when there is a change in the
* children of the object
*/
void (* children_changed) (AtkObject *accessible,
guint change_index,
gpointer changed_child);
/*
* The signal handler which is executed when there is a focus event
* for an object.
*/
void (* focus_event) (AtkObject *accessible,
gboolean focus_in);
/*
* The signal handler which is executed when there is a property_change
* signal for an object.
*/
void (* property_change) (AtkObject *accessible,
AtkPropertyValues *values);
/*
* The signal handler which is executed when there is a state_change
* signal for an object.
*/
void (* state_change) (AtkObject *accessible,
const gchar *name,
gboolean state_set);
/*
* The signal handler which is executed when there is a change in the
* visible data for an object
*/
void (*visible_data_changed) (AtkObject *accessible);
/*
* The signal handler which is executed when there is a change in the
* 'active' child or children of the object, for instance when
* interior focus changes in a table or list. This signal should be emitted
* by objects whose state includes ATK_STATE_MANAGES_DESCENDANTS.
*/
void (*active_descendant_changed) (AtkObject *accessible,
gpointer *child);
/*
* Gets a list of properties applied to this object as a whole, as an #AtkAttributeSet consisting of name-value pairs.
* Since ATK 1.12
*/
AtkAttributeSet* (*get_attributes) (AtkObject *accessible);
const gchar* (*get_object_locale) (AtkObject *accessible);
AtkFunction pad1;
};
GDK_AVAILABLE_IN_ALL
GType atk_object_get_type (void);
/**
* AtkImplementorIface:
*
* The AtkImplementor interface is implemented by objects for which
* AtkObject peers may be obtained via calls to
* iface->(ref_accessible)(implementor);
*/
struct _AtkImplementorIface
{
GTypeInterface parent;
AtkObject* (*ref_accessible) (AtkImplementor *implementor);
};
GDK_AVAILABLE_IN_ALL
GType atk_implementor_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_implementor_ref_accessible (AtkImplementor *implementor);
/*
* Properties directly supported by AtkObject
*/
GDK_AVAILABLE_IN_ALL
const gchar* atk_object_get_name (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
const gchar* atk_object_get_description (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_object_get_parent (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_object_peek_parent (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
gint atk_object_get_n_accessible_children (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_object_ref_accessible_child (AtkObject *accessible,
gint i);
GDK_AVAILABLE_IN_ALL
AtkRelationSet* atk_object_ref_relation_set (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
AtkRole atk_object_get_role (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
AtkAttributeSet* atk_object_get_attributes (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
AtkStateSet* atk_object_ref_state_set (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
gint atk_object_get_index_in_parent (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
void atk_object_set_name (AtkObject *accessible,
const gchar *name);
GDK_AVAILABLE_IN_ALL
void atk_object_set_description (AtkObject *accessible,
const gchar *description);
GDK_AVAILABLE_IN_ALL
void atk_object_set_parent (AtkObject *accessible,
AtkObject *parent);
GDK_AVAILABLE_IN_ALL
void atk_object_set_role (AtkObject *accessible,
AtkRole role);
GDK_AVAILABLE_IN_ALL
void atk_object_notify_state_change (AtkObject *accessible,
AtkState state,
gboolean value);
GDK_AVAILABLE_IN_ALL
void atk_object_initialize (AtkObject *accessible,
gpointer data);
GDK_AVAILABLE_IN_ALL
const gchar* atk_role_get_name (AtkRole role);
GDK_AVAILABLE_IN_ALL
AtkRole atk_role_for_name (const gchar *name);
GDK_AVAILABLE_IN_ALL
gboolean atk_object_add_relationship (AtkObject *object,
AtkRelationType relationship,
AtkObject *target);
GDK_AVAILABLE_IN_ALL
gboolean atk_object_remove_relationship (AtkObject *object,
AtkRelationType relationship,
AtkObject *target);
GDK_AVAILABLE_IN_ALL
const gchar* atk_role_get_localized_name (AtkRole role);
GDK_AVAILABLE_IN_ALL
const gchar* atk_object_get_object_locale (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
const gchar* atk_object_get_accessible_id (AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
void atk_object_set_accessible_id (AtkObject *accessible,
const gchar *name);
G_END_DECLS
#endif /* __ATK_OBJECT_H__ */

View File

@@ -1,147 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkobjectfactory.h"
#include "atknoopobjectfactory.h"
/**
* SECTION:atkobjectfactory
* @Short_description: The base object class for a factory used to
* create accessible objects for objects of a specific GType.
* @Title:AtkObjectFactory
*
* This class is the base object class for a factory used to create an
* accessible object for a specific GType. The function
* atk_registry_set_factory_type() is normally called to store in the
* registry the factory type to be used to create an accessible of a
* particular GType.
*/
static void atk_object_factory_class_init (AtkObjectFactoryClass *klass);
static gpointer parent_class = NULL;
GType
atk_object_factory_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkObjectFactoryClass),
(GBaseInitFunc) NULL, /* base init */
(GBaseFinalizeFunc) NULL, /* base finalize */
(GClassInitFunc) atk_object_factory_class_init, /* class init */
(GClassFinalizeFunc) NULL, /* class finalize */
NULL, /* class data */
sizeof (AtkObjectFactory), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
type = g_type_register_static (G_TYPE_OBJECT, "AtkObjectFactory", &tinfo, 0);
}
return type;
}
static void
atk_object_factory_class_init (AtkObjectFactoryClass *klass)
{
parent_class = g_type_class_peek_parent (klass);
}
/**
* atk_object_factory_create_accessible:
* @factory: The #AtkObjectFactory associated with @obj's
* object type
* @obj: a #GObject
*
* Provides an #AtkObject that implements an accessibility interface
* on behalf of @obj
*
* Returns: (transfer full): an #AtkObject that implements an accessibility
* interface on behalf of @obj
**/
AtkObject*
atk_object_factory_create_accessible (AtkObjectFactory *factory,
GObject *obj)
{
AtkObjectFactoryClass *klass;
AtkObject *accessible = NULL;
g_return_val_if_fail (ATK_IS_OBJECT_FACTORY (factory), NULL);
g_return_val_if_fail (G_IS_OBJECT (obj), NULL);
klass = ATK_OBJECT_FACTORY_GET_CLASS (factory);
if (klass->create_accessible)
{
accessible = klass->create_accessible (obj);
}
return accessible;
}
/**
* atk_object_factory_invalidate:
* @factory: an #AtkObjectFactory to invalidate
*
* Inform @factory that it is no longer being used to create
* accessibles. When called, @factory may need to inform
* #AtkObjects which it has created that they need to be re-instantiated.
* Note: primarily used for runtime replacement of #AtkObjectFactorys
* in object registries.
**/
void
atk_object_factory_invalidate (AtkObjectFactory *factory)
{
AtkObjectFactoryClass *klass;
g_return_if_fail (ATK_OBJECT_FACTORY (factory));
klass = ATK_OBJECT_FACTORY_GET_CLASS (factory);
if (klass->invalidate)
(klass->invalidate) (factory);
}
/**
* atk_object_factory_get_accessible_type:
* @factory: an #AtkObjectFactory
*
* Gets the GType of the accessible which is created by the factory.
* Returns: the type of the accessible which is created by the @factory.
* The value G_TYPE_INVALID is returned if no type if found.
**/
GType
atk_object_factory_get_accessible_type (AtkObjectFactory *factory)
{
AtkObjectFactoryClass *klass;
g_return_val_if_fail (ATK_OBJECT_FACTORY (factory), G_TYPE_INVALID);
klass = ATK_OBJECT_FACTORY_GET_CLASS (factory);
if (klass->get_accessible_type)
return (klass->get_accessible_type) ();
else
return G_TYPE_INVALID;
}

View File

@@ -1,72 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_OBJECT_FACTORY_H__
#define __ATK_OBJECT_FACTORY_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <glib-object.h>
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_OBJECT_FACTORY (atk_object_factory_get_type ())
#define ATK_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_OBJECT_FACTORY, AtkObjectFactory))
#define ATK_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_OBJECT_FACTORY, AtkObjectFactoryClass))
#define ATK_IS_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_OBJECT_FACTORY))
#define ATK_IS_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_OBJECT_FACTORY))
#define ATK_OBJECT_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_OBJECT_FACTORY, AtkObjectFactoryClass))
typedef struct _AtkObjectFactory AtkObjectFactory;
typedef struct _AtkObjectFactoryClass AtkObjectFactoryClass;
struct _AtkObjectFactory
{
GObject parent;
};
struct _AtkObjectFactoryClass
{
GObjectClass parent_class;
AtkObject* (* create_accessible) (GObject *obj);
void (* invalidate) (AtkObjectFactory *factory);
GType (* get_accessible_type) (void);
AtkFunction pad1;
AtkFunction pad2;
};
GDK_AVAILABLE_IN_ALL
GType atk_object_factory_get_type(void);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_object_factory_create_accessible (AtkObjectFactory *factory, GObject *obj);
GDK_AVAILABLE_IN_ALL
void atk_object_factory_invalidate (AtkObjectFactory *factory);
GDK_AVAILABLE_IN_ALL
GType atk_object_factory_get_accessible_type (AtkObjectFactory *factory);
G_END_DECLS
#endif /* __GTK_OBJECT_FACTORY_H__ */

View File

@@ -1,194 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright (C) 2009 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atk.h"
#include "atkplug.h"
/**
* SECTION:atkplug
* @Short_description: Toplevel for embedding into other processes
* @Title: AtkPlug
* @See_also: #AtkPlug
*
* See #AtkSocket
*
*/
static void atk_component_interface_init (AtkComponentIface *iface);
typedef struct {
AtkObject *child;
} AtkPlugPrivate;
static gint AtkPlug_private_offset;
G_DEFINE_TYPE_WITH_CODE (AtkPlug, atk_plug, ATK_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
G_ADD_PRIVATE(AtkPlug))
static AtkObject*
atk_plug_ref_child (AtkObject *obj, int i)
{
AtkPlugPrivate *private = atk_plug_get_instance_private (ATK_PLUG (obj));
AtkObject *child;
if (i != 0)
return NULL;
child = private->child;
if (child == NULL)
return NULL;
return g_object_ref (child);
}
static int
atk_plug_get_n_children (AtkObject *obj)
{
AtkPlugPrivate *private = atk_plug_get_instance_private (ATK_PLUG (obj));
if (private->child == NULL)
return 0;
return 1;
}
static AtkStateSet*
atk_plug_ref_state_set (AtkObject *obj)
{
AtkPlugPrivate *private = atk_plug_get_instance_private (ATK_PLUG (obj));
AtkObject *child;
child = private->child;
if (child == NULL)
return NULL;
return atk_object_ref_state_set (child);
}
static void
atk_plug_init (AtkPlug* obj)
{
AtkObject *accessible = ATK_OBJECT (obj);
accessible->role = ATK_ROLE_FILLER;
accessible->layer = ATK_LAYER_WIDGET;
}
static void
atk_plug_class_init (AtkPlugClass* klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
if (AtkPlug_private_offset != 0)
g_type_class_adjust_private_offset (klass, &AtkPlug_private_offset);
klass->get_object_id = NULL;
class->get_n_children = atk_plug_get_n_children;
class->ref_child = atk_plug_ref_child;
class->ref_state_set = atk_plug_ref_state_set;
}
static void
atk_component_interface_init (AtkComponentIface *iface)
{
}
/**
* atk_plug_new:
*
* Creates a new #AtkPlug instance.
*
* Returns: (transfer full): the newly created #AtkPlug
*
* Since: 1.30
*/
AtkObject *
atk_plug_new (void)
{
return g_object_new (ATK_TYPE_PLUG, NULL);
}
/**
* atk_plug_set_child:
* @plug: an #AtkPlug to be set as accessible parent of @child.
* @child: an #AtkObject to be set as accessible child of @plug.
*
* Sets @child as accessible child of @plug and @plug as accessible parent of
* @child. @child can be NULL.
*
* In some cases, one can not use the AtkPlug type directly as accessible
* object for the toplevel widget of the application. For instance in the gtk
* case, GtkPlugAccessible can not inherit both from GtkWindowAccessible and
* from AtkPlug. In such a case, one can create, in addition to the standard
* accessible object for the toplevel widget, an AtkPlug object, and make the
* former the child of the latter by calling atk_plug_set_child().
*
* Since: 2.35.0
*/
void
atk_plug_set_child (AtkPlug *plug, AtkObject *child)
{
AtkPlugPrivate *private = atk_plug_get_instance_private (plug);
if (private->child)
atk_object_set_parent (private->child, NULL);
private->child = child;
if (child)
atk_object_set_parent (child, ATK_OBJECT(plug));
}
/**
* atk_plug_get_id:
* @plug: an #AtkPlug
*
* Gets the unique ID of an #AtkPlug object, which can be used to
* embed inside of an #AtkSocket using atk_socket_embed().
*
* Internally, this calls a class function that should be registered
* by the IPC layer (usually at-spi2-atk). The implementor of an
* #AtkPlug object should call this function (after atk-bridge is
* loaded) and pass the value to the process implementing the
* #AtkSocket, so it could embed the plug.
*
* Returns: the unique ID for the plug
*
* Since: 1.30
**/
gchar*
atk_plug_get_id (AtkPlug* plug)
{
AtkPlugClass *klass;
g_return_val_if_fail (ATK_IS_PLUG (plug), NULL);
klass = g_type_class_peek (ATK_TYPE_PLUG);
if (klass && klass->get_object_id)
return (klass->get_object_id) (plug);
else
return NULL;
}

View File

@@ -1,68 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2009 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_PLUG_H__
#define __ATK_PLUG_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_PLUG (atk_plug_get_type ())
#define ATK_PLUG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_PLUG, AtkPlug))
#define ATK_IS_PLUG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_PLUG))
#define ATK_PLUG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_PLUG, AtkPlugClass))
#define ATK_IS_PLUG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_PLUG))
#define ATK_PLUG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_PLUG, AtkPlugClass))
typedef struct _AtkPlug AtkPlug;
typedef struct _AtkPlugClass AtkPlugClass;
struct _AtkPlug
{
AtkObject parent;
};
GDK_AVAILABLE_IN_ALL
GType atk_plug_get_type (void);
struct _AtkPlugClass
{
AtkObjectClass parent_class;
/* to be subscribed to by atk-bridge */
/*< protected >*/
gchar* (* get_object_id) (AtkPlug* obj);
};
GDK_AVAILABLE_IN_ALL
AtkObject* atk_plug_new (void);
GDK_AVAILABLE_IN_ALL
void atk_plug_set_child (AtkPlug *plug, AtkObject *child);
GDK_AVAILABLE_IN_ALL
gchar* atk_plug_get_id (AtkPlug* plug);
G_END_DECLS
#endif /* __ATK_PLUG_H__ */

View File

@@ -1,131 +0,0 @@
/* ATK - Accessibility Toolkit
*
* Copyright (C) 2014 Igalia, S.L.
*
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <locale.h>
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include "atkprivate.h"
#ifdef G_OS_WIN32
#define STRICT
#include <windows.h>
#undef STRICT
static HMODULE atk_dll;
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
atk_dll = (HMODULE) hinstDLL;
break;
}
return TRUE;
}
static const char *
get_atk_locale_dir (void)
{
static gchar *atk_localedir = NULL;
if (!atk_localedir)
{
const gchar *p;
gchar *root, *temp;
/* ATK_LOCALEDIR might end in either /lib/locale or
* /share/locale. Scan for that slash.
*/
p = ATK_LOCALEDIR + strlen (ATK_LOCALEDIR);
while (*--p != '/')
;
while (*--p != '/')
;
root = g_win32_get_package_installation_directory_of_module (atk_dll);
temp = g_build_filename (root, p, NULL);
g_free (root);
/* atk_localedir is passed to bindtextdomain() which isn't
* UTF-8-aware.
*/
atk_localedir = g_win32_locale_filename_from_utf8 (temp);
g_free (temp);
}
return atk_localedir;
}
#undef ATK_LOCALEDIR
#define ATK_LOCALEDIR get_atk_locale_dir()
#endif
void
_gettext_initialization (void)
{
#ifdef ENABLE_NLS
static gboolean gettext_initialized = FALSE;
if (!gettext_initialized)
{
const char *dir = g_getenv ("ATK_ALT_LOCALEDIR");
gettext_initialized = TRUE;
if (dir == NULL)
dir = ATK_LOCALEDIR;
bindtextdomain (GETTEXT_PACKAGE, dir);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
}
#endif
}
/*
* Compacts a name. For example: to get "accelerator label" instead of
* "accelerator-label"
*/
void
_compact_name (gchar *name)
{
gchar *p = name;
while (*p)
{
if (*p == '-')
*p = ' ';
p++;
}
}

View File

@@ -1,36 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright (C) 2014 Igalia, S.L.
*
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_PRIVATE_H__
#define __ATK_PRIVATE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
G_BEGIN_DECLS
void _gettext_initialization (void);
void _compact_name (gchar *name);
G_END_DECLS
#endif /* __ATK_PRIVATE_H__ */

View File

@@ -1,169 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2014 Igalia S.L.
*
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkvalue.h"
/**
* SECTION:atkrange
* @Short_description: A given range or subrange, to be used with #AtkValue
* @Title:AtkRange
*
* #AtkRange are used on #AtkValue, in order to represent the full
* range of a given component (for example an slider or a range
* control), or to define each individual subrange this full range is
* splitted if available. See #AtkValue documentation for further
* details.
*/
struct _AtkRange {
gdouble lower;
gdouble upper;
gchar *description;
};
/**
* atk_range_copy:
* @src: #AtkRange to copy
*
* Returns a new #AtkRange that is a exact copy of @src
*
* Since: 2.12
*
* Returns: (transfer full): a new #AtkRange copy of @src
*/
AtkRange *
atk_range_copy (AtkRange *src)
{
g_return_val_if_fail (src != NULL, NULL);
return atk_range_new (src->lower,
src->upper,
src->description);
}
/**
* atk_range_free:
* @range: #AtkRange to free
*
* Free @range
*
* Since: 2.12
*/
void
atk_range_free (AtkRange *range)
{
g_return_if_fail (range != NULL);
if (range->description)
g_free (range->description);
g_slice_free (AtkRange, range);
}
G_DEFINE_BOXED_TYPE (AtkRange, atk_range, atk_range_copy,
atk_range_free)
/**
* atk_range_new:
* @lower_limit: inferior limit for this range
* @upper_limit: superior limit for this range
* @description: human readable description of this range.
*
* Creates a new #AtkRange.
*
* Since: 2.12
*
* Returns: (transfer full): a new #AtkRange
*
*/
AtkRange*
atk_range_new (gdouble lower_limit,
gdouble upper_limit,
const gchar *description)
{
AtkRange *range;
range = g_slice_new0 (AtkRange);
range->lower = lower_limit;
range->upper = upper_limit;
if (description != NULL)
range->description = g_strdup (description);
return range;
}
/**
* atk_range_get_lower_limit:
* @range: an #AtkRange
*
* Returns the lower limit of @range
*
* Since: 2.12
*
* Returns: the lower limit of @range
*/
gdouble
atk_range_get_lower_limit (AtkRange *range)
{
g_return_val_if_fail (range != NULL, 0);
return range->lower;
}
/**
* atk_range_get_upper_limit:
* @range: an #AtkRange
*
* Returns the upper limit of @range
*
* Since: 2.12
*
* Returns: the upper limit of @range
*/
gdouble
atk_range_get_upper_limit (AtkRange *range)
{
g_return_val_if_fail (range != NULL, 0);
return range->upper;
}
/**
* atk_range_get_description:
* @range: an #AtkRange
*
* Returns the human readable description of @range
*
* Since: 2.12
*
* Returns: the human-readable description of @range
*/
const gchar*
atk_range_get_description (AtkRange *range)
{
g_return_val_if_fail (range != NULL, NULL);
return range->description;
}

View File

@@ -1,58 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2014 Igalia S.L.
*
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_RANGE_H__
#define __ATK_RANGE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <glib-object.h>
G_BEGIN_DECLS
#define ATK_TYPE_RANGE (atk_range_get_type ())
typedef struct _AtkRange AtkRange;
/* AtkRange methods */
GDK_AVAILABLE_IN_ALL
GType atk_range_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkRange* atk_range_copy (AtkRange *src);
GDK_AVAILABLE_IN_ALL
void atk_range_free (AtkRange *range);
GDK_AVAILABLE_IN_ALL
gdouble atk_range_get_lower_limit (AtkRange *range);
GDK_AVAILABLE_IN_ALL
gdouble atk_range_get_upper_limit (AtkRange *range);
GDK_AVAILABLE_IN_ALL
const gchar* atk_range_get_description (AtkRange *range);
GDK_AVAILABLE_IN_ALL
AtkRange* atk_range_new (gdouble lower_limit,
gdouble upper_limit,
const gchar *description);
G_END_DECLS
#endif /* __ATK_RANGE_H__ */

View File

@@ -1,274 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkregistry.h"
#include "atknoopobjectfactory.h"
/**
* SECTION:atkregistry
* @Short_description: An object used to store the GType of the
* factories used to create an accessible object for an object of a
* particular GType.
* @Title:AtkRegistry
*
* The AtkRegistry is normally used to create appropriate ATK "peers"
* for user interface components. Application developers usually need
* only interact with the AtkRegistry by associating appropriate ATK
* implementation classes with GObject classes via the
* atk_registry_set_factory_type call, passing the appropriate GType
* for application custom widget classes.
*/
static AtkRegistry *default_registry = NULL;
static void atk_registry_init (AtkRegistry *instance,
AtkRegistryClass *klass);
static void atk_registry_finalize (GObject *instance);
static void atk_registry_class_init (AtkRegistryClass *klass);
static AtkRegistry* atk_registry_new (void);
static gpointer parent_class = NULL;
GType
atk_registry_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo info =
{
sizeof (AtkRegistryClass),
(GBaseInitFunc) NULL, /* base_init */
(GBaseFinalizeFunc) NULL, /* base_finalize */
(GClassInitFunc) atk_registry_class_init, /* class_init */
(GClassFinalizeFunc) NULL, /* class_finalize */
NULL, /* class_data */
sizeof (AtkRegistry), /* instance size */
0, /* n_preallocs */
(GInstanceInitFunc) atk_registry_init, /* instance init */
NULL /* value table */
};
type = g_type_register_static (G_TYPE_OBJECT, "AtkRegistry", &info, 0);
}
return type;
}
static void
atk_registry_class_init (AtkRegistryClass *klass)
{
GObjectClass *object_class = (GObjectClass *) klass;
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = atk_registry_finalize;
}
static void
atk_registry_init (AtkRegistry *instance, AtkRegistryClass *klass)
{
instance->factory_type_registry = g_hash_table_new ((GHashFunc) NULL,
(GEqualFunc) NULL);
instance->factory_singleton_cache = g_hash_table_new ((GHashFunc) NULL,
(GEqualFunc) NULL);
}
static AtkRegistry *
atk_registry_new (void)
{
GObject *object;
object = g_object_new (ATK_TYPE_REGISTRY, NULL);
g_return_val_if_fail (ATK_IS_REGISTRY (object), NULL);
return (AtkRegistry *) object;
}
static void
atk_registry_finalize (GObject *object)
{
AtkRegistry *registry = ATK_REGISTRY (object);
g_hash_table_destroy (registry->factory_type_registry);
g_hash_table_destroy (registry->factory_singleton_cache);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/**
* atk_registry_set_factory_type:
* @registry: the #AtkRegistry in which to register the type association
* @type: an #AtkObject type
* @factory_type: an #AtkObjectFactory type to associate with @type. Must
* implement AtkObject appropriate for @type.
*
* Associate an #AtkObjectFactory subclass with a #GType. Note:
* The associated @factory_type will thereafter be responsible for
* the creation of new #AtkObject implementations for instances
* appropriate for @type.
**/
void
atk_registry_set_factory_type (AtkRegistry *registry,
GType type,
GType factory_type)
{
GType old_type;
gpointer value;
AtkObjectFactory *old_factory;
g_return_if_fail (ATK_IS_REGISTRY (registry));
value = g_hash_table_lookup (registry->factory_type_registry,
(gpointer) type);
old_type = (GType) value;
if (old_type && old_type != factory_type)
{
g_hash_table_remove (registry->factory_type_registry,
(gpointer) type);
/*
* If the old factory was created, notify it that it has
* been replaced, then free it.
*/
old_factory = g_hash_table_lookup (registry->factory_singleton_cache,
(gpointer) old_type);
if (old_factory)
{
atk_object_factory_invalidate (old_factory);
g_type_free_instance ((GTypeInstance *) old_factory);
}
}
g_hash_table_insert (registry->factory_type_registry,
(gpointer) type,
(gpointer) factory_type);
}
/**
* atk_registry_get_factory_type:
* @registry: an #AtkRegistry
* @type: a #GType with which to look up the associated #AtkObjectFactory
* subclass
*
* Provides a #GType indicating the #AtkObjectFactory subclass
* associated with @type.
*
* Returns: a #GType associated with type @type
**/
GType
atk_registry_get_factory_type (AtkRegistry *registry,
GType type)
{
GType factory_type;
gpointer value;
/*
* look up factory type in first hash;
* if there isn't an explicitly registered factory type,
* try inheriting one...
*/
do {
value =
g_hash_table_lookup (registry->factory_type_registry,
(gpointer) type);
type = g_type_parent (type);
if (type == G_TYPE_INVALID)
{
break;
}
} while (value == NULL);
factory_type = (GType) value;
return factory_type;
}
/**
* atk_registry_get_factory:
* @registry: an #AtkRegistry
* @type: a #GType with which to look up the associated #AtkObjectFactory
*
* Gets an #AtkObjectFactory appropriate for creating #AtkObjects
* appropriate for @type.
*
* Returns: (transfer none): an #AtkObjectFactory appropriate for creating
* #AtkObjects appropriate for @type.
**/
AtkObjectFactory*
atk_registry_get_factory (AtkRegistry *registry,
GType type)
{
gpointer factory_pointer = NULL;
GType factory_type;
factory_type = atk_registry_get_factory_type (registry, type);
if (factory_type == G_TYPE_INVALID)
{
/* Factory type has not been specified for this object type */
static AtkObjectFactory* default_factory = NULL;
if (!default_factory)
default_factory = atk_no_op_object_factory_new ();
return default_factory;
}
/* ask second hashtable for instance of factory type */
factory_pointer =
g_hash_table_lookup (registry->factory_singleton_cache,
(gpointer) factory_type);
/* if there isn't one already, create one and save it */
if (factory_pointer == NULL)
{
factory_pointer = g_type_create_instance (factory_type);
g_hash_table_insert (registry->factory_singleton_cache,
(gpointer) factory_type,
factory_pointer);
}
return ATK_OBJECT_FACTORY (factory_pointer);
}
/**
* atk_get_default_registry:
*
* Gets a default implementation of the #AtkObjectFactory/type
* registry.
* Note: For most toolkit maintainers, this will be the correct
* registry for registering new #AtkObject factories. Following
* a call to this function, maintainers may call atk_registry_set_factory_type()
* to associate an #AtkObjectFactory subclass with the GType of objects
* for whom accessibility information will be provided.
*
* Returns: (transfer full): a default implementation of the
* #AtkObjectFactory/type registry
**/
AtkRegistry*
atk_get_default_registry (void)
{
if (!default_registry)
{
default_registry = atk_registry_new ();
}
return default_registry;
}

View File

@@ -1,74 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_REGISTRY_H__
#define __ATK_REGISTRY_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <glib-object.h>
#include "atkobjectfactory.h"
G_BEGIN_DECLS
#define ATK_TYPE_REGISTRY (atk_registry_get_type ())
#define ATK_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_REGISTRY, AtkRegistry))
#define ATK_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_REGISTRY, AtkRegistryClass))
#define ATK_IS_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_REGISTRY))
#define ATK_IS_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_REGISTRY))
#define ATK_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_REGISTRY, AtkRegistryClass))
struct _AtkRegistry
{
GObject parent;
GHashTable *factory_type_registry;
GHashTable *factory_singleton_cache;
};
struct _AtkRegistryClass
{
GObjectClass parent_class;
};
typedef struct _AtkRegistry AtkRegistry;
typedef struct _AtkRegistryClass AtkRegistryClass;
GDK_AVAILABLE_IN_ALL
GType atk_registry_get_type (void);
GDK_AVAILABLE_IN_ALL
void atk_registry_set_factory_type (AtkRegistry *registry,
GType type,
GType factory_type);
GDK_AVAILABLE_IN_ALL
GType atk_registry_get_factory_type (AtkRegistry *registry,
GType type);
GDK_AVAILABLE_IN_ALL
AtkObjectFactory* atk_registry_get_factory (AtkRegistry *registry,
GType type);
GDK_AVAILABLE_IN_ALL
AtkRegistry* atk_get_default_registry (void);
G_END_DECLS
#endif /* __ATK_REGISTRY_H__ */

View File

@@ -1,501 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <glib-object.h>
#include "atk.h"
/**
* SECTION:atkrelation
* @Short_description: An object used to describe a relation between a
* object and one or more other objects.
* @Title:AtkRelation
*
* An AtkRelation describes a relation between an object and one or
* more other objects. The actual relations that an object has with
* other objects are defined as an AtkRelationSet, which is a set of
* AtkRelations.
*/
enum {
PROP_0,
PROP_RELATION_TYPE,
PROP_TARGET,
PROP_LAST
};
static GPtrArray *extra_names = NULL;
static gpointer parent_class = NULL;
static void atk_relation_class_init (AtkRelationClass *klass);
static void atk_relation_finalize (GObject *object);
static void atk_relation_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void atk_relation_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static GPtrArray* atk_relation_get_ptr_array_from_value_array (GValueArray *array);
static GValueArray* atk_relation_get_value_array_from_ptr_array (GPtrArray *array);
GType
atk_relation_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo typeInfo =
{
sizeof (AtkRelationClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) atk_relation_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (AtkRelation),
0,
(GInstanceInitFunc) NULL,
} ;
type = g_type_register_static (G_TYPE_OBJECT, "AtkRelation", &typeInfo, 0) ;
}
return type;
}
static void
atk_relation_class_init (AtkRelationClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = atk_relation_finalize;
gobject_class->set_property = atk_relation_set_property;
gobject_class->get_property = atk_relation_get_property;
g_object_class_install_property (gobject_class,
PROP_RELATION_TYPE,
g_param_spec_enum ("relation_type",
"Relation Type",
"The type of the relation",
ATK_TYPE_RELATION_TYPE,
ATK_RELATION_NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TARGET,
g_param_spec_value_array ("target",
"Target",
"An array of the targets for the relation",
NULL,
G_PARAM_READWRITE));
}
/**
* atk_relation_type_register:
* @name: a name string
*
* Associate @name with a new #AtkRelationType
* Returns: an #AtkRelationType associated with @name
**/
AtkRelationType
atk_relation_type_register (const gchar *name)
{
g_return_val_if_fail (name, ATK_RELATION_NULL);
if (!extra_names)
extra_names = g_ptr_array_new ();
g_ptr_array_add (extra_names, g_strdup (name));
return extra_names->len + ATK_RELATION_LAST_DEFINED;
}
/**
* atk_relation_type_get_name:
* @type: The #AtkRelationType whose name is required
*
* Gets the description string describing the #AtkRelationType @type.
*
* Returns: the string describing the AtkRelationType
*/
const gchar*
atk_relation_type_get_name (AtkRelationType type)
{
GTypeClass *type_class;
GEnumValue *value;
const gchar *name = NULL;
type_class = g_type_class_ref (ATK_TYPE_RELATION_TYPE);
g_return_val_if_fail (G_IS_ENUM_CLASS (type_class), NULL);
value = g_enum_get_value (G_ENUM_CLASS (type_class), type);
if (value)
{
name = value->value_nick;
}
else
{
if (extra_names)
{
gint n = type;
n -= ATK_RELATION_LAST_DEFINED + 1;
if (n < extra_names->len)
name = g_ptr_array_index (extra_names, n);
}
}
g_type_class_unref (type_class);
return name;
}
/**
* atk_relation_type_for_name:
* @name: a string which is the (non-localized) name of an ATK relation type.
*
* Get the #AtkRelationType type corresponding to a relation name.
*
* Returns: the #AtkRelationType enumerated type corresponding to the specified name,
* or #ATK_RELATION_NULL if no matching relation type is found.
**/
AtkRelationType
atk_relation_type_for_name (const gchar *name)
{
GTypeClass *type_class;
GEnumValue *value;
AtkRelationType type = ATK_RELATION_NULL;
g_return_val_if_fail (name, ATK_RELATION_NULL);
type_class = g_type_class_ref (ATK_TYPE_RELATION_TYPE);
g_return_val_if_fail (G_IS_ENUM_CLASS (type_class), ATK_RELATION_NULL);
value = g_enum_get_value_by_nick (G_ENUM_CLASS (type_class), name);
if (value)
{
type = value->value;
}
else
{
gint i;
if (extra_names)
{
for (i = 0; i < extra_names->len; i++)
{
gchar *extra_name = (gchar *)g_ptr_array_index (extra_names, i);
g_return_val_if_fail (extra_name, ATK_RELATION_NULL);
if (strcmp (name, extra_name) == 0)
{
type = i + 1 + ATK_RELATION_LAST_DEFINED;
break;
}
}
}
}
g_type_class_unref (type_class);
return type;
}
/**
* atk_relation_new:
* @targets: (array length=n_targets): an array of pointers to
* #AtkObjects
* @n_targets: number of #AtkObjects pointed to by @targets
* @relationship: an #AtkRelationType with which to create the new
* #AtkRelation
*
* Create a new relation for the specified key and the specified list
* of targets. See also atk_object_add_relationship().
*
* Returns: a pointer to a new #AtkRelation
**/
AtkRelation*
atk_relation_new (AtkObject **targets,
gint n_targets,
AtkRelationType relationship)
{
AtkRelation *relation;
int i;
GValueArray *array;
GValue *value;
g_return_val_if_fail (targets != NULL, NULL);
array = g_value_array_new (n_targets);
for (i = 0; i < n_targets; i++)
{
value = g_new0 (GValue, 1);
g_value_init (value, ATK_TYPE_OBJECT);
g_value_set_object (value, targets[i]);
array = g_value_array_append (array, value);
g_value_unset (value);
g_free (value);
}
relation = g_object_new (ATK_TYPE_RELATION,
"relation_type", relationship,
"target", array,
NULL);
g_value_array_free (array);
return relation;
}
/**
* atk_relation_get_relation_type:
* @relation: an #AtkRelation
*
* Gets the type of @relation
*
* Returns: the type of @relation
**/
AtkRelationType
atk_relation_get_relation_type (AtkRelation *relation)
{
g_return_val_if_fail (ATK_IS_RELATION (relation), 0);
return relation->relationship;
}
/**
* atk_relation_get_target:
* @relation: an #AtkRelation
*
* Gets the target list of @relation
*
* Returns: (transfer none) (element-type Atk.Object): the target list of @relation
**/
GPtrArray*
atk_relation_get_target (AtkRelation *relation)
{
g_return_val_if_fail (ATK_IS_RELATION (relation), NULL);
return relation->target;
}
static void
delete_object_while_in_relation (gpointer callback_data,
GObject *where_the_object_was)
{
GPtrArray *array;
g_assert (callback_data != NULL);
array = callback_data;
g_ptr_array_remove (array, where_the_object_was);
}
/**
* atk_relation_add_target:
* @relation: an #AtkRelation
* @target: an #AtkObject
*
* Adds the specified AtkObject to the target for the relation, if it is
* not already present. See also atk_object_add_relationship().
*
*
* Since: 1.9
**/
void
atk_relation_add_target (AtkRelation *relation,
AtkObject *target)
{
guint i;
g_return_if_fail (ATK_IS_RELATION (relation));
g_return_if_fail (ATK_IS_OBJECT (target));
/* first check if target occurs in array ... */
for (i = 0; i < relation->target->len; i++)
if (g_ptr_array_index(relation->target, i) == target)
return;
g_ptr_array_add (relation->target, target);
g_object_weak_ref (G_OBJECT (target), (GWeakNotify) delete_object_while_in_relation, relation->target);
}
/**
* atk_relation_remove_target:
* @relation: an #AtkRelation
* @target: an #AtkObject
*
* Remove the specified AtkObject from the target for the relation.
*
* Returns: TRUE if the removal is successful.
**/
gboolean
atk_relation_remove_target (AtkRelation *relation,
AtkObject *target)
{
gboolean ret = FALSE;
GPtrArray *array;
array = atk_relation_get_target (relation);
if (array && g_ptr_array_remove (array, target))
{
g_object_weak_unref (G_OBJECT (target),
(GWeakNotify) delete_object_while_in_relation,
relation->target);
ret = TRUE;
}
return ret;
}
static void
atk_relation_finalize (GObject *object)
{
AtkRelation *relation;
g_return_if_fail (ATK_IS_RELATION (object));
relation = ATK_RELATION (object);
if (relation->target)
{
gint i;
for (i = 0; i < relation->target->len; i++)
{
g_object_weak_unref (G_OBJECT (g_ptr_array_index (relation->target, i)),
(GWeakNotify) delete_object_while_in_relation,
relation->target);
}
g_ptr_array_free (relation->target, TRUE);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
atk_relation_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
AtkRelation *relation;
gpointer boxed;
relation = ATK_RELATION (object);
switch (prop_id)
{
case PROP_RELATION_TYPE:
relation->relationship = g_value_get_enum (value);
break;
case PROP_TARGET:
if (relation->target)
{
gint i;
for (i = 0; i < relation->target->len; i++)
{
g_object_weak_unref (G_OBJECT (g_ptr_array_index (relation->target, i)),
(GWeakNotify) delete_object_while_in_relation,
relation->target);
}
g_ptr_array_free (relation->target, TRUE);
}
boxed = g_value_get_boxed (value);
relation->target = atk_relation_get_ptr_array_from_value_array ( (GValueArray *) boxed);
break;
default:
break;
}
}
static void
atk_relation_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
AtkRelation *relation;
GValueArray *array;
relation = ATK_RELATION (object);
switch (prop_id)
{
case PROP_RELATION_TYPE:
g_value_set_enum (value, relation->relationship);
break;
case PROP_TARGET:
array = atk_relation_get_value_array_from_ptr_array (relation->target);
g_value_set_boxed (value, array);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static GPtrArray*
atk_relation_get_ptr_array_from_value_array (GValueArray *array)
{
gint i;
GPtrArray *return_array;
GValue *value;
GObject *obj;
return_array = g_ptr_array_sized_new (array->n_values);
for (i = 0; i < array->n_values; i++)
{
value = g_value_array_get_nth (array, i);
obj = g_value_get_object (value);
g_ptr_array_add (return_array, obj);
g_object_weak_ref (obj, (GWeakNotify) delete_object_while_in_relation, return_array);
}
return return_array;
}
static GValueArray*
atk_relation_get_value_array_from_ptr_array (GPtrArray *array)
{
int i;
GValueArray *return_array;
GValue *value;
return_array = g_value_array_new (array->len);
for (i = 0; i < array->len; i++)
{
value = g_new0 (GValue, 1);
g_value_init (value, ATK_TYPE_OBJECT);
g_value_set_object (value, g_ptr_array_index (array, i));
return_array = g_value_array_append (return_array, value);
}
return return_array;
}

View File

@@ -1,97 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_RELATION_H__
#define __ATK_RELATION_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
G_BEGIN_DECLS
#include <atk/atktypes.h>
/*
* An AtkRelation describes a relation between the object and one or more
* other objects. The actual relations that an object has with other objects
* are defined as an AtkRelationSet, which is a set of AtkRelations.
*/
#define ATK_TYPE_RELATION (atk_relation_get_type ())
#define ATK_RELATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_RELATION, AtkRelation))
#define ATK_RELATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_RELATION, AtkRelationClass))
#define ATK_IS_RELATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_RELATION))
#define ATK_IS_RELATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_RELATION))
#define ATK_RELATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_RELATION, AtkRelationClass))
typedef struct _AtkRelation AtkRelation;
typedef struct _AtkRelationClass AtkRelationClass;
struct _AtkRelation
{
GObject parent;
GPtrArray *target;
AtkRelationType relationship;
};
struct _AtkRelationClass
{
GObjectClass parent;
};
GDK_AVAILABLE_IN_ALL
GType atk_relation_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkRelationType atk_relation_type_register (const gchar *name);
GDK_AVAILABLE_IN_ALL
const gchar* atk_relation_type_get_name (AtkRelationType type);
GDK_AVAILABLE_IN_ALL
AtkRelationType atk_relation_type_for_name (const gchar *name);
/*
* Create a new relation for the specified key and the specified list
* of targets.
*/
GDK_AVAILABLE_IN_ALL
AtkRelation* atk_relation_new (AtkObject **targets,
gint n_targets,
AtkRelationType relationship);
/*
* Returns the type of a relation.
*/
GDK_AVAILABLE_IN_ALL
AtkRelationType atk_relation_get_relation_type (AtkRelation *relation);
/*
* Returns the target list of a relation.
*/
GDK_AVAILABLE_IN_ALL
GPtrArray* atk_relation_get_target (AtkRelation *relation);
GDK_AVAILABLE_IN_ALL
void atk_relation_add_target (AtkRelation *relation,
AtkObject *target);
GDK_AVAILABLE_IN_ALL
gboolean atk_relation_remove_target (AtkRelation *relation,
AtkObject *target);
G_END_DECLS
#endif /* __ATK_RELATION_H__ */

View File

@@ -1,409 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib-object.h>
#include "atk.h"
/**
* SECTION:atkrelationset
* @Short_description: A set of AtkRelations, normally the set of
* AtkRelations which an AtkObject has.
* @Title:AtkRelationSet
*
* The AtkRelationSet held by an object establishes its relationships
* with objects beyond the normal "parent/child" hierarchical
* relationships that all user interface objects have.
* AtkRelationSets establish whether objects are labelled or
* controlled by other components, share group membership with other
* components (for instance within a radio-button group), or share
* content which "flows" between them, among other types of possible
* relationships.
*/
static gpointer parent_class = NULL;
static void atk_relation_set_class_init (AtkRelationSetClass *klass);
static void atk_relation_set_finalize (GObject *object);
GType
atk_relation_set_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo typeInfo =
{
sizeof (AtkRelationSetClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) atk_relation_set_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (AtkRelationSet),
0,
(GInstanceInitFunc) NULL,
} ;
type = g_type_register_static (G_TYPE_OBJECT, "AtkRelationSet", &typeInfo, 0) ;
}
return type;
}
static void
atk_relation_set_class_init (AtkRelationSetClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = atk_relation_set_finalize;
}
/**
* atk_relation_set_new:
*
* Creates a new empty relation set.
*
* Returns: a new #AtkRelationSet
**/
AtkRelationSet*
atk_relation_set_new (void)
{
AtkRelationSet *relation_set;
relation_set = g_object_new (ATK_TYPE_RELATION_SET, NULL);
return relation_set;
}
/**
* atk_relation_set_contains:
* @set: an #AtkRelationSet
* @relationship: an #AtkRelationType
*
* Determines whether the relation set contains a relation that matches the
* specified type.
*
* Returns: %TRUE if @relationship is the relationship type of a relation
* in @set, %FALSE otherwise
**/
gboolean
atk_relation_set_contains (AtkRelationSet *set,
AtkRelationType relationship)
{
GPtrArray *array_item;
AtkRelation *item;
gint i;
g_return_val_if_fail (ATK_IS_RELATION_SET (set), FALSE);
array_item = set->relations;
if (array_item == NULL)
return FALSE;
for (i = 0; i < array_item->len; i++)
{
item = g_ptr_array_index (array_item, i);
if (item->relationship == relationship)
return TRUE;
}
return FALSE;
}
/**
* atk_relation_set_remove:
* @set: an #AtkRelationSet
* @relation: an #AtkRelation
*
* Removes a relation from the relation set.
* This function unref's the #AtkRelation so it will be deleted unless there
* is another reference to it.
**/
void
atk_relation_set_remove (AtkRelationSet *set,
AtkRelation *relation)
{
GPtrArray *array_item;
AtkRelationType relationship;
g_return_if_fail (ATK_IS_RELATION_SET (set));
array_item = set->relations;
if (array_item == NULL)
return;
if (g_ptr_array_remove (array_item, relation))
{
g_object_unref (relation);
}
else
{
relationship = atk_relation_get_relation_type (relation);
if (atk_relation_set_contains (set, relationship))
{
AtkRelation *exist_relation;
gint i;
exist_relation = atk_relation_set_get_relation_by_type (set, relationship);
for (i = 0; i < relation->target->len; i++)
{
AtkObject *target = g_ptr_array_index(relation->target, i);
atk_relation_remove_target (exist_relation, target);
}
}
}
}
/**
* atk_relation_set_add:
* @set: an #AtkRelationSet
* @relation: an #AtkRelation
*
* Add a new relation to the current relation set if it is not already
* present.
* This function ref's the AtkRelation so the caller of this function
* should unref it to ensure that it will be destroyed when the AtkRelationSet
* is destroyed.
**/
void
atk_relation_set_add (AtkRelationSet *set,
AtkRelation *relation)
{
AtkRelationType relationship;
g_return_if_fail (ATK_IS_RELATION_SET (set));
g_return_if_fail (relation != NULL);
if (set->relations == NULL)
{
set->relations = g_ptr_array_new ();
}
relationship = atk_relation_get_relation_type (relation);
if (!atk_relation_set_contains (set, relationship))
{
g_ptr_array_add (set->relations, relation);
g_object_ref (relation);
}
else
{
AtkRelation *exist_relation;
gint i;
exist_relation = atk_relation_set_get_relation_by_type (set, relationship);
for (i = 0; i < relation->target->len; i++)
{
AtkObject *target = g_ptr_array_index(relation->target, i);
atk_relation_add_target (exist_relation, target);
}
}
}
/**
* atk_relation_set_get_n_relations:
* @set: an #AtkRelationSet
*
* Determines the number of relations in a relation set.
*
* Returns: an integer representing the number of relations in the set.
**/
gint
atk_relation_set_get_n_relations (AtkRelationSet *set)
{
g_return_val_if_fail (ATK_IS_RELATION_SET (set), 0);
if (set->relations == NULL)
return 0;
return set->relations->len;
}
/**
* atk_relation_set_get_relation:
* @set: an #AtkRelationSet
* @i: a gint representing a position in the set, starting from 0.
*
* Determines the relation at the specified position in the relation set.
*
* Returns: (transfer none): a #AtkRelation, which is the relation at
* position i in the set.
**/
AtkRelation*
atk_relation_set_get_relation (AtkRelationSet *set,
gint i)
{
GPtrArray *array_item;
AtkRelation* item;
g_return_val_if_fail (ATK_IS_RELATION_SET (set), NULL);
g_return_val_if_fail (i >= 0, NULL);
array_item = set->relations;
if (array_item == NULL)
return NULL;
item = g_ptr_array_index (array_item, i);
if (item == NULL)
return NULL;
return item;
}
/**
* atk_relation_set_get_relation_by_type:
* @set: an #AtkRelationSet
* @relationship: an #AtkRelationType
*
* Finds a relation that matches the specified type.
*
* Returns: (transfer none): an #AtkRelation, which is a relation matching the
* specified type.
**/
AtkRelation*
atk_relation_set_get_relation_by_type (AtkRelationSet *set,
AtkRelationType relationship)
{
GPtrArray *array_item;
AtkRelation *item;
gint i;
g_return_val_if_fail (ATK_IS_RELATION_SET (set), NULL);
array_item = set->relations;
if (array_item == NULL)
return NULL;
for (i = 0; i < array_item->len; i++)
{
item = g_ptr_array_index (array_item, i);
if (item->relationship == relationship)
return item;
}
return NULL;
}
static void
atk_relation_set_finalize (GObject *object)
{
AtkRelationSet *relation_set;
GPtrArray *array;
gint i;
g_return_if_fail (ATK_IS_RELATION_SET (object));
relation_set = ATK_RELATION_SET (object);
array = relation_set->relations;
if (array)
{
for (i = 0; i < array->len; i++)
{
g_object_unref (g_ptr_array_index (array, i));
}
g_ptr_array_free (array, TRUE);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/**
* atk_relation_set_add_relation_by_type:
* @set: an #AtkRelationSet
* @relationship: an #AtkRelationType
* @target: an #AtkObject
*
* Add a new relation of the specified type with the specified target to
* the current relation set if the relation set does not contain a relation
* of that type. If it is does contain a relation of that typea the target
* is added to the relation.
*
* Since: 1.9
**/
void
atk_relation_set_add_relation_by_type (AtkRelationSet *set,
AtkRelationType relationship,
AtkObject *target)
{
AtkRelation *relation;
g_return_if_fail (ATK_IS_RELATION_SET (set));
g_return_if_fail (ATK_IS_OBJECT (target));
relation = atk_relation_set_get_relation_by_type (set,
relationship);
if (relation)
{
atk_relation_add_target (relation, target);
}
else
{
/* the relation hasn't been created yet ... */
relation = atk_relation_new (&target, 1, relationship);
atk_relation_set_add (set, relation);
g_object_unref(relation);
}
}
/**
* atk_relation_set_contains_target:
* @set: an #AtkRelationSet
* @relationship: an #AtkRelationType
* @target: an #AtkObject
*
* Determines whether the relation set contains a relation that
* matches the specified pair formed by type @relationship and object
* @target.
*
* Returns: %TRUE if @set contains a relation with the relationship
* type @relationship with an object @target, %FALSE otherwise
**/
gboolean
atk_relation_set_contains_target (AtkRelationSet *set,
AtkRelationType relationship,
AtkObject *target)
{
GPtrArray *array_relations;
GPtrArray *array_target;
AtkObject *current_target;
AtkRelation *relation;
gint i;
gint c;
g_return_val_if_fail (ATK_IS_RELATION_SET (set), FALSE);
g_return_val_if_fail (ATK_IS_OBJECT (target), FALSE);
array_relations = set->relations;
if (array_relations == NULL)
return FALSE;
for (i = 0; i < array_relations->len; i++)
{
relation = g_ptr_array_index (array_relations, i);
if (relation->relationship == relationship)
{
array_target = atk_relation_get_target (relation);
for (c = 0; c < array_target->len; c++)
{
current_target = g_ptr_array_index (array_target, c);
if (target == current_target)
return TRUE;
}
}
}
return FALSE;
}

View File

@@ -1,91 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_RELATION_SET_H__
#define __ATK_RELATION_SET_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
G_BEGIN_DECLS
#include <glib-object.h>
#include <atk/atkobject.h>
#include <atk/atkrelation.h>
#define ATK_TYPE_RELATION_SET (atk_relation_set_get_type ())
#define ATK_RELATION_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_RELATION_SET, AtkRelationSet))
#define ATK_RELATION_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_RELATION_SET, AtkRelationSetClass))
#define ATK_IS_RELATION_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_RELATION_SET))
#define ATK_IS_RELATION_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_RELATION_SET))
#define ATK_RELATION_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_RELATION_SET, AtkRelationSetClass))
typedef struct _AtkRelationSetClass AtkRelationSetClass;
struct _AtkRelationSet
{
GObject parent;
GPtrArray *relations;
};
struct _AtkRelationSetClass
{
GObjectClass parent;
AtkFunction pad1;
AtkFunction pad2;
};
GDK_AVAILABLE_IN_ALL
GType atk_relation_set_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkRelationSet* atk_relation_set_new (void);
GDK_AVAILABLE_IN_ALL
gboolean atk_relation_set_contains (AtkRelationSet *set,
AtkRelationType relationship);
GDK_AVAILABLE_IN_ALL
gboolean atk_relation_set_contains_target (AtkRelationSet *set,
AtkRelationType relationship,
AtkObject *target);
GDK_AVAILABLE_IN_ALL
void atk_relation_set_remove (AtkRelationSet *set,
AtkRelation *relation);
GDK_AVAILABLE_IN_ALL
void atk_relation_set_add (AtkRelationSet *set,
AtkRelation *relation);
GDK_AVAILABLE_IN_ALL
gint atk_relation_set_get_n_relations (AtkRelationSet *set);
GDK_AVAILABLE_IN_ALL
AtkRelation* atk_relation_set_get_relation (AtkRelationSet *set,
gint i);
GDK_AVAILABLE_IN_ALL
AtkRelation* atk_relation_set_get_relation_by_type (AtkRelationSet *set,
AtkRelationType relationship);
GDK_AVAILABLE_IN_ALL
void atk_relation_set_add_relation_by_type (AtkRelationSet *set,
AtkRelationType relationship,
AtkObject *target);
G_END_DECLS
#endif /* __ATK_RELATION_SET_H__ */

View File

@@ -1,33 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2002 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_RELATION_TYPE_H__
#define __ATK_RELATION_TYPE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <glib.h>
G_BEGIN_DECLS
G_END_DECLS
#endif /* __ATK_RELATION_TYPE_H__ */

View File

@@ -1,289 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkselection.h"
/**
* SECTION:atkselection
* @Short_description: The ATK interface implemented by container
* objects whose #AtkObject children can be selected.
* @Title:AtkSelection
*
* #AtkSelection should be implemented by UI components with children
* which are exposed by #atk_object_ref_child and
* #atk_object_get_n_children, if the use of the parent UI component
* ordinarily involves selection of one or more of the objects
* corresponding to those #AtkObject children - for example,
* selectable lists.
*
* Note that other types of "selection" (for instance text selection)
* are accomplished a other ATK interfaces - #AtkSelection is limited
* to the selection/deselection of children.
*/
enum {
SELECTION_CHANGED,
LAST_SIGNAL
};
static void atk_selection_base_init (gpointer *g_class);
static guint atk_selection_signals[LAST_SIGNAL] = { 0 };
GType
atk_selection_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkSelectionIface),
(GBaseInitFunc)atk_selection_base_init,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkSelection", &tinfo, 0);
}
return type;
}
static void
atk_selection_base_init (gpointer *g_class)
{
static gboolean initialized = FALSE;
if (! initialized)
{
/**
* AtkSelection::selection-changed:
* @atkselection: the object which received the signal.
*
* The "selection-changed" signal is emitted by an object which
* implements AtkSelection interface when the selection changes.
*/
atk_selection_signals[SELECTION_CHANGED] =
g_signal_new ("selection_changed",
ATK_TYPE_SELECTION,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkSelectionIface, selection_changed),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
/**
* atk_selection_add_selection:
* @selection: a #GObject instance that implements AtkSelectionIface
* @i: a #gint specifying the child index.
*
* Adds the specified accessible child of the object to the
* object's selection.
*
* Returns: TRUE if success, FALSE otherwise.
**/
gboolean
atk_selection_add_selection (AtkSelection *obj,
gint i)
{
AtkSelectionIface *iface;
g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE);
iface = ATK_SELECTION_GET_IFACE (obj);
if (iface->add_selection)
return (iface->add_selection) (obj, i);
else
return FALSE;
}
/**
* atk_selection_clear_selection:
* @selection: a #GObject instance that implements AtkSelectionIface
*
* Clears the selection in the object so that no children in the object
* are selected.
*
* Returns: TRUE if success, FALSE otherwise.
**/
gboolean
atk_selection_clear_selection (AtkSelection *obj)
{
AtkSelectionIface *iface;
g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE);
iface = ATK_SELECTION_GET_IFACE (obj);
if (iface->clear_selection)
return (iface->clear_selection) (obj);
else
return FALSE;
}
/**
* atk_selection_ref_selection:
* @selection: a #GObject instance that implements AtkSelectionIface
* @i: a #gint specifying the index in the selection set. (e.g. the
* ith selection as opposed to the ith child).
*
* Gets a reference to the accessible object representing the specified
* selected child of the object.
* Note: callers should not rely on %NULL or on a zero value for
* indication of whether AtkSelectionIface is implemented, they should
* use type checking/interface checking macros or the
* atk_get_accessible_value() convenience method.
*
* Returns: (nullable) (transfer full): an #AtkObject representing the
* selected accessible, or %NULL if @selection does not implement this
* interface.
**/
AtkObject*
atk_selection_ref_selection (AtkSelection *obj,
gint i)
{
AtkSelectionIface *iface;
g_return_val_if_fail (ATK_IS_SELECTION (obj), NULL);
iface = ATK_SELECTION_GET_IFACE (obj);
if (iface->ref_selection)
return (iface->ref_selection) (obj, i);
else
return NULL;
}
/**
* atk_selection_get_selection_count:
* @selection: a #GObject instance that implements AtkSelectionIface
*
* Gets the number of accessible children currently selected.
* Note: callers should not rely on %NULL or on a zero value for
* indication of whether AtkSelectionIface is implemented, they should
* use type checking/interface checking macros or the
* atk_get_accessible_value() convenience method.
*
* Returns: a gint representing the number of items selected, or 0
* if @selection does not implement this interface.
**/
gint
atk_selection_get_selection_count (AtkSelection *obj)
{
AtkSelectionIface *iface;
g_return_val_if_fail (ATK_IS_SELECTION (obj), 0);
iface = ATK_SELECTION_GET_IFACE (obj);
if (iface->get_selection_count)
return (iface->get_selection_count) (obj);
else
return 0;
}
/**
* atk_selection_is_child_selected:
* @selection: a #GObject instance that implements AtkSelectionIface
* @i: a #gint specifying the child index.
*
* Determines if the current child of this object is selected
* Note: callers should not rely on %NULL or on a zero value for
* indication of whether AtkSelectionIface is implemented, they should
* use type checking/interface checking macros or the
* atk_get_accessible_value() convenience method.
*
* Returns: a gboolean representing the specified child is selected, or 0
* if @selection does not implement this interface.
**/
gboolean
atk_selection_is_child_selected (AtkSelection *obj,
gint i)
{
AtkSelectionIface *iface;
g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE);
iface = ATK_SELECTION_GET_IFACE (obj);
if (iface->is_child_selected)
return (iface->is_child_selected) (obj, i);
else
return FALSE;
}
/**
* atk_selection_remove_selection:
* @selection: a #GObject instance that implements AtkSelectionIface
* @i: a #gint specifying the index in the selection set. (e.g. the
* ith selection as opposed to the ith child).
*
* Removes the specified child of the object from the object's selection.
*
* Returns: TRUE if success, FALSE otherwise.
**/
gboolean
atk_selection_remove_selection (AtkSelection *obj,
gint i)
{
AtkSelectionIface *iface;
g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE);
iface = ATK_SELECTION_GET_IFACE (obj);
if (iface->remove_selection)
return (iface->remove_selection) (obj, i);
else
return FALSE;
}
/**
* atk_selection_select_all_selection:
* @selection: a #GObject instance that implements AtkSelectionIface
*
* Causes every child of the object to be selected if the object
* supports multiple selections.
*
* Returns: TRUE if success, FALSE otherwise.
**/
gboolean
atk_selection_select_all_selection (AtkSelection *obj)
{
AtkSelectionIface *iface;
g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE);
iface = ATK_SELECTION_GET_IFACE (obj);
if (iface->select_all_selection)
return (iface->select_all_selection) (obj);
else
return FALSE;
}

View File

@@ -1,100 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_SELECTION_H__
#define __ATK_SELECTION_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
/*
* This AtkSelection interface provides the standard mechanism for an
* assistive technology to determine what the current selected children are,
* as well as modify the selection set. Any object that has children that
* can be selected should support the AtkSelection interface.
*/
#define ATK_TYPE_SELECTION (atk_selection_get_type ())
#define ATK_IS_SELECTION(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_SELECTION)
#define ATK_SELECTION(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_SELECTION, AtkSelection)
#define ATK_SELECTION_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_SELECTION, AtkSelectionIface))
#ifndef _TYPEDEF_ATK_SELECTION_
#define _TYPEDEF_ATK_SELECTION_
typedef struct _AtkSelection AtkSelection;
#endif
typedef struct _AtkSelectionIface AtkSelectionIface;
struct _AtkSelectionIface
{
GTypeInterface parent;
gboolean (* add_selection) (AtkSelection *selection,
gint i);
gboolean (* clear_selection) (AtkSelection *selection);
AtkObject* (* ref_selection) (AtkSelection *selection,
gint i);
gint (* get_selection_count) (AtkSelection *selection);
gboolean (* is_child_selected) (AtkSelection *selection,
gint i);
gboolean (* remove_selection) (AtkSelection *selection,
gint i);
gboolean (* select_all_selection) (AtkSelection *selection);
/* signal handlers */
void (*selection_changed) (AtkSelection *selection);
};
GDK_AVAILABLE_IN_ALL
GType atk_selection_get_type (void);
GDK_AVAILABLE_IN_ALL
gboolean atk_selection_add_selection (AtkSelection *selection,
gint i);
GDK_AVAILABLE_IN_ALL
gboolean atk_selection_clear_selection (AtkSelection *selection);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_selection_ref_selection (AtkSelection *selection,
gint i);
GDK_AVAILABLE_IN_ALL
gint atk_selection_get_selection_count (AtkSelection *selection);
GDK_AVAILABLE_IN_ALL
gboolean atk_selection_is_child_selected (AtkSelection *selection,
gint i);
GDK_AVAILABLE_IN_ALL
gboolean atk_selection_remove_selection (AtkSelection *selection,
gint i);
GDK_AVAILABLE_IN_ALL
gboolean atk_selection_select_all_selection (AtkSelection *selection);
G_END_DECLS
#endif /* __ATK_SELECTION_H__ */

View File

@@ -1,199 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright (C) 2009 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atk.h"
#include "atksocket.h"
/**
* SECTION:atksocket
* @Short_description: Container for AtkPlug objects from other processes
* @Title: AtkSocket
* @See_also: #AtkPlug
*
* Together with #AtkPlug, #AtkSocket provides the ability to embed
* accessibles from one process into another in a fashion that is
* transparent to assistive technologies. #AtkSocket works as the
* container of #AtkPlug, embedding it using the method
* atk_socket_embed(). Any accessible contained in the #AtkPlug will
* appear to the assistive technologies as being inside the
* application that created the #AtkSocket.
*
* The communication between a #AtkSocket and a #AtkPlug is done by
* the IPC layer of the accessibility framework, normally implemented
* by the D-Bus based implementation of AT-SPI (at-spi2). If that is
* the case, at-spi-atk2 is the responsible to implement the abstract
* methods atk_plug_get_id() and atk_socket_embed(), so an ATK
* implementor shouldn't reimplement them. The process that contains
* the #AtkPlug is responsible to send the ID returned by
* atk_plug_id() to the process that contains the #AtkSocket, so it
* could call the method atk_socket_embed() in order to embed it.
*
* For the same reasons, an implementor doesn't need to implement
* atk_object_get_n_accessible_children() and
* atk_object_ref_accessible_child(). All the logic related to those
* functions will be implemented by the IPC layer.
*/
static void atk_socket_finalize (GObject *obj);
static void atk_component_interface_init (AtkComponentIface *iface);
static void atk_socket_component_real_get_extents (AtkComponent *component,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type);
G_DEFINE_TYPE_WITH_CODE (AtkSocket, atk_socket, ATK_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
static void
atk_socket_init (AtkSocket* obj)
{
AtkObject *accessible = ATK_OBJECT (obj);
obj->embedded_plug_id = NULL;
accessible->role = ATK_ROLE_FILLER;
accessible->layer = ATK_LAYER_WIDGET;
}
static void
atk_socket_class_init (AtkSocketClass* klass)
{
GObjectClass *obj_class = G_OBJECT_CLASS (klass);
obj_class->finalize = atk_socket_finalize;
klass->embed = NULL;
}
static void
atk_socket_finalize (GObject *_obj)
{
AtkSocket *obj = ATK_SOCKET (_obj);
g_free (obj->embedded_plug_id);
obj->embedded_plug_id = NULL;
G_OBJECT_CLASS (atk_socket_parent_class)->finalize (_obj);
}
static void
atk_component_interface_init (AtkComponentIface *iface)
{
iface->get_extents = atk_socket_component_real_get_extents;
}
/**
* atk_socket_new:
*
* Creates a new #AtkSocket.
*
* Returns: (transfer full): the newly created #AtkSocket instance
*/
AtkObject*
atk_socket_new (void)
{
return g_object_new (ATK_TYPE_SOCKET, NULL);
}
/**
* atk_socket_embed:
* @obj: an #AtkSocket
* @plug_id: the ID of an #AtkPlug
*
* Embeds the children of an #AtkPlug as the children of the
* #AtkSocket. The plug may be in the same process or in a different
* process.
*
* The class item used by this function should be filled in by the IPC
* layer (usually at-spi2-atk). The implementor of the AtkSocket
* should call this function and pass the id for the plug as returned
* by atk_plug_get_id(). It is the responsibility of the application
* to pass the plug id on to the process implementing the #AtkSocket
* as needed.
*
* Since: 1.30
**/
void
atk_socket_embed (AtkSocket* obj, const gchar* plug_id)
{
AtkSocketClass *klass;
g_return_if_fail (plug_id != NULL);
g_return_if_fail (ATK_IS_SOCKET (obj));
klass = g_type_class_peek (ATK_TYPE_SOCKET);
if (klass && klass->embed)
{
if (obj->embedded_plug_id)
g_free (obj->embedded_plug_id);
obj->embedded_plug_id = g_strdup (plug_id);
(klass->embed) (obj, plug_id);
}
}
/**
* atk_socket_is_occupied:
* @obj: an #AtkSocket
*
* Determines whether or not the socket has an embedded plug.
*
* Returns: TRUE if a plug is embedded in the socket
*
* Since: 1.30
**/
gboolean
atk_socket_is_occupied (AtkSocket* obj)
{
g_return_val_if_fail (ATK_IS_SOCKET (obj), FALSE);
return (obj->embedded_plug_id != NULL);
}
static void
atk_socket_component_real_get_extents (AtkComponent *component,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type)
{
AtkObject *parent = atk_object_get_parent (ATK_OBJECT (component));
if (parent == NULL || !ATK_IS_COMPONENT (parent))
{
if (x)
*x = -1;
if (y)
*y = -1;
if (width)
*width = -1;
if (height)
*height = -1;
return;
}
atk_component_get_extents (ATK_COMPONENT (parent), x, y, width, height, coord_type);
}

View File

@@ -1,71 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2009 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_SOCKET_H__
#define __ATK_SOCKET_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_SOCKET (atk_socket_get_type ())
#define ATK_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_SOCKET, AtkSocket))
#define ATK_IS_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_SOCKET))
#define ATK_SOCKET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_SOCKET, AtkSocketClass))
#define ATK_IS_SOCKET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_SOCKET))
#define ATK_SOCKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_SOCKET, AtkSocketClass))
typedef struct _AtkSocket AtkSocket;
typedef struct _AtkSocketClass AtkSocketClass;
struct _AtkSocket
{
AtkObject parent;
/*< private >*/
gchar* embedded_plug_id;
};
GDK_AVAILABLE_IN_ALL
GType atk_socket_get_type (void);
struct _AtkSocketClass
{
AtkObjectClass parent_class;
/* to be subscribed to by atk-bridge */
/*< protected >*/
void (* embed) (AtkSocket *obj, const gchar* plug_id);
};
GDK_AVAILABLE_IN_ALL
AtkObject* atk_socket_new (void);
GDK_AVAILABLE_IN_ALL
void atk_socket_embed (AtkSocket* obj, const gchar* plug_id);
GDK_AVAILABLE_IN_ALL
gboolean atk_socket_is_occupied (AtkSocket* obj);
G_END_DECLS
#endif /* __ATK_SOCKET_H__ */

View File

@@ -1,143 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atk.h"
#include <string.h>
/**
* SECTION:atkstate
* @Short_description: An AtkState describes a single state of an object.
* @Title:AtkState
*
* An AtkState describes a single state of an object. The full set of states
* that apply to an object at a given time are contained in its #AtkStateSet.
* See also #atk_object_ref_state_set and #atk_object_notify_state_change.
*/
static guint last_type = ATK_STATE_LAST_DEFINED;
#define NUM_POSSIBLE_STATES (sizeof(AtkState)*8)
static gchar* state_names[NUM_POSSIBLE_STATES];
/**
* atk_state_type_register:
* @name: a character string describing the new state.
*
* Register a new object state.
*
* Returns: an #AtkState value for the new state.
**/
AtkStateType
atk_state_type_register (const gchar *name)
{
g_return_val_if_fail (name, ATK_STATE_INVALID);
if (last_type < NUM_POSSIBLE_STATES -1)
{
state_names[++last_type] = g_strdup (name);
return (last_type);
}
return ATK_STATE_INVALID; /* caller needs to check */
}
/**
* atk_state_type_get_name:
* @type: The #AtkStateType whose name is required
*
* Gets the description string describing the #AtkStateType @type.
*
* Returns: the string describing the AtkStateType
*/
const gchar*
atk_state_type_get_name (AtkStateType type)
{
GTypeClass *type_class;
GEnumValue *value;
const gchar *name = NULL;
type_class = g_type_class_ref (ATK_TYPE_STATE_TYPE);
g_return_val_if_fail (G_IS_ENUM_CLASS (type_class), NULL);
value = g_enum_get_value (G_ENUM_CLASS (type_class), type);
if (value)
{
name = value->value_nick;
}
else
{
if (type <= last_type)
{
if (type >= 0)
name = state_names[type];
}
}
g_type_class_unref (type_class);
return name;
}
/**
* atk_state_type_for_name:
* @name: a character string state name
*
* Gets the #AtkStateType corresponding to the description string @name.
*
* Returns: an #AtkStateType corresponding to @name
*/
AtkStateType
atk_state_type_for_name (const gchar *name)
{
GTypeClass *type_class;
GEnumValue *value;
AtkStateType type = ATK_STATE_INVALID;
g_return_val_if_fail (name, ATK_STATE_INVALID);
type_class = g_type_class_ref (ATK_TYPE_STATE_TYPE);
g_return_val_if_fail (G_IS_ENUM_CLASS (type_class), ATK_STATE_INVALID);
value = g_enum_get_value_by_nick (G_ENUM_CLASS (type_class), name);
if (value)
{
type = value->value;
}
else
{
gint i;
for (i = ATK_STATE_LAST_DEFINED + 1; i <= last_type; i++)
{
if (state_names[i] == NULL)
continue;
if (!strcmp(name, state_names[i]))
{
type = i;
break;
}
}
}
return type;
}

View File

@@ -1,43 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_STATE_H__
#define __ATK_STATE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atktypes.h>
G_BEGIN_DECLS
typedef guint64 AtkState;
GDK_AVAILABLE_IN_ALL
AtkStateType atk_state_type_register (const gchar *name);
GDK_AVAILABLE_IN_ALL
const gchar* atk_state_type_get_name (AtkStateType type);
GDK_AVAILABLE_IN_ALL
AtkStateType atk_state_type_for_name (const gchar *name);
G_END_DECLS
#endif /* __ATK_STATE_H__ */

View File

@@ -1,384 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib-object.h>
#include "atkobject.h"
#include "atkstateset.h"
/**
* SECTION:atkstateset
* @Short_description: An AtkStateSet contains the states of an object.
* @Title:AtkStateSet
*
* An AtkStateSet is a read-only representation of the full set of #AtkStates
* that apply to an object at a given time. This set is not meant to be
* modified, but rather created when #atk_object_ref_state_set() is called.
*/
#define ATK_STATE(state_enum) ((AtkState)((guint64)1 << ((state_enum)%64)))
struct _AtkRealStateSet
{
GObject parent;
AtkState state;
};
typedef struct _AtkRealStateSet AtkRealStateSet;
static void atk_state_set_class_init (AtkStateSetClass *klass);
GType
atk_state_set_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo typeInfo =
{
sizeof (AtkStateSetClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) atk_state_set_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (AtkRealStateSet),
0,
(GInstanceInitFunc) NULL,
} ;
type = g_type_register_static (G_TYPE_OBJECT, "AtkStateSet", &typeInfo, 0) ;
}
return type;
}
static void
atk_state_set_class_init (AtkStateSetClass *klass)
{
}
/**
* atk_state_set_new:
*
* Creates a new empty state set.
*
* Returns: a new #AtkStateSet
**/
AtkStateSet*
atk_state_set_new (void)
{
return (AtkStateSet*) g_object_new (ATK_TYPE_STATE_SET, NULL);
}
/**
* atk_state_set_is_empty:
* @set: an #AtkStateType
*
* Checks whether the state set is empty, i.e. has no states set.
*
* Returns: %TRUE if @set has no states set, otherwise %FALSE
**/
gboolean
atk_state_set_is_empty (AtkStateSet *set)
{
AtkRealStateSet *real_set;
g_return_val_if_fail (ATK_IS_STATE_SET (set), FALSE);
real_set = (AtkRealStateSet *)set;
if (real_set->state)
return FALSE;
else
return TRUE;
}
/**
* atk_state_set_add_state:
* @set: an #AtkStateSet
* @type: an #AtkStateType
*
* Adds the state of the specified type to the state set if it is not already
* present.
*
* Note that because an #AtkStateSet is a read-only object, this method should
* be used to add a state to a newly-created set which will then be returned by
* #atk_object_ref_state_set. It should not be used to modify the existing state
* of an object. See also #atk_object_notify_state_change.
*
* Returns: %TRUE if the state for @type is not already in @set.
**/
gboolean
atk_state_set_add_state (AtkStateSet *set,
AtkStateType type)
{
AtkRealStateSet *real_set;
g_return_val_if_fail (ATK_IS_STATE_SET (set), FALSE);
real_set = (AtkRealStateSet *)set;
if (real_set->state & ATK_STATE (type))
return FALSE;
else
{
real_set->state |= ATK_STATE (type);
return TRUE;
}
}
/**
* atk_state_set_add_states:
* @set: an #AtkStateSet
* @types: (array length=n_types): an array of #AtkStateType
* @n_types: The number of elements in the array
*
* Adds the states of the specified types to the state set.
*
* Note that because an #AtkStateSet is a read-only object, this method should
* be used to add states to a newly-created set which will then be returned by
* #atk_object_ref_state_set. It should not be used to modify the existing state
* of an object. See also #atk_object_notify_state_change.
**/
void
atk_state_set_add_states (AtkStateSet *set,
AtkStateType *types,
gint n_types)
{
AtkRealStateSet *real_set;
gint i;
g_return_if_fail (ATK_IS_STATE_SET (set));
real_set = (AtkRealStateSet *)set;
for (i = 0; i < n_types; i++)
{
real_set->state |= ATK_STATE (types[i]);
}
}
/**
* atk_state_set_clear_states:
* @set: an #AtkStateSet
*
* Removes all states from the state set.
**/
void
atk_state_set_clear_states (AtkStateSet *set)
{
AtkRealStateSet *real_set;
g_return_if_fail (ATK_IS_STATE_SET (set));
real_set = (AtkRealStateSet *)set;
real_set->state = 0;
}
/**
* atk_state_set_contains_state:
* @set: an #AtkStateSet
* @type: an #AtkStateType
*
* Checks whether the state for the specified type is in the specified set.
*
* Returns: %TRUE if @type is the state type is in @set.
**/
gboolean
atk_state_set_contains_state (AtkStateSet *set,
AtkStateType type)
{
AtkRealStateSet *real_set;
g_return_val_if_fail (ATK_IS_STATE_SET (set), FALSE);
real_set = (AtkRealStateSet *)set;
if (real_set->state & ATK_STATE (type))
return TRUE;
else
return FALSE;
}
/**
* atk_state_set_contains_states:
* @set: an #AtkStateSet
* @types: (array length=n_types): an array of #AtkStateType
* @n_types: The number of elements in the array
*
* Checks whether the states for all the specified types are in the
* specified set.
*
* Returns: %TRUE if all the states for @type are in @set.
**/
gboolean
atk_state_set_contains_states (AtkStateSet *set,
AtkStateType *types,
gint n_types)
{
AtkRealStateSet *real_set;
gint i;
g_return_val_if_fail (ATK_IS_STATE_SET (set), FALSE);
real_set = (AtkRealStateSet *)set;
for (i = 0; i < n_types; i++)
{
if (!(real_set->state & ATK_STATE (types[i])))
return FALSE;
}
return TRUE;
}
/**
* atk_state_set_remove_state:
* @set: an #AtkStateSet
* @type: an #AtkType
*
* Removes the state for the specified type from the state set.
*
* Note that because an #AtkStateSet is a read-only object, this method should
* be used to remove a state to a newly-created set which will then be returned
* by #atk_object_ref_state_set. It should not be used to modify the existing
* state of an object. See also #atk_object_notify_state_change.
*
* Returns: %TRUE if @type was the state type is in @set.
**/
gboolean
atk_state_set_remove_state (AtkStateSet *set,
AtkStateType type)
{
AtkRealStateSet *real_set;
g_return_val_if_fail (ATK_IS_STATE_SET (set), FALSE);
real_set = (AtkRealStateSet *)set;
if (real_set->state & ATK_STATE (type))
{
real_set->state ^= ATK_STATE (type);
return TRUE;
}
else
return FALSE;
}
/**
* atk_state_set_and_sets:
* @set: an #AtkStateSet
* @compare_set: another #AtkStateSet
*
* Constructs the intersection of the two sets, returning %NULL if the
* intersection is empty.
*
* Returns: (transfer full): a new #AtkStateSet which is the intersection of
* the two sets.
**/
AtkStateSet*
atk_state_set_and_sets (AtkStateSet *set,
AtkStateSet *compare_set)
{
AtkRealStateSet *real_set, *real_compare_set;
AtkStateSet *return_set = NULL;
AtkState state;
g_return_val_if_fail (ATK_IS_STATE_SET (set), NULL);
g_return_val_if_fail (ATK_IS_STATE_SET (compare_set), NULL);
real_set = (AtkRealStateSet *)set;
real_compare_set = (AtkRealStateSet *)compare_set;
state = real_set->state & real_compare_set->state;
if (state)
{
return_set = atk_state_set_new();
((AtkRealStateSet *) return_set)->state = state;
}
return return_set;
}
/**
* atk_state_set_or_sets:
* @set: an #AtkStateSet
* @compare_set: another #AtkStateSet
*
* Constructs the union of the two sets.
*
* Returns: (nullable) (transfer full): a new #AtkStateSet which is
* the union of the two sets, returning %NULL is empty.
**/
AtkStateSet*
atk_state_set_or_sets (AtkStateSet *set,
AtkStateSet *compare_set)
{
AtkRealStateSet *real_set, *real_compare_set;
AtkStateSet *return_set = NULL;
AtkState state;
g_return_val_if_fail (ATK_IS_STATE_SET (set), NULL);
g_return_val_if_fail (ATK_IS_STATE_SET (compare_set), NULL);
real_set = (AtkRealStateSet *)set;
real_compare_set = (AtkRealStateSet *)compare_set;
state = real_set->state | real_compare_set->state;
if (state)
{
return_set = atk_state_set_new();
((AtkRealStateSet *) return_set)->state = state;
}
return return_set;
}
/**
* atk_state_set_xor_sets:
* @set: an #AtkStateSet
* @compare_set: another #AtkStateSet
*
* Constructs the exclusive-or of the two sets, returning %NULL is empty.
* The set returned by this operation contains the states in exactly
* one of the two sets.
*
* Returns: (transfer full): a new #AtkStateSet which contains the states
* which are in exactly one of the two sets.
**/
AtkStateSet*
atk_state_set_xor_sets (AtkStateSet *set,
AtkStateSet *compare_set)
{
AtkRealStateSet *real_set, *real_compare_set;
AtkStateSet *return_set = NULL;
AtkState state, state1, state2;
g_return_val_if_fail (ATK_IS_STATE_SET (set), NULL);
g_return_val_if_fail (ATK_IS_STATE_SET (compare_set), NULL);
real_set = (AtkRealStateSet *)set;
real_compare_set = (AtkRealStateSet *)compare_set;
state1 = real_set->state & (~real_compare_set->state);
state2 = (~real_set->state) & real_compare_set->state;
state = state1 | state2;
if (state)
{
return_set = atk_state_set_new();
((AtkRealStateSet *) return_set)->state = state;
}
return return_set;
}

View File

@@ -1,92 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_STATE_SET_H__
#define __ATK_STATE_SET_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <glib-object.h>
#include <atk/atkobject.h>
#include <atk/atkstate.h>
G_BEGIN_DECLS
#define ATK_TYPE_STATE_SET (atk_state_set_get_type ())
#define ATK_STATE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_STATE_SET, AtkStateSet))
#define ATK_STATE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_STATE_SET, AtkStateSetClass))
#define ATK_IS_STATE_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_STATE_SET))
#define ATK_IS_STATE_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_STATE_SET))
#define ATK_STATE_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_STATE_SET, AtkStateSetClass))
typedef struct _AtkStateSetClass AtkStateSetClass;
struct _AtkStateSet
{
GObject parent;
};
struct _AtkStateSetClass
{
GObjectClass parent;
};
GDK_AVAILABLE_IN_ALL
GType atk_state_set_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkStateSet* atk_state_set_new (void);
GDK_AVAILABLE_IN_ALL
gboolean atk_state_set_is_empty (AtkStateSet *set);
GDK_AVAILABLE_IN_ALL
gboolean atk_state_set_add_state (AtkStateSet *set,
AtkStateType type);
GDK_AVAILABLE_IN_ALL
void atk_state_set_add_states (AtkStateSet *set,
AtkStateType *types,
gint n_types);
GDK_AVAILABLE_IN_ALL
void atk_state_set_clear_states (AtkStateSet *set);
GDK_AVAILABLE_IN_ALL
gboolean atk_state_set_contains_state (AtkStateSet *set,
AtkStateType type);
GDK_AVAILABLE_IN_ALL
gboolean atk_state_set_contains_states (AtkStateSet *set,
AtkStateType *types,
gint n_types);
GDK_AVAILABLE_IN_ALL
gboolean atk_state_set_remove_state (AtkStateSet *set,
AtkStateType type);
GDK_AVAILABLE_IN_ALL
AtkStateSet* atk_state_set_and_sets (AtkStateSet *set,
AtkStateSet *compare_set);
GDK_AVAILABLE_IN_ALL
AtkStateSet* atk_state_set_or_sets (AtkStateSet *set,
AtkStateSet *compare_set);
GDK_AVAILABLE_IN_ALL
AtkStateSet* atk_state_set_xor_sets (AtkStateSet *set,
AtkStateSet *compare_set);
G_END_DECLS
#endif /* __ATK_STATE_SET_H__ */

View File

@@ -1,181 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkstreamablecontent.h"
/**
* SECTION:atkstreamablecontent
* @Short_description: The ATK interface which provides access to
* streamable content.
* @Title:AtkStreamableContent
*
* An interface whereby an object allows its backing content to be
* streamed to clients. Typical implementors would be images or
* icons, HTML content, or multimedia display/rendering widgets.
*
* Negotiation of content type is allowed. Clients may examine the
* backing data and transform, convert, or parse the content in order
* to present it in an alternate form to end-users.
*
* The AtkStreamableContent interface is particularly useful for
* saving, printing, or post-processing entire documents, or for
* persisting alternate views of a document. If document content
* itself is being serialized, stored, or converted, then use of the
* AtkStreamableContent interface can help address performance
* issues. Unlike most ATK interfaces, this interface is not strongly
* tied to the current user-agent view of the a particular document,
* but may in some cases give access to the underlying model data.
*/
GType
atk_streamable_content_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkStreamableContentIface),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkStreamableContent", &tinfo, 0);
}
return type;
}
/**
* atk_streamable_content_get_n_mime_types:
* @streamable: a GObject instance that implements AtkStreamableContentIface
*
* Gets the number of mime types supported by this object.
*
* Returns: a gint which is the number of mime types supported by the object.
**/
gint
atk_streamable_content_get_n_mime_types (AtkStreamableContent *streamable)
{
AtkStreamableContentIface *iface;
g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (streamable), 0);
iface = ATK_STREAMABLE_CONTENT_GET_IFACE (streamable);
if (iface->get_n_mime_types)
return (iface->get_n_mime_types) (streamable);
else
return 0;
}
/**
* atk_streamable_content_get_mime_type:
* @streamable: a GObject instance that implements AtkStreamableContent
* @i: a gint representing the position of the mime type starting from 0
*
* Gets the character string of the specified mime type. The first mime
* type is at position 0, the second at position 1, and so on.
*
* Returns: a gchar* representing the specified mime type; the caller
* should not free the character string.
**/
const gchar*
atk_streamable_content_get_mime_type (AtkStreamableContent *streamable,
gint i)
{
AtkStreamableContentIface *iface;
g_return_val_if_fail (i >= 0, NULL);
g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (streamable), NULL);
iface = ATK_STREAMABLE_CONTENT_GET_IFACE (streamable);
if (iface->get_mime_type)
return (iface->get_mime_type) (streamable, i);
else
return NULL;
}
/**
* atk_streamable_content_get_stream:
* @streamable: a GObject instance that implements AtkStreamableContentIface
* @mime_type: a gchar* representing the mime type
*
* Gets the content in the specified mime type.
*
* Returns: (transfer full): A #GIOChannel which contains the content in the
* specified mime type.
**/
GIOChannel*
atk_streamable_content_get_stream (AtkStreamableContent *streamable,
const gchar *mime_type)
{
AtkStreamableContentIface *iface;
g_return_val_if_fail (mime_type != NULL, NULL);
g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (streamable), NULL);
iface = ATK_STREAMABLE_CONTENT_GET_IFACE (streamable);
if (iface->get_stream)
return (iface->get_stream) (streamable, mime_type);
else
return NULL;
}
/**
* atk_streamable_content_get_uri:
* @streamable: a GObject instance that implements AtkStreamableContentIface
* @mime_type: a gchar* representing the mime type, or NULL to request a URI
* for the default mime type.
*
* Get a string representing a URI in IETF standard format
* (see http://www.ietf.org/rfc/rfc2396.txt) from which the object's content
* may be streamed in the specified mime-type, if one is available.
* If mime_type is NULL, the URI for the default (and possibly only) mime-type is
* returned.
*
* Note that it is possible for get_uri to return NULL but for
* get_stream to work nonetheless, since not all GIOChannels connect to URIs.
*
* Returns: (nullable): Returns a string representing a URI, or %NULL
* if no corresponding URI can be constructed.
*
* Since: 1.12
**/
const gchar*
atk_streamable_content_get_uri (AtkStreamableContent *streamable,
const gchar *mime_type)
{
AtkStreamableContentIface *iface;
g_return_val_if_fail (mime_type != NULL, NULL);
g_return_val_if_fail (ATK_IS_STREAMABLE_CONTENT (streamable), NULL);
iface = ATK_STREAMABLE_CONTENT_GET_IFACE (streamable);
if (iface->get_uri)
return (iface->get_uri) (streamable, mime_type);
else
return NULL;
}

View File

@@ -1,110 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_STREAMABLE_CONTENT_H__
#define __ATK_STREAMABLE_CONTENT_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_STREAMABLE_CONTENT (atk_streamable_content_get_type ())
#define ATK_IS_STREAMABLE_CONTENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_STREAMABLE_CONTENT)
#define ATK_STREAMABLE_CONTENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_STREAMABLE_CONTENT, AtkStreamableContent)
#define ATK_STREAMABLE_CONTENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_STREAMABLE_CONTENT, AtkStreamableContentIface))
#ifndef _TYPEDEF_ATK_STREAMABLE_CONTENT
#define _TYPEDEF_ATK_STREAMABLE_CONTENT
typedef struct _AtkStreamableContent AtkStreamableContent;
#endif
typedef struct _AtkStreamableContentIface AtkStreamableContentIface;
struct _AtkStreamableContentIface
{
GTypeInterface parent;
/*
* Get the number of mime types supported by this object
*/
gint (* get_n_mime_types) (AtkStreamableContent *streamable);
/*
* Gets the specified mime type supported by this object.
* The mime types are 0-based so the first mime type is
* at index 0, the second at index 1 and so on. The mime-type
* at index 0 should be considered the "default" data type for the stream.
*
* This assumes that the strings for the mime types are stored in the
* AtkStreamableContent. Alternatively the const could be removed
* and the caller would be responsible for calling g_free() on the
* returned value.
*/
const gchar* (* get_mime_type) (AtkStreamableContent *streamable,
gint i);
/*
* One possible implementation for this method is that it constructs the
* content appropriate for the mime type and then creates a temporary
* file containing the content, opens the file and then calls
* g_io_channel_unix_new_fd().
*/
GIOChannel* (* get_stream) (AtkStreamableContent *streamable,
const gchar *mime_type);
/*
* Returns a string representing a URI in IETF standard format
* (see http://www.ietf.org/rfc/rfc2396.txt) from which the object's content
* may be streamed in the specified mime-type.
* If mime_type is NULL, the URI for the default (and possibly only) mime-type is
* returned.
*
* returns NULL if the mime-type is not supported, or if no URI can be
* constructed. Note that it is possible for get_uri to return NULL but for
* get_stream to work nonetheless, since not all GIOChannels connect to URIs.
*/
const gchar* (* get_uri) (AtkStreamableContent *streamable,
const gchar *mime_type);
AtkFunction pad1;
AtkFunction pad2;
AtkFunction pad3;
};
GDK_AVAILABLE_IN_ALL
GType atk_streamable_content_get_type (void);
GDK_AVAILABLE_IN_ALL
gint atk_streamable_content_get_n_mime_types (AtkStreamableContent *streamable);
GDK_AVAILABLE_IN_ALL
const gchar* atk_streamable_content_get_mime_type (AtkStreamableContent *streamable,
gint i);
GDK_AVAILABLE_IN_ALL
GIOChannel* atk_streamable_content_get_stream (AtkStreamableContent *streamable,
const gchar *mime_type);
GDK_AVAILABLE_IN_ALL
const gchar* atk_streamable_content_get_uri (AtkStreamableContent *streamable,
const gchar *mime_type);
G_END_DECLS
#endif /* __ATK_STREAMABLE_CONTENT_H__ */

View File

@@ -1,892 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atktable.h"
#include "atkmarshal.h"
/**
* SECTION:atktable
* @Short_description: The ATK interface implemented for UI components
* which contain tabular or row/column information.
* @Title:AtkTable
*
* #AtkTable should be implemented by components which present
* elements ordered via rows and columns. It may also be used to
* present tree-structured information if the nodes of the trees can
* be said to contain multiple "columns". Individual elements of an
* #AtkTable are typically referred to as "cells". Those cells should
* implement the interface #AtkTableCell, but #Atk doesn't require
* them to be direct children of the current #AtkTable. They can be
* grand-children, grand-grand-children etc. #AtkTable provides the
* API needed to get a individual cell based on the row and column
* numbers.
*
* Children of #AtkTable are frequently "lightweight" objects, that
* is, they may not have backing widgets in the host UI toolkit. They
* are therefore often transient.
*
* Since tables are often very complex, #AtkTable includes provision
* for offering simplified summary information, as well as row and
* column headers and captions. Headers and captions are #AtkObjects
* which may implement other interfaces (#AtkText, #AtkImage, etc.) as
* appropriate. #AtkTable summaries may themselves be (simplified)
* #AtkTables, etc.
*
* Note for implementors: in the past, #AtkTable required that all the
* cells should be direct children of #AtkTable, and provided some
* index based methods to request the cells. The practice showed that
* that forcing made #AtkTable implementation complex, and hard to
* expose other kind of children, like rows or captions. Right now,
* index-based methods are deprecated.
*/
enum {
ROW_INSERTED,
ROW_DELETED,
COLUMN_INSERTED,
COLUMN_DELETED,
ROW_REORDERED,
COLUMN_REORDERED,
MODEL_CHANGED,
LAST_SIGNAL
};
static void atk_table_base_init (gpointer *g_class);
static guint atk_table_signals[LAST_SIGNAL] = { 0 };
GType
atk_table_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkTableIface),
(GBaseInitFunc) atk_table_base_init,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0);
}
return type;
}
static void
atk_table_base_init (gpointer *g_class)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* AtkTable::row-inserted:
* @atktable: the object which received the signal.
* @arg1: The index of the first row inserted.
* @arg2: The number of rows inserted.
*
* The "row-inserted" signal is emitted by an object which
* implements the AtkTable interface when a row is inserted.
*/
atk_table_signals[ROW_INSERTED] =
g_signal_new ("row_inserted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, row_inserted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::column-inserted:
* @atktable: the object which received the signal.
* @arg1: The index of the column inserted.
* @arg2: The number of colums inserted.
*
* The "column-inserted" signal is emitted by an object which
* implements the AtkTable interface when a column is inserted.
*/
atk_table_signals[COLUMN_INSERTED] =
g_signal_new ("column_inserted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, column_inserted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::row-deleted:
* @atktable: the object which received the signal.
* @arg1: The index of the first row deleted.
* @arg2: The number of rows deleted.
*
* The "row-deleted" signal is emitted by an object which
* implements the AtkTable interface when a row is deleted.
*/
atk_table_signals[ROW_DELETED] =
g_signal_new ("row_deleted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, row_deleted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::column-deleted:
* @atktable: the object which received the signal.
* @arg1: The index of the first column deleted.
* @arg2: The number of columns deleted.
*
* The "column-deleted" signal is emitted by an object which
* implements the AtkTable interface when a column is deleted.
*/
atk_table_signals[COLUMN_DELETED] =
g_signal_new ("column_deleted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, column_deleted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::row-reordered:
* @atktable: the object which received the signal.
*
* The "row-reordered" signal is emitted by an object which
* implements the AtkTable interface when the rows are
* reordered.
*/
atk_table_signals[ROW_REORDERED] =
g_signal_new ("row_reordered",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, row_reordered),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
/**
* AtkTable::column-reordered:
* @atktable: the object which received the signal.
*
* The "column-reordered" signal is emitted by an object which
* implements the AtkTable interface when the columns are
* reordered.
*/
atk_table_signals[COLUMN_REORDERED] =
g_signal_new ("column_reordered",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, column_reordered),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
/**
* AtkTable::model-changed:
* @atktable: the object which received the signal.
*
* The "model-changed" signal is emitted by an object which
* implements the AtkTable interface when the model displayed by
* the table changes.
*/
atk_table_signals[MODEL_CHANGED] =
g_signal_new ("model_changed",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, model_changed),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
/**
* atk_table_ref_at:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Get a reference to the table cell at @row, @column. This cell
* should implement the interface #AtkTableCell
*
* Returns: (transfer full): an #AtkObject representing the referred
* to accessible
**/
AtkObject*
atk_table_ref_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
g_return_val_if_fail (row >= 0, NULL);
g_return_val_if_fail (column >= 0, NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->ref_at)
return (iface->ref_at) (table, row, column);
else
return NULL;
}
/**
* atk_table_get_caption:
* @table: a GObject instance that implements AtkTableInterface
*
* Gets the caption for the @table.
*
* Returns: (nullable) (transfer none): a AtkObject* representing the
* table caption, or %NULL if value does not implement this interface.
**/
AtkObject*
atk_table_get_caption (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_caption)
return (iface->get_caption) (table);
else
return NULL;
}
/**
* atk_table_get_n_columns:
* @table: a GObject instance that implements AtkTableIface
*
* Gets the number of columns in the table.
*
* Returns: a gint representing the number of columns, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_n_columns (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_n_columns)
return (iface->get_n_columns) (table);
else
return 0;
}
/**
* atk_table_get_column_description:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Gets the description text of the specified @column in the table
*
* Returns: a gchar* representing the column description, or %NULL
* if value does not implement this interface.
**/
const gchar*
atk_table_get_column_description (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_column_description)
return (iface->get_column_description) (table, column);
else
return NULL;
}
/**
* atk_table_get_column_extent_at:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Gets the number of columns occupied by the accessible object
* at the specified @row and @column in the @table.
*
* Returns: a gint representing the column extent at specified position, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_column_extent_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_column_extent_at)
return (iface->get_column_extent_at) (table, row, column);
else
return 0;
}
/**
* atk_table_get_column_header:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in the table
*
* Gets the column header of a specified column in an accessible table.
*
* Returns: (nullable) (transfer none): a AtkObject* representing the
* specified column header, or %NULL if value does not implement this
* interface.
**/
AtkObject*
atk_table_get_column_header (AtkTable *table, gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_column_header)
return (iface->get_column_header) (table, column);
else
return NULL;
}
/**
* atk_table_get_n_rows:
* @table: a GObject instance that implements AtkTableIface
*
* Gets the number of rows in the table.
*
* Returns: a gint representing the number of rows, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_n_rows (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_n_rows)
return (iface->get_n_rows) (table);
else
return 0;
}
/**
* atk_table_get_row_description:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Gets the description text of the specified row in the table
*
* Returns: (nullable): a gchar* representing the row description, or
* %NULL if value does not implement this interface.
**/
const gchar*
atk_table_get_row_description (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_description)
return (iface->get_row_description) (table, row);
else
return NULL;
}
/**
* atk_table_get_row_extent_at:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Gets the number of rows occupied by the accessible object
* at a specified @row and @column in the @table.
*
* Returns: a gint representing the row extent at specified position, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_row_extent_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_extent_at)
return (iface->get_row_extent_at) (table, row, column);
else
return 0;
}
/**
* atk_table_get_row_header:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in the table
*
* Gets the row header of a specified row in an accessible table.
*
* Returns: (nullable) (transfer none): a AtkObject* representing the
* specified row header, or %NULL if value does not implement this
* interface.
**/
AtkObject*
atk_table_get_row_header (AtkTable *table, gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_header)
return (iface->get_row_header) (table, row);
else
return NULL;
}
/**
* atk_table_get_summary:
* @table: a GObject instance that implements AtkTableIface
*
* Gets the summary description of the table.
*
* Returns: (transfer full): a AtkObject* representing a summary description
* of the table, or zero if value does not implement this interface.
**/
AtkObject*
atk_table_get_summary (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_summary)
return (iface->get_summary) (table);
else
return NULL;
}
/**
* atk_table_get_selected_rows:
* @table: a GObject instance that implements AtkTableIface
* @selected: a #gint** that is to contain the selected row numbers
*
* Gets the selected rows of the table by initializing **selected with
* the selected row numbers. This array should be freed by the caller.
*
* Returns: a gint representing the number of selected rows,
* or zero if value does not implement this interface.
**/
gint
atk_table_get_selected_rows (AtkTable *table, gint **selected)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_selected_rows)
return (iface->get_selected_rows) (table, selected);
else
return 0;
}
/**
* atk_table_get_selected_columns:
* @table: a GObject instance that implements AtkTableIface
* @selected: a #gint** that is to contain the selected columns numbers
*
* Gets the selected columns of the table by initializing **selected with
* the selected column numbers. This array should be freed by the caller.
*
* Returns: a gint representing the number of selected columns,
* or %0 if value does not implement this interface.
**/
gint
atk_table_get_selected_columns (AtkTable *table, gint **selected)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_selected_columns)
return (iface->get_selected_columns) (table, selected);
else
return 0;
}
/**
* atk_table_is_column_selected:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Gets a boolean value indicating whether the specified @column
* is selected
*
* Returns: a gboolean representing if the column is selected, or 0
* if value does not implement this interface.
**/
gboolean
atk_table_is_column_selected (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->is_column_selected)
return (iface->is_column_selected) (table, column);
else
return FALSE;
}
/**
* atk_table_is_row_selected:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Gets a boolean value indicating whether the specified @row
* is selected
*
* Returns: a gboolean representing if the row is selected, or 0
* if value does not implement this interface.
**/
gboolean
atk_table_is_row_selected (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->is_row_selected)
return (iface->is_row_selected) (table, row);
else
return FALSE;
}
/**
* atk_table_is_selected:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Gets a boolean value indicating whether the accessible object
* at the specified @row and @column is selected
*
* Returns: a gboolean representing if the cell is selected, or 0
* if value does not implement this interface.
**/
gboolean
atk_table_is_selected (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->is_selected)
return (iface->is_selected) (table, row, column);
else
return FALSE;
}
/**
* atk_table_add_row_selection:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Adds the specified @row to the selection.
*
* Returns: a gboolean representing if row was successfully added to selection,
* or 0 if value does not implement this interface.
**/
gboolean
atk_table_add_row_selection (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->add_row_selection)
return (iface->add_row_selection) (table, row);
else
return FALSE;
}
/**
* atk_table_remove_row_selection:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Removes the specified @row from the selection.
*
* Returns: a gboolean representing if the row was successfully removed from
* the selection, or 0 if value does not implement this interface.
**/
gboolean
atk_table_remove_row_selection (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->remove_row_selection)
return (iface->remove_row_selection) (table, row);
else
return FALSE;
}
/**
* atk_table_add_column_selection:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Adds the specified @column to the selection.
*
* Returns: a gboolean representing if the column was successfully added to
* the selection, or 0 if value does not implement this interface.
**/
gboolean
atk_table_add_column_selection (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->add_column_selection)
return (iface->add_column_selection) (table, column);
else
return FALSE;
}
/**
* atk_table_remove_column_selection:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Adds the specified @column to the selection.
*
* Returns: a gboolean representing if the column was successfully removed from
* the selection, or 0 if value does not implement this interface.
**/
gboolean
atk_table_remove_column_selection (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->remove_column_selection)
return (iface->remove_column_selection) (table, column);
else
return FALSE;
}
/**
* atk_table_set_caption:
* @table: a GObject instance that implements AtkTableIface
* @caption: a #AtkObject representing the caption to set for @table
*
* Sets the caption for the table.
**/
void
atk_table_set_caption (AtkTable *table,
AtkObject *caption)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_caption)
(iface->set_caption) (table, caption);
}
/**
* atk_table_set_column_description:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
* @description: a #gchar representing the description text
* to set for the specified @column of the @table
*
* Sets the description text for the specified @column of the @table.
**/
void
atk_table_set_column_description (AtkTable *table,
gint column,
const gchar *description)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_column_description)
(iface->set_column_description) (table, column, description);
}
/**
* atk_table_set_column_header:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
* @header: an #AtkTable
*
* Sets the specified column header to @header.
**/
void
atk_table_set_column_header (AtkTable *table,
gint column,
AtkObject *header)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_column_header)
(iface->set_column_header) (table, column, header);
}
/**
* atk_table_set_row_description:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @description: a #gchar representing the description text
* to set for the specified @row of @table
*
* Sets the description text for the specified @row of @table.
**/
void
atk_table_set_row_description (AtkTable *table,
gint row,
const gchar *description)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_row_description)
(iface->set_row_description) (table, row, description);
}
/**
* atk_table_set_row_header:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @header: an #AtkTable
*
* Sets the specified row header to @header.
**/
void
atk_table_set_row_header (AtkTable *table,
gint row,
AtkObject *header)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_row_header)
(iface->set_row_header) (table, row, header);
}
/**
* atk_table_set_summary:
* @table: a GObject instance that implements AtkTableIface
* @accessible: an #AtkObject representing the summary description
* to set for @table
*
* Sets the summary description of the table.
**/
void
atk_table_set_summary (AtkTable *table,
AtkObject *accessible)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_summary)
(iface->set_summary) (table, accessible);
}

View File

@@ -1,223 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_TABLE_H__
#define __ATK_TABLE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_TABLE (atk_table_get_type ())
#define ATK_IS_TABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TABLE)
#define ATK_TABLE(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TABLE, AtkTable)
#define ATK_TABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_TABLE, AtkTableIface))
#ifndef _TYPEDEF_ATK_TABLE_
#define _TYPEDEF_ATK_TABLE_
typedef struct _AtkTable AtkTable;
#endif
typedef struct _AtkTableIface AtkTableIface;
struct _AtkTableIface
{
GTypeInterface parent;
AtkObject* (* ref_at) (AtkTable *table,
gint row,
gint column);
gint (* get_index_at) (AtkTable *table,
gint row,
gint column);
gint (* get_column_at_index) (AtkTable *table,
gint index_);
gint (* get_row_at_index) (AtkTable *table,
gint index_);
gint (* get_n_columns) (AtkTable *table);
gint (* get_n_rows) (AtkTable *table);
gint (* get_column_extent_at) (AtkTable *table,
gint row,
gint column);
gint (* get_row_extent_at) (AtkTable *table,
gint row,
gint column);
AtkObject*
(* get_caption) (AtkTable *table);
const gchar* (* get_column_description) (AtkTable *table,
gint column);
AtkObject* (* get_column_header) (AtkTable *table,
gint column);
const gchar* (* get_row_description) (AtkTable *table,
gint row);
AtkObject* (* get_row_header) (AtkTable *table,
gint row);
AtkObject* (* get_summary) (AtkTable *table);
void (* set_caption) (AtkTable *table,
AtkObject *caption);
void (* set_column_description) (AtkTable *table,
gint column,
const gchar *description);
void (* set_column_header) (AtkTable *table,
gint column,
AtkObject *header);
void (* set_row_description) (AtkTable *table,
gint row,
const gchar *description);
void (* set_row_header) (AtkTable *table,
gint row,
AtkObject *header);
void (* set_summary) (AtkTable *table,
AtkObject *accessible);
gint (* get_selected_columns) (AtkTable *table,
gint **selected);
gint (* get_selected_rows) (AtkTable *table,
gint **selected);
gboolean (* is_column_selected) (AtkTable *table,
gint column);
gboolean (* is_row_selected) (AtkTable *table,
gint row);
gboolean (* is_selected) (AtkTable *table,
gint row,
gint column);
gboolean (* add_row_selection) (AtkTable *table,
gint row);
gboolean (* remove_row_selection) (AtkTable *table,
gint row);
gboolean (* add_column_selection) (AtkTable *table,
gint column);
gboolean (* remove_column_selection) (AtkTable *table,
gint column);
/*
* signal handlers
*/
void (* row_inserted) (AtkTable *table,
gint row,
gint num_inserted);
void (* column_inserted) (AtkTable *table,
gint column,
gint num_inserted);
void (* row_deleted) (AtkTable *table,
gint row,
gint num_deleted);
void (* column_deleted) (AtkTable *table,
gint column,
gint num_deleted);
void (* row_reordered) (AtkTable *table);
void (* column_reordered) (AtkTable *table);
void (* model_changed) (AtkTable *table);
};
GDK_AVAILABLE_IN_ALL
GType atk_table_get_type (void);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_table_ref_at (AtkTable *table,
gint row,
gint column);
GDK_AVAILABLE_IN_ALL
gint atk_table_get_n_columns (AtkTable *table);
GDK_AVAILABLE_IN_ALL
gint atk_table_get_n_rows (AtkTable *table);
GDK_AVAILABLE_IN_ALL
gint atk_table_get_column_extent_at (AtkTable *table,
gint row,
gint column);
GDK_AVAILABLE_IN_ALL
gint atk_table_get_row_extent_at (AtkTable *table,
gint row,
gint column);
GDK_AVAILABLE_IN_ALL
AtkObject*
atk_table_get_caption (AtkTable *table);
GDK_AVAILABLE_IN_ALL
const gchar* atk_table_get_column_description
(AtkTable *table,
gint column);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_table_get_column_header (AtkTable *table,
gint column);
GDK_AVAILABLE_IN_ALL
const gchar* atk_table_get_row_description (AtkTable *table,
gint row);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_table_get_row_header (AtkTable *table,
gint row);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_table_get_summary (AtkTable *table);
GDK_AVAILABLE_IN_ALL
void atk_table_set_caption (AtkTable *table,
AtkObject *caption);
GDK_AVAILABLE_IN_ALL
void atk_table_set_column_description
(AtkTable *table,
gint column,
const gchar *description);
GDK_AVAILABLE_IN_ALL
void atk_table_set_column_header (AtkTable *table,
gint column,
AtkObject *header);
GDK_AVAILABLE_IN_ALL
void atk_table_set_row_description (AtkTable *table,
gint row,
const gchar *description);
GDK_AVAILABLE_IN_ALL
void atk_table_set_row_header (AtkTable *table,
gint row,
AtkObject *header);
GDK_AVAILABLE_IN_ALL
void atk_table_set_summary (AtkTable *table,
AtkObject *accessible);
GDK_AVAILABLE_IN_ALL
gint atk_table_get_selected_columns (AtkTable *table,
gint **selected);
GDK_AVAILABLE_IN_ALL
gint atk_table_get_selected_rows (AtkTable *table,
gint **selected);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_is_column_selected (AtkTable *table,
gint column);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_is_row_selected (AtkTable *table,
gint row);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_is_selected (AtkTable *table,
gint row,
gint column);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_add_row_selection (AtkTable *table,
gint row);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_remove_row_selection (AtkTable *table,
gint row);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_add_column_selection (AtkTable *table,
gint column);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_remove_column_selection
(AtkTable *table,
gint column);
G_END_DECLS
#endif /* __ATK_TABLE_H__ */

View File

@@ -1,277 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2014 SUSE LLC.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atktablecell.h"
/**
* SECTION:atktablecell
* @Short_description: The ATK interface implemented for a cell inside
* a two-dimentional #AtkTable
* @Title:AtkTableCell
*
* Being #AtkTable a component which present elements ordered via rows
* and columns, an #AtkTableCell is the interface which each of those
* elements, so "cells" should implement.
*
* See also #AtkTable.
*/
typedef AtkTableCellIface AtkTableCellInterface;
G_DEFINE_INTERFACE (AtkTableCell, atk_table_cell, ATK_TYPE_OBJECT)
static gboolean atk_table_cell_real_get_row_column_span (AtkTableCell *cell,
gint *row,
gint *column,
gint *row_span,
gint *column_span);
static void
atk_table_cell_default_init (AtkTableCellInterface *iface)
{
iface->get_row_column_span = atk_table_cell_real_get_row_column_span;
}
/**
* atk_table_cell_get_column_span:
* @cell: a GObject instance that implements AtkTableCellIface
*
* Returns the number of columns occupied by this cell accessible.
*
* Returns: a gint representing the number of columns occupied by this cell,
* or 0 if the cell does not implement this method.
*
* Since: 2.12
*/
gint
atk_table_cell_get_column_span (AtkTableCell *cell)
{
AtkTableCellIface *iface;
g_return_val_if_fail (ATK_IS_TABLE_CELL (cell), 0);
iface = ATK_TABLE_CELL_GET_IFACE (cell);
if (iface->get_column_span)
return (iface->get_column_span) (cell);
else
return 0;
}
/**
* atk_table_cell_get_column_header_cells:
* @cell: a GObject instance that implements AtkTableCellIface
*
* Returns the column headers as an array of cell accessibles.
*
* Returns: (element-type AtkObject) (transfer full): a GPtrArray of AtkObjects
* representing the column header cells.
*
* Since: 2.12
*/
GPtrArray *
atk_table_cell_get_column_header_cells (AtkTableCell *cell)
{
AtkTableCellIface *iface;
g_return_val_if_fail (ATK_IS_TABLE_CELL (cell), NULL);
iface = ATK_TABLE_CELL_GET_IFACE (cell);
if (iface->get_column_header_cells)
return (iface->get_column_header_cells) (cell);
else
return NULL;
}
/**
* atk_table_cell_get_position:
* @cell: a GObject instance that implements AtkTableCellIface
* @row: (out): the row of the given cell.
* @column: (out): the column of the given cell.
*
* Retrieves the tabular position of this cell.
*
* Returns: TRUE if successful; FALSE otherwise.
*
* Since: 2.12
*/
gboolean
atk_table_cell_get_position (AtkTableCell *cell,
gint *row,
gint *column)
{
AtkTableCellIface *iface;
gint tmp_row, tmp_column;
gint *real_row = (row ? row : &tmp_row);
gint *real_column = (column ? column : &tmp_column);
*real_row = -1;
*real_column = -1;
g_return_val_if_fail (ATK_IS_TABLE_CELL (cell), FALSE);
iface = ATK_TABLE_CELL_GET_IFACE (cell);
if (iface->get_position)
return (iface->get_position) (cell, real_row, real_column);
else
return FALSE;
}
/**
* atk_table_cell_get_row_span:
* @cell: a GObject instance that implements AtkTableCellIface
*
* Returns the number of rows occupied by this cell accessible.
*
* Returns: a gint representing the number of rows occupied by this cell,
* or 0 if the cell does not implement this method.
*
* Since: 2.12
*/
gint
atk_table_cell_get_row_span (AtkTableCell *cell)
{
AtkTableCellIface *iface;
g_return_val_if_fail (ATK_IS_TABLE_CELL (cell), 0);
iface = ATK_TABLE_CELL_GET_IFACE (cell);
if (iface->get_row_span)
return (iface->get_row_span) (cell);
else
return 0;
}
/**
* atk_table_cell_get_row_header_cells:
* @cell: a GObject instance that implements AtkTableCellIface
*
* Returns the row headers as an array of cell accessibles.
*
* Returns: (element-type AtkObject) (transfer full): a GPtrArray of AtkObjects
* representing the row header cells.
*
* Since: 2.12
*/
GPtrArray *
atk_table_cell_get_row_header_cells (AtkTableCell *cell)
{
AtkTableCellIface *iface;
g_return_val_if_fail (ATK_IS_TABLE_CELL (cell), NULL);
iface = ATK_TABLE_CELL_GET_IFACE (cell);
if (iface->get_row_header_cells)
return (iface->get_row_header_cells) (cell);
else
return NULL;
}
/**
* atk_table_cell_get_row_column_span:
* @cell: a GObject instance that implements AtkTableCellIface
* @row: (out): the row index of the given cell.
* @column: (out): the column index of the given cell.
* @row_span: (out): the number of rows occupied by this cell.
* @column_span: (out): the number of columns occupied by this cell.
*
* Gets the row and column indexes and span of this cell accessible.
*
* Note: If the object does not implement this function, then, by default, atk
* will implement this function by calling get_row_span and get_column_span
* on the object.
*
* Returns: TRUE if successful; FALSE otherwise.
*
* Since: 2.12
*/
gboolean
atk_table_cell_get_row_column_span (AtkTableCell *cell,
gint *row,
gint *column,
gint *row_span,
gint *column_span)
{
AtkTableCellIface *iface;
gint local_row = 0, local_column = 0;
gint local_row_span = 0, local_column_span = 0;
gint *real_row, *real_column;
gint *real_row_span, *real_column_span;
g_return_val_if_fail (ATK_IS_TABLE_CELL (cell), FALSE);
real_row = (row ? row : &local_row);
real_column = (column ? column : &local_column);
real_row_span = (row_span ? row_span : &local_row_span);
real_column_span = (column_span ? column_span : &local_column_span);
iface = ATK_TABLE_CELL_GET_IFACE (cell);
if (iface->get_row_column_span)
return (iface->get_row_column_span) (cell, real_row, real_column,
real_row_span,
real_column_span);
else
return FALSE;
}
/**
* atk_table_cell_get_table:
* @cell: a GObject instance that implements AtkTableCellIface
*
* Returns a reference to the accessible of the containing table.
*
* Returns: (transfer full): the atk object for the containing table.
*
* Since: 2.12
*/
AtkObject *
atk_table_cell_get_table (AtkTableCell *cell)
{
AtkTableCellIface *iface;
g_return_val_if_fail (ATK_IS_TABLE_CELL (cell), FALSE);
iface = ATK_TABLE_CELL_GET_IFACE (cell);
if (iface->get_table)
return (iface->get_table) (cell);
else
return NULL;
}
static gboolean
atk_table_cell_real_get_row_column_span (AtkTableCell *cell,
gint *row,
gint *column,
gint *row_span,
gint *column_span)
{
atk_table_cell_get_position (cell, row, column);
*row_span = atk_table_cell_get_row_span (cell);
*column_span = atk_table_cell_get_column_span (cell);
return (*row != 0 && *column != 0 && *row_span > 0 && *column_span > 0);
}

View File

@@ -1,110 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2014 SUSE LLC.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_TABLE_CELL_H__
#define __ATK_TABLE_CELL_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_TABLE_CELL (atk_table_cell_get_type ())
#define ATK_IS_TABLE_CELL(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TABLE_CELL)
#define ATK_TABLE_CELL(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TABLE_CELL, AtkTableCell)
#define ATK_TABLE_CELL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_TABLE_CELL, AtkTableCellIface))
#ifndef _TYPEDEF_ATK_TABLE_CELL_
#define _TYPEDEF_ATK_TABLE_CELL_
typedef struct _AtkTableCell AtkTableCell;
#endif
typedef struct _AtkTableCellIface AtkTableCellIface;
/**
* AtkTableCellIface:
* @get_column_span: virtual function that returns the number of
* columns occupied by this cell accessible
* @get_column_header_cells: virtual function that returns the column
* headers as an array of cell accessibles
* @get_position: virtual function that retrieves the tabular position
* of this cell
* @get_row_span: virtual function that returns the number of rows
* occupied by this cell
* @get_row_header_cells: virtual function that returns the row
* headers as an array of cell accessibles
* @get_row_column_span: virtual function that get the row an column
* indexes and span of this cell
* @get_table: virtual function that returns a reference to the
* accessible of the containing table
*
* AtkTableCell is an interface for cells inside an #AtkTable.
*
* Since: 2.12
*/
struct _AtkTableCellIface
{
/*< private >*/
GTypeInterface parent;
/*< public >*/
gint (*get_column_span) (AtkTableCell *cell);
GPtrArray * (*get_column_header_cells) (AtkTableCell *cell);
gboolean (*get_position) (AtkTableCell *cell,
gint *row,
gint *column);
gint (*get_row_span) (AtkTableCell *cell);
GPtrArray * (*get_row_header_cells) (AtkTableCell *cell);
gboolean (*get_row_column_span) (AtkTableCell *cell,
gint *row,
gint *column,
gint *row_span,
gint *column_span);
AtkObject * (*get_table) (AtkTableCell *cell);
};
GDK_AVAILABLE_IN_ALL
GType atk_table_cell_get_type (void);
GDK_AVAILABLE_IN_ALL
gint atk_table_cell_get_column_span (AtkTableCell *cell);
GDK_AVAILABLE_IN_ALL
GPtrArray * atk_table_cell_get_column_header_cells (AtkTableCell *cell);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_cell_get_position (AtkTableCell *cell,
gint *row,
gint *column);
GDK_AVAILABLE_IN_ALL
gint atk_table_cell_get_row_span (AtkTableCell *cell);
GDK_AVAILABLE_IN_ALL
GPtrArray * atk_table_cell_get_row_header_cells (AtkTableCell *cell);
GDK_AVAILABLE_IN_ALL
gboolean atk_table_cell_get_row_column_span (AtkTableCell *cell,
gint *row,
gint *column,
gint *row_span,
gint *column_span);
GDK_AVAILABLE_IN_ALL
AtkObject * atk_table_cell_get_table (AtkTableCell *cell);
G_END_DECLS
#endif /* __ATK_TABLE_CELL_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,329 +0,0 @@
/* ATK - The Accessibility Toolkit for GTK+
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_TEXT_H__
#define __ATK_TEXT_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <glib-object.h>
#include <atk/atkobject.h>
#include <atk/atkutil.h>
#include <atk/atkcomponent.h>
G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
AtkTextAttribute atk_text_attribute_register (const gchar *name);
#define ATK_TYPE_TEXT (atk_text_get_type ())
#define ATK_IS_TEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TEXT)
#define ATK_TEXT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TEXT, AtkText)
#define ATK_TEXT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_TEXT, AtkTextIface))
#ifndef _TYPEDEF_ATK_TEXT_
#define _TYPEDEF_ATK_TEXT_
typedef struct _AtkText AtkText;
#endif
typedef struct _AtkTextIface AtkTextIface;
/**
* AtkTextRectangle:
* @x: The horizontal coordinate of a rectangle
* @y: The vertical coordinate of a rectangle
* @width: The width of a rectangle
* @height: The height of a rectangle
*
* A structure used to store a rectangle used by AtkText.
**/
typedef struct _AtkTextRectangle AtkTextRectangle;
struct _AtkTextRectangle {
gint x;
gint y;
gint width;
gint height;
};
/**
* AtkTextRange:
* @bounds: A rectangle giving the bounds of the text range
* @start_offset: The start offset of a AtkTextRange
* @end_offset: The end offset of a AtkTextRange
* @content: The text in the text range
*
* A structure used to describe a text range.
**/
typedef struct _AtkTextRange AtkTextRange;
struct _AtkTextRange {
AtkTextRectangle bounds;
gint start_offset;
gint end_offset;
gchar* content;
};
GDK_AVAILABLE_IN_ALL
GType atk_text_range_get_type (void);
/**
* AtkTextIface:
* @get_text_after_offset: Gets specified text. This virtual function
* is deprecated and it should not be overridden.
* @get_text_at_offset: Gets specified text. This virtual function
* is deprecated and it should not be overridden.
* @get_text_before_offset: Gets specified text. This virtual function
* is deprecated and it should not be overridden.
* @get_string_at_offset: Gets a portion of the text exposed through
* an AtkText according to a given offset and a specific
* granularity, along with the start and end offsets defining the
* boundaries of such a portion of text.
* @text_changed: the signal handler which is executed when there is a
* text change. This virtual function is deprecated sice 2.9.4 and
* it should not be overriden.
*/
struct _AtkTextIface
{
GTypeInterface parent;
gchar* (* get_text) (AtkText *text,
gint start_offset,
gint end_offset);
gchar* (* get_text_after_offset) (AtkText *text,
gint offset,
AtkTextBoundary boundary_type,
gint *start_offset,
gint *end_offset);
gchar* (* get_text_at_offset) (AtkText *text,
gint offset,
AtkTextBoundary boundary_type,
gint *start_offset,
gint *end_offset);
gunichar (* get_character_at_offset) (AtkText *text,
gint offset);
gchar* (* get_text_before_offset) (AtkText *text,
gint offset,
AtkTextBoundary boundary_type,
gint *start_offset,
gint *end_offset);
gint (* get_caret_offset) (AtkText *text);
AtkAttributeSet* (* get_run_attributes) (AtkText *text,
gint offset,
gint *start_offset,
gint *end_offset);
AtkAttributeSet* (* get_default_attributes) (AtkText *text);
void (* get_character_extents) (AtkText *text,
gint offset,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coords);
gint (* get_character_count) (AtkText *text);
gint (* get_offset_at_point) (AtkText *text,
gint x,
gint y,
AtkCoordType coords);
gint (* get_n_selections) (AtkText *text);
gchar* (* get_selection) (AtkText *text,
gint selection_num,
gint *start_offset,
gint *end_offset);
gboolean (* add_selection) (AtkText *text,
gint start_offset,
gint end_offset);
gboolean (* remove_selection) (AtkText *text,
gint selection_num);
gboolean (* set_selection) (AtkText *text,
gint selection_num,
gint start_offset,
gint end_offset);
gboolean (* set_caret_offset) (AtkText *text,
gint offset);
/*
* signal handlers
*/
void (* text_changed) (AtkText *text,
gint position,
gint length);
void (* text_caret_moved) (AtkText *text,
gint location);
void (* text_selection_changed) (AtkText *text);
void (* text_attributes_changed) (AtkText *text);
void (* get_range_extents) (AtkText *text,
gint start_offset,
gint end_offset,
AtkCoordType coord_type,
AtkTextRectangle *rect);
AtkTextRange** (* get_bounded_ranges) (AtkText *text,
AtkTextRectangle *rect,
AtkCoordType coord_type,
AtkTextClipType x_clip_type,
AtkTextClipType y_clip_type);
gchar* (* get_string_at_offset) (AtkText *text,
gint offset,
AtkTextGranularity granularity,
gint *start_offset,
gint *end_offset);
/*
* Scrolls this text range so it becomes visible on the screen.
*
* scroll_substring_to lets the implementation compute an appropriate target
* position on the screen, with type used as a positioning hint.
*
* scroll_substring_to_point lets the client specify a precise target position
* on the screen for the top-left of the substring.
*
* Since ATK 2.32
*/
gboolean (* scroll_substring_to) (AtkText *text,
gint start_offset,
gint end_offset,
AtkScrollType type);
gboolean (* scroll_substring_to_point) (AtkText *text,
gint start_offset,
gint end_offset,
AtkCoordType coords,
gint x,
gint y);
};
GDK_AVAILABLE_IN_ALL
GType atk_text_get_type (void);
/*
* Additional AtkObject properties used by AtkText:
* "accessible_text" (accessible text has changed)
* "accessible_caret" (accessible text cursor position changed:
* editable text only)
*/
GDK_AVAILABLE_IN_ALL
gchar* atk_text_get_text (AtkText *text,
gint start_offset,
gint end_offset);
GDK_AVAILABLE_IN_ALL
gunichar atk_text_get_character_at_offset (AtkText *text,
gint offset);
GDK_AVAILABLE_IN_ALL
gchar* atk_text_get_string_at_offset (AtkText *text,
gint offset,
AtkTextGranularity granularity,
gint *start_offset,
gint *end_offset);
GDK_AVAILABLE_IN_ALL
gint atk_text_get_caret_offset (AtkText *text);
GDK_AVAILABLE_IN_ALL
void atk_text_get_character_extents (AtkText *text,
gint offset,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coords);
GDK_AVAILABLE_IN_ALL
AtkAttributeSet* atk_text_get_run_attributes (AtkText *text,
gint offset,
gint *start_offset,
gint *end_offset);
GDK_AVAILABLE_IN_ALL
AtkAttributeSet* atk_text_get_default_attributes (AtkText *text);
GDK_AVAILABLE_IN_ALL
gint atk_text_get_character_count (AtkText *text);
GDK_AVAILABLE_IN_ALL
gint atk_text_get_offset_at_point (AtkText *text,
gint x,
gint y,
AtkCoordType coords);
GDK_AVAILABLE_IN_ALL
gint atk_text_get_n_selections (AtkText *text);
GDK_AVAILABLE_IN_ALL
gchar* atk_text_get_selection (AtkText *text,
gint selection_num,
gint *start_offset,
gint *end_offset);
GDK_AVAILABLE_IN_ALL
gboolean atk_text_add_selection (AtkText *text,
gint start_offset,
gint end_offset);
GDK_AVAILABLE_IN_ALL
gboolean atk_text_remove_selection (AtkText *text,
gint selection_num);
GDK_AVAILABLE_IN_ALL
gboolean atk_text_set_selection (AtkText *text,
gint selection_num,
gint start_offset,
gint end_offset);
GDK_AVAILABLE_IN_ALL
gboolean atk_text_set_caret_offset (AtkText *text,
gint offset);
GDK_AVAILABLE_IN_ALL
void atk_text_get_range_extents (AtkText *text,
gint start_offset,
gint end_offset,
AtkCoordType coord_type,
AtkTextRectangle *rect);
GDK_AVAILABLE_IN_ALL
AtkTextRange** atk_text_get_bounded_ranges (AtkText *text,
AtkTextRectangle *rect,
AtkCoordType coord_type,
AtkTextClipType x_clip_type,
AtkTextClipType y_clip_type);
GDK_AVAILABLE_IN_ALL
void atk_text_free_ranges (AtkTextRange **ranges);
GDK_AVAILABLE_IN_ALL
void atk_attribute_set_free (AtkAttributeSet *attrib_set);
GDK_AVAILABLE_IN_ALL
const gchar* atk_text_attribute_get_name (AtkTextAttribute attr);
GDK_AVAILABLE_IN_ALL
AtkTextAttribute atk_text_attribute_for_name (const gchar *name);
GDK_AVAILABLE_IN_ALL
const gchar* atk_text_attribute_get_value (AtkTextAttribute attr,
gint index_);
GDK_AVAILABLE_IN_ALL
gboolean atk_text_scroll_substring_to (AtkText *text,
gint start_offset,
gint end_offset,
AtkScrollType type);
GDK_AVAILABLE_IN_ALL
gboolean atk_text_scroll_substring_to_point (AtkText *text,
gint start_offset,
gint end_offset,
AtkCoordType coords,
gint x,
gint y);
G_END_DECLS
#endif /* __ATK_TEXT_H__ */

View File

@@ -1,9 +0,0 @@
#pragma once
#if !defined(__ATK_H_INSIDE__) && !defined(GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <glib-object.h>
#include <gdk/gdk.h>
#include <atk/atkenums.h>

View File

@@ -1,374 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkutil.h"
#include "atkmarshal.h"
/**
* SECTION:atkutil
* @Short_description: A set of ATK utility functions for event and toolkit support.
* @Title:AtkUtil
*
* A set of ATK utility functions which are used to support event
* registration of various types, and obtaining the 'root' accessible
* of a process and information about the current ATK implementation
* and toolkit version.
*/
static void atk_util_class_init (AtkUtilClass *klass);
static AtkObject *previous_focus_object = NULL;
typedef struct _AtkUtilListenerInfo AtkUtilListenerInfo;
struct _AtkUtilListenerInfo
{
gint key;
guint signal_id;
gulong hook_id;
};
static GHashTable *listener_list = NULL;
GType
atk_util_get_type (void)
{
static GType type = 0;
if (!type)
{
static const GTypeInfo typeInfo =
{
sizeof (AtkUtilClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) atk_util_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (AtkUtil),
0,
(GInstanceInitFunc) NULL,
} ;
type = g_type_register_static (G_TYPE_OBJECT, "AtkUtil", &typeInfo, 0) ;
}
return type;
}
typedef struct _FocusTracker FocusTracker;
struct _FocusTracker {
guint index;
AtkEventListener func;
};
static guint
add_listener (GSignalEmissionHook listener,
const gchar *object_type,
const gchar *signal_name,
const gchar *detail_string,
const gchar *hook_data)
{
GType type;
guint signal_id;
gint rc = 0;
static gint listener_idx = 1;
GQuark detail_quark = 0;
type = g_type_from_name (object_type);
if (type)
{
signal_id = g_signal_lookup (signal_name, type);
detail_quark = g_quark_from_string (detail_string);
if (signal_id > 0)
{
AtkUtilListenerInfo *listener_info;
rc = listener_idx;
listener_info = g_new (AtkUtilListenerInfo, 1);
listener_info->key = listener_idx;
listener_info->hook_id =
g_signal_add_emission_hook (signal_id, detail_quark, listener,
g_strdup (hook_data),
(GDestroyNotify) g_free);
listener_info->signal_id = signal_id;
g_hash_table_insert(listener_list, &(listener_info->key), listener_info);
listener_idx++;
}
else
{
g_debug ("Signal type %s not supported\n", signal_name);
}
}
else
{
g_warning("Invalid object type %s\n", object_type);
}
return rc;
}
static guint
atk_util_real_add_global_event_listener (GSignalEmissionHook listener,
const gchar *event_type)
{
guint rc = 0;
gchar **split_string;
guint length;
split_string = g_strsplit (event_type, ":", 0);
length = g_strv_length (split_string);
if ((length == 3) || (length == 4))
rc = add_listener (listener, split_string[1], split_string[2],
split_string[3], event_type);
g_strfreev (split_string);
return rc;
}
static void
atk_util_real_remove_global_event_listener (guint remove_listener)
{
if (remove_listener > 0)
{
AtkUtilListenerInfo *listener_info;
gint tmp_idx = remove_listener;
listener_info = (AtkUtilListenerInfo *)
g_hash_table_lookup(listener_list, &tmp_idx);
if (listener_info != NULL)
{
/* Hook id of 0 and signal id of 0 are invalid */
if (listener_info->hook_id != 0 && listener_info->signal_id != 0)
{
/* Remove the emission hook */
g_signal_remove_emission_hook(listener_info->signal_id,
listener_info->hook_id);
/* Remove the element from the hash */
g_hash_table_remove(listener_list, &tmp_idx);
}
else
{
g_warning("Invalid listener hook_id %ld or signal_id %d\n",
listener_info->hook_id, listener_info->signal_id);
}
}
else
{
g_warning("No listener with the specified listener id %d",
remove_listener);
}
}
else
{
g_warning("Invalid listener_id %d", remove_listener);
}
}
/**
* atk_add_global_event_listener: (skip)
* @listener: the listener to notify
* @event_type: the type of event for which notification is requested
*
* Adds the specified function to the list of functions to be called
* when an ATK event of type event_type occurs.
*
* The format of event_type is the following:
* "ATK:&lt;atk_type&gt;:&lt;atk_event&gt;:&lt;atk_event_detail&gt;
*
* Where "ATK" works as the namespace, &lt;atk_interface&gt; is the name of
* the ATK type (interface or object), &lt;atk_event&gt; is the name of the
* signal defined on that interface and &lt;atk_event_detail&gt; is the
* gsignal detail of that signal. You can find more info about gsignal
* details here:
* http://developer.gnome.org/gobject/stable/gobject-Signals.html
*
* The first three parameters are mandatory. The last one is optional.
*
* For example:
* ATK:AtkObject:state-change
* ATK:AtkText:text-selection-changed
* ATK:AtkText:text-insert:system
*
* Toolkit implementor note: ATK provides a default implementation for
* this virtual method. ATK implementors are discouraged from
* reimplementing this method.
*
* Toolkit implementor note: this method is not intended to be used by
* ATK implementors but by ATK consumers.
*
* ATK consumers note: as this method adds a listener for a given ATK
* type, that type should be already registered on the GType system
* before calling this method. A simple way to do that is creating an
* instance of #AtkNoOpObject. This class implements all ATK
* interfaces, so creating the instance will register all ATK types as
* a collateral effect.
*
* Returns: added event listener id, or 0 on failure.
**/
guint
atk_add_global_event_listener (GSignalEmissionHook listener,
const gchar *event_type)
{
guint retval;
AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL);
if (klass->add_global_event_listener)
{
retval = klass->add_global_event_listener (listener, event_type);
}
else
{
retval = 0;
}
g_type_class_unref (klass);
return retval;
}
/**
* atk_remove_global_event_listener:
* @listener_id: the id of the event listener to remove
*
* @listener_id is the value returned by #atk_add_global_event_listener
* when you registered that event listener.
*
* Toolkit implementor note: ATK provides a default implementation for
* this virtual method. ATK implementors are discouraged from
* reimplementing this method.
*
* Toolkit implementor note: this method is not intended to be used by
* ATK implementors but by ATK consumers.
*
* Removes the specified event listener
**/
void
atk_remove_global_event_listener (guint listener_id)
{
AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL);
if (klass && klass->remove_global_event_listener)
klass->remove_global_event_listener (listener_id);
}
/**
* atk_add_key_event_listener: (skip)
* @listener: the listener to notify
* @data: a #gpointer that points to a block of data that should be sent to the registered listeners,
* along with the event notification, when it occurs.
*
* Adds the specified function to the list of functions to be called
* when a key event occurs. The @data element will be passed to the
* #AtkKeySnoopFunc (@listener) as the @func_data param, on notification.
*
* Returns: added event listener id, or 0 on failure.
**/
guint
atk_add_key_event_listener (AtkKeySnoopFunc listener, gpointer data)
{
guint retval;
AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL);
if (klass && klass->add_key_event_listener)
{
retval = klass->add_key_event_listener (listener, data);
}
else
{
retval = 0;
}
return retval;
}
/**
* atk_remove_key_event_listener:
* @listener_id: the id of the event listener to remove
*
* @listener_id is the value returned by #atk_add_key_event_listener
* when you registered that event listener.
*
* Removes the specified event listener.
**/
void
atk_remove_key_event_listener (guint listener_id)
{
AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL);
if (klass->remove_key_event_listener)
klass->remove_key_event_listener (listener_id);
}
/**
* atk_get_root:
*
* Gets the root accessible container for the current application.
*
* Returns: (transfer none): the root accessible container for the current
* application
**/
AtkObject*
atk_get_root (void)
{
AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL);
AtkObject *retval;
if (klass->get_root)
{
retval = klass->get_root ();
}
else
{
retval = NULL;
}
g_type_class_unref (klass);
return retval;
}
/**
* atk_get_focus_object:
*
* Gets the currently focused object.
*
* Since: 1.6
*
* Returns: (transfer none): the currently focused object for the current
* application
**/
AtkObject*
atk_get_focus_object (void)
{
return previous_focus_object;
}
static void
atk_util_class_init (AtkUtilClass *klass)
{
klass->add_global_event_listener = atk_util_real_add_global_event_listener;
klass->remove_global_event_listener = atk_util_real_remove_global_event_listener;
klass->get_root = NULL;
listener_list = g_hash_table_new_full (g_int_hash, g_int_equal, NULL,
g_free);
}

View File

@@ -1,306 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_UTIL_H__
#define __ATK_UTIL_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
#define ATK_TYPE_UTIL (atk_util_get_type ())
#define ATK_IS_UTIL(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_UTIL)
#define ATK_UTIL(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_UTIL, AtkUtil)
#define ATK_UTIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_UTIL, AtkUtilClass))
#define ATK_IS_UTIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_UTIL))
#define ATK_UTIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_UTIL, AtkUtilClass))
#ifndef _TYPEDEF_ATK_UTIL_
#define _TYPEDEF_ATK_UTIL_
typedef struct _AtkUtil AtkUtil;
typedef struct _AtkUtilClass AtkUtilClass;
typedef struct _AtkKeyEventStruct AtkKeyEventStruct;
#endif
/**
* AtkEventListener:
* @obj: An #AtkObject instance for whom the callback will be called when
* the specified event (e.g. 'focus:') takes place.
*
* A function which is called when an object emits a matching event,
* as used in #atk_add_focus_tracker.
* Currently the only events for which object-specific handlers are
* supported are events of type "focus:". Most clients of ATK will prefer to
* attach signal handlers for the various ATK signals instead.
*
* see atk_add_focus_tracker.
**/
typedef void (*AtkEventListener) (AtkObject* obj);
/**
* AtkEventListenerInit:
*
* An #AtkEventListenerInit function is a special function that is
* called in order to initialize the per-object event registration system
* used by #AtkEventListener, if any preparation is required.
*
* see atk_focus_tracker_init.
**/
typedef void (*AtkEventListenerInit) (void);
/**
* AtkKeySnoopFunc:
* @event: an AtkKeyEventStruct containing information about the key event for which
* notification is being given.
* @user_data: a block of data which will be passed to the event listener, on notification.
*
* An #AtkKeySnoopFunc is a type of callback which is called whenever a key event occurs,
* if registered via atk_add_key_event_listener. It allows for pre-emptive
* interception of key events via the return code as described below.
*
* Returns: TRUE (nonzero) if the event emission should be stopped and the event
* discarded without being passed to the normal GUI recipient; FALSE (zero) if the
* event dispatch to the client application should proceed as normal.
*
* see atk_add_key_event_listener.
**/
typedef gint (*AtkKeySnoopFunc) (AtkKeyEventStruct *event,
gpointer user_data);
/**
* AtkKeyEventStruct:
* @type: An AtkKeyEventType, generally one of ATK_KEY_EVENT_PRESS or ATK_KEY_EVENT_RELEASE
* @state: A bitmask representing the state of the modifier keys immediately after the event takes place.
* The meaning of the bits is currently defined to match the bitmask used by GDK in
* GdkEventType.state, see
* http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html#GdkEventKey
* @keyval: A guint representing a keysym value corresponding to those used by GDK and X11: see
* /usr/X11/include/keysymdef.h.
* @length: The length of member #string.
* @string: A string containing one of the following: either a string approximating the text that would
* result from this keypress, if the key is a control or graphic character, or a symbolic name for this keypress.
* Alphanumeric and printable keys will have the symbolic key name in this string member, for instance "A". "0",
* "semicolon", "aacute". Keypad keys have the prefix "KP".
* @keycode: The raw hardware code that generated the key event. This field is raraly useful.
* @timestamp: A timestamp in milliseconds indicating when the event occurred.
* These timestamps are relative to a starting point which should be considered arbitrary,
* and only used to compare the dispatch times of events to one another.
*
* Encapsulates information about a key event.
**/
struct _AtkKeyEventStruct {
gint type;
guint state;
guint keyval;
gint length;
gchar *string;
guint16 keycode;
guint32 timestamp;
};
struct _AtkUtil
{
GObject parent;
};
/**
* AtkUtilClass:
* @add_global_event_listener: adds the specified function to the list
* of functions to be called when an ATK event occurs. ATK
* implementors are discouraged from reimplementing this method.
* @remove_global_event_listener: removes the specified function to
* the list of functions to be called when an ATK event occurs. ATK
* implementors are discouraged from reimplementing this method.
* @add_key_event_listener: adds the specified function to the list of
* functions to be called when a key event occurs.
* @remove_key_event_listener: remove the specified function to the
* list of functions to be called when a key event occurs.
* @get_root: gets the root accessible container for the current
* application.
*/
struct _AtkUtilClass
{
GObjectClass parent;
guint (* add_global_event_listener) (GSignalEmissionHook listener,
const gchar *event_type);
void (* remove_global_event_listener) (guint listener_id);
guint (* add_key_event_listener) (AtkKeySnoopFunc listener,
gpointer data);
void (* remove_key_event_listener) (guint listener_id);
AtkObject* (* get_root) (void);
};
GDK_AVAILABLE_IN_ALL
GType atk_util_get_type (void);
GDK_AVAILABLE_IN_ALL
guint atk_add_global_event_listener (GSignalEmissionHook listener,
const gchar *event_type);
GDK_AVAILABLE_IN_ALL
void atk_remove_global_event_listener (guint listener_id);
GDK_AVAILABLE_IN_ALL
guint atk_add_key_event_listener (AtkKeySnoopFunc listener, gpointer data);
GDK_AVAILABLE_IN_ALL
void atk_remove_key_event_listener (guint listener_id);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_get_root(void);
GDK_AVAILABLE_IN_ALL
AtkObject* atk_get_focus_object (void);
/* --- GType boilerplate --- */
/* convenience macros for atk type implementations, which for a type GtkGadgetAccessible will:
* - prototype: static void gtk_gadget_accessible_class_init (GtkGadgetClass *klass);
* - prototype: static void gtk_gadget_accessible_init (GtkGadget *self);
* - define: static gpointer gtk_gadget_accessible_parent_class = NULL;
* gtk_gadget_accessible_parent_class is initialized prior to calling gtk_gadget_class_init()
* - implement: GType gtk_gadget_accessible_get_type (void) { ... }
* - support custom code in gtk_gadget_accessible_get_type() after the type is registered.
*
* macro arguments: TypeName, type_name, TYPE_PARENT, CODE
* example: ATK_DEFINE_TYPE_WITH_CODE (GtkGadgetAccessible, gtk_gadget_accessible, GTK_TYPE_GADGET,
* G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE, gtk_gadget_accessible_table_iface_init))
*/
/**
* ATK_DEFINE_TYPE:
* @TN: The name of the new type, in Camel case.
* @t_n: The name of the new type, in lowercase, with words separated by '_'.
* @T_P: The #GType of the parent type.
*
* A convenience macro for type ATK implementations, which declares a class
* initialization function, an instance initialization function (see #GTypeInfo
* for information about these) and a static variable named
* @t_n _parent_class pointing to the parent class. Furthermore, it
* defines a _get_type() function.
*
* Since: 1.22
*/
#define ATK_DEFINE_TYPE(TN, t_n, T_P) ATK_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
/**
* ATK_DEFINE_TYPE_WITH_CODE:
* @TN: The name of the new type, in Camel case.
* @t_n: The name of the new type in lowercase, with words separated by '_'.
* @T_P: The #GType of the parent type.
* @_C_: Custom code that gets inserted in the _get_type() function.
*
* A convenience macro for ATK type implementations.
* Similar to ATK_DEFINE_TYPE(), but allows you to insert custom code into the
* _get_type() function, e.g. interface implementations via G_IMPLEMENT_INTERFACE().
*
* Since: 1.22
*/
#define ATK_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _ATK_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _ATK_DEFINE_TYPE_EXTENDED_END()
/**
* ATK_DEFINE_ABSTRACT_TYPE:
* @TN: The name of the new type, in Camel case.
* @t_n: The name of the new type, in lowercase, with words separated by '_'.
* @T_P: The #GType of the parent type.
*
* A convenience macro for ATK type implementations.
* Similar to ATK_DEFINE_TYPE(), but defines an abstract type.
*
* Since: 1.22
*/
#define ATK_DEFINE_ABSTRACT_TYPE(TN, t_n, T_P) ATK_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, {})
/**
* ATK_DEFINE_ABSTRACT_TYPE_WITH_CODE:
* @TN: The name of the new type, in Camel case.
* @t_n: The name of the new type, in lowercase, with words separated by '_'.
* @T_P: The #GType of the parent type.
* @_C_: Custom code that gets inserted in the _get_type() function.
*
* A convenience macro for ATK type implementations.
* Similar to ATK_DEFINE_TYPE_WITH_CODE(), but defines an abstract type.
*
* Since: 1.22
*/
#define ATK_DEFINE_ABSTRACT_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _ATK_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT) {_C_;} _ATK_DEFINE_TYPE_EXTENDED_END()
/**
* ATK_DEFINE_TYPE_EXTENDED:
* @TN: The name of the new type, in Camel case.
* @t_n: The name of the new type, in lowercase, with words separated by '_'.
* @T_P: The #GType of the parent type.
* @_f_: #GTypeFlags to pass to g_type_register_static()
* @_C_: Custom code that gets inserted in the _get_type() function.
*
* The most general convenience macro for ATK type implementations, on which
* ATK_DEFINE_TYPE(), etc are based.
*
* Since: 1.22
*/
#define ATK_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _ATK_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _ATK_DEFINE_TYPE_EXTENDED_END()
#define _ATK_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE, flags) \
\
static void type_name##_init (TypeName *self); \
static void type_name##_class_init (TypeName##Class *klass); \
static gpointer type_name##_parent_class = NULL; \
static void type_name##_class_intern_init (gpointer klass) \
{ \
type_name##_parent_class = g_type_class_peek_parent (klass); \
type_name##_class_init ((TypeName##Class*) klass); \
} \
\
GDK_AVAILABLE_IN_ALL \
GType \
type_name##_get_type (void) \
{ \
static volatile gsize g_define_type_id__volatile = 0; \
if (g_once_init_enter (&g_define_type_id__volatile)) \
{ \
AtkObjectFactory *factory; \
GType derived_type; \
GTypeQuery query; \
GType derived_atk_type; \
GType g_define_type_id; \
\
/* Figure out the size of the class and instance we are deriving from */ \
derived_type = g_type_parent (TYPE); \
factory = atk_registry_get_factory (atk_get_default_registry (), \
derived_type); \
derived_atk_type = atk_object_factory_get_accessible_type (factory); \
g_type_query (derived_atk_type, &query); \
\
g_define_type_id = \
g_type_register_static_simple (derived_atk_type, \
g_intern_static_string (#TypeName), \
query.class_size, \
(GClassInitFunc) type_name##_class_intern_init, \
query.instance_size, \
(GInstanceInitFunc) type_name##_init, \
(GTypeFlags) flags); \
{ /* custom code follows */
#define _ATK_DEFINE_TYPE_EXTENDED_END() \
/* following custom code */ \
} \
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
} \
return g_define_type_id__volatile; \
} /* closes type_name##_get_type() */
G_END_DECLS
#endif /* __ATK_UTIL_H__ */

View File

@@ -1,591 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <glib/gi18n-lib.h>
#include "atkvalue.h"
#include "atkmarshal.h"
#include "atkenumtypes.h"
#include "atkprivate.h"
/**
* SECTION:atkvalue
* @Short_description: The ATK interface implemented by valuators and
* components which display or select a value from a bounded range of
* values.
* @Title:AtkValue
*
* #AtkValue should be implemented for components which either display
* a value from a bounded range, or which allow the user to specify a
* value from a bounded range, or both. For instance, most sliders and
* range controls, as well as dials, should have #AtkObject
* representations which implement #AtkValue on the component's
* behalf. #AtKValues may be read-only, in which case attempts to
* alter the value return would fail.
*
* <refsect1 id="current-value-text">
* <title>On the subject of current value text</title>
* <para>
* In addition to providing the current value, implementors can
* optionally provide an end-user-consumable textual description
* associated with this value. This description should be included
* when the numeric value fails to convey the full, on-screen
* representation seen by users.
* </para>
*
* <example>
* <title>Password strength</title>
* A password strength meter whose value changes as the user types
* their new password. Red is used for values less than 4.0, yellow
* for values between 4.0 and 7.0, and green for values greater than
* 7.0. In this instance, value text should be provided by the
* implementor. Appropriate value text would be "weak", "acceptable,"
* and "strong" respectively.
* </example>
*
* A level bar whose value changes to reflect the battery charge. The
* color remains the same regardless of the charge and there is no
* on-screen text reflecting the fullness of the battery. In this
* case, because the position within the bar is the only indication
* the user has of the current charge, value text should not be
* provided by the implementor.
*
* <refsect2 id="implementor-notes">
* <title>Implementor Notes</title>
* <para>
* Implementors should bear in mind that assistive technologies will
* likely prefer the value text provided over the numeric value when
* presenting a widget's value. As a result, strings not intended for
* end users should not be exposed in the value text, and strings
* which are exposed should be localized. In the case of widgets which
* display value text on screen, for instance through a separate label
* in close proximity to the value-displaying widget, it is still
* expected that implementors will expose the value text using the
* above API.
* </para>
*
* <para>
* #AtkValue should NOT be implemented for widgets whose displayed
* value is not reflective of a meaningful amount. For instance, a
* progress pulse indicator whose value alternates between 0.0 and 1.0
* to indicate that some process is still taking place should not
* implement #AtkValue because the current value does not reflect
* progress towards completion.
* </para>
* </refsect2>
* </refsect1>
*
* <refsect1 id="ranges">
* <title>On the subject of ranges</title>
* <para>
* In addition to providing the minimum and maximum values,
* implementors can optionally provide details about subranges
* associated with the widget. These details should be provided by the
* implementor when both of the following are communicated visually to
* the end user:
* </para>
* <itemizedlist>
* <listitem>The existence of distinct ranges such as "weak",
* "acceptable", and "strong" indicated by color, bar tick marks,
* and/or on-screen text.</listitem>
* <listitem>Where the current value stands within a given subrange,
* for instance illustrating progression from very "weak" towards
* nearly "acceptable" through changes in shade and/or position on
* the bar within the "weak" subrange.</listitem>
* </itemizedlist>
* <para>
* If both of the above do not apply to the widget, it should be
* sufficient to expose the numeric value, along with the value text
* if appropriate, to make the widget accessible.
* </para>
*
* <refsect2 id="ranges-implementor-notes">
* <title>Implementor Notes</title>
* <para>
* If providing subrange details is deemed necessary, all possible
* values of the widget are expected to fall within one of the
* subranges defined by the implementor.
* </para>
* </refsect2>
* </refsect1>
*
* <refsect1 id="localization">
* <title>On the subject of localization of end-user-consumable text
* values</title>
* <para>
* Because value text and subrange descriptors are human-consumable,
* implementors are expected to provide localized strings which can be
* directly presented to end users via their assistive technology. In
* order to simplify this for implementors, implementors can use
* atk_value_type_get_localized_name() with the following
* already-localized constants for commonly-needed values can be used:
* </para>
*
* <itemizedlist>
* <listitem>ATK_VALUE_VERY_WEAK</listitem>
* <listitem>ATK_VALUE_WEAK</listitem>
* <listitem>ATK_VALUE_ACCEPTABLE</listitem>
* <listitem>ATK_VALUE_STRONG</listitem>
* <listitem>ATK_VALUE_VERY_STRONG</listitem>
* <listitem>ATK_VALUE_VERY_LOW</listitem>
* <listitem>ATK_VALUE_LOW</listitem>
* <listitem>ATK_VALUE_MEDIUM</listitem>
* <listitem>ATK_VALUE_HIGH</listitem>
* <listitem>ATK_VALUE_VERY_HIGH</listitem>
* <listitem>ATK_VALUE_VERY_BAD</listitem>
* <listitem>ATK_VALUE_BAD</listitem>
* <listitem>ATK_VALUE_GOOD</listitem>
* <listitem>ATK_VALUE_VERY_GOOD</listitem>
* <listitem>ATK_VALUE_BEST</listitem>
* <listitem>ATK_VALUE_SUBSUBOPTIMAL</listitem>
* <listitem>ATK_VALUE_SUBOPTIMAL</listitem>
* <listitem>ATK_VALUE_OPTIMAL</listitem>
* </itemizedlist>
* <para>
* Proposals for additional constants, along with their use cases,
* should be submitted to the GNOME Accessibility Team.
* </para>
* </refsect1>
*
* <refsect1 id="changes">
* <title>On the subject of changes</title>
* <para>
* Note that if there is a textual description associated with the new
* numeric value, that description should be included regardless of
* whether or not it has also changed.
* </para>
* </refsect1>
*/
static GPtrArray *value_type_names = NULL;
enum {
VALUE_CHANGED,
LAST_SIGNAL
};
/* These are listed here for extraction by intltool */
#if 0
/* Translators: This string describes a range within value-related
* widgets such as a password-strength meter. Note that what such a
* widget presents is controlled by application developers. Thus
* assistive technologies such as screen readers are expected to
* present this string alone or as a token in a list.
*/
N_("very weak")
/* Translators: This string describes a range within value-related
* widgets such as a password-strength meter. Note that what such a
* widget presents is controlled by application developers. Thus
* assistive technologies such as screen readers are expected to
* present this string alone or as a token in a list.
*/
N_("weak")
/* Translators: This string describes a range within value-related
* widgets such as a password-strength meter. Note that what such a
* widget presents is controlled by application developers. Thus
* assistive technologies such as screen readers are expected to
* present this string alone or as a token in a list.
*/
N_("acceptable")
/* Translators: This string describes a range within value-related
* widgets such as a password-strength meter. Note that what such a
* widget presents is controlled by application developers. Thus
* assistive technologies such as screen readers are expected to
* present this string alone or as a token in a list.
*/
N_("strong")
/* Translators: This string describes a range within value-related
* widgets such as a password-strength meter. Note that what such a
* widget presents is controlled by application developers. Thus
* assistive technologies such as screen readers are expected to
* present this string alone or as a token in a list.
*/
N_("very strong")
/* Translators: This string describes a range within value-related
* widgets such as a volume slider. Note that what such a widget
* presents (e.g. temperature, volume, price) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("very low")
/* Translators: This string describes a range within value-related
* widgets such as a volume slider. Note that what such a widget
* presents (e.g. temperature, volume, price) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("medium")
/* Translators: This string describes a range within value-related
* widgets such as a volume slider. Note that what such a widget
* presents (e.g. temperature, volume, price) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("high")
/* Translators: This string describes a range within value-related
* widgets such as a volume slider. Note that what such a widget
* presents (e.g. temperature, volume, price) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("very high")
/* Translators: This string describes a range within value-related
* widgets such as a hard drive usage. Note that what such a widget
* presents (e.g. hard drive usage, network traffic) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("very bad")
/* Translators: This string describes a range within value-related
* widgets such as a hard drive usage. Note that what such a widget
* presents (e.g. hard drive usage, network traffic) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("bad")
/* Translators: This string describes a range within value-related
* widgets such as a hard drive usage. Note that what such a widget
* presents (e.g. hard drive usage, network traffic) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("good")
/* Translators: This string describes a range within value-related
* widgets such as a hard drive usage. Note that what such a widget
* presents (e.g. hard drive usage, network traffic) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("very good")
/* Translators: This string describes a range within value-related
* widgets such as a hard drive usage. Note that what such a widget
* presents (e.g. hard drive usage, network traffic) is controlled by
* application developers. Thus assistive technologies such as screen
* readers are expected to present this string alone or as a token in
* a list.
*/
N_("best")
#endif
static void atk_value_base_init (AtkValueIface *class);
static guint atk_value_signals[LAST_SIGNAL] = {0};
GType
atk_value_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkValueIface),
(GBaseInitFunc) atk_value_base_init,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkValue", &tinfo, 0);
}
return type;
}
static void
atk_value_base_init (AtkValueIface *class)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* AtkValue::value-changed:
* @atkvalue: the object on which the signal was emitted.
* @value: the new value in a numerical form.
* @text: human readable text alternative (also called
* description) of this object. NULL if not available.
*
* The 'value-changed' signal is emitted when the current value
* that represent the object changes. @value is the numerical
* representation of this new value. @text is the human
* readable text alternative of @value, and can be NULL if it is
* not available. Note that if there is a textual description
* associated with the new numeric value, that description
* should be included regardless of whether or not it has also
* changed.
*
* Example: a password meter whose value changes as the user
* types their new password. Appropiate value text would be
* "weak", "acceptable" and "strong".
*
* Since: 2.12
*/
atk_value_signals[VALUE_CHANGED] =
g_signal_new ("value_changed",
ATK_TYPE_VALUE,
G_SIGNAL_RUN_LAST,
0,
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__DOUBLE_STRING,
G_TYPE_NONE,
2, G_TYPE_DOUBLE, G_TYPE_STRING);
initialized = TRUE;
}
}
/**
* atk_value_get_value_and_text:
* @obj: a GObject instance that implements AtkValueIface
* @value: (out): address of #gdouble to put the current value of @obj
* @text: (out) (allow-none): address of #gchar to put the human
* readable text alternative for @value
*
* Gets the current value and the human readable text alternative of
* @obj. @text is a newly created string, that must be freed by the
* caller. Can be NULL if no descriptor is available.
*
* Since: 2.12
**/
void
atk_value_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
AtkValueIface *iface;
g_return_if_fail (ATK_IS_VALUE (obj));
iface = ATK_VALUE_GET_IFACE (obj);
if (iface->get_value_and_text)
{
(iface->get_value_and_text) (obj, value, text);
}
else
{
*value = 0.0;
*text = NULL;
}
}
/**
* atk_value_get_range:
* @obj: a GObject instance that implements AtkValueIface
*
* Gets the range of this object.
*
* Returns: (nullable) (transfer full): a newly allocated #AtkRange
* that represents the minimum, maximum and descriptor (if available)
* of @obj. NULL if that range is not defined.
*
* Since: 2.12
**/
AtkRange*
atk_value_get_range (AtkValue *obj)
{
AtkValueIface *iface;
g_return_val_if_fail (ATK_IS_VALUE (obj), NULL);
iface = ATK_VALUE_GET_IFACE (obj);
if (iface->get_range)
{
return (iface->get_range) (obj);
}
else
return NULL;
}
/**
* atk_value_get_increment:
* @obj: a GObject instance that implements AtkValueIface
*
* Gets the minimum increment by which the value of this object may be
* changed. If zero, the minimum increment is undefined, which may
* mean that it is limited only by the floating point precision of the
* platform.
*
* Return value: the minimum increment by which the value of this
* object may be changed. zero if undefined.
*
* Since: 2.12
**/
gdouble
atk_value_get_increment (AtkValue *obj)
{
AtkValueIface *iface;
g_return_val_if_fail (ATK_IS_VALUE (obj), 0);
iface = ATK_VALUE_GET_IFACE (obj);
if (iface->get_increment)
{
return (iface->get_increment) (obj);
}
else
return 0;
}
/**
* atk_value_get_sub_ranges:
* @obj: a GObject instance that implements AtkValueIface
*
* Gets the list of subranges defined for this object. See #AtkValue
* introduction for examples of subranges and when to expose them.
*
* Returns: (element-type AtkRange) (transfer full): an #GSList of
* #AtkRange which each of the subranges defined for this object. Free
* the returns list with g_slist_free().
*
* Since: 2.12
**/
GSList*
atk_value_get_sub_ranges (AtkValue *obj)
{
AtkValueIface *iface;
g_return_val_if_fail (ATK_IS_VALUE (obj), NULL);
iface = ATK_VALUE_GET_IFACE (obj);
if (iface->get_sub_ranges)
{
return (iface->get_sub_ranges) (obj);
}
else
return NULL;
}
/**
* atk_value_set_value:
* @obj: a GObject instance that implements AtkValueIface
* @new_value: a double which is the desired new accessible value.
*
* Sets the value of this object.
*
* This method is intended to provide a way to change the value of the
* object. In any case, it is possible that the value can't be
* modified (ie: a read-only component). If the value changes due this
* call, it is possible that the text could change, and will trigger
* an #AtkValue::value-changed signal emission.
*
* Note for implementors: the deprecated atk_value_set_current_value()
* method returned TRUE or FALSE depending if the value was assigned
* or not. In the practice several implementors were not able to
* decide it, and returned TRUE in any case. For that reason it is not
* required anymore to return if the value was properly assigned or
* not.
*
* Since: 2.12
**/
void
atk_value_set_value (AtkValue *obj,
const gdouble new_value)
{
AtkValueIface *iface;
g_return_if_fail (ATK_IS_VALUE (obj));
iface = ATK_VALUE_GET_IFACE (obj);
if (iface->set_value)
{
(iface->set_value) (obj, new_value);
}
}
static void
initialize_value_type_names ()
{
GTypeClass *enum_class;
GEnumValue *enum_value;
int i;
gchar *value_type_name = NULL;
if (value_type_names)
return;
value_type_names = g_ptr_array_new ();
enum_class = g_type_class_ref (ATK_TYPE_VALUE_TYPE);
if (!G_IS_ENUM_CLASS(enum_class))
return;
for (i = 0; i < ATK_VALUE_LAST_DEFINED; i++)
{
enum_value = g_enum_get_value (G_ENUM_CLASS (enum_class), i);
value_type_name = g_strdup (enum_value->value_nick);
_compact_name (value_type_name);
g_ptr_array_add (value_type_names, value_type_name);
}
g_type_class_unref (enum_class);
}
/**
* atk_value_type_get_name:
* @value_type: The #AtkValueType whose name is required
*
* Gets the description string describing the #AtkValueType @value_type.
*
* Returns: the string describing the #AtkValueType
*/
const gchar*
atk_value_type_get_name (AtkValueType value_type)
{
g_return_val_if_fail (value_type >= 0, NULL);
if (!value_type_names)
initialize_value_type_names ();
if (value_type < value_type_names->len)
return g_ptr_array_index (value_type_names, value_type);
return NULL;
}
/**
* atk_value_type_get_localized_name:
* @value_type: The #AtkValueType whose localized name is required
*
* Gets the localized description string describing the #AtkValueType @value_type.
*
* Returns: the localized string describing the #AtkValueType
**/
const gchar*
atk_value_type_get_localized_name (AtkValueType value_type)
{
_gettext_initialization ();
return dgettext (GETTEXT_PACKAGE, atk_value_type_get_name (value_type));
}

View File

@@ -1,96 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_VALUE_H__
#define __ATK_VALUE_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
#include <atk/atkrange.h>
G_BEGIN_DECLS
#define ATK_TYPE_VALUE (atk_value_get_type ())
#define ATK_IS_VALUE(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_VALUE)
#define ATK_VALUE(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_VALUE, AtkValue)
#define ATK_VALUE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_VALUE, AtkValueIface))
#ifndef _TYPEDEF_ATK_VALUE_
#define _TYPEDEF_ATK_VALUE__
typedef struct _AtkValue AtkValue;
#endif
typedef struct _AtkValueIface AtkValueIface;
/**
* AtkValueIface:
* @get_value_and_text: gets the current value and the human readable
* text alternative (if available) of this object. Since 2.12.
* @get_range: gets the range that defines the minimum and maximum
* value of this object. Returns NULL if there is no range
* defined. Since 2.12.
* @get_increment: gets the minimum increment by which the value of
* this object may be changed. If zero it is undefined. Since 2.12.
* @get_sub_ranges: returns a list of different subranges, and their
* description (if available) of this object. Returns NULL if there
* is not subranges defined. Since 2.12.
* @set_value: sets the value of this object. Since 2.12.
*/
struct _AtkValueIface
{
GTypeInterface parent;
void (* get_value_and_text) (AtkValue *obj,
gdouble *value,
gchar **text);
AtkRange*(* get_range) (AtkValue *obj);
gdouble (* get_increment) (AtkValue *obj);
GSList* (* get_sub_ranges) (AtkValue *obj);
void (* set_value) (AtkValue *obj,
const gdouble new_value);
};
GDK_AVAILABLE_IN_ALL
GType atk_value_get_type (void);
GDK_AVAILABLE_IN_ALL
void atk_value_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text);
GDK_AVAILABLE_IN_ALL
AtkRange* atk_value_get_range (AtkValue *obj);
GDK_AVAILABLE_IN_ALL
gdouble atk_value_get_increment (AtkValue *obj);
GDK_AVAILABLE_IN_ALL
GSList* atk_value_get_sub_ranges (AtkValue *obj);
GDK_AVAILABLE_IN_ALL
void atk_value_set_value (AtkValue *obj,
const gdouble new_value);
/* AtkValueType methods */
GDK_AVAILABLE_IN_ALL
const gchar* atk_value_type_get_name (AtkValueType value_type);
GDK_AVAILABLE_IN_ALL
const gchar* atk_value_type_get_localized_name (AtkValueType value_type);
G_END_DECLS
#endif /* __ATK_VALUE_H__ */

View File

@@ -1,168 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atkwindow.h"
#include "atkmarshal.h"
/**
* SECTION:atkwindow
* @Short_description: The ATK Interface provided by UI components that represent a top-level window.
* @Title: AtkWindow
* @See_also: #AtkObject
*
* #AtkWindow should be implemented by the UI elements that represent
* a top-level window, such as the main window of an application or
* dialog.
*
*/
enum {
ACTIVATE,
CREATE,
DEACTIVATE,
DESTROY,
MAXIMIZE,
MINIMIZE,
MOVE,
RESIZE,
RESTORE,
LAST_SIGNAL
};
static guint atk_window_signals[LAST_SIGNAL] = { 0 };
static guint
atk_window_add_signal (const gchar *name)
{
return g_signal_new (name,
ATK_TYPE_WINDOW,
G_SIGNAL_RUN_LAST,
0,
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
}
typedef AtkWindowIface AtkWindowInterface;
G_DEFINE_INTERFACE (AtkWindow, atk_window, ATK_TYPE_OBJECT)
static void
atk_window_default_init (AtkWindowIface *iface)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* AtkWindow::activate:
* @object: the object which received the signal
*
* The signal #AtkWindow::activate is emitted when a window
* becomes the active window of the application or session.
*
* Since: 2.2
*/
atk_window_signals[ACTIVATE] = atk_window_add_signal ("activate");
/**
* AtkWindow::create:
* @object: the object which received the signal
*
* The signal #AtkWindow::create is emitted when a new window
* is created.
*
* Since: 2.2
*/
atk_window_signals[CREATE] = atk_window_add_signal ("create");
/**
* AtkWindow::deactivate:
* @object: the object which received the signal
*
* The signal #AtkWindow::deactivate is emitted when a window is
* no longer the active window of the application or session.
*
* Since: 2.2
*/
atk_window_signals[DEACTIVATE] = atk_window_add_signal ("deactivate");
/**
* AtkWindow::destroy:
* @object: the object which received the signal
*
* The signal #AtkWindow::destroy is emitted when a window is
* destroyed.
*
* Since: 2.2
*/
atk_window_signals[DESTROY] = atk_window_add_signal ("destroy");
/**
* AtkWindow::maximize:
* @object: the object which received the signal
*
* The signal #AtkWindow::maximize is emitted when a window
* is maximized.
*
* Since: 2.2
*/
atk_window_signals[MAXIMIZE] = atk_window_add_signal ("maximize");
/**
* AtkWindow::minimize:
* @object: the object which received the signal
*
* The signal #AtkWindow::minimize is emitted when a window
* is minimized.
*
* Since: 2.2
*/
atk_window_signals[MINIMIZE] = atk_window_add_signal ("minimize");
/**
* AtkWindow::move:
* @object: the object which received the signal
*
* The signal #AtkWindow::move is emitted when a window
* is moved.
*
* Since: 2.2
*/
atk_window_signals[MOVE] = atk_window_add_signal ("move");
/**
* AtkWindow::resize:
* @object: the object which received the signal
*
* The signal #AtkWindow::resize is emitted when a window
* is resized.
*
* Since: 2.2
*/
atk_window_signals[RESIZE] = atk_window_add_signal ("resize");
/**
* AtkWindow::restore:
* @object: the object which received the signal
*
* The signal #AtkWindow::restore is emitted when a window
* is restored.
*
* Since: 2.2
*/
atk_window_signals[RESTORE] = atk_window_add_signal ("restore");
initialized = TRUE;
}
}

View File

@@ -1,53 +0,0 @@
/* ATK - Accessibility Toolkit
* Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __ATK_WINDOW_H__
#define __ATK_WINDOW_H__
#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <atk/atk.h> can be included directly."
#endif
#include <atk/atkobject.h>
G_BEGIN_DECLS
/*
* AtkWindow describes signals pertaining to on-screen windows.
*/
#define ATK_TYPE_WINDOW (atk_window_get_type ())
#define ATK_IS_WINDOW(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_WINDOW)
#define ATK_WINDOW(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_WINDOW, AtkWindow)
#define ATK_WINDOW_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_WINDOW, AtkWindowIface))
typedef struct _AtkWindow AtkWindow; /* Dummy typedef */
typedef struct _AtkWindowIface AtkWindowIface;
struct _AtkWindowIface
{
GTypeInterface parent;
};
GDK_AVAILABLE_IN_ALL
GType atk_window_get_type (void);
G_END_DECLS
#endif /* __ATK_WINDOW_H__ */

View File

@@ -1,114 +0,0 @@
atk_public_sources = files([
'atkaction.c',
'atkcomponent.c',
'atkdocument.c',
'atkeditabletext.c',
'atkgobjectaccessible.c',
'atkhyperlink.c',
'atkhyperlinkimpl.c',
'atkhypertext.c',
'atkimage.c',
'atknoopobject.c',
'atknoopobjectfactory.c',
'atkobject.c',
'atkobjectfactory.c',
'atkplug.c',
'atkprivate.c',
'atkrange.c',
'atkregistry.c',
'atkrelation.c',
'atkrelationset.c',
'atkselection.c',
'atksocket.c',
'atkstate.c',
'atkstateset.c',
'atkstreamablecontent.c',
'atktable.c',
'atktablecell.c',
'atktext.c',
'atkutil.c',
'atkvalue.c',
'atkwindow.c',
])
atk_public_headers = files([
'atkaction.h',
'atkcomponent.h',
'atkdocument.h',
'atkeditabletext.h',
'atkenums.h',
'atkgobjectaccessible.h',
'atkhyperlink.h',
'atkhyperlinkimpl.h',
'atkhypertext.h',
'atkimage.h',
'atknoopobject.h',
'atknoopobjectfactory.h',
'atkobject.h',
'atkobjectfactory.h',
'atkplug.h',
'atkrange.h',
'atkregistry.h',
'atkrelation.h',
'atkrelationset.h',
'atkselection.h',
'atksocket.h',
'atkstate.h',
'atkstateset.h',
'atkstreamablecontent.h',
'atktable.h',
'atktablecell.h',
'atktext.h',
'atktypes.h',
'atkutil.h',
'atkvalue.h',
'atkwindow.h',
])
install_headers(atk_public_headers + ['atk.h'], subdir: 'gtk-4.0/atk')
# Marshallers
atk_marshals = gnome.genmarshal('atkmarshal',
sources: 'atkmarshal.list',
prefix: 'atk_marshal',
)
atk_marshal_h = atk_marshals[1]
# Enumerations for GType
atk_enums = gnome.mkenums('atkenumtypes',
sources: atk_public_headers,
c_template: 'atkenumtypes.c.template',
h_template: 'atkenumtypes.h.template',
install_dir: gtk_includedir / 'gtk-4.0' / 'atk',
install_header: true,
)
atk_enum_h = atk_enums[1]
atk_deps = [
libgdk_dep,
]
libatk = static_library('atk',
sources: [atk_public_sources, atk_enums, atk_marshals],
dependencies: atk_deps,
include_directories: [confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Atk"',
'-DG_LOG_USE_STRUCTURED=1',
'-DGLIB_DISABLE_DEPRECATION_WARNINGS',
'-DATK_DISABLE_DEPRECATION_WARNINGS',
'-DATK_LOCALEDIR="@0@"'.format(join_paths(gtk_datadir, 'locale')),
],
link_with: libgdk,
link_args: common_ldflags,
)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libatk_dep = declare_dependency(
include_directories: confinc,
sources: [atk_enum_h],
dependencies: libgdk_dep,
)

46
autogen.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.
olddir=`pwd`
cd "$srcdir"
mkdir -p m4
GTKDOCIZE=`which gtkdocize`
if test -z $GTKDOCIZE; then
echo "*** No GTK-Doc found, please install it ***"
exit 1
else
gtkdocize || exit $?
fi
PKGCONFIG=`which pkg-config`
if test -z "$PKGCONFIG"; then
echo "*** pkg-config not found, please install it ***"
exit 1
fi
pkg-config --print-errors gobject-introspection-1.0
if [ $? != 0 ]; then
echo "You probably need to install 'libgirepository1.0-dev'"
exit 1
fi
# README and INSTALL are required by automake, but may be deleted by clean
# up rules. to get automake to work, simply touch these here, they will be
# regenerated from their corresponding *.in files by ./configure anyway.
touch README INSTALL
AUTORECONF=`which autoreconf`
if test -z $AUTORECONF; then
echo "*** No autoreconf found, please install it ***"
exit 1
else
autoreconf --force --install --verbose || exit $?
fi
cd "$olddir"
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"

View File

@@ -1,72 +0,0 @@
{
"app-id": "org.gtk.Demo4",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "gtk4-demo",
"tags": ["devel", "development", "nightly"],
"desktop-file-name-prefix": "(Development) ",
"finish-args": [
"--device=dri",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
],
"cleanup": [
"/include",
"/lib/pkgconfig", "/share/pkgconfig",
"/share/aclocal",
"/man", "/share/man", "/share/gtk-doc",
"*.la", ".a",
"/lib/girepository-1.0",
"/share/gir-1.0",
"/share/doc"
],
"modules": [
{
"name" : "wayland",
"buildsystem" : "autotools",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
}
]
},
{
"name": "graphene",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib",
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ebassi/graphene.git"
}
]
},
{
"name": "gtk",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
}
]
}
]
}

View File

@@ -1,72 +0,0 @@
{
"app-id": "org.gtk.IconBrowser4",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "gtk4-icon-browser",
"tags": ["devel", "development", "nightly"],
"desktop-file-name-prefix": "(Development) ",
"finish-args": [
"--device=dri",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
],
"cleanup": [
"/include",
"/lib/pkgconfig", "/share/pkgconfig",
"/share/aclocal",
"/man", "/share/man", "/share/gtk-doc",
"*.la", ".a",
"/lib/girepository-1.0",
"/share/gir-1.0",
"/share/doc"
],
"modules": [
{
"name" : "wayland",
"buildsystem" : "autotools",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
}
]
},
{
"name": "graphene",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib",
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ebassi/graphene.git"
}
]
},
{
"name": "gtk",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
}
]
}
]
}

View File

@@ -1,72 +0,0 @@
{
"app-id": "org.gtk.WidgetFactory4",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "gtk4-widget-factory",
"tags": ["devel", "development", "nightly"],
"desktop-file-name-prefix": "(Development) ",
"finish-args": [
"--device=dri",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
],
"cleanup": [
"/include",
"/lib/pkgconfig", "/share/pkgconfig",
"/share/aclocal",
"/man", "/share/man", "/share/gtk-doc",
"*.la", ".a",
"/lib/girepository-1.0",
"/share/gir-1.0",
"/share/doc"
],
"modules": [
{
"name" : "wayland",
"buildsystem" : "autotools",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
}
]
},
{
"name": "graphene",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib",
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ebassi/graphene.git"
}
]
},
{
"name": "gtk",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
}
]
}
]
}

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
gtk_libdir = sys.argv[3]
gtk_datadir = sys.argv[4]
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
print('Compiling GSettings schemas...')
subprocess.call(['glib-compile-schemas',
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
subprocess.call(['gtk4-update-icon-cache', '-q', '-t' ,'-f',
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
subprocess.call(['gio-querymodules', gtk_printmodule_dir])
print('Updating module cache for input methods...')
os.makedirs(gtk_immodule_dir, exist_ok=True)
subprocess.call(['gio-querymodules', gtk_immodule_dir])

45
build/Makefile-newvs.am Normal file
View File

@@ -0,0 +1,45 @@
# Centralized autotools file
# Create the Visual Studio 2012/2013/2015 project files
# from the Visual Studio 2010 project files
# This autotools file, from GLib, can be used in other projects
# that have Visual Studio build support, and is copied into
# $(srcroot)/build/.
# Author: Fan, Chun-wei
# November 05, 2012
# MSVC_VER_LONG: Long Version of Visual Studio (2012, 2013, 14 and so on)
# MSVC_VER: Short Version of Visual Studio (11 for 2012, 12 for 2013, 14 for 2015 and so on)
# MSVC_FORMAT_VER: Use 12 for MSVC 2012 through 2015
%.sln:
sed 's/11\.00/$(MSVC_FORMAT_VER)\.00/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
sed 's/2010/$(MSVC_VER_LONG)/g' < $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@
rm $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
%.txt:
sed 's/vs10/vs$(MSVC_VER)/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
sed 's/VS10/VS$(MSVC_VER)/g' < $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@
rm $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
%.vcxproj:
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
sed 's/v100/v$(MSVC_VER)0/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
else \
sed 's/v100/v$(MSVC_VER)0/g' < $(top_builddir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
fi
%.props:
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
sed 's/<VSVer>10<\/VSVer>/<VSVer>$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
else \
sed 's/<VSVer>10<\/VSVer>/<VSVer>$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
fi
%.vcxproj.filters:
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
cp $(top_srcdir)/build/win32/vs10/$@ $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
else \
cp $(top_builddir)/build/win32/vs10/$@ $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
fi

Some files were not shown because too many files have changed in this diff Show More