Compare commits

...

37 Commits

Author SHA1 Message Date
Matthias Clasen
b6d908b8aa selectionfiltermodel: Make constructor allow-none
We don't pay attention to item-type anymore, so
drop the item-type property and the _for_item_type()
constructor, and allow passing NULL to the regular
constructor.

We don't make this constructor transfer-full, since
the selection filter model is not a wrapping model
like the others. It is more like fork than a wrap.
2020-07-26 17:35:49 -04:00
Matthias Clasen
c659910a83 multiselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Also make the constructor return GtkMultiSelection *.

Update all callers.
2020-07-26 17:25:06 -04:00
Matthias Clasen
1af097455c singleselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 17:16:15 -04:00
Matthias Clasen
6873f63987 noselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 16:55:43 -04:00
Matthias Clasen
16b043a127 treelistmodel: Make constructor transfer full
Make gtk_tree_list_model_new() take the root model
as first argument, and make it transfer full, for
consistency with other wrapping list constructors.

Update all callers.

Still missing here: Make the model property writable,
and allow passing NULL in the constructor.
2020-07-26 16:38:53 -04:00
Matthias Clasen
0b7f7028d9 sortlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 16:25:12 -04:00
Matthias Clasen
5dba053ad1 filterlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 15:55:44 -04:00
Matthias Clasen
cd8a810d69 slicelistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 15:38:15 -04:00
Matthias Clasen
8f63a5ab63 listlistmodel: Drop item_type
We are using G_TYPE_OBJECT throughout, so there
is no need for GtkListListModel to do anything else.

Update all callers.
2020-07-26 14:37:55 -04:00
Matthias Clasen
eb3381723f maplistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 14:23:16 -04:00
Matthias Clasen
7e87ad1887 flattenlistmodel: Make the constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 14:21:28 -04:00
Matthias Clasen
ef6babf896 Merge branch 'matthiasc/for-master' into 'master'
overlaylayout: Document minimally

See merge request GNOME/gtk!2285
2020-07-26 12:00:49 +00:00
Matthias Clasen
7f9570b95b overlaylayout: Document minimally
This layout manager is not reusable, but we
still need to make its layout properties show
up in the docs.
2020-07-25 19:02:33 -04:00
Matthias Clasen
d8d8a71a7a Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2284
2020-07-25 17:30:11 +00:00
Matthias Clasen
2ff3e3d1e4 gtk: Improve struct packing in places
Plug some holes in our structs by rearranging
a few fields. This is was done looking at
pahole output.
2020-07-25 11:57:37 -04:00
Matthias Clasen
73f4f518b8 gdk: Improve struct packing in places
Plug some holes in our structs by rearranging
a few fields. This is was done looking at
pahole output.
2020-07-25 11:57:37 -04:00
Matthias Clasen
6e9dbba130 colorswatch: Remove unused radius fields
The radius fields are never used.
2020-07-25 11:57:37 -04:00
Matthias Clasen
706aa93ab5 hsla: Just store floats
We are using floats for rgb, and we don't need more precision
for hsl colors either. We use hsl for computing color expressions
like shade(), lighter() and darker(), which are not precisely
specified anyway.

This commit updates the one test where the output changes a
tiny bit due to this.
2020-07-25 11:56:05 -04:00
Matthias Clasen
54deed9a5a headerbar: Drop the Private struct 2020-07-25 07:41:05 -04:00
Matthias Clasen
0e70ddcab3 colorplane: Drop the Private struct and padding 2020-07-24 22:56:24 -04:00
Matthias Clasen
f2bdb1fb87 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2283
2020-07-25 00:05:28 +00:00
Matthias Clasen
ec9fd76c87 Merge branch 'wip/otte/types' into 'master'
Get rid of unneeded glib types

See merge request GNOME/gtk!2282
2020-07-24 23:54:01 +00:00
Matthias Clasen
bacaa5eb9a Add another sortlistmodel test
This tests the crash fix in f7b73b2e01.
2020-07-24 19:28:54 -04:00
Matthias Clasen
9a297516ba testsuite: Add an incremental sort test
Add a test that makes changes to a model while it
is incrementally sorted.
2020-07-24 19:23:18 -04:00
Matthias Clasen
e9bff53015 timsort: Avoid a crash
We need to clear the pointer after freeing the data,
since the sortlistmodel keeps its timsort structure
around and reuses it.
2020-07-24 19:23:18 -04:00
Benjamin Otte
3078b180fe Replace "gdouble" with "double" 2020-07-25 00:47:36 +02:00
Benjamin Otte
556997f9df Replace "gfloat" with "float" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d7266b25ba Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
Matthias Clasen
2a43ce1705 testsuite: Use better names for sortlistmodel tests
Name the tests for what they do.
2020-07-24 15:37:49 -04:00
Matthias Clasen
3324a6e6b3 testsuite: Reenable tests for incremental sort
This was unintentionally disabled.
2020-07-24 15:22:14 -04:00
Matthias Clasen
46423e614d Merge branch 'remove-align-widget' into 'master'
menubutton: Remove align-widget property

See merge request GNOME/gtk!2280
2020-07-24 18:17:30 +00:00
Matthias Clasen
f7b73b2e01 sortlistmodel: Fix a crash 2020-07-24 14:15:14 -04:00
Matthias Clasen
c85e424279 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 14:15:04 -04:00
Florian Müllner
b146c48e23 menubutton: Remove align-widget property
The property has been unused since commit 8701e34f74. That was four
years ago, so it's safe to say that nobody has been missing it terribly.
2020-07-24 13:55:06 +02:00
Timm Bäder
3176d69009 Merge branch 'fix-gdk-array-msvc' into 'master'
gdk/gdkarrayimpl.c: Fix build on Visual Studio

See merge request GNOME/gtk!2279
2020-07-24 09:28:21 +00:00
Chun-wei Fan
89f7d841ab gdk/gdkarrayimpl.c: Fix build on Visual Studio
It seems like initializing something to an empty array using `{}` is a GCCism,
so just stuff a 0 within the braces to accomplish the same thing.
2020-07-24 16:25:24 +08:00
985 changed files with 14691 additions and 14808 deletions

View File

@@ -81,11 +81,11 @@ constraint_editor_application_activate (GApplication *app)
static void
constraint_editor_application_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
ConstraintEditorWindow *win;
gint i;
int 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,
gint response,
int response,
ConstraintEditorWindow *self)
{
gtk_native_dialog_hide (dialog);
@@ -285,7 +285,7 @@ serialize_model (GListModel *list)
static void
save_response_cb (GtkNativeDialog *dialog,
gint response,
int response,
ConstraintEditorWindow *self)
{
gtk_native_dialog_hide (dialog);

View File

@@ -174,28 +174,25 @@ constraint_view_init (ConstraintView *self)
manager = gtk_constraint_layout_new ();
gtk_widget_set_layout_manager (GTK_WIDGET (self), 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));
all_constraints = gtk_constraint_layout_observe_constraints (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);
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);
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 gchar *name;
const char *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;
gchar *text;
const gchar *name;
const gchar *value;
char *text;
const char *name;
const char *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,
gint response_id,
int response_id,
gpointer user_data)
{
GtkFileChooserNative *native = user_data;
@@ -185,7 +185,7 @@ activate_about (GSimpleAction *action,
{
GtkWidget *window = user_data;
const gchar *authors[] = {
const char *authors[] = {
"Peter Mattis",
"Spencer Kimball",
"Josh MacDonald",
@@ -193,7 +193,7 @@ activate_about (GSimpleAction *action,
NULL
};
const gchar *documentors[] = {
const char *documentors[] = {
"Owen Taylor",
"Tony Gale",
"Matthias Clasen <mclasen@redhat.com>",
@@ -244,9 +244,9 @@ static void
update_statusbar (GtkTextBuffer *buffer,
DemoApplicationWindow *window)
{
gchar *msg;
gint row, col;
gint count;
char *msg;
int row, col;
int 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 gchar *name,
const gchar *name_owner,
const char *name,
const char *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 gchar *name,
const char *name,
gpointer user_data)
{
if (!name_seen)
@@ -55,7 +55,7 @@ do_application_demo (GtkWidget *toplevel)
if (placeholder == NULL)
{
const gchar *command;
const char *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)
{
gdouble fraction;
double 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)
{
gint current_page, n_pages;
gchar *title;
int current_page, n_pages;
char *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;
gint page_number;
const gchar *text;
int page_number;
const char *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;
gint i;
int 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;
gint *indices;
int *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;
gint i;
int 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 gchar *blend_mode)
const char *blend_mode)
{
GBytes *bytes;
gchar *css;
char *css;
bytes = g_resources_lookup_data ("/css_blendmodes/css_blendmodes.css", 0, NULL);
css = g_strdup_printf ((gchar*) g_bytes_get_data (bytes, NULL),
css = g_strdup_printf ((char *) 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 gchar *blend_mode;
const char *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;
gint i;
int 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 gchar *icon_name;
const char *icon_name;
GtkIconTheme *icon_theme;
GtkIconPaintable *icon;

View File

@@ -16,7 +16,7 @@ message_dialog_clicked (GtkButton *button,
gpointer user_data)
{
GtkWidget *dialog;
static gint i = 1;
static int 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,
gdouble x,
gdouble y)
double x,
double y)
{
GdkRectangle update_rect;
cairo_t *cr;

View File

@@ -16,9 +16,9 @@
typedef struct
{
gint number;
gchar *product;
gint yummy;
int number;
char *product;
int yummy;
}
Item;
@@ -74,7 +74,7 @@ add_items (void)
static GtkTreeModel *
create_items_model (void)
{
gint i = 0;
int i = 0;
GtkListStore *model;
GtkTreeIter iter;
@@ -109,7 +109,7 @@ static GtkTreeModel *
create_numbers_model (void)
{
#define N_NUMBERS 10
gint i = 0;
int 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))
{
gint i;
int i;
GtkTreePath *path;
path = gtk_tree_model_get_path (model, &iter);
@@ -211,7 +211,7 @@ separator_row (GtkTreeModel *model,
gpointer data)
{
GtkTreePath *path;
gint idx;
int 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 gchar *path,
const char *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 gchar *path_string,
const gchar *new_text,
const char *path_string,
const char *new_text,
gpointer data)
{
GtkTreeModel *model = (GtkTreeModel *)data;
GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
GtkTreeIter iter;
gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));
int 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:
{
gint i;
int 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:
{
gint i;
gchar *old_text;
int i;
char *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, gint response_id)
response_cb (GtkDialog *dialog, int response_id)
{
gtk_window_destroy (GTK_WINDOW (window));
window = NULL;

View File

@@ -22,8 +22,8 @@ format_number (GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer data)
{
gint num;
gchar *text;
int num;
char *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,
gint column,
int column,
gpointer data)
{
GtkTreeModelFilter *filter_model = GTK_TREE_MODEL_FILTER (model);
gint width, height;
int width, height;
GtkTreeModel *child_model;
GtkTreeIter child_iter;
@@ -75,7 +75,7 @@ visible_func (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
gint width;
int 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 gchar *color)
color_swatch_new (const char *color)
{
GtkWidget *button, *area;
@@ -48,7 +48,7 @@ do_flowbox (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *scrolled, *flowbox;
const gchar *colors[] = {
const char *colors[] = {
"AliceBlue",
"AntiqueWhite",
"AntiqueWhite1",
@@ -716,7 +716,7 @@ do_flowbox (GtkWidget *do_widget)
"YellowGreen",
NULL
};
gint i;
int i;
if (!window)
{

View File

@@ -295,7 +295,7 @@ update_display (void)
GList *l;
PangoAttrList *attrs;
PangoAttribute *attr;
gint ins, bound;
int 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;
gint i, j, k;
int i, j, k;
PangoFont *pango_font;
GHashTable *tags;
GHashTableIter iter;
@@ -593,7 +593,7 @@ update_script_combo (void)
static void
update_features (void)
{
gint i, j;
int i, j;
GtkTreeModel *model;
GtkTreeIter iter;
guint script_index, lang_index;
@@ -728,8 +728,8 @@ static void
entry_activated (GtkEntry *entry,
GtkAdjustment *adjustment)
{
gdouble value;
gchar *err = NULL;
double value;
char *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;
gdouble value;
double 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,
gint *x,
gint *y)
int *x,
int *y)
{
gdouble u, v;
gint width, height;
double u, v;
int 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);
gint x, y;
gint width, height;
int x, y;
int 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,
gint x,
gint y)
int x,
int y)
{
GtkWidget *widget = GTK_WIDGET (plane);
gdouble u, v;
double 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,
gdouble start_x,
gdouble start_y,
double start_x,
double start_y,
GtkFontPlane *plane)
{
guint button;
@@ -164,11 +164,11 @@ plane_drag_gesture_begin (GtkGestureDrag *gesture,
static void
plane_drag_gesture_update (GtkGestureDrag *gesture,
gdouble offset_x,
gdouble offset_y,
double offset_x,
double offset_y,
GtkFontPlane *plane)
{
gdouble start_x, start_y;
double 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,
gdouble offset_x,
gdouble offset_y,
double offset_x,
double 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 gdouble swipe_x = 0;
static gdouble swipe_y = 0;
static double swipe_x = 0;
static double 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,
gdouble velocity_x,
gdouble velocity_y,
double velocity_x,
double 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,
gdouble x,
gdouble y,
double x,
double y,
GtkWidget *widget)
{
long_pressed = TRUE;
@@ -56,8 +56,8 @@ long_press_gesture_end (GtkGesture *gesture,
static void
rotation_angle_changed (GtkGestureRotate *gesture,
gdouble angle,
gdouble delta,
double angle,
double delta,
GtkWidget *widget)
{
gtk_widget_queue_draw (widget);
@@ -65,7 +65,7 @@ rotation_angle_changed (GtkGestureRotate *gesture,
static void
zoom_scale_changed (GtkGestureZoom *gesture,
gdouble scale,
double 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;
gdouble angle, scale;
gdouble x_center, y_center;
double angle, scale;
double 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;
gint child_min, child_nat;
int 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,
gint page)
int page)
{
GtkTextTag *tag;
@@ -35,7 +35,7 @@ insert_link (GtkTextBuffer *buffer,
*/
static void
show_page (GtkTextBuffer *buffer,
gint page)
int 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;
gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
int 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,
gint x,
gint y);
int x,
int y);
static void
released_cb (GtkGestureClick *gesture,
guint n_press,
gdouble x,
gdouble y,
double x,
double y,
GtkWidget *text_view)
{
GtkTextIter start, end, iter;
@@ -168,8 +168,8 @@ released_cb (GtkGestureClick *gesture,
static void
motion_cb (GtkEventControllerMotion *controller,
gdouble x,
gdouble y,
double x,
double 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,
gint x,
gint y)
int x,
int 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;
gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page"));
int 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;
gchar *parent;
char *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 gchar *name;
const char *name;
GtkTreeIter iter;
/* First clear the store */
@@ -62,7 +62,7 @@ fill_store (GtkListStore *store)
name = g_dir_read_name (dir);
while (name != NULL)
{
gchar *path, *display_name;
char *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 gint
static int
sort_func (GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
gpointer user_data)
{
gboolean is_dir_a, is_dir_b;
gchar *name_a, *name_b;
char *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;
gchar *path;
char *path;
GtkTreeIter iter;
gboolean is_dir;
@@ -192,7 +192,7 @@ up_clicked (GtkButton *item,
gpointer user_data)
{
GtkListStore *store;
gchar *dir_name;
char *dir_name;
store = GTK_LIST_STORE (user_data);

View File

@@ -19,8 +19,8 @@ static void
fill_store (GtkListStore *store)
{
GtkTreeIter iter;
const gchar *text[] = { "Red", "Green", "Blue", "Yellow" };
gint i;
const char *text[] = { "Red", "Green", "Blue", "Yellow" };
int i;
/* First clear the store */
gtk_list_store_clear (store);
@@ -49,7 +49,7 @@ set_cell_color (GtkCellLayout *cell_layout,
GtkTreeIter *iter,
gpointer data)
{
gchar *text;
char *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 =
((gint)(color.red * 255)) << 24 |
((gint)(color.green * 255)) << 16 |
((gint)(color.blue * 255)) << 8 |
((gint)(color.alpha * 255));
((int)(color.red * 255)) << 24 |
((int)(color.green * 255)) << 16 |
((int)(color.blue * 255)) << 8 |
((int)(color.alpha * 255));
g_free (text);
@@ -77,8 +77,8 @@ set_cell_color (GtkCellLayout *cell_layout,
static void
edited (GtkCellRendererText *cell,
gchar *path_string,
gchar *text,
char *path_string,
char *text,
gpointer data)
{
GtkTreeModel *model;

View File

@@ -43,10 +43,10 @@ progressive_prepared_callback (GdkPixbufLoader *loader,
static void
progressive_updated_callback (GdkPixbufLoader *loader,
gint x,
gint y,
gint width,
gint height,
int x,
int y,
int width,
int height,
gpointer data)
{
GtkWidget *picture;
@@ -58,7 +58,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
gtk_picture_set_pixbuf (GTK_PICTURE (picture), pixbuf);
}
static gint
static int
progressive_timeout (gpointer data)
{
GtkWidget *picture;

View File

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

View File

@@ -9,7 +9,7 @@
static void
response_cb (GtkWidget *dialog,
gint response_id,
int 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 gchar *uri,
const char *uri,
gpointer data)
{
if (g_strcmp0 (uri, "keynav") == 0)

View File

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

View File

@@ -462,7 +462,6 @@ do_listview_clocks (GtkWidget *do_widget)
{
GtkWidget *gridview, *sw;
GtkListItemFactory *factory;
GListModel *model;
GtkNoSelection *selection;
/* This is the normal window setup code every demo does */
@@ -489,12 +488,10 @@ do_listview_clocks (GtkWidget *do_widget)
gtk_scrollable_set_hscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
gtk_scrollable_set_vscroll_policy (GTK_SCROLLABLE (gridview), GTK_SCROLL_NATURAL);
model = create_clocks_model ();
selection = gtk_no_selection_new (model);
selection = gtk_no_selection_new (create_clocks_model ());
gtk_grid_view_set_model (GTK_GRID_VIEW (gridview), G_LIST_MODEL (selection));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gridview);
g_object_unref (selection);
g_object_unref (model);
}
if (!gtk_widget_get_visible (window))

View File

@@ -89,14 +89,14 @@ static GParamSpec *color_properties[N_COLOR_PROPS] = { NULL, };
static void
rgb_to_hsv (GdkRGBA *rgba,
gdouble *h_out,
gdouble *s_out,
gdouble *v_out)
double *h_out,
double *s_out,
double *v_out)
{
gdouble red, green, blue;
gdouble h, s, v;
gdouble min, max;
gdouble delta;
double red, green, blue;
double h, s, v;
double min, max;
double delta;
red = rgba->red;
green = rgba->green;
@@ -884,7 +884,7 @@ do_listview_colors (GtkWidget *do_widget)
sort_model = gtk_sort_list_model_new (gtk_color_list_new (0), NULL);
gtk_sort_list_model_set_incremental (sort_model, TRUE);
selection = GTK_MULTI_SELECTION (gtk_multi_selection_new (G_LIST_MODEL (sort_model)));
selection = gtk_multi_selection_new (G_LIST_MODEL (sort_model));
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Colors");
@@ -970,7 +970,6 @@ do_listview_colors (GtkWidget *do_widget)
no_selection = G_LIST_MODEL (gtk_no_selection_new (selection_filter));
gtk_grid_view_set_model (GTK_GRID_VIEW (selection_view), no_selection);
g_object_unref (selection_filter);
g_object_unref (no_selection);
selection_info_toggle = gtk_toggle_button_new ();

View File

@@ -214,7 +214,6 @@ transform_settings_to_keys (GBinding *binding,
GtkSortListModel *sort_model;
GtkFilterListModel *filter_model;
GtkFilter *filter;
GtkNoSelection *selection_model;
char **keys;
guint i;
@@ -242,21 +241,13 @@ transform_settings_to_keys (GBinding *binding,
g_object_unref (settings);
sort_model = gtk_sort_list_model_new (G_LIST_MODEL (store),
gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data)));
g_object_unref (store);
g_object_ref (gtk_column_view_get_sorter (GTK_COLUMN_VIEW (data))));
filter = gtk_string_filter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name"));
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (sort_model), filter);
g_object_unref (sort_model);
g_set_object (&current_filter, filter);
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (sort_model), filter);
g_object_unref (filter);
selection_model = gtk_no_selection_new (G_LIST_MODEL (filter_model));
g_object_unref (filter_model);
g_value_take_object (to_value, selection_model);
g_value_take_object (to_value, gtk_no_selection_new (G_LIST_MODEL (filter_model)));
return TRUE;
}
@@ -403,8 +394,8 @@ do_listview_settings (GtkWidget *do_widget)
g_object_unref (actions);
model = create_settings_model (NULL, NULL);
treemodel = gtk_tree_list_model_new (FALSE,
model,
treemodel = gtk_tree_list_model_new (model,
FALSE,
TRUE,
create_settings_model,
NULL,
@@ -418,8 +409,6 @@ do_listview_settings (GtkWidget *do_widget)
columnview, NULL);
gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
g_object_unref (selection);
g_object_unref (treemodel);
g_object_unref (model);
name_column = GTK_COLUMN_VIEW_COLUMN (gtk_builder_get_object (builder, "name_column"));
sorter = gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "name"));

View File

@@ -281,7 +281,7 @@ GtkWidget *
create_weather_view (void)
{
GtkWidget *listview;
GListModel *model, *selection;
GListModel *selection;
GtkListItemFactory *factory;
factory = gtk_signal_list_item_factory_new ();
@@ -290,11 +290,9 @@ create_weather_view (void)
listview = gtk_list_view_new_with_factory (factory);
gtk_orientable_set_orientation (GTK_ORIENTABLE (listview), GTK_ORIENTATION_HORIZONTAL);
gtk_list_view_set_show_separators (GTK_LIST_VIEW (listview), TRUE);
model = create_weather_model ();
selection = G_LIST_MODEL (gtk_no_selection_new (model));
selection = G_LIST_MODEL (gtk_no_selection_new (create_weather_model ()));
gtk_list_view_set_model (GTK_LIST_VIEW (listview), selection);
g_object_unref (selection);
g_object_unref (model);
return listview;
}

View File

@@ -226,7 +226,6 @@ do_listview_words (GtkWidget *do_widget)
g_signal_connect (filter_model, "notify::pending", G_CALLBACK (update_title_cb), progress);
update_title_cb (filter_model);
g_object_unref (filter_model);
}
if (!gtk_widget_get_visible (window))

View File

@@ -13,7 +13,7 @@
static GtkWidget *info_view;
static GtkWidget *source_view;
static gchar *current_file = NULL;
static char *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 gchar *authors[] = {
const char *authors[] = {
"The GTK Team",
NULL
};
@@ -252,11 +252,9 @@ static const char *types[] =
"static",
"const ",
"void",
"gint",
" int ",
" char ",
"gchar ",
"gfloat",
"char ",
"float",
"double",
"gint8",
@@ -272,8 +270,6 @@ static const char *types[] =
"gshort",
"gushort",
"gulong",
"gdouble",
"gldouble",
"gpointer",
"NULL",
"GList",
@@ -385,14 +381,14 @@ static const char *control[] =
NULL
};
void
parse_chars (gchar *text,
gchar **end_ptr,
gint *state,
parse_chars (char *text,
char **end_ptr,
int *state,
const char **tag,
gboolean start)
{
gint i;
gchar *next_token;
int i;
char *next_token;
/* Handle comments first */
if (*state == STATE_IN_COMMENT)
@@ -462,7 +458,7 @@ parse_chars (gchar *text,
/* check for string */
if (text[0] == '"')
{
gint maybe_escape = FALSE;
int maybe_escape = FALSE;
*end_ptr = text + 1;
*tag = "string";
@@ -525,9 +521,9 @@ void
fontify (GtkTextBuffer *source_buffer)
{
GtkTextIter start_iter, next_iter, tmp_iter;
gint state;
gchar *text;
gchar *start_ptr, *end_ptr;
int state;
char *text;
char *start_ptr, *end_ptr;
const char *tag;
gtk_text_buffer_create_tag (source_buffer, "source",
@@ -695,10 +691,10 @@ static struct {
};
static void
add_data_tab (const gchar *demoname)
add_data_tab (const char *demoname)
{
gchar *resource_dir, *resource_name;
gchar **resources;
char *resource_dir, *resource_name;
char **resources;
GtkWidget *widget, *label;
guint i, j;
@@ -742,15 +738,15 @@ add_data_tab (const gchar *demoname)
static void
remove_data_tabs (void)
{
gint i;
int 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 gchar *demoname,
const gchar *filename)
load_file (const char *demoname,
const char *filename)
{
GtkTextBuffer *info_buffer, *source_buffer;
GtkTextIter start, end;
@@ -758,9 +754,9 @@ load_file (const gchar *demoname,
GError *err = NULL;
int state = 0;
gboolean in_para = 0;
gchar **lines;
char **lines;
GBytes *bytes;
gint i;
int i;
if (!g_strcmp0 (current_file, filename))
return;
@@ -800,9 +796,9 @@ load_file (const gchar *demoname,
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
for (i = 0; lines[i] != NULL; i++)
{
gchar *p;
gchar *q;
gchar *r;
char *p;
char *q;
char *r;
/* Make sure \r is stripped at the end for the poor windows people */
lines[i] = g_strchomp (lines[i]);
@@ -1140,8 +1136,8 @@ activate (GApplication *app)
g_signal_connect (search_bar, "notify::search-mode-enabled", G_CALLBACK (clear_search), NULL);
listmodel = create_demo_model ();
treemodel = gtk_tree_list_model_new (FALSE,
G_LIST_MODEL (listmodel),
treemodel = gtk_tree_list_model_new (G_LIST_MODEL (listmodel),
FALSE,
TRUE,
get_child_model,
NULL,
@@ -1149,6 +1145,7 @@ activate (GApplication *app)
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (treemodel), NULL);
filter = gtk_custom_filter_new ((GtkCustomFilterFunc)demo_filter_by_name, filter_model, NULL);
gtk_filter_list_model_set_filter (filter_model, filter);
g_object_unref (filter);
search_entry = GTK_WIDGET (gtk_builder_get_object (builder, "search-entry"));
g_signal_connect (search_entry, "search-changed", G_CALLBACK (demo_search_changed_cb), filter);
@@ -1190,12 +1187,12 @@ list_demos (void)
}
}
static gint
static int
command_line (GApplication *app,
GApplicationCommandLine *cmdline)
{
GVariantDict *options;
const gchar *name = NULL;
const char *name = NULL;
gboolean autoquit = FALSE;
gboolean list = FALSE;
DemoData *d, *c;
@@ -1298,8 +1295,8 @@ main (int argc, char **argv)
{ "inspector", activate_inspector, NULL, NULL, NULL },
};
struct {
const gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *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;
gchar *markup;
char *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 gchar *markup;
const char *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 gchar *)g_bytes_get_data (bytes, NULL);
markup = (const char *)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

@@ -12,9 +12,9 @@ static void
margin_changed (GtkAdjustment *adjustment,
GtkTextView *text)
{
gint value;
int value;
value = (gint)gtk_adjustment_get_value (adjustment);
value = (int)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, gint response, gpointer data)
done_cb (GtkDialog *dialog, int 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;
gdouble brush_size;
double 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 gchar *pad_colors[] = {
static const char *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,
gint width,
gint height)
int width,
int 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 gchar *color = g_object_get_data (G_OBJECT (action), "color");
const char *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)
{
gdouble value = g_variant_get_double (parameter);
double 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;
gint i;
int 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,
gdouble x,
gdouble y,
gdouble pressure)
double x,
double y,
double 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,
gdouble x,
gdouble y,
double x,
double y,
DrawingArea *area)
{
cairo_new_path (area->cr);
@@ -290,13 +290,13 @@ stylus_gesture_down (GtkGestureStylus *gesture,
static void
stylus_gesture_motion (GtkGestureStylus *gesture,
gdouble x,
gdouble y,
double x,
double y,
DrawingArea *area)
{
GdkTimeCoord *backlog;
GdkDeviceTool *tool;
gdouble pressure;
double 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 gchar *frame_label,
const gchar *label1,
const gchar *label2)
const char *frame_label,
const char *label1,
const char *label2)
{
GtkWidget *child1, *child2;
GtkWidget *frame;

View File

@@ -39,7 +39,7 @@ static GdkPixbuf *frame;
/* Background image */
static GdkPixbuf *background;
static gint back_width, back_height;
static int back_width, back_height;
/* Images */
static GdkPixbuf *images[N_IMAGES];
@@ -51,7 +51,7 @@ static GtkWidget *da;
static gboolean
load_pixbufs (GError **error)
{
gint i;
int i;
if (background)
return TRUE; /* already loaded earlier */

View File

@@ -14,13 +14,13 @@
typedef struct
{
gchar *resourcename;
gdouble font_size;
char *resourcename;
double font_size;
gint lines_per_page;
gchar **lines;
gint num_lines;
gint num_pages;
int lines_per_page;
char **lines;
int num_lines;
int num_pages;
} PrintData;
static void
@@ -55,17 +55,17 @@ begin_print (GtkPrintOperation *operation,
static void
draw_page (GtkPrintOperation *operation,
GtkPrintContext *context,
gint page_nr,
int page_nr,
gpointer user_data)
{
PrintData *data = (PrintData *)user_data;
cairo_t *cr;
PangoLayout *layout;
gint text_width, text_height;
gdouble width;
gint line, i;
int text_width, text_height;
double width;
int line, i;
PangoFontDescription *desc;
gchar *page_str;
char *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 gint count = 0;
static int count = 0;
static guint timeout = 0;
static void
@@ -25,7 +25,7 @@ static gboolean
reveal_one (gpointer data)
{
GtkWidget *window = data;
gchar *name;
char *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,
gint position,
int position,
gpointer data)
{
if (position == GTK_ENTRY_ICON_PRIMARY)

View File

@@ -8,12 +8,12 @@
static void
show_shortcuts (GtkWidget *window,
const gchar *id,
const gchar *view)
const char *id,
const char *view)
{
GtkBuilder *builder;
GtkWidget *overlay;
gchar *path;
char *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 gchar* pages[] = {
const char * pages[] = {
"Welcome to GTK",
"GtkStackSidebar Widget",
"Automatic navigation",
@@ -30,7 +30,7 @@ do_sidebar (GtkWidget *do_widget)
"Page 9",
NULL
};
const gchar *c = NULL;
const char *c = NULL;
guint i;
if (!window)

View File

@@ -11,13 +11,13 @@
#include <math.h>
#include <stdlib.h>
gint
int
spinbutton_hex_spin_input (GtkSpinButton *spin_button,
gdouble *new_val)
double *new_val)
{
const gchar *buf;
gchar *err;
gdouble res;
const char *buf;
char *err;
double 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;
}
gint
int
spinbutton_hex_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
gchar *buf;
gdouble val;
char *buf;
double 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", (gint) val);
buf = g_strdup_printf ("0x%.2X", (int) 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;
}
gint
int
spinbutton_time_spin_input (GtkSpinButton *spin_button,
gdouble *new_val)
double *new_val)
{
const gchar *text;
gchar **str;
const char *text;
char **str;
gboolean found = FALSE;
gint hours;
gint minutes;
gchar *endh;
gchar *endm;
int hours;
int minutes;
char *endh;
char *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;
}
gint
int
spinbutton_time_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
gchar *buf;
gdouble hours;
gdouble minutes;
char *buf;
double hours;
double 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"
};
gint
int
spinbutton_month_spin_input (GtkSpinButton *spin_button,
gdouble *new_val)
double *new_val)
{
gint i;
gchar *tmp1, *tmp2;
int i;
char *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 = (gdouble) i;
*new_val = (double) i;
return TRUE;
}
gint
int
spinbutton_month_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
gdouble value;
gint i;
double value;
int 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 gchar *label;
const char *label;
gboolean alex;
gboolean havoc;
gboolean tim;
@@ -222,7 +222,7 @@ create_model (void)
static void
item_toggled (GtkCellRendererToggle *cell,
gchar *path_str,
char *path_str,
gpointer data)
{
GtkTreeModel *model = (GtkTreeModel *)data;
@@ -230,7 +230,7 @@ item_toggled (GtkCellRendererToggle *cell,
GtkTreeIter iter;
gboolean toggle_item;
gint *column;
int *column;
column = g_object_get_data (G_OBJECT (cell), "column");
@@ -252,7 +252,7 @@ item_toggled (GtkCellRendererToggle *cell,
static void
add_columns (GtkTreeView *treeview)
{
gint col_offset;
int 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", (gint *)ALEX_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)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", (gint *)HAVOC_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)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", (gint *)TIM_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)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", (gint *)OWEN_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)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", (gint *)DAVE_COLUMN);
g_object_set_data (G_OBJECT (renderer), "column", (int *)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 gchar *authors[] = {
const char *authors[] = {
"The GTK Team",
NULL
};
@@ -103,7 +103,7 @@ static GActionEntry app_entries[] =
static void
icon_browser_app_startup (GApplication *app)
{
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *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 gchar *name,
const gchar *description,
const gchar *context)
const char *name,
const char *description,
const char *context)
{
GtkIconTheme *icon_theme = icon_browser_window_get_icon_theme (win);
gchar *regular_name;
gchar *symbolic_name;
char *regular_name;
char *symbolic_name;
IbIcon *icon;
regular_name = g_strdup (name);
@@ -77,9 +77,9 @@ add_icon (IconBrowserWindow *win,
static void
add_context (IconBrowserWindow *win,
const gchar *id,
const gchar *name,
const gchar *description)
const char *id,
const char *name,
const char *description)
{
IbContext *context;
@@ -161,7 +161,7 @@ copy_to_clipboard (GtkButton *button,
}
static void
set_image (GtkWidget *image, const gchar *name, gint size)
set_image (GtkWidget *image, const char *name, int 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 gchar *icon_name;
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
NodeEditorWindow *win;
gint i;
int 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 gchar *
static char *
get_current_text (GtkTextBuffer *buffer)
{
GtkTextIter start, end;
@@ -288,14 +288,14 @@ text_view_query_tooltip_cb (GtkWidget *widget,
if (keyboard_tip)
{
gint offset;
int offset;
g_object_get (self->text_buffer, "cursor-position", &offset, NULL);
gtk_text_buffer_get_iter_at_offset (self->text_buffer, &iter, offset);
}
else
{
gint bx, by, trailing;
int 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,
gint response,
int response,
NodeEditorWindow *self)
{
gtk_widget_hide (dialog);
@@ -448,7 +448,7 @@ open_cb (GtkWidget *button,
static void
save_response_cb (GtkWidget *dialog,
gint response,
int response,
NodeEditorWindow *self)
{
gtk_widget_hide (dialog);
@@ -577,7 +577,7 @@ create_cairo_texture (NodeEditorWindow *self)
static void
export_image_response_cb (GtkWidget *dialog,
gint response,
int response,
GdkTexture *texture)
{
gtk_widget_hide (dialog);

View File

@@ -33,8 +33,8 @@ update_title (GtkWindow *window)
static void
update_statusbar (void)
{
gchar *msg;
gint row, col;
char *msg;
int row, col;
GtkTextIter iter;
const char *print_str;
@@ -675,7 +675,7 @@ static GActionEntry app_entries[] = {
{ "print", activate_print, NULL, NULL, NULL }
};
static const gchar ui_info[] =
static const char ui_info[] =
"<interface>"
" <menu id='menubar'>"
" <submenu>"

View File

@@ -139,9 +139,9 @@ get_busy (GSimpleAction *action,
gtk_widget_set_sensitive (window, FALSE);
}
static gint current_page = 0;
static int current_page = 0;
static gboolean
on_page (gint i)
on_page (int i)
{
return current_page == i;
}
@@ -250,12 +250,12 @@ activate_about (GSimpleAction *action,
gpointer user_data)
{
GtkApplication *app = user_data;
const gchar *authors[] = {
const char *authors[] = {
"Andrea Cimitan",
"Cosimo Cecchi",
NULL
};
gchar *version;
char *version;
GString *s;
s = g_string_new ("");
@@ -422,8 +422,8 @@ static void
spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
{
GtkWidget *w;
gint v;
gchar *text;
int v;
char *text;
v = (int)gtk_adjustment_get_value (adjustment);
@@ -454,8 +454,8 @@ spin_value_reset (GtkWidget *button, GtkAdjustment *adjustment)
dismiss (button);
}
static gint pulse_time = 250;
static gint pulse_entry_mode = 0;
static int pulse_time = 250;
static int 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)
{
gdouble value;
double 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,
gdouble value,
double value,
gpointer user_data)
{
GtkAdjustment *adjustment;
gdouble val;
gchar *str;
double val;
char *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
{
gint percent;
int percent;
percent = (gint) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
percent = (int) (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;
gint v1, v2;
int 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;
gint v1, v2;
int 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, gint response_id)
info_bar_response (GtkWidget *infobar, int 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 gchar *name;
const char *name;
GtkWidget *window;
GtkWidget *page;
@@ -853,10 +853,10 @@ update_title_header (GtkListBoxRow *row,
gpointer data)
{
GtkWidget *header;
gchar *title;
char *title;
header = gtk_list_box_row_get_header (row);
title = (gchar *)g_object_get_data (G_OBJECT (row), "title");
title = (char *)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 gchar *color;
gchar *text;
const char *color;
char *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 gchar *name; const gchar *color; const gchar *title; } colors[] = {
struct { const char *name; const char *color; const char *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 }
};
gint i;
int i;
GtkWidget *row, *box, *label, *swatch;
GtkWidget *sw;
GdkRGBA rgba;
@@ -1081,7 +1081,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
typedef struct {
GtkWidget *flowbox;
gchar *filename;
char *filename;
} BackgroundData;
static void
@@ -1127,11 +1127,11 @@ background_loaded_cb (GObject *source,
static void
populate_flowbox (GtkWidget *flowbox)
{
const gchar *location;
const char *location;
GDir *dir;
GError *error = NULL;
const gchar *name;
gchar *filename;
const char *name;
char *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 gchar *filename, gboolean is_resource)
my_text_view_set_background (MyTextView *tv, const char *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, gint response, GtkWidget *tv)
close_selection_dialog (GtkWidget *dialog, int response, GtkWidget *tv)
{
GtkWidget *box;
GtkWidget *child;
GList *children;
const gchar *filename;
const char *filename;
gboolean is_resource;
gtk_widget_hide (dialog);
@@ -1352,7 +1352,7 @@ close_selection_dialog (GtkWidget *dialog, gint response, GtkWidget *tv)
return;
child = children->data;
filename = (const gchar *)g_object_get_data (G_OBJECT (child), "filename");
filename = (const char *)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 gchar *id;
const gchar *text;
const char *id;
const char *text;
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
@@ -1402,7 +1402,7 @@ handle_cutcopypaste (GtkWidget *button, GtkWidget *textview)
{
GtkTextBuffer *buffer;
GdkClipboard *clipboard;
const gchar *id;
const char *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 gchar *id;
const char *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 gchar *id;
const char *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)
{
gchar *text;
char *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 gchar *text;
const char *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 gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *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 gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *accelerators[2];
} late_accels[] = {
{ "app.cut", { "<Control>x", NULL } },
{ "app.copy", { "<Control>c", NULL } },
{ "app.paste", { "<Control>v", NULL } },
{ "win.delete", { "Delete", NULL } },
};
gint i;
int 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 },
};
gint status;
int 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 gchar *value,
GError **error);
const gchar *gtk_type_get_property (GtkType *type);
void gtk_type_set_property (GtkType *type,
const char *value,
GError **error);
const char *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,
gfloat value);
gfloat gtk_type_get_prop (GtkType *type);
gint gtk_type_update_foobar (GtkType *type);
float value);
float gtk_type_get_prop (GtkType *type);
int 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,
gdouble x,
gdouble y)
double x,
double y)
{
cairo_t *cr;
@@ -797,8 +797,8 @@ example_app_activate (GApplication *app)
static void
example_app_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;
@@ -1138,7 +1138,7 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
const gchar *quit_accels[2] = { "&lt;Ctrl&gt;Q", NULL };
const char *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 gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;

View File

@@ -2041,8 +2041,6 @@ 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

View File

@@ -189,7 +189,7 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
{
GtkTreeIter iter;
GtkTreeModel *model;
gchar *author;
char *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;
gint x = 0, y = 0;
gint width, height;
int x = 0, y = 0;
int width, height;
GdkPixbuf *tmp, *tmp2;
GdkPixbuf *retval = NULL;

View File

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

View File

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

View File

@@ -32,7 +32,7 @@ static GActionEntry win_entries[] = {
{ "close", action_activated },
};
const gchar *menu_ui =
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -25,7 +25,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -55,7 +55,7 @@ static void
find_word (GtkButton *button,
ExampleAppWindow *win)
{
const gchar *word;
const char *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;
gchar *word, *key;
char *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;
gchar *lines;
char *lines;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
@@ -248,9 +248,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -36,9 +36,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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 gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -46,9 +46,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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 gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -66,9 +66,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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 gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -67,9 +67,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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 gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -20,7 +20,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -120,9 +120,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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 gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -23,7 +23,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -53,7 +53,7 @@ static void
find_word (GtkButton *button,
ExampleAppWindow *win)
{
const gchar *word;
const char *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;
gchar *word, *key;
char *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)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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 gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
GList *windows;
ExampleAppWindow *win;

View File

@@ -25,7 +25,7 @@ static void
search_text_changed (GtkEntry *entry,
ExampleAppWindow *win)
{
const gchar *text;
const char *text;
GtkWidget *tab;
GtkWidget *view;
GtkTextBuffer *buffer;
@@ -55,7 +55,7 @@ static void
find_word (GtkButton *button,
ExampleAppWindow *win)
{
const gchar *word;
const char *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;
gchar *word, *key;
char *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;
gchar *lines;
char *lines;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
@@ -246,9 +246,9 @@ void
example_app_window_open (ExampleAppWindow *win,
GFile *file)
{
gchar *basename;
char *basename;
GtkWidget *scrolled, *view;
gchar *contents;
char *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 gchar *str;
const char *str;
str = g_variant_get_string (state, NULL);
@@ -150,7 +150,7 @@ text_buffer_changed_cb (GtkTextBuffer *buffer,
{
GtkWindow *window = user_data;
BloatPad *app;
gint old_n, n;
int old_n, n;
app = (BloatPad *) gtk_window_get_application (window);
@@ -265,7 +265,7 @@ new_window (GApplication *app,
if (file != NULL)
{
gchar *contents;
char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
gint i;
int 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 gchar *action;
gchar **accels;
gchar *str;
const char *action;
char **accels;
char *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 gchar *action;
const gchar *str;
gchar **accels;
const char *action;
const char *str;
char **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 gchar **) accels);
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const char **) accels);
g_strfreev (accels);
}
@@ -398,9 +398,9 @@ edit_accels (GSimpleAction *action,
GtkApplication *app = user_data;
GtkWidget *combo;
GtkWidget *entry;
gchar **actions;
char **actions;
GtkWidget *dialog;
gint i;
int 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;
gchar *time;
char *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)
{
gchar **actions;
gint i;
char **actions;
int i;
actions = gtk_application_list_action_descriptions (app);
for (i = 0; actions[i]; i++)
{
gchar **accels;
gchar *str;
char **accels;
char *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;
gint i;
int i;
struct {
const gchar *action_and_target;
const gchar *accelerators[2];
const char *action_and_target;
const char *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 gchar *new_accels[] = { "<Control>n", "<Control>t", NULL };
const char *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 gchar *accels[] = { "F11", NULL };
const char *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,
gdouble x,
gdouble y)
double x,
double y)
{
cairo_t *cr;

View File

@@ -99,7 +99,7 @@ new_window (GApplication *app,
if (file != NULL)
{
gchar *contents;
char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
gint i;
int 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 gchar *name)
plugin_enabled (const char *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 gchar *name)
enable_plugin (const char *name)
{
GMenuModel *plugin_menu;
GAction *action;
@@ -246,8 +246,8 @@ enable_plugin (const gchar *name)
{
GMenu *section;
GMenuItem *item;
gchar *label;
gchar *action_name;
char *label;
char *action_name;
section = g_menu_new ();
label = g_strdup_printf ("Turn text %s", name);
@@ -272,7 +272,7 @@ enable_plugin (const gchar *name)
}
static void
disable_plugin (const gchar *name)
disable_plugin (const char *name)
{
GMenuModel *plugin_menu;
@@ -281,11 +281,11 @@ disable_plugin (const gchar *name)
plugin_menu = find_plugin_menu ();
if (plugin_menu)
{
gint i;
int i;
for (i = 0; i < g_menu_model_get_n_items (plugin_menu); i++)
{
gchar *id;
char *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 gchar *name)
static void
enable_or_disable_plugin (GtkToggleButton *button,
const gchar *name)
const char *name)
{
if (plugin_enabled (name))
disable_plugin (name);
@@ -498,7 +498,7 @@ main (int argc, char **argv)
{
PlugMan *plug_man;
int status;
const gchar *accels[] = { "F11", NULL };
const char *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);
}
gint
main (gint argc,
gchar *argv[])
int
main (int argc,
char *argv[])
{
GtkApplication *app;

View File

@@ -30,7 +30,7 @@ new_window (GApplication *app,
if (file != NULL)
{
gchar *contents;
char *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,
gint n_files,
const gchar *hint)
int n_files,
const char *hint)
{
gint i;
int 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 gint append_node_depth = -1;
static int 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 */
gint show_keyboard;
int 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,
gint id,
int id,
guint32 tag)
{
BroadwayInputMsg msg;
@@ -1001,7 +1001,7 @@ broadway_server_flush (BroadwayServer *server)
void
broadway_server_roundtrip (BroadwayServer *server,
gint id,
int 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 gchar *
generate_handshake_response_wsietf_v7 (const gchar *key)
static char *
generate_handshake_response_wsietf_v7 (const char *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,
gint id)
int id)
{
BroadwaySurface *surface;
@@ -1594,7 +1594,7 @@ broadway_server_destroy_surface (BroadwayServer *server,
gboolean
broadway_server_surface_show (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
gboolean sent = FALSE;
@@ -1616,7 +1616,7 @@ broadway_server_surface_show (BroadwayServer *server,
gboolean
broadway_server_surface_hide (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
gboolean sent = FALSE;
@@ -1646,7 +1646,7 @@ broadway_server_surface_hide (BroadwayServer *server,
void
broadway_server_surface_raise (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
@@ -1676,7 +1676,7 @@ broadway_server_set_show_keyboard (BroadwayServer *server,
void
broadway_server_surface_lower (BroadwayServer *server,
gint id)
int id)
{
BroadwaySurface *surface;
@@ -1693,7 +1693,7 @@ broadway_server_surface_lower (BroadwayServer *server,
void
broadway_server_surface_set_transient_for (BroadwayServer *server,
gint id, gint parent)
int id, int parent)
{
BroadwaySurface *surface;
@@ -1865,7 +1865,7 @@ decode_nodes (BroadwayServer *server,
/* passes ownership of nodes */
void
broadway_server_surface_update_nodes (BroadwayServer *server,
gint id,
int 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,
gint id,
int 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,
gint new_focused_surface)
int new_focused_surface)
{
BroadwayInputMsg focus_msg;
@@ -2010,8 +2010,8 @@ broadway_server_focus_surface (BroadwayServer *server,
guint32
broadway_server_grab_pointer (BroadwayServer *server,
gint client_id,
gint id,
int client_id,
int 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,
gint id,
int 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,
gint client_id,
gint id,
int client_id,
int 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,
gint id);
int id);
gboolean broadway_server_surface_show (BroadwayServer *server,
gint id);
int id);
gboolean broadway_server_surface_hide (BroadwayServer *server,
gint id);
int id);
void broadway_server_surface_raise (BroadwayServer *server,
gint id);
int id);
void broadway_server_surface_lower (BroadwayServer *server,
gint id);
int id);
void broadway_server_surface_set_transient_for (BroadwayServer *server,
gint id,
gint parent);
int id,
int parent);
gboolean broadway_server_surface_translate (BroadwayServer *server,
gint id,
int id,
cairo_region_t *area,
gint dx,
gint dy);
int dx,
int 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,
gint id,
int id,
guint32 data[],
int len,
GHashTable *client_texture_map);
gboolean broadway_server_surface_move_resize (BroadwayServer *server,
gint id,
int id,
gboolean with_move,
int x,
int y,
int width,
int height);
void broadway_server_focus_surface (BroadwayServer *server,
gint new_focused_surface);
int 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,
gint id)
int id)
{
BroadwayRequestDestroySurface msg;
@@ -512,7 +512,7 @@ _gdk_broadway_server_destroy_surface (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_show (GdkBroadwayServer *server,
gint id)
int id)
{
BroadwayRequestShowSurface msg;
@@ -525,7 +525,7 @@ _gdk_broadway_server_surface_show (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
gint id)
int id)
{
BroadwayRequestHideSurface msg;
@@ -538,7 +538,7 @@ _gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
void
_gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
gint id)
int id)
{
BroadwayRequestFocusSurface msg;
@@ -549,7 +549,7 @@ _gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
void
_gdk_broadway_server_surface_set_transient_for (GdkBroadwayServer *server,
gint id, gint parent)
int id, int parent)
{
BroadwayRequestSetTransientFor msg;
@@ -692,7 +692,7 @@ gdk_broadway_server_surface_set_nodes (GdkBroadwayServer *server,
gboolean
_gdk_broadway_server_surface_move_resize (GdkBroadwayServer *server,
gint id,
int 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,
gint id,
int 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,
gint id,
int 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,
gint id);
int id);
gboolean _gdk_broadway_server_surface_show (GdkBroadwayServer *server,
gint id);
int id);
gboolean _gdk_broadway_server_surface_hide (GdkBroadwayServer *server,
gint id);
int id);
void _gdk_broadway_server_surface_focus (GdkBroadwayServer *server,
gint id);
int id);
void _gdk_broadway_server_surface_set_transient_for (GdkBroadwayServer *server,
gint id,
gint parent);
int id,
int parent);
void _gdk_broadway_server_set_show_keyboard (GdkBroadwayServer *server,
gboolean show_keyboard);
gboolean _gdk_broadway_server_surface_translate (GdkBroadwayServer *server,
gint id,
int id,
cairo_region_t *area,
gint dx,
gint dy);
int dx,
int 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,
gint id,
int 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,
gdouble *axes,
GdkSurface *surface,
double *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,
gdouble *win_x,
gdouble *win_y,
double *win_x,
double *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,
gdouble *axes,
GdkSurface *surface,
double *axes,
GdkModifierType *mask)
{
gdouble x, y;
double 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,
gdouble *win_x,
gdouble *win_y,
double *win_x,
double *win_y,
GdkModifierType *mask)
{
GdkSurface *surface = NULL;

View File

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

View File

@@ -25,7 +25,7 @@
#include <stdlib.h>
static gboolean gdk_event_source_prepare (GSource *source,
gint *timeout);
int *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,
gint *timeout)
int *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,
gint *n_entries)
int *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,
gint group,
int group,
guint *keyval,
gint *effective_group,
gint *level,
int *effective_group,
int *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,
gint dx,
gint dy);
int dx,
int 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,
gint x,
gint y,
gint width,
gint height);
int x,
int y,
int width,
int height);
void _gdk_keymap_keys_changed (GdkDisplay *display);
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,
int _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 gchar *display_name);
GdkDisplay * _gdk_broadway_display_open (const char *display_name);
void _gdk_broadway_display_queue_events (GdkDisplay *display);
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
const char *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 gint
static int
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,
gint x,
gint y,
gint width,
gint height)
int x,
int y,
int width,
int 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,
gint x,
gint y,
gint width,
gint height)
int x,
int y,
int width,
int 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,
gint width,
gint height)
int width,
int 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,
gint x,
gint y)
int x,
int 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 gchar *title)
const char *title)
{
}
static void
gdk_broadway_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
const char *startup_id)
{
}
@@ -696,10 +696,10 @@ gdk_broadway_surface_set_transient_for (GdkSurface *surface,
static void
gdk_broadway_surface_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height)
int *x,
int *y,
int *width,
int *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,
gint x,
gint y,
gint *root_x,
gint *root_y)
int x,
int y,
int *root_x,
int *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,
gdouble *x,
gdouble *y,
double *x,
double *y,
GdkModifierType *mask)
{
GdkSurface *child;
@@ -839,13 +839,13 @@ struct _MoveResizeData
GdkSurface *moveresize_emulation_surface;
gboolean is_resize;
GdkSurfaceEdge resize_edge;
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;
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;
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,
gint new_root_x,
gint new_root_y)
int new_root_x,
int new_root_y)
{
gint dx, dy;
int dx, dy;
dx = new_root_x - mv_resize->moveresize_x;
dy = new_root_y - mv_resize->moveresize_y;
if (mv_resize->is_resize)
{
gint x, y, w, h;
int 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
{
gint x, y;
int 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)
{
gint x, y, width, height;
int 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 gchar * gdk_get_startup_notification_id (void);
const char * 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 gchar *startup_notification_id = NULL;
static char *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 gchar *p;
const gchar *q;
const char *p;
const char *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 gchar *
const char *
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 gchar *text,
gint length)
gdk_find_base_dir (const char *text,
int length)
{
PangoDirection dir = PANGO_DIRECTION_NEUTRAL;
const gchar *p;
const char *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 gchar * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
static char * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static gchar * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
static char * 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 gchar *startup_notify_id);
const char *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 gchar *
static char *
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,
gint desktop)
int 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 gchar *startup_notify_id)
const char *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,
gint desktop);
int 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;
gint workspace;
int 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]) {};
*self->start = *(_T_[1]) { 0 };
#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]) {};
*self->start = *(_T_[1]) { 0 };
}
else
#endif

View File

@@ -91,7 +91,7 @@ gdk_cairo_region (cairo_t *cr,
const cairo_region_t *region)
{
cairo_rectangle_int_t box;
gint n_boxes, i;
int 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)
{
gint width, height;
int 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,
gdouble pixbuf_x,
gdouble pixbuf_y)
double pixbuf_x,
double 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;
gint x, y, stride;
int 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"*/
gint x0 = x;
int x0 = x;
while (x < extents.width)
{
#if G_BYTE_ORDER == G_LITTLE_ENDIAN

View File

@@ -35,8 +35,8 @@ void gdk_cairo_set_source_rgba (cairo_t *cr,
GDK_AVAILABLE_IN_ALL
void gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
gdouble pixbuf_x,
gdouble pixbuf_y);
double pixbuf_x,
double pixbuf_y);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_rectangle (cairo_t *cr,

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