Compare commits

..

6 Commits

Author SHA1 Message Date
Matthias Clasen
20422f98ab Fix up the warning
It is misleading to complain about the factory here.
2020-08-25 13:54:32 -04:00
Matthias Clasen
ebfdd71a3e gtk-demo: Add suggestion entry demos
Move the Dropdowns demo to Lists/Selections,
and make it show both GtkDropDown and
GtkSuggestionEntry, with some variations.
2020-07-24 10:41:35 -04:00
Matthias Clasen
56069698b1 docs: Mention GtkSuggestionEntry in list widget overview 2020-07-24 10:41:35 -04:00
Matthias Clasen
c86a4222a9 Add GtkSuggestionEntry
GtkSuggestionEntry is a replacement for GtkComboBoxText
and GtkEntryCompletion, very similar to GtkDropDown, but
using an entry as widget.
2020-07-24 10:41:35 -04:00
Matthias Clasen
16d09f154e sortlistmodel: Fix a crash 2020-07-24 10:41:35 -04:00
Matthias Clasen
67fdc4f533 dropdown: Fix popup sizing
Setting a width request is not quite enough, since
gtk_widget_set_size_request() only queues a resize
when the widget is visible. Explicitly force one
here. Without this, the popup sometimes shows up
too small.
2020-07-24 10:41:35 -04:00
964 changed files with 16409 additions and 14569 deletions

View File

@@ -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++)
{

View File

@@ -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);

View File

@@ -174,29 +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);
g_object_unref (filter);
g_object_unref (all_constraints);
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
children = (GListModel *)gtk_filter_list_model_new (all_children, filter);
g_object_unref (filter);
g_object_unref (all_children);
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);

View File

@@ -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 */

View File

@@ -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))

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 ();

View File

@@ -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;

View File

@@ -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,

View File

@@ -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;

View File

@@ -1,13 +1,15 @@
/* Drop Downs
/* Lists/Selections
*
* The GtkDropDown widget is a modern alternative to GtkComboBox.
* It uses list models instead of tree models, and the content is
* displayed using widgets instead of cell renderers.
* The GtkDropDown and GtkSuggestionEntry widgets are modern
* alternatives to GtkComboBox and GtkEntryCompletion.
*
* They use list models instead of tree models, and the content
* is displayed using widgets instead of cell renderers.
*
* The examples here demonstrate how to use different kinds of
* list models with GtkDropDown, how to use search and how to
* display the selected item differently from the presentation
* in the popup.
* list models with GtkDropDown and GtkSuggestionEntry, how to
* use search and how to display the selected item differently
* from the presentation in the popup.
*/
#include <gtk/gtk.h>
@@ -218,13 +220,110 @@ get_title (gpointer item)
return g_strdup (STRING_HOLDER (item)->title);
}
static char *
get_file_name (gpointer item)
{
return g_strdup (g_file_info_get_display_name (G_FILE_INFO (item)));
}
static void
setup_item (GtkSignalListItemFactory *factory,
GtkListItem *item)
{
GtkWidget *box;
GtkWidget *icon;
GtkWidget *label;
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
icon = gtk_image_new ();
label = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_append (GTK_BOX (box), icon);
gtk_box_append (GTK_BOX (box), label);
gtk_list_item_set_child (item, box);
}
static void
bind_item (GtkSignalListItemFactory *factory,
GtkListItem *item)
{
GtkMatchObject *match = GTK_MATCH_OBJECT (gtk_list_item_get_item (item));
GFileInfo *info = G_FILE_INFO (gtk_match_object_get_item (match));
GtkWidget *box = gtk_list_item_get_child (item);
GtkWidget *icon = gtk_widget_get_first_child (box);
GtkWidget *label = gtk_widget_get_last_child (box);
gtk_image_set_from_gicon (GTK_IMAGE (icon), g_file_info_get_icon (info));
gtk_label_set_label (GTK_LABEL (label), g_file_info_get_display_name (info));
}
static void
setup_highlight_item (GtkSignalListItemFactory *factory,
GtkListItem *item)
{
GtkWidget *label;
label = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_list_item_set_child (item, label);
}
static void
bind_highlight_item (GtkSignalListItemFactory *factory,
GtkListItem *item)
{
GtkMatchObject *obj;
GtkWidget *label;
PangoAttrList *attrs;
PangoAttribute *attr;
const char *str;
obj = GTK_MATCH_OBJECT (gtk_list_item_get_item (item));
label = gtk_list_item_get_child (item);
str = gtk_match_object_get_string (obj);
gtk_label_set_label (GTK_LABEL (label), str);
attrs = pango_attr_list_new ();
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
attr->start_index = gtk_match_object_get_match_start (obj);
attr->end_index = gtk_match_object_get_match_end (obj);
pango_attr_list_insert (attrs, attr);
gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs);
}
static void
match_func (GtkMatchObject *obj,
const char *search,
gpointer user_data)
{
char *tmp1, *tmp2;
char *p;
tmp1 = g_utf8_normalize (gtk_match_object_get_string (obj), -1, G_NORMALIZE_ALL);
tmp2 = g_utf8_normalize (search, -1, G_NORMALIZE_ALL);
if ((p = strstr (tmp1, tmp2)) != NULL)
gtk_match_object_set_match (obj,
p - tmp1,
(p - tmp1) + g_utf8_strlen (search, -1),
1);
else
gtk_match_object_set_match (obj, 0, 0, 0);
g_free (tmp1);
g_free (tmp2);
}
GtkWidget *
do_dropdown (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *button, *box, *spin, *check;
GtkWidget *button, *box, *spin, *check, *hbox, *label, *entry;
GListModel *model;
GtkExpression *expression;
GtkListItemFactory *factory;
const char * const times[] = { "1 minute", "2 minutes", "5 minutes", "20 minutes", NULL };
const char * const many_times[] = {
"1 minute", "2 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes",
@@ -237,23 +336,51 @@ do_dropdown (GtkWidget *do_widget)
const char * const device_descriptions[] = {
"Built-in Audio", "Built-in audio", "Thinkpad Tunderbolt 3 Dock USB Audio", "Thinkpad Tunderbolt 3 Dock USB Audio", NULL
};
char *cwd;
GFile *file;
GListModel *dir;
GtkStringList *strings;
if (!window)
{
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Drop Downs");
gtk_window_set_title (GTK_WINDOW (window), "Selections");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_widget_set_margin_start (box, 10);
gtk_widget_set_margin_end (box, 10);
gtk_widget_set_margin_top (box, 10);
gtk_widget_set_margin_bottom (box, 10);
gtk_window_set_child (GTK_WINDOW (window), box);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
gtk_widget_set_margin_start (hbox, 20);
gtk_widget_set_margin_end (hbox, 20);
gtk_widget_set_margin_top (hbox, 20);
gtk_widget_set_margin_bottom (hbox, 20);
gtk_window_set_child (GTK_WINDOW (window), hbox);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_box_append (GTK_BOX (hbox), box);
label = gtk_label_new ("Dropdowns");
gtk_widget_add_css_class (label, "title-4");
gtk_box_append (GTK_BOX (box), label);
/* A basic dropdown */
button = drop_down_new_from_strings (times, NULL, NULL);
gtk_box_append (GTK_BOX (box), button);
/* A dropdown using an expression to obtain strings */
button = drop_down_new_from_strings (many_times, NULL, NULL);
gtk_drop_down_set_enable_search (GTK_DROP_DOWN (button), TRUE);
expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL,
0, NULL,
(GCallback)get_title,
NULL, NULL);
gtk_drop_down_set_expression (GTK_DROP_DOWN (button), expression);
gtk_expression_unref (expression);
gtk_box_append (GTK_BOX (box), button);
/* A dropdown using a non-trivial model, and search */
button = gtk_drop_down_new ();
model = G_LIST_MODEL (pango_cairo_font_map_get_default ());
@@ -270,30 +397,118 @@ do_dropdown (GtkWidget *do_widget)
spin = gtk_spin_button_new_with_range (-1, g_list_model_get_n_items (G_LIST_MODEL (model)), 1);
gtk_widget_set_halign (spin, GTK_ALIGN_START);
gtk_widget_set_margin_start (spin, 20);
g_object_bind_property (button, "selected", spin, "value", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
gtk_box_append (GTK_BOX (box), spin);
check = gtk_check_button_new_with_label ("Enable search");
gtk_widget_set_margin_start (check, 20);
g_object_bind_property (button, "enable-search", check, "active", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
gtk_box_append (GTK_BOX (box), check);
g_object_unref (model);
button = drop_down_new_from_strings (times, NULL, NULL);
gtk_box_append (GTK_BOX (box), button);
button = drop_down_new_from_strings (many_times, NULL, NULL);
gtk_drop_down_set_enable_search (GTK_DROP_DOWN (button), TRUE);
expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL,
0, NULL,
(GCallback)get_title,
NULL, NULL);
gtk_drop_down_set_expression (GTK_DROP_DOWN (button), expression);
gtk_expression_unref (expression);
gtk_box_append (GTK_BOX (box), button);
/* A dropdown with a separate list factory */
button = drop_down_new_from_strings (device_titles, device_icons, device_descriptions);
gtk_box_append (GTK_BOX (box), button);
gtk_box_append (GTK_BOX (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL));
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_box_append (GTK_BOX (hbox), box);
label = gtk_label_new ("Suggestions");
gtk_widget_add_css_class (label, "title-4");
gtk_box_append (GTK_BOX (box), label);
/* A basic suggestion entry */
entry = gtk_suggestion_entry_new ();
g_object_set (entry, "placeholder-text", "Words with T or G…", NULL);
strings = gtk_string_list_new ((const char *[]){
"GNOME",
"gnominious",
"Gnomonic projection",
"total",
"totally",
"toto",
"tottery",
"totterer",
"Totten trust",
"totipotent",
"totipotency",
"totemism",
"totem pole",
"Totara",
"totalizer",
"totalizator",
"totalitarianism",
"total parenteral nutrition",
"total hysterectomy",
"total eclipse",
"Totipresence",
"Totipalmi",
"Tomboy",
"zombie",
NULL});
gtk_suggestion_entry_set_model (GTK_SUGGESTION_ENTRY (entry), G_LIST_MODEL (strings));
g_object_unref (strings);
gtk_box_append (GTK_BOX (box), entry);
/* A suggestion entry using a custom model, and no filtering */
entry = gtk_suggestion_entry_new ();
cwd = g_get_current_dir ();
file = g_file_new_for_path (cwd);
dir = G_LIST_MODEL (gtk_directory_list_new ("standard::display-name,standard::content-type,standard::icon,standard::size", file));
gtk_suggestion_entry_set_model (GTK_SUGGESTION_ENTRY (entry), dir);
g_object_unref (dir);
g_object_unref (file);
g_free (cwd);
expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL,
0, NULL,
(GCallback)get_file_name,
NULL, NULL);
gtk_suggestion_entry_set_expression (GTK_SUGGESTION_ENTRY (entry), expression);
gtk_expression_unref (expression);
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_item), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind_item), NULL);
gtk_suggestion_entry_set_factory (GTK_SUGGESTION_ENTRY (entry), factory);
g_object_unref (factory);
gtk_suggestion_entry_set_use_filter (GTK_SUGGESTION_ENTRY (entry), FALSE);
gtk_suggestion_entry_set_show_arrow (GTK_SUGGESTION_ENTRY (entry), TRUE);
gtk_box_append (GTK_BOX (box), entry);
/* A suggestion entry with match highlighting */
entry = gtk_suggestion_entry_new ();
g_object_set (entry, "placeholder-text", "Destination", NULL);
strings = gtk_string_list_new ((const char *[]){
"app-mockups",
"settings-mockups",
"os-mockups",
"software-mockups",
"mocktails",
NULL});
gtk_suggestion_entry_set_model (GTK_SUGGESTION_ENTRY (entry), G_LIST_MODEL (strings));
g_object_unref (strings);
gtk_box_append (GTK_BOX (box), entry);
gtk_suggestion_entry_set_match_func (GTK_SUGGESTION_ENTRY (entry), match_func, NULL, NULL);
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_highlight_item), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind_highlight_item), NULL);
gtk_suggestion_entry_set_factory (GTK_SUGGESTION_ENTRY (entry), factory);
g_object_unref (factory);
}
if (!gtk_widget_get_visible (window))

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,

View File

@@ -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)
{

View File

@@ -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];

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -8,7 +8,7 @@
static void
on_bar_response (GtkInfoBar *info_bar,
int response_id,
gint response_id,
gpointer user_data)
{
GtkWidget *dialog;

View File

@@ -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)

View File

@@ -81,7 +81,7 @@ spinner_timeout (gpointer data)
static GtkTreeModel *
create_model (void)
{
int i = 0;
gint i = 0;
GtkListStore *store;
GtkTreeIter iter;

View File

@@ -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;

View File

@@ -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]);
@@ -1186,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;
@@ -1294,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 } },

View File

@@ -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);

View File

@@ -18,7 +18,6 @@ demos = files([
'cursors.c',
'dialog.c',
'drawingarea.c',
'dropdown.c',
'dnd.c',
'editable_cells.c',
'entry_completion.c',
@@ -47,6 +46,7 @@ demos = files([
'listview_colors.c',
'listview_filebrowser.c',
'listview_minesweeper.c',
'dropdown.c',
'listview_settings.c',
'listview_weather.c',
'listview_words.c',

View File

@@ -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);
}

View File

@@ -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));
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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++)
{

View File

@@ -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);

View File

@@ -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>"

View File

@@ -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,9 +557,9 @@ 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);
}
@@ -627,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"));
@@ -642,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"));
@@ -654,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);
@@ -703,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;
@@ -853,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);
@@ -881,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;
@@ -983,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 },
@@ -1025,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;
@@ -1081,7 +1081,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
typedef struct {
GtkWidget *flowbox;
char *filename;
gchar *filename;
} BackgroundData;
static void
@@ -1127,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;
@@ -1288,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;
@@ -1331,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);
@@ -1352,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);
@@ -1377,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));
@@ -1402,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));
@@ -1421,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));
@@ -1434,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));
@@ -1469,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);
@@ -1594,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);
@@ -1864,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 } },
@@ -1878,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;
@@ -2282,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);

View File

@@ -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:

View File

@@ -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] = { "&lt;Ctrl&gt;Q", NULL };
const gchar *quit_accels[2] = { "&lt;Ctrl&gt;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;

View File

@@ -223,6 +223,7 @@
<xi:include href="xml/gtksearchentry.xml" />
<xi:include href="xml/gtksearchbar.xml" />
<xi:include href="xml/gtkeditablelabel.xml" />
<xi:include href="xml/gtksuggestionentry.xml" />
</chapter>
<chapter id="TextWidgetObjects">

View File

@@ -2041,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
@@ -7639,3 +7641,27 @@ gtk_selection_filter_model_new_for_type
gtk_selection_filter_model_set_model
gtk_selection_filter_model_get_model
</SECTION>
<SECTION>
<FILE>gtksuggestionentry</FILE>
<TITLE>GtkSuggestionEntry</TITLE>
GtkSuggestionEntry
gtk_suggestion_entry_new
gtk_suggestion_entry_set_model
gtk_suggestion_entry_get_model
gtk_suggestion_entry_set_from_strings
gtk_suggestion_entry_set_factory
gtk_suggestion_entry_get_factory
gtk_suggestion_entry_set_expression
gtk_suggestion_entry_get_expression
gtk_suggestion_entry_set_use_filter
gtk_suggestion_entry_get_use_filter
gtk_suggestion_entry_set_insert_selection
gtk_suggestion_entry_get_insert_selection
gtk_suggestion_entry_set_insert_prefix
gtk_suggestion_entry_get_insert_prefix
gtk_suggestion_entry_set_show_button
gtk_suggestion_entry_get_show_button
gtk_suggestion_entry_set_minimum_length
gtk_suggestion_entry_get_minimum_length
</SECTION>

View File

@@ -220,6 +220,7 @@ gtk_string_filter_get_type
gtk_string_list_get_type
gtk_string_object_get_type
gtk_string_sorter_get_type
gtk_suggestion_entry_get_type
gtk_switch_get_type
gtk_level_bar_get_type
gtk_style_context_get_type

View File

@@ -224,4 +224,6 @@ transitioning code for easy lookup:
| #GtkCellLayout | #GtkListItemFactory |
| #GtkCellArea | #GtkWidget |
| #GtkCellRenderer | #GtkWidget |
| #GtkComboBoxText | #GtkSuggestionEntry |
| #GtkEntryCompletion | #GtkSuggestionEntry |

View File

@@ -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))
{

View File

@@ -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;

View File

@@ -797,7 +797,7 @@ static WidgetInfo *
create_about_dialog (void)
{
GtkWidget *widget;
const char *authors[] = {
const gchar *authors[] = {
"Peter Mattis",
"Spencer Kimball",
"Josh MacDonald",

View File

@@ -15,7 +15,7 @@ typedef enum
typedef struct WidgetInfo
{
GtkWidget *window;
char *name;
gchar *name;
gboolean no_focus;
gboolean include_decorations;
WidgetSize size;

View File

@@ -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>"

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);

View 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;

View File

@@ -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);

View 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;

View File

@@ -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;

View File

@@ -46,7 +46,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);
@@ -70,8 +70,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;

View File

@@ -67,9 +67,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;

View File

@@ -46,7 +46,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);
@@ -70,8 +70,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;

View File

@@ -20,7 +20,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const char *text;
const gchar *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -120,9 +120,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;

View File

@@ -46,7 +46,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);
@@ -70,8 +70,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;

View File

@@ -23,7 +23,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const char *text;
const gchar *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -53,7 +53,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);
@@ -67,7 +67,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));
@@ -212,9 +212,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;

View File

@@ -46,7 +46,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);
@@ -70,8 +70,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;

View File

@@ -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));
@@ -246,9 +246,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;

View File

@@ -77,7 +77,7 @@ change_justify_state (GSimpleAction *action,
gpointer user_data)
{
GtkTextView *text = g_object_get_data (user_data, "bloatpad-text");
const char *str;
const gchar *str;
str = g_variant_get_string (state, NULL);
@@ -150,7 +150,7 @@ text_buffer_changed_cb (GtkTextBuffer *buffer,
{
GtkWindow *window = user_data;
BloatPad *app;
int old_n, n;
gint old_n, n;
app = (BloatPad *) gtk_window_get_application (window);
@@ -265,7 +265,7 @@ new_window (GApplication *app,
if (file != NULL)
{
char *contents;
gchar *contents;
gsize length;
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))
@@ -293,10 +293,10 @@ bloat_pad_activate (GApplication *application)
static void
bloat_pad_open (GApplication *application,
GFile **files,
int n_files,
const char *hint)
gint n_files,
const gchar *hint)
{
int i;
gint i;
for (i = 0; i < n_files; i++)
new_window (application, files[i]);
@@ -345,9 +345,9 @@ combo_changed (GtkComboBox *combo,
gpointer user_data)
{
GtkEntry *entry = g_object_get_data (user_data, "entry");
const char *action;
char **accels;
char *str;
const gchar *action;
gchar **accels;
gchar *str;
action = gtk_combo_box_get_active_id (combo);
@@ -368,9 +368,9 @@ response (GtkDialog *dialog,
{
GtkEntry *entry = g_object_get_data (user_data, "entry");
GtkComboBox *combo = g_object_get_data (user_data, "combo");
const char *action;
const char *str;
char **accels;
const gchar *action;
const gchar *str;
gchar **accels;
if (response_id == GTK_RESPONSE_CLOSE)
{
@@ -386,7 +386,7 @@ response (GtkDialog *dialog,
str = gtk_editable_get_text (GTK_EDITABLE (entry));
accels = g_strsplit (str, ",", 0);
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const char **) accels);
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const gchar **) accels);
g_strfreev (accels);
}
@@ -398,9 +398,9 @@ edit_accels (GSimpleAction *action,
GtkApplication *app = user_data;
GtkWidget *combo;
GtkWidget *entry;
char **actions;
gchar **actions;
GtkWidget *dialog;
int i;
gint i;
dialog = gtk_dialog_new ();
gtk_window_set_application (GTK_WINDOW (dialog), app);
@@ -426,7 +426,7 @@ update_time (gpointer user_data)
{
BloatPad *bloatpad = user_data;
GDateTime *now;
char *time;
gchar *time;
while (g_menu_model_get_n_items (G_MENU_MODEL (bloatpad->time)))
g_menu_remove (bloatpad->time, 0);
@@ -481,14 +481,14 @@ static GActionEntry app_entries[] = {
static void
dump_accels (GtkApplication *app)
{
char **actions;
int i;
gchar **actions;
gint i;
actions = gtk_application_list_action_descriptions (app);
for (i = 0; actions[i]; i++)
{
char **accels;
char *str;
gchar **accels;
gchar *str;
accels = gtk_application_get_accels_for_action (app, actions[i]);
@@ -512,10 +512,10 @@ bloat_pad_startup (GApplication *application)
GIcon *icon2;
GEmblem *emblem;
GFile *file;
int i;
gint i;
struct {
const char *action_and_target;
const char *accelerators[2];
const gchar *action_and_target;
const gchar *accelerators[2];
} accels[] = {
{ "app.new", { "<Control>n", NULL } },
{ "app.quit", { "<Control>q", NULL } },
@@ -592,7 +592,7 @@ bloat_pad_startup (GApplication *application)
g_object_unref (item);
g_object_unref (icon);
const char *new_accels[] = { "<Control>n", "<Control>t", NULL };
const gchar *new_accels[] = { "<Control>n", "<Control>t", NULL };
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels);
dump_accels (GTK_APPLICATION (application));
@@ -657,7 +657,7 @@ main (int argc, char **argv)
{
BloatPad *bloat_pad;
int status;
const char *accels[] = { "F11", NULL };
const gchar *accels[] = { "F11", NULL };
bloat_pad = bloat_pad_new ();

View File

@@ -59,8 +59,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;

View File

@@ -99,7 +99,7 @@ new_window (GApplication *app,
if (file != NULL)
{
char *contents;
gchar *contents;
gsize length;
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))
@@ -124,10 +124,10 @@ plug_man_activate (GApplication *application)
static void
plug_man_open (GApplication *application,
GFile **files,
int n_files,
const char *hint)
gint n_files,
const gchar *hint)
{
int i;
gint i;
for (i = 0; i < n_files; i++)
new_window (application, files[i]);
@@ -184,7 +184,7 @@ static gboolean is_red_plugin_enabled;
static gboolean is_black_plugin_enabled;
static gboolean
plugin_enabled (const char *name)
plugin_enabled (const gchar *name)
{
if (g_strcmp0 (name, "red") == 0)
return is_red_plugin_enabled;
@@ -228,7 +228,7 @@ plugin_action (GAction *action,
}
static void
enable_plugin (const char *name)
enable_plugin (const gchar *name)
{
GMenuModel *plugin_menu;
GAction *action;
@@ -246,8 +246,8 @@ enable_plugin (const char *name)
{
GMenu *section;
GMenuItem *item;
char *label;
char *action_name;
gchar *label;
gchar *action_name;
section = g_menu_new ();
label = g_strdup_printf ("Turn text %s", name);
@@ -272,7 +272,7 @@ enable_plugin (const char *name)
}
static void
disable_plugin (const char *name)
disable_plugin (const gchar *name)
{
GMenuModel *plugin_menu;
@@ -281,11 +281,11 @@ disable_plugin (const char *name)
plugin_menu = find_plugin_menu ();
if (plugin_menu)
{
int i;
gint i;
for (i = 0; i < g_menu_model_get_n_items (plugin_menu); i++)
{
char *id;
gchar *id;
if (g_menu_model_get_item_attribute (plugin_menu, i, "id", "s", &id))
{
if (g_strcmp0 (id, name) == 0)
@@ -311,7 +311,7 @@ disable_plugin (const char *name)
static void
enable_or_disable_plugin (GtkToggleButton *button,
const char *name)
const gchar *name)
{
if (plugin_enabled (name))
disable_plugin (name);
@@ -498,7 +498,7 @@ main (int argc, char **argv)
{
PlugMan *plug_man;
int status;
const char *accels[] = { "F11", NULL };
const gchar *accels[] = { "F11", NULL };
plug_man = plug_man_new ();
gtk_application_set_accels_for_action (GTK_APPLICATION (plug_man),

View File

@@ -32,9 +32,9 @@ activate_cb (GtkApplication *app,
gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (search_bar), window);
}
int
main (int argc,
char *argv[])
gint
main (gint argc,
gchar *argv[])
{
GtkApplication *app;

View File

@@ -30,7 +30,7 @@ new_window (GApplication *app,
if (file != NULL)
{
char *contents;
gchar *contents;
gsize length;
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))
@@ -55,10 +55,10 @@ activate (GApplication *application)
static void
open (GApplication *application,
GFile **files,
int n_files,
const char *hint)
gint n_files,
const gchar *hint)
{
int i;
gint i;
for (i = 0; i < n_files; i++)
new_window (application, files[i]);

View File

@@ -310,7 +310,7 @@ broadway_output_set_transient_for (BroadwayOutput *output,
append_uint16 (output, parent_id);
}
static int append_node_depth = -1;
static gint append_node_depth = -1;
static void
append_type (BroadwayOutput *output, guint32 type, BroadwayNode *node)

View File

@@ -63,7 +63,7 @@ struct _BroadwayServer {
GList *surfaces;
BroadwaySurface *root;
gint32 focused_surface_id; /* -1 => none */
int show_keyboard;
gint show_keyboard;
guint32 next_texture_id;
GHashTable *textures;
@@ -970,7 +970,7 @@ broadway_server_get_screen_size (BroadwayServer *server,
static void
broadway_server_fake_roundtrip_reply (BroadwayServer *server,
int id,
gint id,
guint32 tag)
{
BroadwayInputMsg msg;
@@ -1001,7 +1001,7 @@ broadway_server_flush (BroadwayServer *server)
void
broadway_server_roundtrip (BroadwayServer *server,
int id,
gint id,
guint32 tag)
{
if (server->output)
@@ -1060,8 +1060,8 @@ send_error (HttpRequest *request,
#define SEC_WEB_SOCKET_KEY_MAGIC "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
/* 'x3JJHMbDL1EzLkh9GBhXDw==' generates 'HSmrc0sMlYUkAGmm5OPpG2HaGWk=' */
static char *
generate_handshake_response_wsietf_v7 (const char *key)
static gchar *
generate_handshake_response_wsietf_v7 (const gchar *key)
{
gsize digest_len = 20;
guchar digest[20];
@@ -1565,7 +1565,7 @@ broadway_server_query_mouse (BroadwayServer *server,
void
broadway_server_destroy_surface (BroadwayServer *server,
int id)
gint id)
{
BroadwaySurface *surface;
@@ -1594,7 +1594,7 @@ broadway_server_destroy_surface (BroadwayServer *server,
gboolean
broadway_server_surface_show (BroadwayServer *server,
int id)
gint id)
{
BroadwaySurface *surface;
gboolean sent = FALSE;
@@ -1616,7 +1616,7 @@ broadway_server_surface_show (BroadwayServer *server,
gboolean
broadway_server_surface_hide (BroadwayServer *server,
int id)
gint id)
{
BroadwaySurface *surface;
gboolean sent = FALSE;
@@ -1646,7 +1646,7 @@ broadway_server_surface_hide (BroadwayServer *server,
void
broadway_server_surface_raise (BroadwayServer *server,
int id)
gint id)
{
BroadwaySurface *surface;
@@ -1676,7 +1676,7 @@ broadway_server_set_show_keyboard (BroadwayServer *server,
void
broadway_server_surface_lower (BroadwayServer *server,
int id)
gint id)
{
BroadwaySurface *surface;
@@ -1693,7 +1693,7 @@ broadway_server_surface_lower (BroadwayServer *server,
void
broadway_server_surface_set_transient_for (BroadwayServer *server,
int id, int parent)
gint id, gint parent)
{
BroadwaySurface *surface;
@@ -1865,7 +1865,7 @@ decode_nodes (BroadwayServer *server,
/* passes ownership of nodes */
void
broadway_server_surface_update_nodes (BroadwayServer *server,
int id,
gint id,
guint32 data[],
int len,
GHashTable *client_texture_map)
@@ -1946,7 +1946,7 @@ broadway_server_release_texture (BroadwayServer *server,
gboolean
broadway_server_surface_move_resize (BroadwayServer *server,
int id,
gint id,
gboolean with_move,
int x,
int y,
@@ -1989,7 +1989,7 @@ broadway_server_surface_move_resize (BroadwayServer *server,
void
broadway_server_focus_surface (BroadwayServer *server,
int new_focused_surface)
gint new_focused_surface)
{
BroadwayInputMsg focus_msg;
@@ -2010,8 +2010,8 @@ broadway_server_focus_surface (BroadwayServer *server,
guint32
broadway_server_grab_pointer (BroadwayServer *server,
int client_id,
int id,
gint client_id,
gint id,
gboolean owner_events,
guint32 event_mask,
guint32 time_)

View File

@@ -60,7 +60,7 @@ gboolean broadway_server_has_client (BroadwayServer *
void broadway_server_flush (BroadwayServer *server);
void broadway_server_sync (BroadwayServer *server);
void broadway_server_roundtrip (BroadwayServer *server,
int id,
gint id,
guint32 tag);
void broadway_server_get_screen_size (BroadwayServer *server,
guint32 *width,
@@ -76,8 +76,8 @@ void broadway_server_query_mouse (BroadwayServer *
gint32 *root_y,
guint32 *mask);
guint32 broadway_server_grab_pointer (BroadwayServer *server,
int client_id,
int id,
gint client_id,
gint id,
gboolean owner_events,
guint32 event_mask,
guint32 time_);
@@ -93,23 +93,23 @@ guint32 broadway_server_new_surface (BroadwayServer *
int width,
int height);
void broadway_server_destroy_surface (BroadwayServer *server,
int id);
gint id);
gboolean broadway_server_surface_show (BroadwayServer *server,
int id);
gint id);
gboolean broadway_server_surface_hide (BroadwayServer *server,
int id);
gint id);
void broadway_server_surface_raise (BroadwayServer *server,
int id);
gint id);
void broadway_server_surface_lower (BroadwayServer *server,
int id);
gint id);
void broadway_server_surface_set_transient_for (BroadwayServer *server,
int id,
int parent);
gint id,
gint parent);
gboolean broadway_server_surface_translate (BroadwayServer *server,
int id,
gint id,
cairo_region_t *area,
int dx,
int dy);
gint dx,
gint dy);
guint32 broadway_server_upload_texture (BroadwayServer *server,
GBytes *texture);
void broadway_server_release_texture (BroadwayServer *server,
@@ -117,19 +117,19 @@ void broadway_server_release_texture (BroadwayServer *
cairo_surface_t * broadway_server_create_surface (int width,
int height);
void broadway_server_surface_update_nodes (BroadwayServer *server,
int id,
gint id,
guint32 data[],
int len,
GHashTable *client_texture_map);
gboolean broadway_server_surface_move_resize (BroadwayServer *server,
int id,
gint id,
gboolean with_move,
int x,
int y,
int width,
int height);
void broadway_server_focus_surface (BroadwayServer *server,
int new_focused_surface);
gint new_focused_surface);
#endif /* __BROADWAY_SERVER__ */

View File

@@ -501,7 +501,7 @@ _gdk_broadway_server_new_surface (GdkBroadwayServer *server,
void
_gdk_broadway_server_destroy_surface (GdkBroadwayServer *server,
int id)
gint id)
{
BroadwayRequestDestroySurface msg;
@@ -512,7 +512,7 @@ _gdk_broadway_server_destroy_surface (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_show (GdkBroadwayServer *server,
int id)
gint id)
{
BroadwayRequestShowSurface msg;
@@ -525,7 +525,7 @@ _gdk_broadway_server_surface_show (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
int id)
gint id)
{
BroadwayRequestHideSurface msg;
@@ -538,7 +538,7 @@ _gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
void
_gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
int id)
gint id)
{
BroadwayRequestFocusSurface msg;
@@ -549,7 +549,7 @@ _gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
void
_gdk_broadway_server_surface_set_transient_for (GdkBroadwayServer *server,
int id, int parent)
gint id, gint parent)
{
BroadwayRequestSetTransientFor msg;
@@ -692,7 +692,7 @@ gdk_broadway_server_surface_set_nodes (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_move_resize (GdkBroadwayServer *server,
int id,
gint id,
gboolean with_move,
int x,
int y,
@@ -716,7 +716,7 @@ _gdk_broadway_server_surface_move_resize (GdkBroadwayServer *server,
GdkGrabStatus
_gdk_broadway_server_grab_pointer (GdkBroadwayServer *server,
int id,
gint id,
gboolean owner_events,
guint32 event_mask,
guint32 time_)

View File

@@ -32,7 +32,7 @@ void _gdk_broadway_server_query_mouse (GdkBroadwaySer
gint32 *root_y,
guint32 *mask);
GdkGrabStatus _gdk_broadway_server_grab_pointer (GdkBroadwayServer *server,
int id,
gint id,
gboolean owner_events,
guint32 event_mask,
guint32 time_);
@@ -45,23 +45,23 @@ guint32 _gdk_broadway_server_new_surface (GdkBroadwaySe
int width,
int height);
void _gdk_broadway_server_destroy_surface (GdkBroadwayServer *server,
int id);
gint id);
gboolean _gdk_broadway_server_surface_show (GdkBroadwayServer *server,
int id);
gint id);
gboolean _gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
int id);
gint id);
void _gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
int id);
gint id);
void _gdk_broadway_server_surface_set_transient_for (GdkBroadwayServer *server,
int id,
int parent);
gint id,
gint parent);
void _gdk_broadway_server_set_show_keyboard (GdkBroadwayServer *server,
gboolean show_keyboard);
gboolean _gdk_broadway_server_surface_translate (GdkBroadwayServer *server,
int id,
gint id,
cairo_region_t *area,
int dx,
int dy);
gint dx,
gint dy);
guint32 gdk_broadway_server_upload_texture (GdkBroadwayServer *server,
GdkTexture *texture);
void gdk_broadway_server_release_texture (GdkBroadwayServer *server,
@@ -70,7 +70,7 @@ void gdk_broadway_server_surface_set_nodes (GdkBroadwaySe
guint32 id,
GArray *nodes);
gboolean _gdk_broadway_server_surface_move_resize (GdkBroadwayServer *server,
int id,
gint id,
gboolean with_move,
int x,
int y,

View File

@@ -24,8 +24,8 @@
#include "gdkprivate-broadway.h"
static void gdk_broadway_device_get_state (GdkDevice *device,
GdkSurface *surface,
double *axes,
GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
static void gdk_broadway_device_set_surface_cursor (GdkDevice *device,
GdkSurface *surface,
@@ -46,8 +46,8 @@ static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
static void gdk_broadway_device_ungrab (GdkDevice *device,
guint32 time_);
static GdkSurface * gdk_broadway_device_surface_at_position (GdkDevice *device,
double *win_x,
double *win_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
@@ -79,11 +79,11 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core)
static void
gdk_broadway_device_get_state (GdkDevice *device,
GdkSurface *surface,
double *axes,
GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
double x, y;
gdouble x, y;
gdk_surface_get_device_position (surface, device, &x, &y, mask);
@@ -271,8 +271,8 @@ gdk_broadway_device_ungrab (GdkDevice *device,
static GdkSurface *
gdk_broadway_device_surface_at_position (GdkDevice *device,
double *win_x,
double *win_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask)
{
GdkSurface *surface = NULL;

View File

@@ -175,7 +175,7 @@ create_touchscreen (GdkDisplay *display)
}
GdkDisplay *
_gdk_broadway_display_open (const char *display_name)
_gdk_broadway_display_open (const gchar *display_name)
{
GdkDisplay *display;
GdkBroadwayDisplay *broadway_display;
@@ -225,12 +225,12 @@ _gdk_broadway_display_open (const char *display_name)
return display;
}
static const char *
static const gchar *
gdk_broadway_display_get_name (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
return (char *) "Broadway";
return (gchar *) "Broadway";
}
static void
@@ -311,7 +311,7 @@ gdk_broadway_display_finalize (GObject *object)
static void
gdk_broadway_display_notify_startup_complete (GdkDisplay *display,
const char *startup_id)
const gchar *startup_id)
{
}

View File

@@ -25,7 +25,7 @@
#include <stdlib.h>
static gboolean gdk_event_source_prepare (GSource *source,
int *timeout);
gint *timeout);
static gboolean gdk_event_source_check (GSource *source);
static gboolean gdk_event_source_dispatch (GSource *source,
GSourceFunc callback,
@@ -54,7 +54,7 @@ static GList *event_sources = NULL;
static gboolean
gdk_event_source_prepare (GSource *source,
int *timeout)
gint *timeout)
{
GdkDisplay *display = ((GdkEventSource*) source)->display;
gboolean retval;

View File

@@ -142,7 +142,7 @@ gdk_broadway_keymap_get_entries_for_keycode (GdkKeymap *keymap,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
int *n_entries)
gint *n_entries)
{
if (n_entries)
*n_entries = 1;
@@ -171,10 +171,10 @@ static gboolean
gdk_broadway_keymap_translate_keyboard_state (GdkKeymap *keymap,
guint hardware_keycode,
GdkModifierType state,
int group,
gint group,
guint *keyval,
int *effective_group,
int *level,
gint *effective_group,
gint *level,
GdkModifierType *consumed_modifiers)
{
if (keyval)

View File

@@ -55,8 +55,8 @@ GdkDrag * _gdk_broadway_surface_drag_begin (GdkSurface *surface,
double dy);
void _gdk_broadway_surface_translate (GdkSurface *surface,
cairo_region_t *area,
int dx,
int dy);
gint dx,
gint dy);
gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
BroadwayInputMsg *msg);
gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
@@ -69,13 +69,13 @@ void _gdk_broadway_surface_grab_check_unmap (GdkSurface *surface,
gulong serial);
void gdk_broadway_surface_move_resize (GdkSurface *surface,
int x,
int y,
int width,
int height);
gint x,
gint y,
gint width,
gint height);
void _gdk_keymap_keys_changed (GdkDisplay *display);
int _gdk_broadway_get_group_for_state (GdkDisplay *display,
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,
GdkModifierType state);
void _gdk_keymap_add_virtual_modifiers_compat (GdkKeymap *keymap,
GdkModifierType *modifiers);
@@ -89,10 +89,10 @@ void _gdk_broadway_events_got_input (GdkDisplay *display,
BroadwayInputMsg *message);
void _gdk_broadway_display_init_root_window (GdkDisplay *display);
GdkDisplay * _gdk_broadway_display_open (const char *display_name);
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
void _gdk_broadway_display_queue_events (GdkDisplay *display);
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
const char *name);
const gchar *name);
GdkCursor *_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
GdkTexture *texture,
int x,

View File

@@ -405,7 +405,7 @@ gdk_broadway_surface_hide (GdkSurface *surface)
_gdk_surface_clear_update_area (surface);
}
static int
static gint
gdk_broadway_surface_get_scale_factor (GdkSurface *surface)
{
GdkBroadwayDisplay *broadway_display;
@@ -456,10 +456,10 @@ sync_child_root_pos (GdkSurface *parent)
static void
gdk_broadway_surface_move_resize_internal (GdkSurface *surface,
gboolean with_move,
int x,
int y,
int width,
int height)
gint x,
gint y,
gint width,
gint height)
{
GdkBroadwaySurface *impl = GDK_BROADWAY_SURFACE (surface);
GdkBroadwayDisplay *broadway_display;
@@ -522,10 +522,10 @@ gdk_broadway_surface_move_resize_internal (GdkSurface *surface,
void
gdk_broadway_surface_move_resize (GdkSurface *surface,
int x,
int y,
int width,
int height)
gint x,
gint y,
gint width,
gint height)
{
gdk_broadway_surface_move_resize_internal (surface, TRUE,
x, y,
@@ -534,8 +534,8 @@ gdk_broadway_surface_move_resize (GdkSurface *surface,
static void
gdk_broadway_surface_toplevel_resize (GdkSurface *surface,
int width,
int height)
gint width,
gint height)
{
gdk_broadway_surface_move_resize_internal (surface, FALSE,
0, 0,
@@ -544,8 +544,8 @@ gdk_broadway_surface_toplevel_resize (GdkSurface *surface,
static void
gdk_broadway_surface_move (GdkSurface *surface,
int x,
int y)
gint x,
gint y)
{
gdk_broadway_surface_move_resize_internal (surface, TRUE, x, y, -1, -1);
}
@@ -660,13 +660,13 @@ gdk_broadway_surface_set_geometry_hints (GdkSurface *surface,
static void
gdk_broadway_surface_set_title (GdkSurface *surface,
const char *title)
const gchar *title)
{
}
static void
gdk_broadway_surface_set_startup_id (GdkSurface *surface,
const char *startup_id)
const gchar *startup_id)
{
}
@@ -696,10 +696,10 @@ gdk_broadway_surface_set_transient_for (GdkSurface *surface,
static void
gdk_broadway_surface_get_geometry (GdkSurface *surface,
int *x,
int *y,
int *width,
int *height)
gint *x,
gint *y,
gint *width,
gint *height)
{
g_return_if_fail (GDK_IS_SURFACE (surface));
@@ -718,10 +718,10 @@ gdk_broadway_surface_get_geometry (GdkSurface *surface,
static void
gdk_broadway_surface_get_root_coords (GdkSurface *surface,
int x,
int y,
int *root_x,
int *root_y)
gint x,
gint y,
gint *root_x,
gint *root_y)
{
GdkBroadwaySurface *impl;
@@ -736,8 +736,8 @@ gdk_broadway_surface_get_root_coords (GdkSurface *surface,
static gboolean
gdk_broadway_surface_get_device_state (GdkSurface *surface,
GdkDevice *device,
double *x,
double *y,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
{
GdkSurface *child;
@@ -839,13 +839,13 @@ struct _MoveResizeData
GdkSurface *moveresize_emulation_surface;
gboolean is_resize;
GdkSurfaceEdge resize_edge;
int moveresize_button;
int moveresize_x;
int moveresize_y;
int moveresize_orig_x;
int moveresize_orig_y;
int moveresize_orig_width;
int moveresize_orig_height;
gint moveresize_button;
gint moveresize_x;
gint moveresize_y;
gint moveresize_orig_x;
gint moveresize_orig_y;
gint moveresize_orig_width;
gint moveresize_orig_height;
long moveresize_process_time;
GdkSurfaceHints moveresize_geom_mask;
GdkGeometry moveresize_geometry;
@@ -876,17 +876,17 @@ get_move_resize_data (GdkDisplay *display,
static void
update_pos (MoveResizeData *mv_resize,
int new_root_x,
int new_root_y)
gint new_root_x,
gint new_root_y)
{
int dx, dy;
gint dx, dy;
dx = new_root_x - mv_resize->moveresize_x;
dy = new_root_y - mv_resize->moveresize_y;
if (mv_resize->is_resize)
{
int x, y, w, h;
gint x, y, w, h;
x = mv_resize->moveresize_orig_x;
y = mv_resize->moveresize_orig_y;
@@ -951,7 +951,7 @@ update_pos (MoveResizeData *mv_resize,
}
else
{
int x, y;
gint x, y;
x = mv_resize->moveresize_orig_x + dx;
y = mv_resize->moveresize_orig_y + dy;
@@ -1129,7 +1129,7 @@ create_moveresize_surface (MoveResizeData *mv_resize,
static void
calculate_unmoving_origin (MoveResizeData *mv_resize)
{
int x, y, width, height;
gint x, y, width, height;
if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY &&
mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC)

View File

@@ -30,7 +30,7 @@ void gdk_display_set_cursor_theme (GdkDisplay *display,
gboolean gdk_running_in_sandbox (void);
gboolean gdk_should_use_portal (void);
const char * gdk_get_startup_notification_id (void);
const gchar * gdk_get_startup_notification_id (void);
PangoDirection gdk_unichar_direction (gunichar ch);
PangoDirection gdk_find_base_dir (const char *text,

View File

@@ -163,7 +163,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
G_DEFINE_CONSTRUCTOR(stash_desktop_startup_notification_id)
#endif
static char *startup_notification_id = NULL;
static gchar *startup_notification_id = NULL;
static void
stash_desktop_startup_notification_id (void)
@@ -209,8 +209,8 @@ gdk_parse_debug_var (const char *variable,
guint i;
guint result = 0;
const char *string;
const char *p;
const char *q;
const gchar *p;
const gchar *q;
gboolean invert;
gboolean help;
@@ -352,7 +352,7 @@ gdk_display_open_default (void)
* Returns: (nullable) (transfer none): the original value of the
* DESKTOP_STARTUP_ID environment variable, or %NULL.
*/
const char *
const gchar *
gdk_get_startup_notification_id (void)
{
return startup_notification_id;
@@ -402,11 +402,11 @@ gdk_unichar_direction (gunichar ch)
}
PangoDirection
gdk_find_base_dir (const char *text,
int length)
gdk_find_base_dir (const gchar *text,
gint length)
{
PangoDirection dir = PANGO_DIRECTION_NEUTRAL;
const char *p;
const gchar *p;
g_return_val_if_fail (text != NULL || length == 0, PANGO_DIRECTION_NEUTRAL);

View File

@@ -60,14 +60,14 @@
*/
static void gdk_app_launch_context_finalize (GObject *object);
static char * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
static gchar * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static char * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
static gchar * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static void gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id);
const gchar *startup_notify_id);
enum
@@ -157,7 +157,7 @@ gdk_app_launch_context_finalize (GObject *object)
G_OBJECT_CLASS (gdk_app_launch_context_parent_class)->finalize (object);
}
static char *
static gchar *
gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
@@ -205,7 +205,7 @@ gdk_app_launch_context_get_display (GdkAppLaunchContext *context)
*/
void
gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
int desktop)
gint desktop)
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
@@ -298,6 +298,6 @@ gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
static void
gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id)
const gchar *startup_notify_id)
{
}

View File

@@ -43,7 +43,7 @@ GdkDisplay * gdk_app_launch_context_get_display (GdkAppLaunchContext *
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
int desktop);
gint desktop);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context,
guint32 timestamp);

View File

@@ -35,7 +35,7 @@ struct _GdkAppLaunchContext
GAppLaunchContext parent_instance;
GdkDisplay *display;
int workspace;
gint workspace;
guint32 timestamp;
GIcon *icon;
char *icon_name;

View File

@@ -73,7 +73,7 @@ gdk_array(init) (GdkArray *self)
self->end = self->start;
self->end_allocation = self->start + GDK_ARRAY_PREALLOC;
#ifdef GDK_ARRAY_NULL_TERMINATED
*self->start = *(_T_[1]) { 0 };
*self->start = *(_T_[1]) {};
#endif
#else
self->start = NULL;
@@ -165,7 +165,7 @@ gdk_array(reserve) (GdkArray *self,
if (self->start == NULL)
{
self->start = g_new (_T_, new_size);
*self->start = *(_T_[1]) { 0 };
*self->start = *(_T_[1]) {};
}
else
#endif

View File

@@ -91,7 +91,7 @@ gdk_cairo_region (cairo_t *cr,
const cairo_region_t *region)
{
cairo_rectangle_int_t box;
int n_boxes, i;
gint n_boxes, i;
g_return_if_fail (cr != NULL);
g_return_if_fail (region != NULL);
@@ -109,7 +109,7 @@ void
gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
const GdkPixbuf *pixbuf)
{
int width, height;
gint width, height;
guchar *gdk_pixels, *cairo_pixels;
int gdk_rowstride, cairo_stride;
int n_channels;
@@ -213,8 +213,8 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
void
gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
double pixbuf_x,
double pixbuf_y)
gdouble pixbuf_x,
gdouble pixbuf_y)
{
cairo_format_t format;
cairo_surface_t *surface;
@@ -312,7 +312,7 @@ gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
GdkRectangle extents, rect;
cairo_surface_t *image;
cairo_t *cr;
int x, y, stride;
gint x, y, stride;
guchar *data;
_gdk_cairo_surface_extents (surface, &extents);
@@ -347,7 +347,7 @@ gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
for (x = 0; x < extents.width; x++)
{
/* Search for a continuous range of "non transparent pixels"*/
int x0 = x;
gint x0 = x;
while (x < extents.width)
{
#if G_BYTE_ORDER == G_LITTLE_ENDIAN

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