Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d61fc9e51 | |||
| dbfbb03748 | |||
| e4f3c5da40 |
+1
-14
@@ -68,7 +68,6 @@ style-check-diff:
|
||||
fedora-x86_64:
|
||||
extends: .build-fedora-default
|
||||
stage: build
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
||||
script:
|
||||
@@ -83,7 +82,6 @@ fedora-x86_64:
|
||||
release-build:
|
||||
extends: .build-fedora-default
|
||||
stage: build
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
script:
|
||||
@@ -111,7 +109,6 @@ release-build:
|
||||
|
||||
msys2-mingw64:
|
||||
extends: .mingw-defaults
|
||||
needs: []
|
||||
variables:
|
||||
MSYSTEM: "MINGW64"
|
||||
CHERE_INVOKING: "yes"
|
||||
@@ -142,44 +139,37 @@ msys2-mingw64:
|
||||
|
||||
flatpak-manual:demo:
|
||||
extends: .flatpak-manual
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.Demo4
|
||||
|
||||
flatpak-master:demo:
|
||||
extends: .flatpak-master
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.Demo4
|
||||
|
||||
flatpak-manual:widget-factory:
|
||||
extends: .flatpak-manual
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.WidgetFactory4
|
||||
|
||||
flatpak-master:widget-factory:
|
||||
extends: .flatpak-master
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.WidgetFactory4
|
||||
|
||||
flatpak-manual:icon-browser:
|
||||
extends: .flatpak-manual
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.IconBrowser4
|
||||
|
||||
flatpak-master:icon-browser:
|
||||
extends: .flatpak-master
|
||||
needs: []
|
||||
variables:
|
||||
APPID: org.gtk.IconBrowser4
|
||||
|
||||
static-scan:
|
||||
image: $FEDORA_IMAGE
|
||||
stage: analysis
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug"
|
||||
script:
|
||||
@@ -194,9 +184,8 @@ static-scan:
|
||||
# since it is incompatible with asan
|
||||
asan-build:
|
||||
image: $FEDORA_IMAGE
|
||||
tags: [ asan ]
|
||||
tags: [ privileged ]
|
||||
stage: analysis
|
||||
needs: []
|
||||
variables:
|
||||
script:
|
||||
- CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=false _build
|
||||
@@ -210,7 +199,6 @@ asan-build:
|
||||
reference:
|
||||
image: $DOCS_IMAGE
|
||||
stage: docs
|
||||
needs: []
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
script:
|
||||
@@ -226,7 +214,6 @@ reference:
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
needs: ['reference']
|
||||
script:
|
||||
- mv _reference/ public/
|
||||
artifacts:
|
||||
|
||||
@@ -75,6 +75,7 @@ RUN dnf -y install \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
sassc \
|
||||
sysprof-devel \
|
||||
systemtap-sdt-devel \
|
||||
vulkan-devel \
|
||||
wayland-devel \
|
||||
|
||||
@@ -18,6 +18,7 @@ case "${backend}" in
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
--no-suite=gtk:a11y \
|
||||
--no-suite=gsk-compare-broadway
|
||||
|
||||
# Store the exit code for the CI run, but always
|
||||
@@ -37,6 +38,7 @@ case "${backend}" in
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
--no-suite=gtk:a11y \
|
||||
--no-suite=gsk-compare-broadway
|
||||
|
||||
exit_code=$?
|
||||
@@ -55,6 +57,7 @@ case "${backend}" in
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
--no-suite=gtk:a11y \
|
||||
--no-suite=gsk-compare-opengl
|
||||
|
||||
# don't let Broadway failures fail the run, for now
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
Overview of Changes in GTK 3.99.0
|
||||
=================================
|
||||
|
||||
* Remove the old accessibility implementation and
|
||||
add the foundations for a new one that is based
|
||||
on ARIA. The relevant widget api is GtkAccessible,
|
||||
the backend implementations will use GtkATContext.
|
||||
Currently, there is just a nascent test backend.
|
||||
|
||||
* Update the GTK headers to use char *, int, float and
|
||||
double instead of the corresponding GLib types.
|
||||
|
||||
* Add GtkEditableLabel, a label that can be edited
|
||||
* Add GtkEditableLabel
|
||||
|
||||
* Add GtkBookmarkList, a list model for bookmarks
|
||||
|
||||
@@ -44,15 +35,6 @@ Overview of Changes in GTK 3.99.0
|
||||
|
||||
* GtkFilterListModel:
|
||||
- Add incremental filtering
|
||||
- Add a boolean filter, GtkBoolFilter
|
||||
|
||||
* GtkSortListModel:
|
||||
- Use timsort
|
||||
- Add various tweaks that massively speed up sorting
|
||||
- Add incremental sorting
|
||||
|
||||
* GtkWidget:
|
||||
- Massively speed up action handling
|
||||
|
||||
* GtkEntry:
|
||||
- Make entry completion work again
|
||||
@@ -61,18 +43,12 @@ Overview of Changes in GTK 3.99.0
|
||||
* Inspector:
|
||||
- Improve list model support
|
||||
- Add direct navigation between objects
|
||||
- Show accessibility information
|
||||
|
||||
* GDK:
|
||||
- Compress scroll events
|
||||
- Keep a scroll history
|
||||
- Clean up GdkDevice api
|
||||
- Drop the master/slave device split
|
||||
- Move axes to GdkDeviceTool
|
||||
- Change monitor workarea to be per-backend API
|
||||
- Improve frame clock accuracy
|
||||
- Add a new macOS backend
|
||||
- Add an ANGLE-based GLES renderer for Windows
|
||||
|
||||
* GSK:
|
||||
- Use GL_ARB_framebuffer_object
|
||||
|
||||
@@ -56,6 +56,7 @@ building for:
|
||||
- [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:
|
||||
@@ -69,6 +70,7 @@ If you are building the X11 backend, you will also need:
|
||||
- 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:
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@ constraint_editor_application_activate (GApplication *app)
|
||||
static void
|
||||
constraint_editor_application_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
ConstraintEditorWindow *win;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < n_files; i++)
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ constraint_editor_window_load (ConstraintEditorWindow *self,
|
||||
|
||||
static void
|
||||
open_response_cb (GtkNativeDialog *dialog,
|
||||
int response,
|
||||
gint response,
|
||||
ConstraintEditorWindow *self)
|
||||
{
|
||||
gtk_native_dialog_hide (dialog);
|
||||
@@ -285,7 +285,7 @@ serialize_model (GListModel *list)
|
||||
|
||||
static void
|
||||
save_response_cb (GtkNativeDialog *dialog,
|
||||
int response,
|
||||
gint response,
|
||||
ConstraintEditorWindow *self)
|
||||
{
|
||||
gtk_native_dialog_hide (dialog);
|
||||
|
||||
@@ -174,25 +174,28 @@ constraint_view_init (ConstraintView *self)
|
||||
manager = gtk_constraint_layout_new ();
|
||||
gtk_widget_set_layout_manager (GTK_WIDGET (self), manager);
|
||||
|
||||
guides = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (manager));
|
||||
|
||||
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
|
||||
all_constraints = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (manager));
|
||||
guides = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (manager));
|
||||
filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
|
||||
constraints = (GListModel *)gtk_filter_list_model_new (all_constraints, filter);
|
||||
|
||||
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
|
||||
g_object_unref (filter);
|
||||
filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
|
||||
children = (GListModel *)gtk_filter_list_model_new (all_children, filter);
|
||||
g_object_unref (filter);
|
||||
|
||||
list = g_list_store_new (G_TYPE_LIST_MODEL);
|
||||
g_list_store_append (list, children);
|
||||
g_list_store_append (list, guides);
|
||||
g_list_store_append (list, constraints);
|
||||
self->model = G_LIST_MODEL (gtk_flatten_list_model_new (G_LIST_MODEL (list)));
|
||||
g_object_unref (children);
|
||||
g_object_unref (guides);
|
||||
g_object_unref (constraints);
|
||||
g_object_unref (all_children);
|
||||
g_object_unref (all_constraints);
|
||||
g_object_unref (list);
|
||||
|
||||
self->model = G_LIST_MODEL (gtk_flatten_list_model_new (G_LIST_MODEL (list)));
|
||||
|
||||
controller = (GtkEventController *)gtk_gesture_drag_new ();
|
||||
g_signal_connect (controller, "drag-begin", G_CALLBACK (drag_begin), self);
|
||||
|
||||
@@ -34,7 +34,7 @@ static void create_window (GApplication *app, const char *contents);
|
||||
static void
|
||||
show_action_dialog (GSimpleAction *action)
|
||||
{
|
||||
const char *name;
|
||||
const gchar *name;
|
||||
GtkWidget *dialog;
|
||||
|
||||
name = g_action_get_name (G_ACTION (action));
|
||||
@@ -58,9 +58,9 @@ show_action_infobar (GSimpleAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
DemoApplicationWindow *window = data;
|
||||
char *text;
|
||||
const char *name;
|
||||
const char *value;
|
||||
gchar *text;
|
||||
const gchar *name;
|
||||
const gchar *value;
|
||||
|
||||
name = g_action_get_name (G_ACTION (action));
|
||||
value = g_variant_get_string (parameter, NULL);
|
||||
@@ -92,7 +92,7 @@ activate_new (GSimpleAction *action,
|
||||
|
||||
static void
|
||||
open_response_cb (GtkNativeDialog *dialog,
|
||||
int response_id,
|
||||
gint response_id,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkFileChooserNative *native = user_data;
|
||||
@@ -185,7 +185,7 @@ activate_about (GSimpleAction *action,
|
||||
{
|
||||
GtkWidget *window = user_data;
|
||||
|
||||
const char *authors[] = {
|
||||
const gchar *authors[] = {
|
||||
"Peter Mattis",
|
||||
"Spencer Kimball",
|
||||
"Josh MacDonald",
|
||||
@@ -193,7 +193,7 @@ activate_about (GSimpleAction *action,
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *documentors[] = {
|
||||
const gchar *documentors[] = {
|
||||
"Owen Taylor",
|
||||
"Tony Gale",
|
||||
"Matthias Clasen <mclasen@redhat.com>",
|
||||
@@ -244,9 +244,9 @@ static void
|
||||
update_statusbar (GtkTextBuffer *buffer,
|
||||
DemoApplicationWindow *window)
|
||||
{
|
||||
char *msg;
|
||||
int row, col;
|
||||
int count;
|
||||
gchar *msg;
|
||||
gint row, col;
|
||||
gint count;
|
||||
GtkTextIter iter;
|
||||
|
||||
/* clear any previous message, underflow is allowed */
|
||||
|
||||
@@ -16,8 +16,8 @@ static GtkWidget *placeholder;
|
||||
|
||||
static void
|
||||
on_name_appeared (GDBusConnection *connection,
|
||||
const char *name,
|
||||
const char *name_owner,
|
||||
const gchar *name,
|
||||
const gchar *name_owner,
|
||||
gpointer user_data)
|
||||
{
|
||||
name_seen = TRUE;
|
||||
@@ -25,7 +25,7 @@ on_name_appeared (GDBusConnection *connection,
|
||||
|
||||
static void
|
||||
on_name_vanished (GDBusConnection *connection,
|
||||
const char *name,
|
||||
const gchar *name,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (!name_seen)
|
||||
@@ -55,7 +55,7 @@ do_application_demo (GtkWidget *toplevel)
|
||||
|
||||
if (placeholder == NULL)
|
||||
{
|
||||
const char *command;
|
||||
const gchar *command;
|
||||
GError *error = NULL;
|
||||
|
||||
if (g_file_test ("./gtk4-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
|
||||
|
||||
@@ -12,7 +12,7 @@ static GtkWidget *progress_bar = NULL;
|
||||
static gboolean
|
||||
apply_changes_gradually (gpointer data)
|
||||
{
|
||||
double fraction;
|
||||
gdouble fraction;
|
||||
|
||||
/* Work, work, work... */
|
||||
fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progress_bar));
|
||||
@@ -47,8 +47,8 @@ on_assistant_close_cancel (GtkWidget *widget, gpointer data)
|
||||
static void
|
||||
on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data)
|
||||
{
|
||||
int current_page, n_pages;
|
||||
char *title;
|
||||
gint current_page, n_pages;
|
||||
gchar *title;
|
||||
|
||||
current_page = gtk_assistant_get_current_page (GTK_ASSISTANT (widget));
|
||||
n_pages = gtk_assistant_get_n_pages (GTK_ASSISTANT (widget));
|
||||
@@ -70,8 +70,8 @@ on_entry_changed (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkAssistant *assistant = GTK_ASSISTANT (data);
|
||||
GtkWidget *current_page;
|
||||
int page_number;
|
||||
const char *text;
|
||||
gint page_number;
|
||||
const gchar *text;
|
||||
|
||||
page_number = gtk_assistant_get_current_page (assistant);
|
||||
current_page = gtk_assistant_get_nth_page (assistant, page_number);
|
||||
|
||||
@@ -38,7 +38,7 @@ create_icon_store (void)
|
||||
|
||||
GtkTreeIter iter;
|
||||
GtkListStore *store;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
|
||||
|
||||
@@ -77,7 +77,7 @@ set_sensitive (GtkCellLayout *cell_layout,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
int *indices;
|
||||
gint *indices;
|
||||
gboolean sensitive;
|
||||
|
||||
path = gtk_tree_model_get_path (tree_model, iter);
|
||||
@@ -175,7 +175,7 @@ create_capital_store (void)
|
||||
|
||||
GtkTreeIter iter, iter2;
|
||||
GtkTreeStore *store;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
store = gtk_tree_store_new (1, G_TYPE_STRING);
|
||||
|
||||
|
||||
@@ -38,14 +38,14 @@ struct {
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
static void
|
||||
update_css_for_blend_mode (GtkCssProvider *provider,
|
||||
const char *blend_mode)
|
||||
const gchar *blend_mode)
|
||||
{
|
||||
GBytes *bytes;
|
||||
char *css;
|
||||
gchar *css;
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_blendmodes/css_blendmodes.css", 0, NULL);
|
||||
|
||||
css = g_strdup_printf ((char *) g_bytes_get_data (bytes, NULL),
|
||||
css = g_strdup_printf ((gchar*) g_bytes_get_data (bytes, NULL),
|
||||
blend_mode,
|
||||
blend_mode,
|
||||
blend_mode);
|
||||
@@ -62,7 +62,7 @@ row_activated (GtkListBox *listbox,
|
||||
GtkListBoxRow *row,
|
||||
GtkCssProvider *provider)
|
||||
{
|
||||
const char *blend_mode;
|
||||
const gchar *blend_mode;
|
||||
|
||||
blend_mode = blend_modes[gtk_list_box_row_get_index (row)].id;
|
||||
|
||||
@@ -75,7 +75,7 @@ setup_listbox (GtkBuilder *builder,
|
||||
{
|
||||
GtkWidget *normal_row;
|
||||
GtkWidget *listbox;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
normal_row = NULL;
|
||||
listbox = gtk_list_box_new ();
|
||||
|
||||
@@ -95,6 +95,9 @@
|
||||
<property name="program-name" translatable="yes">Builder demo</property>
|
||||
<property name="logo-icon-name" translatable="yes">gtk3-demo</property>
|
||||
<property name="modal">True</property>
|
||||
<accessibility>
|
||||
<relation target="window1" type="subwindow-of"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="default-height">250</property>
|
||||
@@ -110,6 +113,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="toolbar1">
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-toolbar">
|
||||
<property name="AtkObject::accessible-name">The toolbar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">New</property>
|
||||
@@ -166,6 +174,14 @@
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="model">liststore1</property>
|
||||
<property name="tooltip-column">3</property>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-treeview">
|
||||
<property name="AtkObject::accessible-name">Name list</property>
|
||||
<property name="AtkObject::accessible-description">
|
||||
A list of person with name, surname and age columns
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="column1">
|
||||
<property name="title">Name</property>
|
||||
|
||||
@@ -17,7 +17,7 @@ G_DEFINE_TYPE(DemoImage, demo_image, GTK_TYPE_WIDGET)
|
||||
static GdkPaintable *
|
||||
get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const char *icon_name;
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconPaintable *icon;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "demotaggedentry.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gtk/gtk-a11y.h>
|
||||
|
||||
struct _DemoTaggedEntry
|
||||
{
|
||||
@@ -118,6 +119,7 @@ demo_tagged_entry_class_init (DemoTaggedEntryClass *klass)
|
||||
gtk_editable_install_properties (object_class, 1);
|
||||
|
||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
|
||||
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_ENTRY_ACCESSIBLE);
|
||||
gtk_widget_class_set_css_name (widget_class, "entry");
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ message_dialog_clicked (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
static int i = 1;
|
||||
static gint i = 1;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
|
||||
+12
-78
@@ -597,83 +597,6 @@ css_button_new (const char *class)
|
||||
return button;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
GdkRGBA color;
|
||||
} ColorSwatch;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
} ColorSwatchClass;
|
||||
|
||||
G_DEFINE_TYPE (ColorSwatch, color_swatch, GTK_TYPE_WIDGET)
|
||||
|
||||
static GdkContentProvider *
|
||||
color_swatch_drag_prepare (GtkDragSource *source,
|
||||
double x,
|
||||
double y,
|
||||
ColorSwatch *swatch)
|
||||
{
|
||||
return gdk_content_provider_new_typed (GDK_TYPE_RGBA, &swatch->color);
|
||||
}
|
||||
|
||||
static void
|
||||
color_swatch_init (ColorSwatch *swatch)
|
||||
{
|
||||
GtkDragSource *source = gtk_drag_source_new ();
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (color_swatch_drag_prepare), swatch);
|
||||
gtk_widget_add_controller (GTK_WIDGET (swatch), GTK_EVENT_CONTROLLER (source));
|
||||
}
|
||||
|
||||
static void
|
||||
color_swatch_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
ColorSwatch *swatch = (ColorSwatch *)widget;
|
||||
float w = gtk_widget_get_width (widget);
|
||||
float h = gtk_widget_get_height (widget);
|
||||
|
||||
gtk_snapshot_append_color (snapshot, &swatch->color,
|
||||
&GRAPHENE_RECT_INIT(0, 0, w, h));
|
||||
}
|
||||
|
||||
void
|
||||
color_swatch_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum_size,
|
||||
int *natural_size,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
*minimum_size = *natural_size = 48;
|
||||
else
|
||||
*minimum_size = *natural_size = 32;
|
||||
}
|
||||
|
||||
static void
|
||||
color_swatch_class_init (ColorSwatchClass *class)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
widget_class->snapshot = color_swatch_snapshot;
|
||||
widget_class->measure = color_swatch_measure;
|
||||
gtk_widget_class_set_css_name (widget_class, "colorswatch");
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
color_swatch_new (const char *color)
|
||||
{
|
||||
ColorSwatch *swatch = g_object_new (color_swatch_get_type (), NULL);
|
||||
|
||||
gdk_rgba_parse (&swatch->color, color);
|
||||
|
||||
return GTK_WIDGET (swatch);
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
@@ -747,7 +670,18 @@ do_dnd (GtkWidget *do_widget)
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box3);
|
||||
|
||||
for (i = 0; colors[i]; i++)
|
||||
gtk_box_append (GTK_BOX (box3), color_swatch_new (colors[i]));
|
||||
{
|
||||
GdkRGBA rgba;
|
||||
GtkWidget *swatch;
|
||||
|
||||
gdk_rgba_parse (&rgba, colors[i]);
|
||||
|
||||
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
|
||||
"rgba", &rgba,
|
||||
"selectable", FALSE,
|
||||
NULL);
|
||||
gtk_box_append (GTK_BOX (box3), swatch);
|
||||
}
|
||||
|
||||
gtk_box_append (GTK_BOX (box3), css_button_new ("rainbow1"));
|
||||
gtk_box_append (GTK_BOX (box3), css_button_new ("rainbow2"));
|
||||
|
||||
@@ -64,8 +64,8 @@ scribble_draw (GtkDrawingArea *da,
|
||||
/* Draw a rectangle on the screen */
|
||||
static void
|
||||
draw_brush (GtkWidget *widget,
|
||||
double x,
|
||||
double y)
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
GdkRectangle update_rect;
|
||||
cairo_t *cr;
|
||||
|
||||
@@ -254,7 +254,7 @@ do_dropdown (GtkWidget *do_widget)
|
||||
gtk_widget_set_margin_bottom (box, 10);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
||||
button = gtk_drop_down_new (NULL, NULL);
|
||||
button = gtk_drop_down_new ();
|
||||
|
||||
model = G_LIST_MODEL (pango_cairo_font_map_get_default ());
|
||||
gtk_drop_down_set_model (GTK_DROP_DOWN (button), model);
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int number;
|
||||
char *product;
|
||||
int yummy;
|
||||
gint number;
|
||||
gchar *product;
|
||||
gint yummy;
|
||||
}
|
||||
Item;
|
||||
|
||||
@@ -74,7 +74,7 @@ add_items (void)
|
||||
static GtkTreeModel *
|
||||
create_items_model (void)
|
||||
{
|
||||
int i = 0;
|
||||
gint i = 0;
|
||||
GtkListStore *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
@@ -109,7 +109,7 @@ static GtkTreeModel *
|
||||
create_numbers_model (void)
|
||||
{
|
||||
#define N_NUMBERS 10
|
||||
int i = 0;
|
||||
gint i = 0;
|
||||
GtkListStore *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
@@ -192,7 +192,7 @@ remove_item (GtkWidget *widget, gpointer data)
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
{
|
||||
int i;
|
||||
gint i;
|
||||
GtkTreePath *path;
|
||||
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
@@ -211,7 +211,7 @@ separator_row (GtkTreeModel *model,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
int idx;
|
||||
gint idx;
|
||||
|
||||
path = gtk_tree_model_get_path (model, iter);
|
||||
idx = gtk_tree_path_get_indices (path)[0];
|
||||
@@ -224,7 +224,7 @@ separator_row (GtkTreeModel *model,
|
||||
static void
|
||||
editing_started (GtkCellRenderer *cell,
|
||||
GtkCellEditable *editable,
|
||||
const char *path,
|
||||
const gchar *path,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (editable),
|
||||
@@ -233,15 +233,15 @@ editing_started (GtkCellRenderer *cell,
|
||||
|
||||
static void
|
||||
cell_edited (GtkCellRendererText *cell,
|
||||
const char *path_string,
|
||||
const char *new_text,
|
||||
const gchar *path_string,
|
||||
const gchar *new_text,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreeModel *model = (GtkTreeModel *)data;
|
||||
GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
|
||||
GtkTreeIter iter;
|
||||
|
||||
int column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));
|
||||
gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
|
||||
@@ -249,7 +249,7 @@ cell_edited (GtkCellRendererText *cell,
|
||||
{
|
||||
case COLUMN_ITEM_NUMBER:
|
||||
{
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
i = gtk_tree_path_get_indices (path)[0];
|
||||
g_array_index (articles, Item, i).number = atoi (new_text);
|
||||
@@ -261,8 +261,8 @@ cell_edited (GtkCellRendererText *cell,
|
||||
|
||||
case COLUMN_ITEM_PRODUCT:
|
||||
{
|
||||
int i;
|
||||
char *old_text;
|
||||
gint i;
|
||||
gchar *old_text;
|
||||
|
||||
gtk_tree_model_get (model, &iter, column, &old_text, -1);
|
||||
g_free (old_text);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void
|
||||
response_cb (GtkDialog *dialog, int response_id)
|
||||
response_cb (GtkDialog *dialog, gint response_id)
|
||||
{
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
window = NULL;
|
||||
|
||||
@@ -22,8 +22,8 @@ format_number (GtkTreeViewColumn *col,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
int num;
|
||||
char *text;
|
||||
gint num;
|
||||
gchar *text;
|
||||
|
||||
gtk_tree_model_get (model, iter, GPOINTER_TO_INT (data), &num, -1);
|
||||
text = g_strdup_printf ("%d", num);
|
||||
@@ -35,11 +35,11 @@ static void
|
||||
filter_modify_func (GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
GValue *value,
|
||||
int column,
|
||||
gint column,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreeModelFilter *filter_model = GTK_TREE_MODEL_FILTER (model);
|
||||
int width, height;
|
||||
gint width, height;
|
||||
GtkTreeModel *child_model;
|
||||
GtkTreeIter child_iter;
|
||||
|
||||
@@ -75,7 +75,7 @@ visible_func (GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
int width;
|
||||
gint width;
|
||||
|
||||
gtk_tree_model_get (model, iter,
|
||||
WIDTH_COLUMN, &width,
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="treeview1"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
@@ -80,6 +83,9 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label1"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -127,6 +133,9 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label2"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -140,6 +149,9 @@
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="treeview2"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
@@ -153,6 +165,9 @@
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="treeview3"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -182,6 +197,9 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label3"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
|
||||
@@ -29,7 +29,7 @@ draw_color (GtkDrawingArea *drawingarea,
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
color_swatch_new (const char *color)
|
||||
color_swatch_new (const gchar *color)
|
||||
{
|
||||
GtkWidget *button, *area;
|
||||
|
||||
@@ -48,7 +48,7 @@ do_flowbox (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *scrolled, *flowbox;
|
||||
const char *colors[] = {
|
||||
const gchar *colors[] = {
|
||||
"AliceBlue",
|
||||
"AntiqueWhite",
|
||||
"AntiqueWhite1",
|
||||
@@ -716,7 +716,7 @@ do_flowbox (GtkWidget *do_widget)
|
||||
"YellowGreen",
|
||||
NULL
|
||||
};
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
|
||||
@@ -295,7 +295,7 @@ update_display (void)
|
||||
GList *l;
|
||||
PangoAttrList *attrs;
|
||||
PangoAttribute *attr;
|
||||
int ins, bound;
|
||||
gint ins, bound;
|
||||
guint start, end;
|
||||
PangoLanguage *lang;
|
||||
char *font_desc;
|
||||
@@ -479,7 +479,7 @@ update_script_combo (void)
|
||||
{
|
||||
GtkListStore *store;
|
||||
hb_font_t *hb_font;
|
||||
int i, j, k;
|
||||
gint i, j, k;
|
||||
PangoFont *pango_font;
|
||||
GHashTable *tags;
|
||||
GHashTableIter iter;
|
||||
@@ -593,7 +593,7 @@ update_script_combo (void)
|
||||
static void
|
||||
update_features (void)
|
||||
{
|
||||
int i, j;
|
||||
gint i, j;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
guint script_index, lang_index;
|
||||
@@ -728,8 +728,8 @@ static void
|
||||
entry_activated (GtkEntry *entry,
|
||||
GtkAdjustment *adjustment)
|
||||
{
|
||||
double value;
|
||||
char *err = NULL;
|
||||
gdouble value;
|
||||
gchar *err = NULL;
|
||||
|
||||
value = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
|
||||
if (err != NULL)
|
||||
@@ -939,7 +939,7 @@ instance_changed (GtkComboBox *combo)
|
||||
{
|
||||
Axis *axis;
|
||||
Axis akey;
|
||||
double value;
|
||||
gdouble value;
|
||||
|
||||
value = coords[ai[i].axis_index];
|
||||
|
||||
|
||||
+16
-16
@@ -36,11 +36,11 @@ adjustment_get_normalized_value (GtkAdjustment *adj)
|
||||
|
||||
static void
|
||||
val_to_xy (GtkFontPlane *plane,
|
||||
int *x,
|
||||
int *y)
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
double u, v;
|
||||
int width, height;
|
||||
gdouble u, v;
|
||||
gint width, height;
|
||||
|
||||
width = gtk_widget_get_allocated_width (GTK_WIDGET (plane));
|
||||
height = gtk_widget_get_allocated_height (GTK_WIDGET (plane));
|
||||
@@ -57,8 +57,8 @@ plane_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkFontPlane *plane = GTK_FONT_PLANE (widget);
|
||||
int x, y;
|
||||
int width, height;
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
cairo_t *cr;
|
||||
|
||||
val_to_xy (plane, &x, &y);
|
||||
@@ -125,11 +125,11 @@ adjustment_set_normalized_value (GtkAdjustment *adj,
|
||||
|
||||
static void
|
||||
update_value (GtkFontPlane *plane,
|
||||
int x,
|
||||
int y)
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (plane);
|
||||
double u, v;
|
||||
gdouble u, v;
|
||||
|
||||
u = CLAMP (x * (1.0 / gtk_widget_get_allocated_width (widget)), 0, 1);
|
||||
v = CLAMP (1 - y * (1.0 / gtk_widget_get_allocated_height (widget)), 0, 1);
|
||||
@@ -142,8 +142,8 @@ update_value (GtkFontPlane *plane,
|
||||
|
||||
static void
|
||||
plane_drag_gesture_begin (GtkGestureDrag *gesture,
|
||||
double start_x,
|
||||
double start_y,
|
||||
gdouble start_x,
|
||||
gdouble start_y,
|
||||
GtkFontPlane *plane)
|
||||
{
|
||||
guint button;
|
||||
@@ -164,11 +164,11 @@ plane_drag_gesture_begin (GtkGestureDrag *gesture,
|
||||
|
||||
static void
|
||||
plane_drag_gesture_update (GtkGestureDrag *gesture,
|
||||
double offset_x,
|
||||
double offset_y,
|
||||
gdouble offset_x,
|
||||
gdouble offset_y,
|
||||
GtkFontPlane *plane)
|
||||
{
|
||||
double start_x, start_y;
|
||||
gdouble start_x, start_y;
|
||||
|
||||
gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (gesture),
|
||||
&start_x, &start_y);
|
||||
@@ -177,8 +177,8 @@ plane_drag_gesture_update (GtkGestureDrag *gesture,
|
||||
|
||||
static void
|
||||
plane_drag_gesture_end (GtkGestureDrag *gesture,
|
||||
double offset_x,
|
||||
double offset_y,
|
||||
gdouble offset_x,
|
||||
gdouble offset_y,
|
||||
GtkFontPlane *plane)
|
||||
{
|
||||
set_cross_cursor (GTK_WIDGET (plane), FALSE);
|
||||
|
||||
+11
-11
@@ -9,8 +9,8 @@
|
||||
|
||||
static GtkGesture *rotate = NULL;
|
||||
static GtkGesture *zoom = NULL;
|
||||
static double swipe_x = 0;
|
||||
static double swipe_y = 0;
|
||||
static gdouble swipe_x = 0;
|
||||
static gdouble swipe_y = 0;
|
||||
static gboolean long_pressed = FALSE;
|
||||
|
||||
static gboolean
|
||||
@@ -26,8 +26,8 @@ touchpad_swipe_gesture_begin (GtkGesture *gesture,
|
||||
|
||||
static void
|
||||
swipe_gesture_swept (GtkGestureSwipe *gesture,
|
||||
double velocity_x,
|
||||
double velocity_y,
|
||||
gdouble velocity_x,
|
||||
gdouble velocity_y,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
swipe_x = velocity_x / 10;
|
||||
@@ -37,8 +37,8 @@ swipe_gesture_swept (GtkGestureSwipe *gesture,
|
||||
|
||||
static void
|
||||
long_press_gesture_pressed (GtkGestureLongPress *gesture,
|
||||
double x,
|
||||
double y,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
long_pressed = TRUE;
|
||||
@@ -56,8 +56,8 @@ long_press_gesture_end (GtkGesture *gesture,
|
||||
|
||||
static void
|
||||
rotation_angle_changed (GtkGestureRotate *gesture,
|
||||
double angle,
|
||||
double delta,
|
||||
gdouble angle,
|
||||
gdouble delta,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
gtk_widget_queue_draw (widget);
|
||||
@@ -65,7 +65,7 @@ rotation_angle_changed (GtkGestureRotate *gesture,
|
||||
|
||||
static void
|
||||
zoom_scale_changed (GtkGestureZoom *gesture,
|
||||
double scale,
|
||||
gdouble scale,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
gtk_widget_queue_draw (widget);
|
||||
@@ -93,8 +93,8 @@ drawing_area_draw (GtkDrawingArea *area,
|
||||
{
|
||||
cairo_pattern_t *pat;
|
||||
cairo_matrix_t matrix;
|
||||
double angle, scale;
|
||||
double x_center, y_center;
|
||||
gdouble angle, scale;
|
||||
gdouble x_center, y_center;
|
||||
|
||||
gtk_gesture_get_bounding_box_center (GTK_GESTURE (zoom), &x_center, &y_center);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
precision highp float;
|
||||
|
||||
void main() {
|
||||
float lerpVal = gl_FragCoord.y / 500.0;
|
||||
float lerpVal = gl_FragCoord.y / 500.0f;
|
||||
|
||||
gl_FragColor = mix(vec4(1.0, 0.85, 0.35, 1.0), vec4(0.2, 0.2, 0.2, 1.0), lerpVal);
|
||||
gl_FragColor = mix(vec4(1.0f, 0.85f, 0.35f, 1.0f), vec4(0.2f, 0.2f, 0.2f, 1.0f), lerpVal);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ gtk_fishbowl_measure (GtkWidget *widget,
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
GtkFishbowlChild *child;
|
||||
int child_min, child_nat;
|
||||
gint child_min, child_nat;
|
||||
|
||||
*minimum = 0;
|
||||
*natural = 0;
|
||||
|
||||
+12
-12
@@ -18,7 +18,7 @@ static void
|
||||
insert_link (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter,
|
||||
const char *text,
|
||||
int page)
|
||||
gint page)
|
||||
{
|
||||
GtkTextTag *tag;
|
||||
|
||||
@@ -35,7 +35,7 @@ insert_link (GtkTextBuffer *buffer,
|
||||
*/
|
||||
static void
|
||||
show_page (GtkTextBuffer *buffer,
|
||||
int page)
|
||||
gint page)
|
||||
{
|
||||
GtkTextIter iter;
|
||||
|
||||
@@ -91,7 +91,7 @@ follow_if_link (GtkWidget *text_view,
|
||||
for (tagp = tags; tagp != NULL; tagp = tagp->next)
|
||||
{
|
||||
GtkTextTag *tag = tagp->data;
|
||||
int page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
|
||||
gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
|
||||
|
||||
if (page != 0)
|
||||
{
|
||||
@@ -134,14 +134,14 @@ key_pressed (GtkEventController *controller,
|
||||
}
|
||||
|
||||
static void set_cursor_if_appropriate (GtkTextView *text_view,
|
||||
int x,
|
||||
int y);
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
static void
|
||||
released_cb (GtkGestureClick *gesture,
|
||||
guint n_press,
|
||||
double x,
|
||||
double y,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkWidget *text_view)
|
||||
{
|
||||
GtkTextIter start, end, iter;
|
||||
@@ -168,8 +168,8 @@ released_cb (GtkGestureClick *gesture,
|
||||
|
||||
static void
|
||||
motion_cb (GtkEventControllerMotion *controller,
|
||||
double x,
|
||||
double y,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkTextView *text_view)
|
||||
{
|
||||
set_cursor_if_appropriate (text_view, x, y);
|
||||
@@ -183,8 +183,8 @@ static gboolean hovering_over_link = FALSE;
|
||||
*/
|
||||
static void
|
||||
set_cursor_if_appropriate (GtkTextView *text_view,
|
||||
int x,
|
||||
int y)
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GSList *tags = NULL, *tagp = NULL;
|
||||
GtkTextIter iter;
|
||||
@@ -196,7 +196,7 @@ set_cursor_if_appropriate (GtkTextView *text_view,
|
||||
for (tagp = tags; tagp != NULL; tagp = tagp->next)
|
||||
{
|
||||
GtkTextTag *tag = tagp->data;
|
||||
int page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
|
||||
gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
|
||||
|
||||
if (page != 0)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ enum
|
||||
|
||||
|
||||
static GdkPixbuf *file_pixbuf, *folder_pixbuf;
|
||||
char *parent;
|
||||
gchar *parent;
|
||||
GtkWidget *up_button;
|
||||
|
||||
/* Loads the images for the demo and returns whether the operation succeeded */
|
||||
@@ -47,7 +47,7 @@ static void
|
||||
fill_store (GtkListStore *store)
|
||||
{
|
||||
GDir *dir;
|
||||
const char *name;
|
||||
const gchar *name;
|
||||
GtkTreeIter iter;
|
||||
|
||||
/* First clear the store */
|
||||
@@ -62,7 +62,7 @@ fill_store (GtkListStore *store)
|
||||
name = g_dir_read_name (dir);
|
||||
while (name != NULL)
|
||||
{
|
||||
char *path, *display_name;
|
||||
gchar *path, *display_name;
|
||||
gboolean is_dir;
|
||||
|
||||
/* We ignore hidden files that start with a '.' */
|
||||
@@ -90,14 +90,14 @@ fill_store (GtkListStore *store)
|
||||
g_dir_close (dir);
|
||||
}
|
||||
|
||||
static int
|
||||
static gint
|
||||
sort_func (GtkTreeModel *model,
|
||||
GtkTreeIter *a,
|
||||
GtkTreeIter *b,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean is_dir_a, is_dir_b;
|
||||
char *name_a, *name_b;
|
||||
gchar *name_a, *name_b;
|
||||
int ret;
|
||||
|
||||
/* We need this function because we want to sort
|
||||
@@ -158,7 +158,7 @@ item_activated (GtkIconView *icon_view,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkListStore *store;
|
||||
char *path;
|
||||
gchar *path;
|
||||
GtkTreeIter iter;
|
||||
gboolean is_dir;
|
||||
|
||||
@@ -192,7 +192,7 @@ up_clicked (GtkButton *item,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkListStore *store;
|
||||
char *dir_name;
|
||||
gchar *dir_name;
|
||||
|
||||
store = GTK_LIST_STORE (user_data);
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ static void
|
||||
fill_store (GtkListStore *store)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
const char *text[] = { "Red", "Green", "Blue", "Yellow" };
|
||||
int i;
|
||||
const gchar *text[] = { "Red", "Green", "Blue", "Yellow" };
|
||||
gint i;
|
||||
|
||||
/* First clear the store */
|
||||
gtk_list_store_clear (store);
|
||||
@@ -49,7 +49,7 @@ set_cell_color (GtkCellLayout *cell_layout,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
char *text;
|
||||
gchar *text;
|
||||
GdkRGBA color;
|
||||
guint32 pixel = 0;
|
||||
GdkPixbuf *pixbuf;
|
||||
@@ -60,10 +60,10 @@ set_cell_color (GtkCellLayout *cell_layout,
|
||||
|
||||
if (gdk_rgba_parse (&color, text))
|
||||
pixel =
|
||||
((int)(color.red * 255)) << 24 |
|
||||
((int)(color.green * 255)) << 16 |
|
||||
((int)(color.blue * 255)) << 8 |
|
||||
((int)(color.alpha * 255));
|
||||
((gint)(color.red * 255)) << 24 |
|
||||
((gint)(color.green * 255)) << 16 |
|
||||
((gint)(color.blue * 255)) << 8 |
|
||||
((gint)(color.alpha * 255));
|
||||
|
||||
g_free (text);
|
||||
|
||||
@@ -77,8 +77,8 @@ set_cell_color (GtkCellLayout *cell_layout,
|
||||
|
||||
static void
|
||||
edited (GtkCellRendererText *cell,
|
||||
char *path_string,
|
||||
char *text,
|
||||
gchar *path_string,
|
||||
gchar *text,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreeModel *model;
|
||||
|
||||
@@ -43,10 +43,10 @@ progressive_prepared_callback (GdkPixbufLoader *loader,
|
||||
|
||||
static void
|
||||
progressive_updated_callback (GdkPixbufLoader *loader,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *picture;
|
||||
@@ -58,7 +58,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
|
||||
gtk_picture_set_pixbuf (GTK_PICTURE (picture), pixbuf);
|
||||
}
|
||||
|
||||
static int
|
||||
static gint
|
||||
progressive_timeout (gpointer data)
|
||||
{
|
||||
GtkWidget *picture;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
static void
|
||||
on_bar_response (GtkInfoBar *info_bar,
|
||||
int response_id,
|
||||
gint response_id,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
static void
|
||||
response_cb (GtkWidget *dialog,
|
||||
int response_id,
|
||||
gint response_id,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_window_destroy (GTK_WINDOW (dialog));
|
||||
@@ -17,7 +17,7 @@ response_cb (GtkWidget *dialog,
|
||||
|
||||
static gboolean
|
||||
activate_link (GtkWidget *label,
|
||||
const char *uri,
|
||||
const gchar *uri,
|
||||
gpointer data)
|
||||
{
|
||||
if (g_strcmp0 (uri, "keynav") == 0)
|
||||
|
||||
@@ -81,7 +81,7 @@ spinner_timeout (gpointer data)
|
||||
static GtkTreeModel *
|
||||
create_model (void)
|
||||
{
|
||||
int i = 0;
|
||||
gint i = 0;
|
||||
GtkListStore *store;
|
||||
GtkTreeIter iter;
|
||||
|
||||
|
||||
@@ -84,6 +84,9 @@
|
||||
<property name="yalign">0</property>
|
||||
<property name="label" translatable="0">Message</property>
|
||||
<property name="wrap">1</property>
|
||||
<accessibility>
|
||||
<role type="static"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -181,17 +184,27 @@
|
||||
<property name="margin-bottom">2</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_reshares_label">
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_reshares_label">
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
Reshares</property>
|
||||
<property name="use-markup">1</property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_favorites_label">
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
<object class="GtkFrame" id="frame2">
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_favorites_label">
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
FAVORITES</property>
|
||||
<property name="use-markup">1</property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -166,6 +166,14 @@ do_listview_applauncher (GtkWidget *do_widget)
|
||||
g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL);
|
||||
g_signal_connect (factory, "bind", G_CALLBACK (bind_listitem_cb), NULL);
|
||||
|
||||
/* Create the list widget here.
|
||||
*/
|
||||
list = gtk_list_view_new_with_factory (factory);
|
||||
/* We connect the activate signal here. It's the function we defined
|
||||
* above for launching the selected application.
|
||||
*/
|
||||
g_signal_connect (list, "activate", G_CALLBACK (activate_cb), NULL);
|
||||
|
||||
/* And of course we need to set the data model. Here we call the function
|
||||
* we wrote above that gives us the list of applications. Then we set
|
||||
* it on the list widget.
|
||||
@@ -173,15 +181,8 @@ do_listview_applauncher (GtkWidget *do_widget)
|
||||
* to create as many listitems as it needs to show itself to the user.
|
||||
*/
|
||||
model = create_application_list ();
|
||||
|
||||
/* Create the list widget here.
|
||||
*/
|
||||
list = gtk_list_view_new_with_factory (model, factory);
|
||||
|
||||
/* We connect the activate signal here. It's the function we defined
|
||||
* above for launching the selected application.
|
||||
*/
|
||||
g_signal_connect (list, "activate", G_CALLBACK (activate_cb), NULL);
|
||||
gtk_list_view_set_model (GTK_LIST_VIEW (list), model);
|
||||
g_object_unref (model);
|
||||
|
||||
/* List widgets should always be contained in a #GtkScrolledWindow,
|
||||
* because otherwise they might get too large or they might not
|
||||
|
||||
@@ -463,6 +463,7 @@ do_listview_clocks (GtkWidget *do_widget)
|
||||
GtkWidget *gridview, *sw;
|
||||
GtkListItemFactory *factory;
|
||||
GListModel *model;
|
||||
GtkNoSelection *selection;
|
||||
|
||||
/* This is the normal window setup code every demo does */
|
||||
window = gtk_window_new ();
|
||||
@@ -484,12 +485,16 @@ do_listview_clocks (GtkWidget *do_widget)
|
||||
factory = gtk_signal_list_item_factory_new ();
|
||||
g_signal_connect (factory, "setup", G_CALLBACK (setup_listitem_cb), NULL);
|
||||
|
||||
model = G_LIST_MODEL (gtk_no_selection_new (create_clocks_model ()));
|
||||
gridview = gtk_grid_view_new_with_factory (model, factory);
|
||||
gridview = gtk_grid_view_new_with_factory (factory);
|
||||
gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
|
||||
gtk_scrollable_set_vscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
|
||||
|
||||
model = create_clocks_model ();
|
||||
selection = gtk_no_selection_new (model);
|
||||
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), G_LIST_MODEL (selection));
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview);
|
||||
g_object_unref (selection);
|
||||
g_object_unref (model);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
@@ -89,14 +89,14 @@ static GParamSpec *color_properties[N_COLOR_PROPS] = { NULL, };
|
||||
|
||||
static void
|
||||
rgb_to_hsv (GdkRGBA *rgba,
|
||||
double *h_out,
|
||||
double *s_out,
|
||||
double *v_out)
|
||||
gdouble *h_out,
|
||||
gdouble *s_out,
|
||||
gdouble *v_out)
|
||||
{
|
||||
double red, green, blue;
|
||||
double h, s, v;
|
||||
double min, max;
|
||||
double delta;
|
||||
gdouble red, green, blue;
|
||||
gdouble h, s, v;
|
||||
gdouble min, max;
|
||||
gdouble delta;
|
||||
|
||||
red = rgba->red;
|
||||
green = rgba->green;
|
||||
@@ -662,8 +662,9 @@ create_color_grid (void)
|
||||
{
|
||||
GtkWidget *gridview;
|
||||
GtkListItemFactory *factory;
|
||||
GListModel *model, *selection;
|
||||
|
||||
gridview = gtk_grid_view_new (NULL);
|
||||
gridview = gtk_grid_view_new ();
|
||||
gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
|
||||
gtk_scrollable_set_vscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
|
||||
|
||||
@@ -675,6 +676,13 @@ create_color_grid (void)
|
||||
gtk_grid_view_set_max_columns (GTK_GRID_VIEW (gridview), 24);
|
||||
gtk_grid_view_set_enable_rubberband (GTK_GRID_VIEW (gridview), TRUE);
|
||||
|
||||
model = G_LIST_MODEL (gtk_sort_list_model_new (gtk_color_list_new (0), NULL));
|
||||
|
||||
selection = G_LIST_MODEL (gtk_multi_selection_new (model));
|
||||
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), selection);
|
||||
g_object_unref (selection);
|
||||
g_object_unref (model);
|
||||
|
||||
return gridview;
|
||||
}
|
||||
|
||||
@@ -827,22 +835,6 @@ update_selection_average (GListModel *model,
|
||||
g_object_unref (color);
|
||||
}
|
||||
|
||||
static void
|
||||
update_progress_cb (GtkSortListModel *model,
|
||||
GParamSpec *pspec,
|
||||
GtkProgressBar *progress)
|
||||
{
|
||||
guint total;
|
||||
guint pending;
|
||||
|
||||
total = g_list_model_get_n_items (G_LIST_MODEL (model));
|
||||
total = MAX (total, 1); /* avoid div by 0 below */
|
||||
pending = gtk_sort_list_model_get_pending (model);
|
||||
|
||||
gtk_widget_set_visible (GTK_WIDGET (progress), pending != 0);
|
||||
gtk_progress_bar_set_fraction (progress, (total - pending) / (double) total);
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
@@ -850,11 +842,10 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
{
|
||||
if (window == NULL)
|
||||
{
|
||||
GtkMultiSelection *selection;
|
||||
GtkSortListModel *sort_model;
|
||||
GtkWidget *header, *overlay, *gridview, *sw, *box, *dropdown;
|
||||
GtkWidget *header, *gridview, *sw, *box, *dropdown;
|
||||
GtkListItemFactory *factory;
|
||||
GListStore *factories;
|
||||
GListModel *model;
|
||||
GtkSorter *sorter;
|
||||
GtkSorter *multi_sorter;
|
||||
GListStore *sorters;
|
||||
@@ -872,7 +863,6 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
GtkWidget *selection_average_picture;
|
||||
GtkWidget *selection_info_toggle;
|
||||
GtkWidget *selection_info_revealer;
|
||||
GtkWidget *progress;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
@@ -882,10 +872,6 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
800);
|
||||
g_object_unref (provider);
|
||||
|
||||
sort_model = gtk_sort_list_model_new (gtk_color_list_new (0), NULL);
|
||||
gtk_sort_list_model_set_incremental (sort_model, TRUE);
|
||||
selection = gtk_multi_selection_new (G_LIST_MODEL (sort_model));
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Colors");
|
||||
header = gtk_header_bar_new ();
|
||||
@@ -896,17 +882,8 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer*)&window);
|
||||
|
||||
overlay = gtk_overlay_new ();
|
||||
gtk_window_set_child (GTK_WINDOW (window), overlay);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_overlay_set_child (GTK_OVERLAY (overlay), box);
|
||||
|
||||
progress = gtk_progress_bar_new ();
|
||||
gtk_widget_set_hexpand (progress, TRUE);
|
||||
gtk_widget_set_valign (progress, GTK_ALIGN_START);
|
||||
g_signal_connect (sort_model, "notify::pending", G_CALLBACK (update_progress_cb), progress);
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), progress);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
||||
selection_info_revealer = gtk_revealer_new ();
|
||||
gtk_box_append (GTK_BOX (box), selection_info_revealer);
|
||||
@@ -950,7 +927,7 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
|
||||
factory = gtk_signal_list_item_factory_new ();
|
||||
g_signal_connect (factory, "setup", G_CALLBACK (setup_selection_listitem_cb), NULL);
|
||||
selection_view = gtk_grid_view_new_with_factory (NULL, factory);
|
||||
selection_view = gtk_grid_view_new_with_factory (factory);
|
||||
gtk_widget_add_css_class (selection_view, "compact");
|
||||
gtk_grid_view_set_max_columns (GTK_GRID_VIEW (selection_view), 200);
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), selection_view);
|
||||
@@ -959,19 +936,23 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
gtk_box_append (GTK_BOX (box), sw);
|
||||
|
||||
gridview = create_color_grid ();
|
||||
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), G_LIST_MODEL (selection));
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview);
|
||||
gtk_widget_set_hexpand (sw, TRUE);
|
||||
gtk_widget_set_vexpand (sw, TRUE);
|
||||
model = gtk_grid_view_get_model (GTK_GRID_VIEW (gridview));
|
||||
|
||||
selection_filter = G_LIST_MODEL (gtk_selection_filter_model_new (GTK_SELECTION_MODEL (selection)));
|
||||
selection_filter = G_LIST_MODEL (gtk_selection_filter_model_new (GTK_SELECTION_MODEL (model)));
|
||||
g_signal_connect (selection_filter, "items-changed", G_CALLBACK (update_selection_count), selection_size_label);
|
||||
g_signal_connect (selection_filter, "items-changed", G_CALLBACK (update_selection_average), selection_average_picture);
|
||||
|
||||
no_selection = G_LIST_MODEL (gtk_no_selection_new (selection_filter));
|
||||
gtk_grid_view_set_model (GTK_GRID_VIEW (selection_view), no_selection);
|
||||
g_object_unref (selection_filter);
|
||||
g_object_unref (no_selection);
|
||||
|
||||
model = gtk_multi_selection_get_model (GTK_MULTI_SELECTION (model));
|
||||
g_object_ref (model);
|
||||
|
||||
selection_info_toggle = gtk_toggle_button_new ();
|
||||
gtk_button_set_icon_name (GTK_BUTTON (selection_info_toggle), "emblem-important-symbolic");
|
||||
gtk_widget_set_tooltip_text (selection_info_toggle, "Show selection info");
|
||||
@@ -984,7 +965,7 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
button = gtk_button_new_with_mnemonic ("_Refill");
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (refill),
|
||||
gtk_sort_list_model_get_model (sort_model));
|
||||
gtk_sort_list_model_get_model (GTK_SORT_LIST_MODEL (model)));
|
||||
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), button);
|
||||
|
||||
@@ -999,13 +980,15 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
gtk_label_set_width_chars (GTK_LABEL (label), len + 2);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 1);
|
||||
|
||||
g_signal_connect (selection, "items-changed", G_CALLBACK (items_changed_cb), label);
|
||||
g_signal_connect (gtk_grid_view_get_model (GTK_GRID_VIEW (gridview)),
|
||||
"items-changed", G_CALLBACK (items_changed_cb), label);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), label);
|
||||
|
||||
dropdown = gtk_drop_down_new_from_strings ((const char * const[]) { "8", "64", "512", "4096", "32768", "262144", "2097152", "16777216", NULL });
|
||||
dropdown = gtk_drop_down_new ();
|
||||
gtk_drop_down_set_from_strings (GTK_DROP_DOWN (dropdown), (const char *[]) { "8", "64", "512", "4096", "32768", "262144", "2097152", "16777216", NULL });
|
||||
g_signal_connect (dropdown, "notify::selected",
|
||||
G_CALLBACK (limit_changed_cb),
|
||||
gtk_sort_list_model_get_model (sort_model));
|
||||
gtk_sort_list_model_get_model (GTK_SORT_LIST_MODEL (model)));
|
||||
g_signal_connect (dropdown, "notify::selected",
|
||||
G_CALLBACK (limit_changed_cb2),
|
||||
label);
|
||||
@@ -1080,19 +1063,24 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
g_list_store_append (sorters, multi_sorter);
|
||||
g_object_unref (multi_sorter);
|
||||
|
||||
expression = gtk_cclosure_expression_new (G_TYPE_STRING,
|
||||
NULL,
|
||||
0, NULL,
|
||||
(GCallback)get_title,
|
||||
NULL, NULL);
|
||||
|
||||
dropdown = gtk_drop_down_new (G_LIST_MODEL (sorters), expression);
|
||||
dropdown = gtk_drop_down_new ();
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_box_append (GTK_BOX (box), gtk_label_new ("Sort by:"));
|
||||
gtk_box_append (GTK_BOX (box), dropdown);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box);
|
||||
|
||||
g_object_bind_property (dropdown, "selected-item", sort_model, "sorter", G_BINDING_SYNC_CREATE);
|
||||
expression = gtk_cclosure_expression_new (G_TYPE_STRING,
|
||||
NULL,
|
||||
0, NULL,
|
||||
(GCallback)get_title,
|
||||
NULL, NULL);
|
||||
gtk_drop_down_set_expression (GTK_DROP_DOWN (dropdown), expression);
|
||||
gtk_expression_unref (expression);
|
||||
|
||||
gtk_drop_down_set_model (GTK_DROP_DOWN (dropdown), G_LIST_MODEL (sorters));
|
||||
g_object_unref (sorters);
|
||||
|
||||
g_object_bind_property (dropdown, "selected-item", model, "sorter", G_BINDING_SYNC_CREATE);
|
||||
|
||||
factories = g_list_store_new (GTK_TYPE_LIST_ITEM_FACTORY);
|
||||
|
||||
@@ -1106,18 +1094,25 @@ do_listview_colors (GtkWidget *do_widget)
|
||||
set_title (factory, "Everything");
|
||||
g_list_store_append (factories, factory);
|
||||
|
||||
expression = gtk_cclosure_expression_new (G_TYPE_STRING,
|
||||
NULL,
|
||||
0, NULL,
|
||||
(GCallback)get_title,
|
||||
NULL, NULL);
|
||||
dropdown = gtk_drop_down_new (G_LIST_MODEL (factories), expression);
|
||||
dropdown = gtk_drop_down_new ();
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_box_append (GTK_BOX (box), gtk_label_new ("Show:"));
|
||||
gtk_box_append (GTK_BOX (box), dropdown);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), box);
|
||||
|
||||
expression = gtk_cclosure_expression_new (G_TYPE_STRING,
|
||||
NULL,
|
||||
0, NULL,
|
||||
(GCallback)get_title,
|
||||
NULL, NULL);
|
||||
gtk_drop_down_set_expression (GTK_DROP_DOWN (dropdown), expression);
|
||||
gtk_expression_unref (expression);
|
||||
|
||||
gtk_drop_down_set_model (GTK_DROP_DOWN (dropdown), G_LIST_MODEL (factories));
|
||||
g_object_unref (factories);
|
||||
|
||||
g_object_bind_property (dropdown, "selected-item", gridview, "factory", G_BINDING_SYNC_CREATE);
|
||||
g_object_unref (model);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
@@ -214,6 +214,7 @@ transform_settings_to_keys (GBinding *binding,
|
||||
GtkSortListModel *sort_model;
|
||||
GtkFilterListModel *filter_model;
|
||||
GtkFilter *filter;
|
||||
GtkNoSelection *selection_model;
|
||||
char **keys;
|
||||
guint i;
|
||||
|
||||
@@ -241,13 +242,21 @@ transform_settings_to_keys (GBinding *binding,
|
||||
g_object_unref (settings);
|
||||
|
||||
sort_model = gtk_sort_list_model_new (G_LIST_MODEL (store),
|
||||
g_object_ref (gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data))));
|
||||
gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data)));
|
||||
g_object_unref (store);
|
||||
|
||||
filter = gtk_string_filter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name"));
|
||||
g_set_object (¤t_filter, filter);
|
||||
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (sort_model), filter);
|
||||
g_object_unref (sort_model);
|
||||
|
||||
g_value_take_object (to_value, gtk_no_selection_new (G_LIST_MODEL (filter_model)));
|
||||
g_set_object (¤t_filter, filter);
|
||||
|
||||
g_object_unref (filter);
|
||||
|
||||
selection_model = gtk_no_selection_new (G_LIST_MODEL (filter_model));
|
||||
g_object_unref (filter_model);
|
||||
|
||||
g_value_take_object (to_value, selection_model);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -394,8 +403,8 @@ do_listview_settings (GtkWidget *do_widget)
|
||||
g_object_unref (actions);
|
||||
|
||||
model = create_settings_model (NULL, NULL);
|
||||
treemodel = gtk_tree_list_model_new (model,
|
||||
FALSE,
|
||||
treemodel = gtk_tree_list_model_new (FALSE,
|
||||
model,
|
||||
TRUE,
|
||||
create_settings_model,
|
||||
NULL,
|
||||
@@ -409,6 +418,8 @@ do_listview_settings (GtkWidget *do_widget)
|
||||
columnview, NULL);
|
||||
gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
|
||||
g_object_unref (selection);
|
||||
g_object_unref (treemodel);
|
||||
g_object_unref (model);
|
||||
|
||||
name_column = GTK_COLUMN_VIEW_COLUMN (gtk_builder_get_object (builder, "name_column"));
|
||||
sorter = gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name"));
|
||||
|
||||
@@ -281,16 +281,20 @@ GtkWidget *
|
||||
create_weather_view (void)
|
||||
{
|
||||
GtkWidget *listview;
|
||||
GListModel *model;
|
||||
GListModel *model, *selection;
|
||||
GtkListItemFactory *factory;
|
||||
|
||||
factory = gtk_signal_list_item_factory_new ();
|
||||
g_signal_connect (factory, "setup", G_CALLBACK (setup_widget), NULL);
|
||||
g_signal_connect (factory, "bind", G_CALLBACK (bind_widget), NULL);
|
||||
model = G_LIST_MODEL (gtk_no_selection_new (create_weather_model ()));
|
||||
listview = gtk_list_view_new_with_factory (model, factory);
|
||||
listview = gtk_list_view_new_with_factory (factory);
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (listview), GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_list_view_set_show_separators (GTK_LIST_VIEW (listview), TRUE);
|
||||
model = create_weather_model ();
|
||||
selection = G_LIST_MODEL (gtk_no_selection_new (model));
|
||||
gtk_list_view_set_model (GTK_LIST_VIEW (listview), selection);
|
||||
g_object_unref (selection);
|
||||
g_object_unref (model);
|
||||
|
||||
return listview;
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@ do_listview_words (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *header, *listview, *sw, *vbox, *search_entry, *open_button, *overlay;
|
||||
GtkFilterListModel *filter_model;
|
||||
GtkNoSelection *selection;
|
||||
GtkStringList *stringlist;
|
||||
GtkFilter *filter;
|
||||
GFile *file;
|
||||
@@ -214,15 +215,18 @@ do_listview_words (GtkWidget *do_widget)
|
||||
gtk_overlay_set_child (GTK_OVERLAY (overlay), sw);
|
||||
|
||||
listview = gtk_list_view_new_with_factory (
|
||||
G_LIST_MODEL (gtk_no_selection_new (G_LIST_MODEL (filter_model))),
|
||||
gtk_builder_list_item_factory_new_from_bytes (NULL,
|
||||
g_bytes_new_static (factory_text, strlen (factory_text))));
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
|
||||
selection = gtk_no_selection_new (G_LIST_MODEL (filter_model));
|
||||
gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
|
||||
g_object_unref (selection);
|
||||
|
||||
g_signal_connect (filter_model, "items-changed", G_CALLBACK (update_title_cb), progress);
|
||||
g_signal_connect (filter_model, "notify::pending", G_CALLBACK (update_title_cb), progress);
|
||||
update_title_cb (filter_model);
|
||||
|
||||
g_object_unref (filter_model);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
+33
-30
@@ -13,7 +13,7 @@
|
||||
static GtkWidget *info_view;
|
||||
static GtkWidget *source_view;
|
||||
|
||||
static char *current_file = NULL;
|
||||
static gchar *current_file = NULL;
|
||||
|
||||
static GtkWidget *notebook;
|
||||
static GtkSingleSelection *selection;
|
||||
@@ -141,7 +141,7 @@ activate_about (GSimpleAction *action,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkApplication *app = user_data;
|
||||
const char *authors[] = {
|
||||
const gchar *authors[] = {
|
||||
"The GTK Team",
|
||||
NULL
|
||||
};
|
||||
@@ -252,9 +252,11 @@ static const char *types[] =
|
||||
"static",
|
||||
"const ",
|
||||
"void",
|
||||
"gint",
|
||||
" int ",
|
||||
" char ",
|
||||
"char ",
|
||||
"gchar ",
|
||||
"gfloat",
|
||||
"float",
|
||||
"double",
|
||||
"gint8",
|
||||
@@ -270,6 +272,8 @@ static const char *types[] =
|
||||
"gshort",
|
||||
"gushort",
|
||||
"gulong",
|
||||
"gdouble",
|
||||
"gldouble",
|
||||
"gpointer",
|
||||
"NULL",
|
||||
"GList",
|
||||
@@ -381,14 +385,14 @@ static const char *control[] =
|
||||
NULL
|
||||
};
|
||||
void
|
||||
parse_chars (char *text,
|
||||
char **end_ptr,
|
||||
int *state,
|
||||
parse_chars (gchar *text,
|
||||
gchar **end_ptr,
|
||||
gint *state,
|
||||
const char **tag,
|
||||
gboolean start)
|
||||
{
|
||||
int i;
|
||||
char *next_token;
|
||||
gint i;
|
||||
gchar *next_token;
|
||||
|
||||
/* Handle comments first */
|
||||
if (*state == STATE_IN_COMMENT)
|
||||
@@ -458,7 +462,7 @@ parse_chars (char *text,
|
||||
/* check for string */
|
||||
if (text[0] == '"')
|
||||
{
|
||||
int maybe_escape = FALSE;
|
||||
gint maybe_escape = FALSE;
|
||||
|
||||
*end_ptr = text + 1;
|
||||
*tag = "string";
|
||||
@@ -521,9 +525,9 @@ void
|
||||
fontify (GtkTextBuffer *source_buffer)
|
||||
{
|
||||
GtkTextIter start_iter, next_iter, tmp_iter;
|
||||
int state;
|
||||
char *text;
|
||||
char *start_ptr, *end_ptr;
|
||||
gint state;
|
||||
gchar *text;
|
||||
gchar *start_ptr, *end_ptr;
|
||||
const char *tag;
|
||||
|
||||
gtk_text_buffer_create_tag (source_buffer, "source",
|
||||
@@ -691,10 +695,10 @@ static struct {
|
||||
};
|
||||
|
||||
static void
|
||||
add_data_tab (const char *demoname)
|
||||
add_data_tab (const gchar *demoname)
|
||||
{
|
||||
char *resource_dir, *resource_name;
|
||||
char **resources;
|
||||
gchar *resource_dir, *resource_name;
|
||||
gchar **resources;
|
||||
GtkWidget *widget, *label;
|
||||
guint i, j;
|
||||
|
||||
@@ -738,15 +742,15 @@ add_data_tab (const char *demoname)
|
||||
static void
|
||||
remove_data_tabs (void)
|
||||
{
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
for (i = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) - 1; i > 1; i--)
|
||||
gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), i);
|
||||
}
|
||||
|
||||
void
|
||||
load_file (const char *demoname,
|
||||
const char *filename)
|
||||
load_file (const gchar *demoname,
|
||||
const gchar *filename)
|
||||
{
|
||||
GtkTextBuffer *info_buffer, *source_buffer;
|
||||
GtkTextIter start, end;
|
||||
@@ -754,9 +758,9 @@ load_file (const char *demoname,
|
||||
GError *err = NULL;
|
||||
int state = 0;
|
||||
gboolean in_para = 0;
|
||||
char **lines;
|
||||
gchar **lines;
|
||||
GBytes *bytes;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
if (!g_strcmp0 (current_file, filename))
|
||||
return;
|
||||
@@ -796,9 +800,9 @@ load_file (const char *demoname,
|
||||
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
|
||||
for (i = 0; lines[i] != NULL; i++)
|
||||
{
|
||||
char *p;
|
||||
char *q;
|
||||
char *r;
|
||||
gchar *p;
|
||||
gchar *q;
|
||||
gchar *r;
|
||||
|
||||
/* Make sure \r is stripped at the end for the poor windows people */
|
||||
lines[i] = g_strchomp (lines[i]);
|
||||
@@ -1136,8 +1140,8 @@ activate (GApplication *app)
|
||||
g_signal_connect (search_bar, "notify::search-mode-enabled", G_CALLBACK (clear_search), NULL);
|
||||
|
||||
listmodel = create_demo_model ();
|
||||
treemodel = gtk_tree_list_model_new (G_LIST_MODEL (listmodel),
|
||||
FALSE,
|
||||
treemodel = gtk_tree_list_model_new (FALSE,
|
||||
G_LIST_MODEL (listmodel),
|
||||
TRUE,
|
||||
get_child_model,
|
||||
NULL,
|
||||
@@ -1145,7 +1149,6 @@ activate (GApplication *app)
|
||||
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (treemodel), NULL);
|
||||
filter = gtk_custom_filter_new ((GtkCustomFilterFunc)demo_filter_by_name, filter_model, NULL);
|
||||
gtk_filter_list_model_set_filter (filter_model, filter);
|
||||
g_object_unref (filter);
|
||||
search_entry = GTK_WIDGET (gtk_builder_get_object (builder, "search-entry"));
|
||||
g_signal_connect (search_entry, "search-changed", G_CALLBACK (demo_search_changed_cb), filter);
|
||||
|
||||
@@ -1187,12 +1190,12 @@ list_demos (void)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
static gint
|
||||
command_line (GApplication *app,
|
||||
GApplicationCommandLine *cmdline)
|
||||
{
|
||||
GVariantDict *options;
|
||||
const char *name = NULL;
|
||||
const gchar *name = NULL;
|
||||
gboolean autoquit = FALSE;
|
||||
gboolean list = FALSE;
|
||||
DemoData *d, *c;
|
||||
@@ -1295,8 +1298,8 @@ main (int argc, char **argv)
|
||||
{ "inspector", activate_inspector, NULL, NULL, NULL },
|
||||
};
|
||||
struct {
|
||||
const char *action_and_target;
|
||||
const char *accelerators[2];
|
||||
const gchar *action_and_target;
|
||||
const gchar *accelerators[2];
|
||||
} accels[] = {
|
||||
{ "app.about", { "F1", NULL } },
|
||||
{ "app.quit", { "<Control>q", NULL } },
|
||||
|
||||
@@ -21,7 +21,7 @@ source_toggled (GtkToggleButton *button)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, end;
|
||||
char *markup;
|
||||
gchar *markup;
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view2));
|
||||
gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
@@ -50,7 +50,7 @@ do_markup (GtkWidget *do_widget)
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
GBytes *bytes;
|
||||
const char *markup;
|
||||
const gchar *markup;
|
||||
GtkWidget *header;
|
||||
GtkWidget *show_source;
|
||||
|
||||
@@ -102,7 +102,7 @@ do_markup (GtkWidget *do_widget)
|
||||
gtk_stack_add_named (GTK_STACK (stack), sw, "source");
|
||||
|
||||
bytes = g_resources_lookup_data ("/markup/markup.txt", 0, NULL);
|
||||
markup = (const char *)g_bytes_get_data (bytes, NULL);
|
||||
markup = (const gchar *)g_bytes_get_data (bytes, NULL);
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
||||
gtk_text_buffer_get_start_iter (buffer, &iter);
|
||||
|
||||
@@ -31,11 +31,6 @@
|
||||
<update_contact>matthias.clasen_at_gmail.com</update_contact>
|
||||
<developer_name>Matthias Clasen and others</developer_name>
|
||||
<releases>
|
||||
<release version="3.99.0" date="2020-07-30">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="3.94.0" date="2018-06-25">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
|
||||
@@ -12,9 +12,9 @@ static void
|
||||
margin_changed (GtkAdjustment *adjustment,
|
||||
GtkTextView *text)
|
||||
{
|
||||
int value;
|
||||
gint value;
|
||||
|
||||
value = (int)gtk_adjustment_get_value (adjustment);
|
||||
value = (gint)gtk_adjustment_get_value (adjustment);
|
||||
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (text), value);
|
||||
g_object_set (tag, "pixels-above-lines", value, NULL);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <gtk/gtkunixprint.h>
|
||||
|
||||
static void
|
||||
done_cb (GtkDialog *dialog, int response, gpointer data)
|
||||
done_cb (GtkDialog *dialog, gint response, gpointer data)
|
||||
{
|
||||
gtk_window_destroy (GTK_WINDOW (dialog));
|
||||
}
|
||||
|
||||
+15
-15
@@ -20,7 +20,7 @@ typedef struct
|
||||
cairo_t *cr;
|
||||
GdkRGBA draw_color;
|
||||
GtkPadController *pad_controller;
|
||||
double brush_size;
|
||||
gdouble brush_size;
|
||||
} DrawingArea;
|
||||
|
||||
typedef struct
|
||||
@@ -38,7 +38,7 @@ static GtkPadActionEntry pad_actions[] = {
|
||||
{ GTK_PAD_ACTION_STRIP, -1, -1, N_("Brush size"), "pad.brush_size" },
|
||||
};
|
||||
|
||||
static const char *pad_colors[] = {
|
||||
static const gchar *pad_colors[] = {
|
||||
"black",
|
||||
"pink",
|
||||
"green",
|
||||
@@ -55,8 +55,8 @@ static void drawing_area_set_color (DrawingArea *area,
|
||||
|
||||
static void
|
||||
drawing_area_ensure_surface (DrawingArea *area,
|
||||
int width,
|
||||
int height)
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
if (!area->surface ||
|
||||
cairo_image_surface_get_width (area->surface) != width ||
|
||||
@@ -154,7 +154,7 @@ on_pad_button_activate (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
DrawingArea *area)
|
||||
{
|
||||
const char *color = g_object_get_data (G_OBJECT (action), "color");
|
||||
const gchar *color = g_object_get_data (G_OBJECT (action), "color");
|
||||
GdkRGBA rgba;
|
||||
|
||||
gdk_rgba_parse (&rgba, color);
|
||||
@@ -166,7 +166,7 @@ on_pad_knob_change (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
DrawingArea *area)
|
||||
{
|
||||
double value = g_variant_get_double (parameter);
|
||||
gdouble value = g_variant_get_double (parameter);
|
||||
|
||||
area->brush_size = value;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ drawing_area_root (GtkWidget *widget)
|
||||
GSimpleActionGroup *action_group;
|
||||
GSimpleAction *action;
|
||||
GtkWidget *toplevel;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
GTK_WIDGET_CLASS (drawing_area_parent_class)->root (widget);
|
||||
|
||||
@@ -255,9 +255,9 @@ drawing_area_class_init (DrawingAreaClass *klass)
|
||||
static void
|
||||
drawing_area_apply_stroke (DrawingArea *area,
|
||||
GdkDeviceTool *tool,
|
||||
double x,
|
||||
double y,
|
||||
double pressure)
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble pressure)
|
||||
{
|
||||
if (gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
|
||||
{
|
||||
@@ -281,8 +281,8 @@ drawing_area_apply_stroke (DrawingArea *area,
|
||||
|
||||
static void
|
||||
stylus_gesture_down (GtkGestureStylus *gesture,
|
||||
double x,
|
||||
double y,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
DrawingArea *area)
|
||||
{
|
||||
cairo_new_path (area->cr);
|
||||
@@ -290,13 +290,13 @@ stylus_gesture_down (GtkGestureStylus *gesture,
|
||||
|
||||
static void
|
||||
stylus_gesture_motion (GtkGestureStylus *gesture,
|
||||
double x,
|
||||
double y,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
DrawingArea *area)
|
||||
{
|
||||
GdkTimeCoord *backlog;
|
||||
GdkDeviceTool *tool;
|
||||
double pressure;
|
||||
gdouble pressure;
|
||||
guint n_items;
|
||||
|
||||
tool = gtk_gesture_stylus_get_device_tool (gesture);
|
||||
|
||||
@@ -47,9 +47,9 @@ toggle_shrink (GtkWidget *widget,
|
||||
|
||||
static GtkWidget *
|
||||
create_pane_options (GtkPaned *paned,
|
||||
const char *frame_label,
|
||||
const char *label1,
|
||||
const char *label2)
|
||||
const gchar *frame_label,
|
||||
const gchar *label1,
|
||||
const gchar *label2)
|
||||
{
|
||||
GtkWidget *child1, *child2;
|
||||
GtkWidget *frame;
|
||||
|
||||
@@ -39,7 +39,7 @@ static GdkPixbuf *frame;
|
||||
|
||||
/* Background image */
|
||||
static GdkPixbuf *background;
|
||||
static int back_width, back_height;
|
||||
static gint back_width, back_height;
|
||||
|
||||
/* Images */
|
||||
static GdkPixbuf *images[N_IMAGES];
|
||||
@@ -51,7 +51,7 @@ static GtkWidget *da;
|
||||
static gboolean
|
||||
load_pixbufs (GError **error)
|
||||
{
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
if (background)
|
||||
return TRUE; /* already loaded earlier */
|
||||
|
||||
+11
-11
@@ -14,13 +14,13 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *resourcename;
|
||||
double font_size;
|
||||
gchar *resourcename;
|
||||
gdouble font_size;
|
||||
|
||||
int lines_per_page;
|
||||
char **lines;
|
||||
int num_lines;
|
||||
int num_pages;
|
||||
gint lines_per_page;
|
||||
gchar **lines;
|
||||
gint num_lines;
|
||||
gint num_pages;
|
||||
} PrintData;
|
||||
|
||||
static void
|
||||
@@ -55,17 +55,17 @@ begin_print (GtkPrintOperation *operation,
|
||||
static void
|
||||
draw_page (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
int page_nr,
|
||||
gint page_nr,
|
||||
gpointer user_data)
|
||||
{
|
||||
PrintData *data = (PrintData *)user_data;
|
||||
cairo_t *cr;
|
||||
PangoLayout *layout;
|
||||
int text_width, text_height;
|
||||
double width;
|
||||
int line, i;
|
||||
gint text_width, text_height;
|
||||
gdouble width;
|
||||
gint line, i;
|
||||
PangoFontDescription *desc;
|
||||
char *page_str;
|
||||
gchar *page_str;
|
||||
|
||||
cr = gtk_print_context_get_cairo_context (context);
|
||||
width = gtk_print_context_get_width (context);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static int count = 0;
|
||||
static gint count = 0;
|
||||
static guint timeout = 0;
|
||||
|
||||
static void
|
||||
@@ -25,7 +25,7 @@ static gboolean
|
||||
reveal_one (gpointer data)
|
||||
{
|
||||
GtkWidget *window = data;
|
||||
char *name;
|
||||
gchar *name;
|
||||
GtkRevealer *revealer;
|
||||
|
||||
name = g_strdup_printf ("revealer%d", count);
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
<object class="GtkLabel" id="label_plain">
|
||||
<property name="label">Plain</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="scale_plain"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
@@ -45,6 +48,9 @@
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label_plain"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
@@ -55,6 +61,9 @@
|
||||
<object class="GtkLabel" id="label_marks">
|
||||
<property name="label">Marks</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="scale_marks"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -74,6 +83,9 @@
|
||||
<mark value="3" position="bottom"></mark>
|
||||
<mark value="4" position="bottom"></mark>
|
||||
</marks>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label_marks"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -84,6 +96,9 @@
|
||||
<object class="GtkLabel" id="label_discrete">
|
||||
<property name="label">Discrete</property>
|
||||
<property name="xalign">0</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="scale_discrete"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -97,6 +112,9 @@
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment3</property>
|
||||
<property name="hexpand">1</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label_discrete"/>
|
||||
</accessibility>
|
||||
<marks>
|
||||
<mark value="0" position="bottom"></mark>
|
||||
<mark value="1" position="bottom"></mark>
|
||||
|
||||
@@ -123,7 +123,7 @@ set_search_by (GSimpleAction *action,
|
||||
|
||||
static void
|
||||
icon_press_cb (GtkEntry *entry,
|
||||
int position,
|
||||
gint position,
|
||||
gpointer data)
|
||||
{
|
||||
if (position == GTK_ENTRY_ICON_PRIMARY)
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
static void
|
||||
show_shortcuts (GtkWidget *window,
|
||||
const char *id,
|
||||
const char *view)
|
||||
const gchar *id,
|
||||
const gchar *view)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *overlay;
|
||||
char *path;
|
||||
gchar *path;
|
||||
|
||||
path = g_strdup_printf ("/shortcuts/%s.ui", id);
|
||||
builder = gtk_builder_new_from_resource (path);
|
||||
|
||||
@@ -18,7 +18,7 @@ do_sidebar (GtkWidget *do_widget)
|
||||
GtkWidget *box;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *header;
|
||||
const char * pages[] = {
|
||||
const gchar* pages[] = {
|
||||
"Welcome to GTK",
|
||||
"GtkStackSidebar Widget",
|
||||
"Automatic navigation",
|
||||
@@ -30,7 +30,7 @@ do_sidebar (GtkWidget *do_widget)
|
||||
"Page 9",
|
||||
NULL
|
||||
};
|
||||
const char *c = NULL;
|
||||
const gchar *c = NULL;
|
||||
guint i;
|
||||
|
||||
if (!window)
|
||||
|
||||
+29
-29
@@ -11,13 +11,13 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
gint
|
||||
spinbutton_hex_spin_input (GtkSpinButton *spin_button,
|
||||
double *new_val)
|
||||
gdouble *new_val)
|
||||
{
|
||||
const char *buf;
|
||||
char *err;
|
||||
double res;
|
||||
const gchar *buf;
|
||||
gchar *err;
|
||||
gdouble res;
|
||||
|
||||
buf = gtk_editable_get_text (GTK_EDITABLE (spin_button));
|
||||
res = strtol (buf, &err, 16);
|
||||
@@ -28,19 +28,19 @@ spinbutton_hex_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
gint
|
||||
spinbutton_hex_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
char *buf;
|
||||
double val;
|
||||
gchar *buf;
|
||||
gdouble val;
|
||||
|
||||
adjustment = gtk_spin_button_get_adjustment (spin_button);
|
||||
val = gtk_adjustment_get_value (adjustment);
|
||||
if (fabs (val) < 1e-5)
|
||||
buf = g_strdup ("0x00");
|
||||
else
|
||||
buf = g_strdup_printf ("0x%.2X", (int) val);
|
||||
buf = g_strdup_printf ("0x%.2X", (gint) val);
|
||||
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
|
||||
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
|
||||
g_free (buf);
|
||||
@@ -48,17 +48,17 @@ spinbutton_hex_spin_output (GtkSpinButton *spin_button)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
gint
|
||||
spinbutton_time_spin_input (GtkSpinButton *spin_button,
|
||||
double *new_val)
|
||||
gdouble *new_val)
|
||||
{
|
||||
const char *text;
|
||||
char **str;
|
||||
const gchar *text;
|
||||
gchar **str;
|
||||
gboolean found = FALSE;
|
||||
int hours;
|
||||
int minutes;
|
||||
char *endh;
|
||||
char *endm;
|
||||
gint hours;
|
||||
gint minutes;
|
||||
gchar *endh;
|
||||
gchar *endm;
|
||||
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (spin_button));
|
||||
str = g_strsplit (text, ":", 2);
|
||||
@@ -87,13 +87,13 @@ spinbutton_time_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
gint
|
||||
spinbutton_time_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
char *buf;
|
||||
double hours;
|
||||
double minutes;
|
||||
gchar *buf;
|
||||
gdouble hours;
|
||||
gdouble minutes;
|
||||
|
||||
adjustment = gtk_spin_button_get_adjustment (spin_button);
|
||||
hours = gtk_adjustment_get_value (adjustment) / 60.0;
|
||||
@@ -121,12 +121,12 @@ static const char *month[12] = {
|
||||
"December"
|
||||
};
|
||||
|
||||
int
|
||||
gint
|
||||
spinbutton_month_spin_input (GtkSpinButton *spin_button,
|
||||
double *new_val)
|
||||
gdouble *new_val)
|
||||
{
|
||||
int i;
|
||||
char *tmp1, *tmp2;
|
||||
gint i;
|
||||
gchar *tmp1, *tmp2;
|
||||
gboolean found = FALSE;
|
||||
|
||||
for (i = 1; i <= 12; i++)
|
||||
@@ -145,17 +145,17 @@ spinbutton_month_spin_input (GtkSpinButton *spin_button,
|
||||
*new_val = 0.0;
|
||||
return GTK_INPUT_ERROR;
|
||||
}
|
||||
*new_val = (double) i;
|
||||
*new_val = (gdouble) i;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
gint
|
||||
spinbutton_month_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
double value;
|
||||
int i;
|
||||
gdouble value;
|
||||
gint i;
|
||||
|
||||
adjustment = gtk_spin_button_get_adjustment (spin_button);
|
||||
value = gtk_adjustment_get_value (adjustment);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
typedef struct _TreeItem TreeItem;
|
||||
struct _TreeItem
|
||||
{
|
||||
const char *label;
|
||||
const gchar *label;
|
||||
gboolean alex;
|
||||
gboolean havoc;
|
||||
gboolean tim;
|
||||
@@ -222,7 +222,7 @@ create_model (void)
|
||||
|
||||
static void
|
||||
item_toggled (GtkCellRendererToggle *cell,
|
||||
char *path_str,
|
||||
gchar *path_str,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreeModel *model = (GtkTreeModel *)data;
|
||||
@@ -230,7 +230,7 @@ item_toggled (GtkCellRendererToggle *cell,
|
||||
GtkTreeIter iter;
|
||||
gboolean toggle_item;
|
||||
|
||||
int *column;
|
||||
gint *column;
|
||||
|
||||
column = g_object_get_data (G_OBJECT (cell), "column");
|
||||
|
||||
@@ -252,7 +252,7 @@ item_toggled (GtkCellRendererToggle *cell,
|
||||
static void
|
||||
add_columns (GtkTreeView *treeview)
|
||||
{
|
||||
int col_offset;
|
||||
gint col_offset;
|
||||
GtkCellRenderer *renderer;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeModel *model = gtk_tree_view_get_model (treeview);
|
||||
@@ -272,7 +272,7 @@ add_columns (GtkTreeView *treeview)
|
||||
/* alex column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (int *)ALEX_COLUMN);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)ALEX_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
|
||||
@@ -294,7 +294,7 @@ add_columns (GtkTreeView *treeview)
|
||||
/* havoc column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (int *)HAVOC_COLUMN);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)HAVOC_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
|
||||
@@ -315,7 +315,7 @@ add_columns (GtkTreeView *treeview)
|
||||
/* tim column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (int *)TIM_COLUMN);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)TIM_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
|
||||
@@ -337,7 +337,7 @@ add_columns (GtkTreeView *treeview)
|
||||
/* owen column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (int *)OWEN_COLUMN);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)OWEN_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
|
||||
@@ -358,7 +358,7 @@ add_columns (GtkTreeView *treeview)
|
||||
/* dave column */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (int *)DAVE_COLUMN);
|
||||
g_object_set_data (G_OBJECT (renderer), "column", (gint *)DAVE_COLUMN);
|
||||
|
||||
g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ about_activated (GSimpleAction *action,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkApplication *app = user_data;
|
||||
const char *authors[] = {
|
||||
const gchar *authors[] = {
|
||||
"The GTK Team",
|
||||
NULL
|
||||
};
|
||||
@@ -103,7 +103,7 @@ static GActionEntry app_entries[] =
|
||||
static void
|
||||
icon_browser_app_startup (GApplication *app)
|
||||
{
|
||||
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (icon_browser_app_parent_class)->startup (app);
|
||||
|
||||
|
||||
@@ -44,13 +44,13 @@ icon_browser_window_get_icon_theme (IconBrowserWindow *win)
|
||||
|
||||
static void
|
||||
add_icon (IconBrowserWindow *win,
|
||||
const char *name,
|
||||
const char *description,
|
||||
const char *context)
|
||||
const gchar *name,
|
||||
const gchar *description,
|
||||
const gchar *context)
|
||||
{
|
||||
GtkIconTheme *icon_theme = icon_browser_window_get_icon_theme (win);
|
||||
char *regular_name;
|
||||
char *symbolic_name;
|
||||
gchar *regular_name;
|
||||
gchar *symbolic_name;
|
||||
IbIcon *icon;
|
||||
|
||||
regular_name = g_strdup (name);
|
||||
@@ -77,9 +77,9 @@ add_icon (IconBrowserWindow *win,
|
||||
|
||||
static void
|
||||
add_context (IconBrowserWindow *win,
|
||||
const char *id,
|
||||
const char *name,
|
||||
const char *description)
|
||||
const gchar *id,
|
||||
const gchar *name,
|
||||
const gchar *description)
|
||||
{
|
||||
IbContext *context;
|
||||
|
||||
@@ -161,7 +161,7 @@ copy_to_clipboard (GtkButton *button,
|
||||
}
|
||||
|
||||
static void
|
||||
set_image (GtkWidget *image, const char *name, int size)
|
||||
set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), name);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
||||
@@ -219,7 +219,7 @@ item_activated (GtkGridView *view,
|
||||
static GdkPaintable *
|
||||
get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const char *icon_name;
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconPaintable *icon;
|
||||
int size;
|
||||
|
||||
@@ -18,19 +18,3 @@ executable('gtk4-icon-browser',
|
||||
gui_app: true,
|
||||
link_args: extra_demo_ldflags,
|
||||
install: true)
|
||||
|
||||
# icons
|
||||
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
|
||||
|
||||
foreach size: ['scalable', 'symbolic']
|
||||
install_subdir('data/' + size,
|
||||
install_dir: icontheme_dir
|
||||
)
|
||||
endforeach
|
||||
|
||||
# desktop file
|
||||
install_data('org.gtk.IconBrowser4.desktop', install_dir: gtk_applicationsdir)
|
||||
|
||||
# appdata
|
||||
install_data('org.gtk.IconBrowser4.appdata.xml', install_dir: gtk_appdatadir)
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.gtk.IconBrowser4.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.0+</project_license>
|
||||
<name>GTK Icon Browser</name>
|
||||
<summary>Program to browse themed icons</summary>
|
||||
<description>
|
||||
<p>
|
||||
GTK Icon Browser is a simple application to show themed icons that
|
||||
are available on the system.
|
||||
</p>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gtk4-icon-browser/gtk-icon-browser1.png</image>
|
||||
<caption>Icon Browser</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://static.gnome.org/appdata/gtk4-icon-browser/gtk-icon-browser2.png</image>
|
||||
<caption>Search</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<kudos>
|
||||
<kudo>HiDpiIcon</kudo>
|
||||
<kudo>ModernToolkit</kudo>
|
||||
</kudos>
|
||||
<url type="homepage">https://www.gtk.org</url>
|
||||
<translation type="gettext">gtk-4.0</translation>
|
||||
<update_contact>matthias.clasen_at_gmail.com</update_contact>
|
||||
<developer_name>Matthias Clasen and others</developer_name>
|
||||
<releases>
|
||||
<release version="3.99.0" date="2020-07-30">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="3.94.0" date="2018-06-25">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
</component>
|
||||
@@ -245,6 +245,9 @@
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label1"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -255,6 +258,9 @@
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label2"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -265,6 +271,9 @@
|
||||
<object class="GtkImage" id="image3">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label3"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -275,6 +284,9 @@
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label4"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">3</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -285,6 +297,9 @@
|
||||
<object class="GtkImage" id="image5">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label5"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">4</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -295,6 +310,9 @@
|
||||
<object class="GtkImage" id="image6">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label5"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">5</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -305,6 +323,9 @@
|
||||
<object class="GtkImage" id="image7">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label5"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">6</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -315,6 +336,9 @@
|
||||
<object class="GtkImage" id="image8">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label6"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">7</property>
|
||||
<property name="top-attach">1</property>
|
||||
@@ -329,6 +353,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image1"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -343,6 +370,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image2"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -357,6 +387,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image3"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -371,6 +404,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image4"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">3</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -385,6 +421,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image5"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">4</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -399,6 +438,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image6"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">5</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -413,6 +455,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image7"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">6</property>
|
||||
<property name="top-attach">2</property>
|
||||
@@ -427,6 +472,9 @@
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image8"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">7</property>
|
||||
<property name="top-attach">2</property>
|
||||
|
||||
@@ -199,11 +199,11 @@ node_editor_application_activate (GApplication *app)
|
||||
static void
|
||||
node_editor_application_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
NodeEditorWindow *win;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < n_files; i++)
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ text_view_error_free (TextViewError *e)
|
||||
g_free (e->message);
|
||||
}
|
||||
|
||||
static char *
|
||||
static gchar *
|
||||
get_current_text (GtkTextBuffer *buffer)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
@@ -288,14 +288,14 @@ text_view_query_tooltip_cb (GtkWidget *widget,
|
||||
|
||||
if (keyboard_tip)
|
||||
{
|
||||
int offset;
|
||||
gint offset;
|
||||
|
||||
g_object_get (self->text_buffer, "cursor-position", &offset, NULL);
|
||||
gtk_text_buffer_get_iter_at_offset (self->text_buffer, &iter, offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
int bx, by, trailing;
|
||||
gint bx, by, trailing;
|
||||
|
||||
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (self->text_view), GTK_TEXT_WINDOW_TEXT,
|
||||
x, y, &bx, &by);
|
||||
@@ -399,7 +399,7 @@ node_editor_window_load (NodeEditorWindow *self,
|
||||
|
||||
static void
|
||||
open_response_cb (GtkWidget *dialog,
|
||||
int response,
|
||||
gint response,
|
||||
NodeEditorWindow *self)
|
||||
{
|
||||
gtk_widget_hide (dialog);
|
||||
@@ -448,7 +448,7 @@ open_cb (GtkWidget *button,
|
||||
|
||||
static void
|
||||
save_response_cb (GtkWidget *dialog,
|
||||
int response,
|
||||
gint response,
|
||||
NodeEditorWindow *self)
|
||||
{
|
||||
gtk_widget_hide (dialog);
|
||||
@@ -577,7 +577,7 @@ create_cairo_texture (NodeEditorWindow *self)
|
||||
|
||||
static void
|
||||
export_image_response_cb (GtkWidget *dialog,
|
||||
int response,
|
||||
gint response,
|
||||
GdkTexture *texture)
|
||||
{
|
||||
gtk_widget_hide (dialog);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<update_contact>matthias.clasen_at_gmail.com</update_contact>
|
||||
<developer_name>Matthias Clasen and others</developer_name>
|
||||
<releases>
|
||||
<release version="3.99.0" date="2020-07-30">
|
||||
<release version="3.99.0" date="2020">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
|
||||
@@ -33,8 +33,8 @@ update_title (GtkWindow *window)
|
||||
static void
|
||||
update_statusbar (void)
|
||||
{
|
||||
char *msg;
|
||||
int row, col;
|
||||
gchar *msg;
|
||||
gint row, col;
|
||||
GtkTextIter iter;
|
||||
const char *print_str;
|
||||
|
||||
@@ -675,7 +675,7 @@ static GActionEntry app_entries[] = {
|
||||
{ "print", activate_print, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static const char ui_info[] =
|
||||
static const gchar ui_info[] =
|
||||
"<interface>"
|
||||
" <menu id='menubar'>"
|
||||
" <submenu>"
|
||||
|
||||
@@ -32,11 +32,6 @@
|
||||
<update_contact>matthias.clasen_at_gmail.com</update_contact>
|
||||
<developer_name>Matthias Clasen and others</developer_name>
|
||||
<releases>
|
||||
<release version="3.99.0" date="2020-07-30">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="3.94.0" date="2018-06-25">
|
||||
<description>
|
||||
<p>A new developers snapshot towards GTK 4.0.</p>
|
||||
|
||||
@@ -139,9 +139,9 @@ get_busy (GSimpleAction *action,
|
||||
gtk_widget_set_sensitive (window, FALSE);
|
||||
}
|
||||
|
||||
static int current_page = 0;
|
||||
static gint current_page = 0;
|
||||
static gboolean
|
||||
on_page (int i)
|
||||
on_page (gint i)
|
||||
{
|
||||
return current_page == i;
|
||||
}
|
||||
@@ -250,12 +250,12 @@ activate_about (GSimpleAction *action,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkApplication *app = user_data;
|
||||
const char *authors[] = {
|
||||
const gchar *authors[] = {
|
||||
"Andrea Cimitan",
|
||||
"Cosimo Cecchi",
|
||||
NULL
|
||||
};
|
||||
char *version;
|
||||
gchar *version;
|
||||
GString *s;
|
||||
|
||||
s = g_string_new ("");
|
||||
@@ -422,8 +422,8 @@ static void
|
||||
spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
|
||||
{
|
||||
GtkWidget *w;
|
||||
int v;
|
||||
char *text;
|
||||
gint v;
|
||||
gchar *text;
|
||||
|
||||
v = (int)gtk_adjustment_get_value (adjustment);
|
||||
|
||||
@@ -454,8 +454,8 @@ spin_value_reset (GtkWidget *button, GtkAdjustment *adjustment)
|
||||
dismiss (button);
|
||||
}
|
||||
|
||||
static int pulse_time = 250;
|
||||
static int pulse_entry_mode = 0;
|
||||
static gint pulse_time = 250;
|
||||
static gint pulse_entry_mode = 0;
|
||||
|
||||
static void
|
||||
remove_pulse (gpointer pulse_id)
|
||||
@@ -482,7 +482,7 @@ pulse_it (GtkWidget *widget)
|
||||
static void
|
||||
update_pulse_time (GtkAdjustment *adjustment, GtkWidget *widget)
|
||||
{
|
||||
double value;
|
||||
gdouble value;
|
||||
guint pulse_id;
|
||||
|
||||
value = gtk_adjustment_get_value (adjustment);
|
||||
@@ -537,12 +537,12 @@ on_entry_icon_release (GtkEntry *entry,
|
||||
|
||||
static void
|
||||
on_scale_button_value_changed (GtkScaleButton *button,
|
||||
double value,
|
||||
gdouble value,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
double val;
|
||||
char *str;
|
||||
gdouble val;
|
||||
gchar *str;
|
||||
|
||||
adjustment = gtk_scale_button_get_adjustment (button);
|
||||
val = gtk_scale_button_get_value (button);
|
||||
@@ -557,14 +557,15 @@ on_scale_button_value_changed (GtkScaleButton *button,
|
||||
}
|
||||
else
|
||||
{
|
||||
int percent;
|
||||
gint percent;
|
||||
|
||||
percent = (int) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
|
||||
percent = (gint) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
|
||||
|
||||
str = g_strdup_printf (C_("volume percentage", "%d %%"), percent);
|
||||
}
|
||||
|
||||
gtk_widget_set_tooltip_text (GTK_WIDGET (button), str);
|
||||
atk_object_set_description (gtk_widget_get_accessible (GTK_WIDGET (button)), str);
|
||||
|
||||
g_free (str);
|
||||
}
|
||||
@@ -626,7 +627,7 @@ static void
|
||||
on_range_from_changed (GtkSpinButton *from)
|
||||
{
|
||||
GtkSpinButton *to;
|
||||
int v1, v2;
|
||||
gint v1, v2;
|
||||
|
||||
to = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (from), "range_to_spin"));
|
||||
|
||||
@@ -641,7 +642,7 @@ static void
|
||||
on_range_to_changed (GtkSpinButton *to)
|
||||
{
|
||||
GtkSpinButton *from;
|
||||
int v1, v2;
|
||||
gint v1, v2;
|
||||
|
||||
from = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (to), "range_from_spin"));
|
||||
|
||||
@@ -653,7 +654,7 @@ on_range_to_changed (GtkSpinButton *to)
|
||||
}
|
||||
|
||||
static void
|
||||
info_bar_response (GtkWidget *infobar, int response_id)
|
||||
info_bar_response (GtkWidget *infobar, gint response_id)
|
||||
{
|
||||
if (response_id == GTK_RESPONSE_CLOSE)
|
||||
gtk_widget_hide (infobar);
|
||||
@@ -702,7 +703,7 @@ action_dialog_button_clicked (GtkButton *button, GtkWidget *page)
|
||||
static void
|
||||
page_changed_cb (GtkWidget *stack, GParamSpec *pspec, gpointer data)
|
||||
{
|
||||
const char *name;
|
||||
const gchar *name;
|
||||
GtkWidget *window;
|
||||
GtkWidget *page;
|
||||
|
||||
@@ -852,10 +853,10 @@ update_title_header (GtkListBoxRow *row,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *header;
|
||||
char *title;
|
||||
gchar *title;
|
||||
|
||||
header = gtk_list_box_row_get_header (row);
|
||||
title = (char *)g_object_get_data (G_OBJECT (row), "title");
|
||||
title = (gchar *)g_object_get_data (G_OBJECT (row), "title");
|
||||
if (!header && title)
|
||||
{
|
||||
title = g_strdup_printf ("<b>%s</b>", title);
|
||||
@@ -880,8 +881,8 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *box, *row, *label, *swatch;
|
||||
GdkRGBA rgba;
|
||||
const char *color;
|
||||
char *text;
|
||||
const gchar *color;
|
||||
gchar *text;
|
||||
GtkWidget *silver;
|
||||
GtkWidget *gold;
|
||||
|
||||
@@ -982,7 +983,7 @@ set_color (GtkListBox *box, GtkListBoxRow *row, GtkColorChooser *chooser)
|
||||
static void
|
||||
populate_colors (GtkWidget *widget, GtkWidget *chooser)
|
||||
{
|
||||
struct { const char *name; const char *color; const char *title; } colors[] = {
|
||||
struct { const gchar *name; const gchar *color; const gchar *title; } colors[] = {
|
||||
{ "2.5", "#C8828C", "Red" },
|
||||
{ "5", "#C98286", NULL },
|
||||
{ "7.5", "#C9827F", NULL },
|
||||
@@ -1024,7 +1025,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
|
||||
{ "7.5", "#C48299", NULL },
|
||||
{ "10", "#C68292", NULL }
|
||||
};
|
||||
int i;
|
||||
gint i;
|
||||
GtkWidget *row, *box, *label, *swatch;
|
||||
GtkWidget *sw;
|
||||
GdkRGBA rgba;
|
||||
@@ -1080,7 +1081,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
|
||||
|
||||
typedef struct {
|
||||
GtkWidget *flowbox;
|
||||
char *filename;
|
||||
gchar *filename;
|
||||
} BackgroundData;
|
||||
|
||||
static void
|
||||
@@ -1126,11 +1127,11 @@ background_loaded_cb (GObject *source,
|
||||
static void
|
||||
populate_flowbox (GtkWidget *flowbox)
|
||||
{
|
||||
const char *location;
|
||||
const gchar *location;
|
||||
GDir *dir;
|
||||
GError *error = NULL;
|
||||
const char *name;
|
||||
char *filename;
|
||||
const gchar *name;
|
||||
gchar *filename;
|
||||
GFile *file;
|
||||
GInputStream *stream;
|
||||
BackgroundData *bd;
|
||||
@@ -1287,7 +1288,7 @@ my_text_view_class_init (MyTextViewClass *class)
|
||||
}
|
||||
|
||||
static void
|
||||
my_text_view_set_background (MyTextView *tv, const char *filename, gboolean is_resource)
|
||||
my_text_view_set_background (MyTextView *tv, const gchar *filename, gboolean is_resource)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GFile *file;
|
||||
@@ -1330,12 +1331,12 @@ my_text_view_set_adjustment (MyTextView *tv, GtkAdjustment *adjustment)
|
||||
}
|
||||
|
||||
static void
|
||||
close_selection_dialog (GtkWidget *dialog, int response, GtkWidget *tv)
|
||||
close_selection_dialog (GtkWidget *dialog, gint response, GtkWidget *tv)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *child;
|
||||
GList *children;
|
||||
const char *filename;
|
||||
const gchar *filename;
|
||||
gboolean is_resource;
|
||||
|
||||
gtk_widget_hide (dialog);
|
||||
@@ -1351,7 +1352,7 @@ close_selection_dialog (GtkWidget *dialog, int response, GtkWidget *tv)
|
||||
return;
|
||||
|
||||
child = children->data;
|
||||
filename = (const char *)g_object_get_data (G_OBJECT (child), "filename");
|
||||
filename = (const gchar *)g_object_get_data (G_OBJECT (child), "filename");
|
||||
is_resource = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (child), "is-resource"));
|
||||
|
||||
g_list_free (children);
|
||||
@@ -1376,8 +1377,8 @@ static void
|
||||
handle_insert (GtkWidget *button, GtkWidget *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
const char *id;
|
||||
const char *text;
|
||||
const gchar *id;
|
||||
const gchar *text;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
|
||||
@@ -1401,7 +1402,7 @@ handle_cutcopypaste (GtkWidget *button, GtkWidget *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GdkClipboard *clipboard;
|
||||
const char *id;
|
||||
const gchar *id;
|
||||
|
||||
clipboard = gtk_widget_get_clipboard (textview);
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
|
||||
@@ -1420,7 +1421,7 @@ handle_cutcopypaste (GtkWidget *button, GtkWidget *textview)
|
||||
static void
|
||||
clipboard_formats_notify (GdkClipboard *clipboard, GdkEvent *event, GtkWidget *button)
|
||||
{
|
||||
const char *id;
|
||||
const gchar *id;
|
||||
gboolean has_text;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
@@ -1433,7 +1434,7 @@ clipboard_formats_notify (GdkClipboard *clipboard, GdkEvent *event, GtkWidget *b
|
||||
static void
|
||||
textbuffer_notify_selection (GObject *object, GParamSpec *pspec, GtkWidget *button)
|
||||
{
|
||||
const char *id;
|
||||
const gchar *id;
|
||||
gboolean has_selection;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
@@ -1468,7 +1469,7 @@ page_combo_separator_func (GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
char *text;
|
||||
gchar *text;
|
||||
gboolean res;
|
||||
|
||||
gtk_tree_model_get (model, iter, 0, &text, -1);
|
||||
@@ -1593,7 +1594,7 @@ text_view_add_to_context_menu (GtkTextView *text_view)
|
||||
static void
|
||||
open_popover_text_changed (GtkEntry *entry, GParamSpec *pspec, GtkWidget *button)
|
||||
{
|
||||
const char *text;
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
gtk_widget_set_sensitive (button, strlen (text) > 0);
|
||||
@@ -1863,8 +1864,8 @@ activate (GApplication *app)
|
||||
{ "print", activate_print, NULL, NULL, NULL },
|
||||
};
|
||||
struct {
|
||||
const char *action_and_target;
|
||||
const char *accelerators[2];
|
||||
const gchar *action_and_target;
|
||||
const gchar *accelerators[2];
|
||||
} accels[] = {
|
||||
{ "app.about", { "F1", NULL } },
|
||||
{ "app.quit", { "<Control>q", NULL } },
|
||||
@@ -1877,15 +1878,15 @@ activate (GApplication *app)
|
||||
{ "win.lock", { "<Control>l", NULL } },
|
||||
};
|
||||
struct {
|
||||
const char *action_and_target;
|
||||
const char *accelerators[2];
|
||||
const gchar *action_and_target;
|
||||
const gchar *accelerators[2];
|
||||
} late_accels[] = {
|
||||
{ "app.cut", { "<Control>x", NULL } },
|
||||
{ "app.copy", { "<Control>c", NULL } },
|
||||
{ "app.paste", { "<Control>v", NULL } },
|
||||
{ "win.delete", { "Delete", NULL } },
|
||||
};
|
||||
int i;
|
||||
gint i;
|
||||
GPermission *permission;
|
||||
GAction *action;
|
||||
GError *error = NULL;
|
||||
@@ -2281,7 +2282,7 @@ main (int argc, char *argv[])
|
||||
{ "check-off-disabled", NULL, NULL, "false", NULL },
|
||||
{ "radio-x-disabled", NULL, "s", "'x'", NULL },
|
||||
};
|
||||
int status;
|
||||
gint status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.WidgetFactory4", G_APPLICATION_NON_UNIQUE);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<attribute name="target">highcontrast-inverse</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
</submenu>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Transition Pages</attribute>
|
||||
<attribute name="action">win.transition</attribute>
|
||||
@@ -789,6 +789,11 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="separator1">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box19">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -884,6 +889,11 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="separator2">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box20">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -1032,6 +1042,11 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="separator3">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box26">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -1130,6 +1145,11 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="separator4">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box4">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -1229,6 +1249,9 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="separator5"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box5">
|
||||
<property name="spacing">10</property>
|
||||
@@ -1545,6 +1568,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="page2frame1">
|
||||
<child>
|
||||
@@ -1613,6 +1639,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="has-frame">1</property>
|
||||
@@ -1869,6 +1898,11 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -1945,6 +1979,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">1</property>
|
||||
@@ -1969,6 +2006,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
@@ -2029,6 +2069,11 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="filler2">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -2038,6 +2083,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="halign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="expanded">1</property>
|
||||
@@ -2212,6 +2260,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
@@ -2227,6 +2278,11 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -2316,6 +2372,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<child>
|
||||
@@ -2793,6 +2852,11 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -2819,6 +2883,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook">
|
||||
<property name="scrollable">1</property>
|
||||
@@ -2962,6 +3029,9 @@ bad things might happen.</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="label" translatable="yes">To free the princess, you have to slay the dragon.</property>
|
||||
<accessibility>
|
||||
<role type="static"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -3161,6 +3231,9 @@ bad things might happen.</property>
|
||||
<object class="GtkLabel" id="title_label">
|
||||
<property name="label">Title:</property>
|
||||
<property name="xalign">1</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="open_popover_entry"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3168,6 +3241,9 @@ bad things might happen.</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="label">Description:</property>
|
||||
<property name="xalign">1</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="open_popover_textview"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="top-attach">1</property>
|
||||
</layout>
|
||||
@@ -3183,6 +3259,9 @@ bad things might happen.</property>
|
||||
<property name="max-content-width">100</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="open_popover_textview">
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="description_label"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
</child>
|
||||
<layout>
|
||||
@@ -3195,6 +3274,9 @@ bad things might happen.</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="open_popover_entry">
|
||||
<property name="activates-default">1</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="title_label"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="column-span">2</property>
|
||||
@@ -3275,6 +3357,9 @@ bad things might happen.</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">No updates at this time</property>
|
||||
<accessibility>
|
||||
<role type="static"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -3283,6 +3368,9 @@ bad things might happen.</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">You're in too deep!</property>
|
||||
<accessibility>
|
||||
<role type="static"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -474,19 +474,19 @@ The maximum width of each column is given by the longest element in the
|
||||
column:
|
||||
|
||||
```c
|
||||
void gtk_type_set_property (GtkType *type,
|
||||
const char *value,
|
||||
GError **error);
|
||||
const char *gtk_type_get_property (GtkType *type);
|
||||
void gtk_type_set_property (GtkType *type,
|
||||
const gchar *value,
|
||||
GError **error);
|
||||
const gchar *gtk_type_get_property (GtkType *type);
|
||||
```
|
||||
|
||||
It is also possible to align the columns to the next tab:
|
||||
|
||||
```c
|
||||
void gtk_type_set_prop (GtkType *type,
|
||||
float value);
|
||||
float gtk_type_get_prop (GtkType *type);
|
||||
int gtk_type_update_foobar (GtkType *type);
|
||||
gfloat value);
|
||||
gfloat gtk_type_get_prop (GtkType *type);
|
||||
gint gtk_type_update_foobar (GtkType *type);
|
||||
```
|
||||
|
||||
Public headers should never be included directly:
|
||||
|
||||
@@ -81,6 +81,7 @@ gdk_display_close
|
||||
gdk_display_is_closed
|
||||
gdk_display_is_rgba
|
||||
gdk_display_is_composited
|
||||
gdk_display_get_default_group
|
||||
gdk_display_supports_input_shapes
|
||||
gdk_display_get_app_launch_context
|
||||
gdk_display_notify_startup_complete
|
||||
@@ -189,7 +190,9 @@ gdk_surface_create_vulkan_context
|
||||
gdk_surface_create_cairo_context
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_surface_queue_render
|
||||
gdk_surface_queue_expose
|
||||
gdk_surface_freeze_updates
|
||||
gdk_surface_thaw_updates
|
||||
gdk_surface_get_frame_clock
|
||||
|
||||
<SUBSECTION>
|
||||
@@ -352,8 +355,14 @@ gdk_device_get_name
|
||||
gdk_device_get_vendor_id
|
||||
gdk_device_get_product_id
|
||||
gdk_device_get_source
|
||||
gdk_device_get_axis_use
|
||||
gdk_device_get_associated_device
|
||||
gdk_device_list_physical_devices
|
||||
gdk_device_get_device_type
|
||||
gdk_device_get_display
|
||||
gdk_device_get_has_cursor
|
||||
gdk_device_get_n_axes
|
||||
gdk_device_get_axes
|
||||
gdk_device_get_seat
|
||||
gdk_device_get_num_touches
|
||||
gdk_device_get_device_tool
|
||||
@@ -365,14 +374,15 @@ gdk_device_get_scroll_lock_state
|
||||
gdk_device_has_bidi_layouts
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_device_get_state
|
||||
gdk_device_get_surface_at_position
|
||||
GdkTimeCoord
|
||||
gdk_device_get_axis
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_device_tool_get_serial
|
||||
gdk_device_tool_get_tool_type
|
||||
gdk_device_tool_get_hardware_id
|
||||
gdk_device_tool_get_axes
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_TYPE_AXIS_USE
|
||||
@@ -428,8 +438,7 @@ gdk_seat_get_display
|
||||
gdk_seat_get_capabilities
|
||||
gdk_seat_get_pointer
|
||||
gdk_seat_get_keyboard
|
||||
gdk_seat_get_devices
|
||||
gdk_seat_get_tools
|
||||
gdk_seat_get_physical_devices
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_SEAT
|
||||
@@ -469,6 +478,7 @@ gdk_event_unref
|
||||
gdk_event_get_event_type
|
||||
gdk_event_get_surface
|
||||
gdk_event_get_device
|
||||
gdk_event_get_source_device
|
||||
gdk_event_get_device_tool
|
||||
gdk_event_get_time
|
||||
gdk_event_get_display
|
||||
@@ -813,7 +823,6 @@ gdk_x11_display_get_xrootwindow
|
||||
gdk_x11_display_get_xcursor
|
||||
gdk_x11_display_grab
|
||||
gdk_x11_display_ungrab
|
||||
gdk_x11_display_get_default_group
|
||||
gdk_x11_display_error_trap_push
|
||||
gdk_x11_display_error_trap_pop
|
||||
gdk_x11_display_error_trap_pop_ignored
|
||||
@@ -1121,6 +1130,7 @@ GDK_TYPE_GL_PROFILE
|
||||
GdkMonitor
|
||||
gdk_monitor_get_display
|
||||
gdk_monitor_get_geometry
|
||||
gdk_monitor_get_workarea
|
||||
gdk_monitor_get_width_mm
|
||||
gdk_monitor_get_height_mm
|
||||
gdk_monitor_get_manufacturer
|
||||
|
||||
@@ -127,7 +127,7 @@ compilation flags needed for that library along with version number
|
||||
information.)
|
||||
|
||||
Some of the libraries that GTK depends on are maintained by the
|
||||
GTK team: GLib, GdkPixbuf, Pango, and GObject Introspection.
|
||||
GTK team: GLib, GdkPixbuf, Pango, ATK and GObject Introspection.
|
||||
Other libraries are maintained separately.
|
||||
|
||||
- The GLib library provides core non-graphical functionality
|
||||
@@ -139,6 +139,10 @@ Other libraries are maintained separately.
|
||||
file formats. It is available [here](ttps://download.gnome.org/sources/gdk-pixbuf/).
|
||||
- [Pango](http://www.pango.org) is a library for internationalized
|
||||
text handling. It is available [here](https://download.gnome.org/sources/pango/).
|
||||
- ATK is the Accessibility Toolkit. It provides a set of generic
|
||||
interfaces allowing accessibility technologies such as
|
||||
screen readers to interact with a graphical user interface.
|
||||
It is available [here](https://download.gnome.org/sources/atk/).
|
||||
- [GObject Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection)
|
||||
is a framework for making introspection data available to language
|
||||
bindings. It is available [here](https://download.gnome.org/sources/gobject-introspection/).
|
||||
@@ -188,7 +192,7 @@ you'll have all of these installed already, or they will be easily
|
||||
accessible through your operating system package repositories.
|
||||
|
||||
Then build and install the GTK libraries in the order:
|
||||
GLib, Cairo, Pango, then GTK. For each library, follow the
|
||||
GLib, Cairo, Pango, ATK, then GTK. For each library, follow the
|
||||
instructions they provide, and make sure to share common settings
|
||||
between them and the GTK build; if you are using a separate prefix
|
||||
for GTK, for instance, you will need to use the same prefix for
|
||||
|
||||
@@ -9,9 +9,9 @@ is used (the actual output on your system may be different):
|
||||
|
||||
```
|
||||
$ pkg-config --cflags gtk4
|
||||
-pthread -I/usr/include/gtk-4.0 -I/usr/lib64/gtk-4.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
|
||||
-pthread -I/usr/include/gtk-4.0 -I/usr/lib64/gtk-4.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
|
||||
$ pkg-config --libs gtk4
|
||||
-pthread -lgtk-4 -lgdk-4 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
|
||||
-pthread -lgtk-4 -lgdk-4 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
|
||||
```
|
||||
The simplest way to compile a program is to use the "backticks"
|
||||
feature of the shell. If you enclose a command in backticks
|
||||
|
||||
@@ -426,8 +426,8 @@ draw_cb (GtkDrawingArea *drawing_area,
|
||||
/* Draw a rectangle on the surface at the given position */
|
||||
static void
|
||||
draw_brush (GtkWidget *widget,
|
||||
double x,
|
||||
double y)
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
@@ -797,8 +797,8 @@ example_app_activate (GApplication *app)
|
||||
static void
|
||||
example_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
@@ -1138,7 +1138,7 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
@@ -1476,7 +1476,7 @@ static void
|
||||
search_text_changed (GtkEntry *entry,
|
||||
ExampleAppWindow *win)
|
||||
{
|
||||
const char *text;
|
||||
const gchar *text;
|
||||
GtkWidget *tab;
|
||||
GtkWidget *view;
|
||||
GtkTextBuffer *buffer;
|
||||
|
||||
@@ -12,13 +12,6 @@ import subprocess
|
||||
# The following code is taken from gtk-doc
|
||||
|
||||
def ExpandAbbreviations(symbol, text):
|
||||
# Hack!
|
||||
# Strip xlink namespace from hrefs since pandoc insists on
|
||||
# inserting them, and namespace setup doesn't transfer across
|
||||
# xi:include.
|
||||
# Yay for XML!
|
||||
text = re.sub('xlink:href', 'href', text)
|
||||
|
||||
# Convert '@param()'
|
||||
text = re.sub(r'(\A|[^\\])\@(\w+((\.|->)\w+)*)\s*\(\)', r'\1<parameter>\2()</parameter>', text)
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
<xi:include href="xml/gtkfilter.xml" />
|
||||
<xi:include href="xml/gtkcustomfilter.xml" />
|
||||
<xi:include href="xml/gtkmultifilter.xml" />
|
||||
<xi:include href="xml/gtkboolfilter.xml" />
|
||||
<xi:include href="xml/gtkstringfilter.xml" />
|
||||
<xi:include href="xml/gtkfilefilter.xml" />
|
||||
</section>
|
||||
@@ -338,13 +337,6 @@
|
||||
<xi:include href="xml/gtkshortcutlabel.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="Accessibility">
|
||||
<title>Accessibility</title>
|
||||
<xi:include href="section-accessibility.xml"/>
|
||||
<xi:include href="xml/gtkaccessible.xml" />
|
||||
<xi:include href="xml/gtkatcontext.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="MiscObjects">
|
||||
<title>Miscellaneous</title>
|
||||
<xi:include href="xml/gtkadjustment.xml" />
|
||||
|
||||
@@ -88,6 +88,25 @@ GtkAccelLabelPrivate
|
||||
gtk_accel_label_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkaccessible</FILE>
|
||||
<TITLE>GtkAccessible</TITLE>
|
||||
GtkAccessible
|
||||
gtk_accessible_get_widget
|
||||
gtk_accessible_set_widget
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_ACCESSIBLE
|
||||
GTK_TYPE_ACCESSIBLE
|
||||
GTK_ACCESSIBLE_CLASS
|
||||
GTK_ACCESSIBLE_GET_CLASS
|
||||
GTK_IS_ACCESSIBLE
|
||||
GTK_IS_ACCESSIBLE_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkAccessiblePrivate
|
||||
gtk_accessible_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkadjustment</FILE>
|
||||
<TITLE>GtkAdjustment</TITLE>
|
||||
@@ -862,6 +881,7 @@ gtk_combo_box_set_active_id
|
||||
gtk_combo_box_get_model
|
||||
gtk_combo_box_set_model
|
||||
gtk_combo_box_popdown
|
||||
gtk_combo_box_get_popup_accessible
|
||||
gtk_combo_box_get_row_separator_func
|
||||
gtk_combo_box_set_row_separator_func
|
||||
GtkSensitivityType
|
||||
@@ -1203,6 +1223,9 @@ gtk_entry_completion_compute_prefix
|
||||
gtk_entry_completion_complete
|
||||
gtk_entry_completion_get_completion_prefix
|
||||
gtk_entry_completion_insert_prefix
|
||||
gtk_entry_completion_insert_action_text
|
||||
gtk_entry_completion_insert_action_markup
|
||||
gtk_entry_completion_delete_action
|
||||
gtk_entry_completion_set_text_column
|
||||
gtk_entry_completion_get_text_column
|
||||
gtk_entry_completion_set_inline_completion
|
||||
@@ -2018,6 +2041,8 @@ gtk_menu_button_get_menu_model
|
||||
GtkArrowType
|
||||
gtk_menu_button_set_direction
|
||||
gtk_menu_button_get_direction
|
||||
gtk_menu_button_set_align_widget
|
||||
gtk_menu_button_get_align_widget
|
||||
gtk_menu_button_set_icon_name
|
||||
gtk_menu_button_get_icon_name
|
||||
gtk_menu_button_set_label
|
||||
@@ -2807,9 +2832,6 @@ gtk_sort_list_model_set_sorter
|
||||
gtk_sort_list_model_get_sorter
|
||||
gtk_sort_list_model_set_model
|
||||
gtk_sort_list_model_get_model
|
||||
gtk_sort_list_model_set_incremental
|
||||
gtk_sort_list_model_get_incremental
|
||||
gtk_sort_list_model_get_pending
|
||||
<SUBSECTION Standard>
|
||||
GTK_SORT_LIST_MODEL
|
||||
GTK_IS_SORT_LIST_MODEL
|
||||
@@ -4051,6 +4073,7 @@ GtkCellRendererState
|
||||
GtkCellRendererMode
|
||||
GtkCellRenderer
|
||||
GtkCellRendererClass
|
||||
gtk_cell_renderer_class_set_accessible_type
|
||||
gtk_cell_renderer_get_aligned_area
|
||||
gtk_cell_renderer_snapshot
|
||||
gtk_cell_renderer_activate
|
||||
@@ -4463,7 +4486,9 @@ gtk_widget_get_cursor
|
||||
gtk_widget_set_cursor
|
||||
gtk_widget_set_cursor_from_name
|
||||
gtk_widget_mnemonic_activate
|
||||
gtk_widget_class_set_accessible_type
|
||||
gtk_widget_class_set_accessible_role
|
||||
gtk_widget_get_accessible
|
||||
gtk_widget_child_focus
|
||||
gtk_widget_get_child_visible
|
||||
gtk_widget_get_parent
|
||||
@@ -7545,19 +7570,6 @@ GTK_TYPE_EXPRESSION
|
||||
gtk_expression_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkboolfilter</FILE>
|
||||
GtkBoolFilter
|
||||
gtk_bool_filter_new
|
||||
gtk_bool_filter_get_expression
|
||||
gtk_bool_filter_set_expression
|
||||
gtk_bool_filter_get_invert
|
||||
gtk_bool_filter_set_invert
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_bool_filter_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkstringfilter</FILE>
|
||||
GtkStringFilter
|
||||
@@ -7581,7 +7593,7 @@ gtk_string_filter_get_type
|
||||
<TITLE>GtkDropDown</TITLE>
|
||||
GtkDropDown
|
||||
gtk_drop_down_new
|
||||
gtk_drop_down_new_from_strings
|
||||
gtk_drop_down_set_from_strings
|
||||
gtk_drop_down_set_model
|
||||
gtk_drop_down_get_model
|
||||
gtk_drop_down_set_selected
|
||||
@@ -7626,56 +7638,3 @@ gtk_selection_filter_model_new_for_type
|
||||
gtk_selection_filter_model_set_model
|
||||
gtk_selection_filter_model_get_model
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkaccessible</FILE>
|
||||
GtkAccessible
|
||||
GtkAccessibleRole
|
||||
GtkAccessibleState
|
||||
GtkAccessibleProperty
|
||||
GtkAccessibleRelation
|
||||
GtkAccessibleTristate
|
||||
GtkAccessibleInvalidState
|
||||
GtkAccessibleAutocomplete
|
||||
GtkAccessibleSort
|
||||
gtk_accessible_get_accessible_role
|
||||
gtk_accessible_update_state
|
||||
gtk_accessible_update_state_value
|
||||
gtk_accessible_reset_state
|
||||
gtk_accessible_update_property
|
||||
gtk_accessible_update_property_value
|
||||
gtk_accessible_reset_property
|
||||
gtk_accessible_update_relation
|
||||
gtk_accessible_update_relation_value
|
||||
gtk_accessible_reset_relation
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_ACCESSIBLE
|
||||
GTK_TYPE_ACCESSIBLE_PROPERTY
|
||||
GTK_TYPE_ACCESSIBLE_ROLE
|
||||
GTK_TYPE_ACCESSIBLE_STATE
|
||||
GTK_ACCESSIBLE
|
||||
GTK_ACCESSIBLE_GET_IFACE
|
||||
GTK_IS_ACCESSIBLE
|
||||
<SUBSECTION Private>
|
||||
gtk_accessible_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkatcontext</FILE>
|
||||
GtkATContext
|
||||
gtk_at_context_get_accessible
|
||||
gtk_at_context_get_accessible_role
|
||||
<SUBSECTION>
|
||||
gtk_at_context_create
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_AT_CONTEXT
|
||||
GTK_AT_CONTEXT
|
||||
GTK_AT_CONTEXT_CLASS
|
||||
GTK_AT_CONTEXT_GET_CLASS
|
||||
GTK_IS_AT_CONTEXT
|
||||
GTK_IS_AT_CONTEXT_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkATContextClass
|
||||
gtk_at_context_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -17,7 +17,6 @@ gtk_application_window_get_type
|
||||
gtk_aspect_frame_get_type
|
||||
gtk_assistant_get_type
|
||||
gtk_assistant_page_get_type
|
||||
gtk_at_context_get_type
|
||||
gtk_bin_layout_get_type
|
||||
gtk_bitset_get_type
|
||||
gtk_expression_get_type
|
||||
|
||||
@@ -6,24 +6,17 @@ private_headers = [
|
||||
'gdkpixbufutilsprivate.h',
|
||||
'gtkaccelgroupprivate.h',
|
||||
'gtkaccelmapprivate.h',
|
||||
'gtkaccessibleattributesetprivate.h',
|
||||
'gtkaccessibleattributevalueprivate.h',
|
||||
'gtkaccessibleprivate.h',
|
||||
'gtkaccessiblevalueprivate.h',
|
||||
'gtkactionhelperprivate.h',
|
||||
'gtkactionmuxerprivate.h',
|
||||
'gtkactionobservableprivate.h',
|
||||
'gtkactionobserverprivate.h',
|
||||
'gtkadjustmentprivate.h',
|
||||
'gtkallocatedbitmaskprivate.h',
|
||||
'gtkappchooserprivate.h',
|
||||
'gtkapplicationaccelsprivate.h',
|
||||
'gtkapplicationprivate.h',
|
||||
'gtkatcontextprivate.h',
|
||||
'gtkarrayimplprivate.h',
|
||||
'gtkbindingsprivate.h',
|
||||
'gtkbitmaskprivate.h',
|
||||
'gtkbuilderprivate.h',
|
||||
'gtkbuilderscopeprivate.h',
|
||||
'gtkbuttonprivate.h',
|
||||
'gtkcellareaboxcontextprivate.h',
|
||||
'gtkcheckbuttonprivate.h',
|
||||
@@ -52,7 +45,6 @@ private_headers = [
|
||||
'gtkcssarrayvalueprivate.h',
|
||||
'gtkcssbgsizevalueprivate.h',
|
||||
'gtkcssbordervalueprivate.h',
|
||||
'gtkcssboxesimplprivate.h',
|
||||
'gtkcssboxesprivate.h',
|
||||
'gtkcsscalcvalueprivate.h',
|
||||
'gtkcsscolorvalueprivate.h',
|
||||
@@ -401,7 +393,6 @@ expand_content_md_files = [
|
||||
'drawing-model.md',
|
||||
'css-overview.md',
|
||||
'css-properties.md',
|
||||
'section-accessibility.md',
|
||||
'section-text-widget.md',
|
||||
'section-tree-widget.md',
|
||||
'section-list-widget.md',
|
||||
|
||||
@@ -137,41 +137,8 @@ use gtk_button_new_from_icon_name().
|
||||
|
||||
### Stop using GtkWidget event signals
|
||||
|
||||
Event controllers and gestures replace event signals in GTK 4.
|
||||
|
||||
Most of them have been backported to GTK 3.x so you can prepare
|
||||
for this change.
|
||||
|
||||
| Signal | Event controller |
|
||||
| --- | --- |
|
||||
| ::event | #GtkEventControllerLegacy |
|
||||
| ::event-after | #GtkEventControllerLegacy |
|
||||
| ::button-press-event | #GtkGestureClick |
|
||||
| ::button-release-event | #GtkGestureClick |
|
||||
| ::touch-event | various touch gestures |
|
||||
| ::scroll-event | #GtkEventControllerScroll |
|
||||
| ::motion-notify-event | #GtkEventControllerMotion |
|
||||
| ::delete-event | - |
|
||||
| ::key-press-event | #GtkEventControllerKey |
|
||||
| ::key-release-event | #GtkEventControllerKey |
|
||||
| ::enter-notify-event | #GtkEventControllerMotion |
|
||||
| ::leave-notify-event | #GtkEventControllerMotion |
|
||||
| ::configure-event | replaced by #GdkSurface::size-changed |
|
||||
| ::focus-in-event | #GtkEventControllerFocus |
|
||||
| ::focus-out-event | #GtkEventControllerFocus |
|
||||
| ::map-event | replaced by #GdkSurface:mapped |
|
||||
| ::unmap-event | replaced by #GdkSurface:mapped |
|
||||
| ::property-notify-event | replaced by #GdkClipboard |
|
||||
| ::selection-clear-event | replaced by #GdkClipboard |
|
||||
| ::selection-request-event | replaced by #GdkClipboard |
|
||||
| ::selection-notify-event | replaced by #GdkClipboard |
|
||||
| Drag-and-Drop signals | #GtkDragSource, #GtkDropTarget |
|
||||
| ::proximity-in-event | #GtkGestureStylus |
|
||||
| ::proximity-out-event | #GtkGestureStylus |
|
||||
| ::visibility-notify-event | - |
|
||||
| ::window-state-event | replaced by #GdkToplevel:state |
|
||||
| ::damage-event | - |
|
||||
| ::grab-broken-event | - |
|
||||
Event controllers and #GtkGestures replace event signals in GTK 4.
|
||||
They have been backported to GTK 3.x so you can prepare for this change.
|
||||
|
||||
### Set a proper application ID
|
||||
|
||||
@@ -309,9 +276,10 @@ use the #GtkWindow:modal property of the dialog.
|
||||
### Adapt to coordinate API changes
|
||||
|
||||
A number of coordinate APIs in GTK 3 had _double variants:
|
||||
gdk_device_get_surface_at_position(), gdk_surface_get_device_position().
|
||||
These have been changed to use doubles, and the _double variants
|
||||
have been removed. Update your code accordingly.
|
||||
gdk_device_get_position(), gdk_device_get_surface_at_position(),
|
||||
gdk_surface_get_device_position(). These have been changed to use
|
||||
doubles, and the _double variants have been removed. Update your
|
||||
code accordingly.
|
||||
|
||||
Any APIs that deal with global (or root) coordinates have been
|
||||
removed in GTK 4, since not all backends support them. You should
|
||||
@@ -563,26 +531,6 @@ by a layout manager (if they are layout-related), or handled in some
|
||||
other way. One possibility is to use child meta objects, as seen with
|
||||
GtkAssistantPage, GtkStackPage and the like.
|
||||
|
||||
The replacements for gtk_container_add() are:
|
||||
|
||||
| Widget | Replacement |
|
||||
| ------ | ----------- |
|
||||
| GtkActionBar | gtk_action_bar_pack_start(), gtk_action_bar_pack_end() |
|
||||
| GtkBox | gtk_box_append() |
|
||||
| GtkExpander | gtk_expander_set_child() |
|
||||
| GtkFixed | gtk_fixed_put() |
|
||||
| GtkFlowBox | gtk_flow_box_insert() |
|
||||
| GtkGrid | gtk_grid_attach() |
|
||||
| GtkHeaderBar | gtk_header_bar_pack_start(), gtk_header_bar_pack_end() |
|
||||
| GtkIconView | - |
|
||||
| GtkInfoBar | gtk_info_bar_add_child() |
|
||||
| GtkListBox | gtk_list_box_insert() |
|
||||
| GtkNotebook | gtk_notebook_append_page() |
|
||||
| GtkPaned | gtk_paned_set_start_child(), gtk_paned_set_end_child() |
|
||||
| GtkStack | gtk_stack_add_named() |
|
||||
| GtkTextView | gtk_text_view_add_child_at_anchor(), gtk_text_view_add_overlay() |
|
||||
| GtkTreeView | - |
|
||||
|
||||
### Stop using GtkContainer::border-width
|
||||
|
||||
GTK 4 has removed the #GtkContainer::border-width property (together
|
||||
@@ -774,14 +722,6 @@ Instead of a monitor number, #GdkMonitor is now used throughout.
|
||||
gdk_display_get_monitors() returns the list of monitors that can be queried
|
||||
or observed for monitors to pass to APIs like gtk_window_fullscreen_on_monitor().
|
||||
|
||||
### Adapt to monitor API changes
|
||||
|
||||
The gdk_monitor_get_workarea() API is gone. Individual backends can still
|
||||
provide this information, for example with gdk_x11_monitor_get_workarea().
|
||||
|
||||
If you use this information, your code should check which backend is in
|
||||
use and then call the appropriate backend API.
|
||||
|
||||
### Adapt to cursor API changes
|
||||
|
||||
Use the new gtk_widget_set_cursor() function to set cursors, instead of
|
||||
|
||||
@@ -61,6 +61,18 @@ other widgets that display text.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>ATK</term>
|
||||
<listitem><para>
|
||||
ATK is the Accessibility Toolkit. It provides a set of generic
|
||||
interfaces allowing accessibility technologies to interact with a
|
||||
graphical user interface. For example, a screen reader uses ATK to
|
||||
discover the text in an interface and read it to blind users. GTK
|
||||
widgets have built-in support for accessibility using the ATK
|
||||
framework.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>GdkPixbuf</term>
|
||||
<listitem><para>
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
# GTK Accessibility {#gtk-accessibility}
|
||||
|
||||
## The standard accessibility interface
|
||||
|
||||
The #GtkAccessible interface provides the accessibility information about
|
||||
an application's user interface elements. Assistive technology (AT)
|
||||
applications, like Orca, convey this information to users with disabilities,
|
||||
or reduced abilities, to help them use the application.
|
||||
|
||||
Standard GTK controls implement the #GtkAccessible interface and are thus
|
||||
accessible to ATs by default. This means that if you use GTK controls such
|
||||
as #GtkButton, #GtkEntry, or #GtkListView, you only need to supply
|
||||
application-specific details when the defaults values are incomplete. You
|
||||
can do this by setting the appropriate properties in your #GtkBuilder
|
||||
template and UI definition files, or by setting the properties defined by
|
||||
the #GtkAccessible interface.
|
||||
|
||||
If you are implementing your own #GtkWidget derived type, you will need to
|
||||
set the #GtkAccessible properties yourself, and provide an implementation
|
||||
of the #GtkAccessible virtual functions.
|
||||
|
||||
## Accessible roles and attributes
|
||||
|
||||
The fundamental concepts of an accessible widget are *roles* and
|
||||
*attributes*; each GTK control has a role, while its functionality is
|
||||
described by a set of *attributes*.
|
||||
|
||||
### Roles
|
||||
|
||||
Roles define the taxonomy and semantics of a UI control to any assistive
|
||||
technology application; for instance, a button will have a role of
|
||||
`GTK_ACCESSIBLE_ROLE_BUTTON`; an entry will have a role of
|
||||
`GTK_ACCESSIBLE_ROLE_TEXTBOX`; a toggle button will have a role of
|
||||
`GTK_ACCESSIBLE_ROLE_CHECKBOX`; etc.
|
||||
|
||||
Each role is part of the widget's instance, and **cannot** be changed over
|
||||
time or as the result of a user action. Roles allows assistive technology
|
||||
applications to identify a UI control and decide how to present it to a
|
||||
user; if a part of the application's UI changes role, the control needs to
|
||||
be removed and replaced with another one with the appropriate role.
|
||||
|
||||
#### List of accessible roles
|
||||
|
||||
Each role name is part of the #GtkAccessibleRole enumeration.
|
||||
|
||||
| Role name | Description | Related GTK widget |
|
||||
|-----------|-------------|--------------------|
|
||||
| `BUTTON` | A control that performs an action when pressed | #GtkButton, #GtkLinkButton, #GtkExpander |
|
||||
| `CHECKBOX` | A control that has three possible value: `true`, `false`, or `undefined` | #GtkCheckButton |
|
||||
| `COMBOBOX` | A control that can be expanded to show a list of possible values to select | #GtkComboBox |
|
||||
| `DIALOG` | A dialog that prompts the user to enter information or require a response | #GtkDialog and subclasses |
|
||||
| `IMG` | An image | #GtkImage, #GtkPicture |
|
||||
| `LABEL` | A visible name or caption for a user interface component | #GtkLabel |
|
||||
| `METER` | Represents a value within a known range | #GtkLevelBar |
|
||||
| `PROGRESS_BAR` | An element that display progress | #GtkProgressBar |
|
||||
| `RADIO` | A checkable input in a group of radio roles | #GtkRadioButton |
|
||||
| `SCROLLBAR` | A graphical object controlling the scolling of content | #GtkScrollbar |
|
||||
| `SEARCH_BOX` | A text box for entering search criteria | #GtkSearchEntry |
|
||||
| `SEPARATOR` | A divider that separates sections of content or groups of items | #GtkSeparator |
|
||||
| `SPIN_BUTTON` | A range control that allows seelcting among discrete choices | #GtkSpinButton |
|
||||
| `SWITCH` | A control that represents on/off values | #GtkSwitch |
|
||||
| `TEXT_BOX` | A type of input that allows free-form text as its value. | #GtkEntry, #GtkPasswordEntry, #GtkTextView |
|
||||
| `WINDOW` | An application window | #GtkWindow |
|
||||
| `...` | … |
|
||||
|
||||
See the [WAI-ARIA](https://www.w3.org/WAI/PF/aria/appendices#quickref) list
|
||||
of roles for additional information.
|
||||
|
||||
### Attributes
|
||||
|
||||
Attributes provide specific information about an accessible UI
|
||||
control, and describe it for the assistive technology applications. GTK
|
||||
divides the accessible attributes into three categories:
|
||||
|
||||
- *properties*, described by the values of the #GtkAccessibleProperty
|
||||
enumeration
|
||||
- *relations*, described by the values of the #GtkAccessibleRelation
|
||||
enumeration
|
||||
- *states*, described by the values of the #GtkAccessibleState enumeration
|
||||
|
||||
Each attribute accepts a value of a specific type.
|
||||
|
||||
Unlike roles, attributes may change over time, or in response to user action;
|
||||
for instance:
|
||||
|
||||
- a toggle button will change its %GTK_ACCESSIBLE_STATE_CHECKED state every
|
||||
time it is toggled, either by the user or programmatically
|
||||
- setting the mnemonic widget on a #GtkLabel will update the
|
||||
%GTK_ACCESSIBLE_RELATION_LABELLED_BY relation on the widget with a
|
||||
reference to the label
|
||||
- changing the #GtkAdjustment instance on a #GtkScrollbar will change the
|
||||
%GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN,
|
||||
and %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW properties with the upper, lower,
|
||||
and value properties of the #GtkAdjustment
|
||||
|
||||
See the [WAI-ARIA](https://www.w3.org/WAI/PF/aria/appendices#quickref) list
|
||||
of attributes for additional information.
|
||||
|
||||
#### List of accessible properties
|
||||
|
||||
Each state name is part of the #GtkAccessibleProperty enumeration.
|
||||
|
||||
| State name | ARIA attribute | Value type | Notes |
|
||||
|------------|----------------|------------|-------|
|
||||
| %GTK_ACCESSIBLE_STATE_BUSY | “aria-busy” | boolean |
|
||||
| %GTK_ACCESSIBLE_STATE_CHECKED | “aria-checked” | #GtkAccessibleTristate | Indicates the current state of a #GtkCheckButton |
|
||||
| %GTK_ACCESSIBLE_STATE_DISABLED | “aria-disabled” | boolean | Corresponds to the #GtkWidget:sensitive property on #GtkWidget |
|
||||
| %GTK_ACCESSIBLE_STATE_EXPANDED | “aria-expanded” | boolean or undefined | Corresponds to the #GtkExpander:expanded property on #GtkExpander |
|
||||
| %GTK_ACCESSIBLE_STATE_HIDDEN | “aria-hidden” | boolean | Corresponds to the #GtkWidget:visible property on #GtkWidget |
|
||||
| %GTK_ACCESSIBLE_STATE_INVALID | “aria-invalid” | #GtkAccessibleInvalidState | Set when a widget is showing an error |
|
||||
| %GTK_ACCESSIBLE_STATE_PRESSED | “aria-pressed” | #GtkAccessibleTristate | Indicates the current state of a #GtkToggleButton |
|
||||
| %GTK_ACCESSIBLE_STATE_SELECTED | “aria-selected” | boolean or undefined | Set when a widget is selected |
|
||||
|
||||
#### List of accessible relations
|
||||
|
||||
Each state name is part of the #GtkAccessibleRelation enumeration.
|
||||
|
||||
| State name | ARIA attribute | Value type |
|
||||
|------------|----------------|------------|
|
||||
| %GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE | “aria-autocomplete” | #GtkAccessibleAutocomplete |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_DESCRIPTION | “aria-description” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_HAS_POPUP | “aria-haspopup” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS | “aria-keyshortcuts” | string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_LABEL | “aria-label” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_LEVEL | “aria-level” | integer |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_MODAL | “aria-modal” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_MULTI_LINE | “aria-multiline” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE | “aria-multiselectable” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_ORIENTATION | “aria-orientation” | #GtkOrientation |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER | “aria-placeholder” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_READ_ONLY | “aria-readonly” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_REQUIRED | “aria-required” | boolean |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION | “aria-roledescription” | translatable string |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_SORT | “aria-sort” | #GtkAccessibleSort |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_MAX | “aria-valuemax” | double |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN | “aria-valuemin” | double |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW | “aria-valuenow” | double |
|
||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT | “aria-valuetext” | translatable string |
|
||||
|
||||
#### List of accessible states
|
||||
|
||||
Each state name is part of the #GtkAccessibleState enumeration.
|
||||
|
||||
| State name | ARIA attribute | Value type |
|
||||
|------------|----------------|------------|
|
||||
| %GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT | “aria-activedescendant” | #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_COUNT | “aria-colcount” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_INDEX | “aria-colindex” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT | “aria-colindextext” | translatable string |
|
||||
| %GTK_ACCESSIBLE_RELATION_COL_SPAN | “aria-colspan” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_CONTROLS | “aria-controls” | a #GList of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_DESCRIBED_BY | “aria-describedby” | a #GList of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_DETAILS | “aria-details” | a #GList of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE | “aria-errormessage” | #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_FLOW_TO | “aria-flowto” | a #GList of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_LABELLED_BY | “aria-labelledby” | a #GList of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_OWNS | “aria-owns” | a #GList of #GtkAccessible |
|
||||
| %GTK_ACCESSIBLE_RELATION_POS_IN_SET | “aria-posinset” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_ROW_COUNT | “aria-rowcount” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_ROW_INDEX | “aria-rowindex” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT | “aria-rowindextext” | translatable string |
|
||||
| %GTK_ACCESSIBLE_RELATION_ROW_SPAN | “aria-rowspan” | integer |
|
||||
| %GTK_ACCESSIBLE_RELATION_SET_SIZE | “aria-setsize” | integer |
|
||||
|
||||
## Application development rules
|
||||
|
||||
Even if standard UI controls provided by GTK have accessibility information
|
||||
out of the box, there are some additional properties and considerations for
|
||||
application developers. For instance, if your application presents the user
|
||||
with a form to fill out, you should ensure that:
|
||||
|
||||
* the container of the form has a `GTK_ACCESSIBLE_ROLE_FORM` role
|
||||
* each text entry widget in the form has the `GTK_ACCESSIBLE_RELATION_LABELLED_BY`
|
||||
relation pointing to the label widget that describes it
|
||||
|
||||
Another example: if you create a tool bar containing buttons with only icons,
|
||||
you should ensure that:
|
||||
|
||||
* the container has a `GTK_ACCESSIBLE_ROLE_TOOLBAR` role
|
||||
* each button has a `GTK_ACCESSIBLE_PROPERTY_LABEL` property set with the user
|
||||
readable and localised action performed when pressed; for instance "Copy",
|
||||
"Paste", "Add layer", or "Remove"
|
||||
|
||||
GTK will try to fill in some information by using ancillary UI control
|
||||
property, for instance the accessible label will be taken from the label or
|
||||
placeholder text used by the UI control, or from its tooltip, if the
|
||||
`GTK_ACCESSIBLE_PROPERTY_LABEL` property or the `GTK_ACCESSIBLE_RELATION_LABELLED_BY`
|
||||
relation are unset. Nevertheless, it is good practice and project hygiene
|
||||
to explicitly specify the accessible properties, just like it's good practice
|
||||
to specify tooltips and style classes.
|
||||
|
||||
Application developers using GTK **should** ensure that their UI controls
|
||||
are accessible as part of the development process. When using `GtkBuilder`
|
||||
templates and UI definition files, GTK provides a validation tool that
|
||||
verifies that each UI element has a valid role and properties; this tool can
|
||||
be used as part of the application's test suite to avoid regressions.
|
||||
|
||||
## Implementations
|
||||
|
||||
Each UI control implements the #GtkAccessible interface to allow widget and
|
||||
application developers to specify the roles, state, and relations between UI
|
||||
controls. This API is purely descriptive.
|
||||
|
||||
Each `GtkAccessible` implementation must provide a #GtkATContext instance,
|
||||
which acts as a proxy to the specific platform's accessibility API:
|
||||
|
||||
* AT-SPI on Linux/BSD
|
||||
* NSAccessibility on macOS
|
||||
* Active Accessibility on Windows
|
||||
|
||||
Additionally, an ad hoc accessibility backend is available for the GTK
|
||||
testsuite, to ensure reproducibility of issues in the CI pipeline.
|
||||
@@ -123,32 +123,6 @@ the number of listitems they create such as with gtk_grid_view_set_max_columns()
|
||||
and developers running into performance problems should definitely study the
|
||||
tradeoffs of those and experiment with them.
|
||||
|
||||
## Choosing the right model {#model-choosing}
|
||||
|
||||
GTK offers a wide variety of wrapping models which change or supplement an
|
||||
existing model (or models) in some way. But when it comes to storing your
|
||||
actual data, there are only a few ready-made choices available: #GListStore
|
||||
and #GtkStringList.
|
||||
|
||||
GListStore is backed by a balanced tree and has performance characteristics
|
||||
that are expected for that data structure. It works reasonably well for dataset
|
||||
sizes in the 1,000,000 range, and can handle insertions and deletions. It uses
|
||||
a cached iter to make linear access to the items fast.
|
||||
|
||||
GtkStringList is not a general store - it can only handle strings. It is
|
||||
backed by an dynamically allocated array and has performance characteristics
|
||||
that are expected for that data structure. GtkStringList is a good fit for any
|
||||
place where you would otherwise use `char*[]` and works best if the dataset
|
||||
is not very dynamic.
|
||||
|
||||
If these models don't fit your use case or scalability requirements, you
|
||||
should make a custom #GListModel. It is a small interface and not very hard
|
||||
to implement.
|
||||
|
||||
For asymptotic performance comparisons between tree- and array-based
|
||||
implementations, see this
|
||||
[article](https://en.wikipedia.org/wiki/Dynamic_array#Performance).
|
||||
|
||||
## Displaying trees {#displaying-trees}
|
||||
|
||||
While #GtkTreeView provided built-in support for trees, the list widgets, and
|
||||
|
||||
@@ -189,7 +189,7 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
char *author;
|
||||
gchar *author;
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
{
|
||||
|
||||
@@ -141,8 +141,8 @@ take_window_shot (Window child,
|
||||
XWindowAttributes attrs;
|
||||
Window xid;
|
||||
Display *dpy;
|
||||
int x = 0, y = 0;
|
||||
int width, height;
|
||||
gint x = 0, y = 0;
|
||||
gint width, height;
|
||||
|
||||
GdkPixbuf *tmp, *tmp2;
|
||||
GdkPixbuf *retval = NULL;
|
||||
|
||||
@@ -797,7 +797,7 @@ static WidgetInfo *
|
||||
create_about_dialog (void)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
const char *authors[] = {
|
||||
const gchar *authors[] = {
|
||||
"Peter Mattis",
|
||||
"Spencer Kimball",
|
||||
"Josh MacDonald",
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef enum
|
||||
typedef struct WidgetInfo
|
||||
{
|
||||
GtkWidget *window;
|
||||
char *name;
|
||||
gchar *name;
|
||||
gboolean no_focus;
|
||||
gboolean include_decorations;
|
||||
WidgetSize size;
|
||||
|
||||
@@ -32,7 +32,7 @@ static GActionEntry win_entries[] = {
|
||||
{ "close", action_activated },
|
||||
};
|
||||
|
||||
const char *menu_ui =
|
||||
const gchar *menu_ui =
|
||||
"<interface>"
|
||||
" <menu id='doc-menu'>"
|
||||
" <section>"
|
||||
|
||||
@@ -27,8 +27,8 @@ example_app_activate (GApplication *app)
|
||||
static void
|
||||
example_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
|
||||
@@ -25,7 +25,7 @@ static void
|
||||
search_text_changed (GtkEntry *entry,
|
||||
ExampleAppWindow *win)
|
||||
{
|
||||
const char *text;
|
||||
const gchar *text;
|
||||
GtkWidget *tab;
|
||||
GtkWidget *view;
|
||||
GtkTextBuffer *buffer;
|
||||
@@ -55,7 +55,7 @@ static void
|
||||
find_word (GtkButton *button,
|
||||
ExampleAppWindow *win)
|
||||
{
|
||||
const char *word;
|
||||
const gchar *word;
|
||||
|
||||
word = gtk_button_get_label (button);
|
||||
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
|
||||
@@ -69,7 +69,7 @@ update_words (ExampleAppWindow *win)
|
||||
GtkWidget *tab, *view, *row;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start, end;
|
||||
char *word, *key;
|
||||
gchar *word, *key;
|
||||
GtkWidget *child;
|
||||
|
||||
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
|
||||
@@ -121,7 +121,7 @@ update_lines (ExampleAppWindow *win)
|
||||
GtkWidget *tab, *view;
|
||||
GtkTextBuffer *buffer;
|
||||
int count;
|
||||
char *lines;
|
||||
gchar *lines;
|
||||
|
||||
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
|
||||
|
||||
@@ -248,9 +248,9 @@ void
|
||||
example_app_window_open (ExampleAppWindow *win,
|
||||
GFile *file)
|
||||
{
|
||||
char *basename;
|
||||
gchar *basename;
|
||||
GtkWidget *scrolled, *view;
|
||||
char *contents;
|
||||
gchar *contents;
|
||||
gsize length;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextTag *tag;
|
||||
|
||||
@@ -27,8 +27,8 @@ example_app_activate (GApplication *app)
|
||||
static void
|
||||
example_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
|
||||
@@ -27,8 +27,8 @@ example_app_activate (GApplication *app)
|
||||
static void
|
||||
example_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
|
||||
@@ -36,9 +36,9 @@ void
|
||||
example_app_window_open (ExampleAppWindow *win,
|
||||
GFile *file)
|
||||
{
|
||||
char *basename;
|
||||
gchar *basename;
|
||||
GtkWidget *scrolled, *view;
|
||||
char *contents;
|
||||
gchar *contents;
|
||||
gsize length;
|
||||
|
||||
basename = g_file_get_basename (file);
|
||||
|
||||
@@ -39,7 +39,7 @@ static GActionEntry app_entries[] =
|
||||
static void
|
||||
example_app_startup (GApplication *app)
|
||||
{
|
||||
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
@@ -63,8 +63,8 @@ example_app_activate (GApplication *app)
|
||||
static void
|
||||
example_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
|
||||
@@ -46,9 +46,9 @@ void
|
||||
example_app_window_open (ExampleAppWindow *win,
|
||||
GFile *file)
|
||||
{
|
||||
char *basename;
|
||||
gchar *basename;
|
||||
GtkWidget *scrolled, *view;
|
||||
char *contents;
|
||||
gchar *contents;
|
||||
gsize length;
|
||||
|
||||
basename = g_file_get_basename (file);
|
||||
|
||||
@@ -39,7 +39,7 @@ static GActionEntry app_entries[] =
|
||||
static void
|
||||
example_app_startup (GApplication *app)
|
||||
{
|
||||
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
@@ -63,8 +63,8 @@ example_app_activate (GApplication *app)
|
||||
static void
|
||||
example_app_open (GApplication *app,
|
||||
GFile **files,
|
||||
int n_files,
|
||||
const char *hint)
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
|
||||
@@ -66,9 +66,9 @@ void
|
||||
example_app_window_open (ExampleAppWindow *win,
|
||||
GFile *file)
|
||||
{
|
||||
char *basename;
|
||||
gchar *basename;
|
||||
GtkWidget *scrolled, *view;
|
||||
char *contents;
|
||||
gchar *contents;
|
||||
gsize length;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextTag *tag;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user