| /******************************************************************************* |
| * Copyright (c) 2021 Syntevo and others. |
| * |
| * This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Syntevo - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.swt.internal.gtk4; |
| |
| /** |
| * This class contains native functions that are present in GTK4 only. |
| */ |
| public class GTK4 { |
| /** |
| * @param context cast=(GtkIMContext *) |
| * @param event cast=(GdkEvent *) |
| */ |
| public static final native boolean gtk_im_context_filter_keypress(long context, long event); |
| |
| /* GtkButton */ |
| /** @param icon_name cast=(const gchar *) */ |
| public static final native long gtk_button_new_from_icon_name(byte[] icon_name); |
| /** |
| * @param button cast=(GtkButton *) |
| * @param child cast=(GtkWidget *) |
| */ |
| public static final native void gtk_button_set_child(long button, long child); |
| |
| /* GtkColorChooser Interface */ |
| /** |
| * @param r cast=(float *) |
| * @param g cast=(float *) |
| * @param b cast=(float *) |
| */ |
| public static final native void gtk_hsv_to_rgb(float h, float s, float v, float[] r, float[] g, float[] b); |
| /** |
| * @param h cast=(float *) |
| * @param s cast=(float *) |
| * @param v cast=(float *) |
| */ |
| public static final native void gtk_rgb_to_hsv(float r, float g, float b, float[] h, float[] s, float[] v); |
| |
| /* GtkBox */ |
| /** |
| * @param box cast=(GtkBox *) |
| * @param child cast=(GtkWidget *) |
| */ |
| public static final native void gtk_box_append(long box, long child); |
| /** |
| * @param box cast=(GtkBox *) |
| * @param child cast=(GtkWidget *) |
| */ |
| public static final native void gtk_box_prepend(long box, long child); |
| /** |
| * @param box cast=(GtkBox *) |
| * @param child cast=(GtkWidget *) |
| * @param sibling cast=(GtkWidget *) |
| */ |
| public static final native void gtk_box_insert_child_after(long box, long child, long sibling); |
| |
| /* GtkCalendar */ |
| /** @param calendar cast=(GtkCalendar *) */ |
| public static final native long gtk_calendar_get_date(long calendar); |
| /** |
| * @param calendar cast=(GtkCalendar *) |
| * @param date cast=(GDateTime *) |
| */ |
| public static final native void gtk_calendar_select_day(long calendar, long date); |
| /** |
| * @param calendar cast=(GtkCalendar *) |
| * @param value cast=(gboolean) |
| */ |
| public static final native void gtk_calendar_set_show_day_names(long calendar, boolean value); |
| /** |
| * @param calendar cast=(GtkCalendar *) |
| * @param value cast=(gboolean) |
| */ |
| public static final native void gtk_calendar_set_show_heading(long calendar, boolean value); |
| /** |
| * @param calendar cast=(GtkCalendar *) |
| * @param value cast=(gboolean) |
| */ |
| public static final native void gtk_calendar_set_show_week_numbers(long calendar, boolean value); |
| |
| /* GtkCheckButton */ |
| /** @param check_button cast=(GtkCheckButton *) */ |
| public static final native void gtk_check_button_set_use_underline(long check_button, boolean use_underline); |
| /** @param check_button cast=(GtkCheckButton *) */ |
| public static final native void gtk_check_button_set_inconsistent(long check_button, boolean inconsistent); |
| /** |
| * @param check_button cast=(GtkCheckButton *) |
| * @param group cast=(GtkCheckButton *) |
| */ |
| public static final native void gtk_check_button_set_group(long check_button, long group); |
| /** @param check_button cast=(GtkCheckButton *) */ |
| public static final native void gtk_check_button_set_active(long check_button, boolean setting); |
| /** @param check_button cast=(GtkCheckButton *) */ |
| public static final native boolean gtk_check_button_get_active(long check_button); |
| |
| /* GtkPicture */ |
| public static final native long gtk_picture_new(); |
| /** |
| * @param picture cast=(GtkPicture *) |
| * @param paintable cast=(GdkPaintable *) |
| */ |
| public static final native void gtk_picture_set_paintable(long picture, long paintable); |
| /** @param picture cast=(GtkPicture *) */ |
| public static final native void gtk_picture_set_can_shrink(long picture, boolean can_shrink); |
| |
| /* GTK Initialization */ |
| public static final native boolean gtk_init_check(); |
| |
| /* GdkToplevel */ |
| /** @param toplevel cast=(GdkToplevel *) */ |
| public static final native int gdk_toplevel_get_state(long toplevel); |
| /** |
| * @param toplevel cast=(GdkToplevel *) |
| * @param textures cast=(GList *) |
| */ |
| public static final native void gdk_toplevel_set_icon_list(long toplevel, long textures); |
| /** @param toplevel cast=(GdkToplevel *) */ |
| public static final native boolean gdk_toplevel_lower(long toplevel); |
| /** @param surface cast=(GdkToplevel *) */ |
| public static final native void gdk_toplevel_focus(long surface, int timestamp); |
| |
| /* GtkDragSource */ |
| public static final native long gtk_drag_source_new(); |
| /** |
| * @param source cast=(GtkDragSource *) |
| * @param actions cast=(GdkDragAction) |
| */ |
| public static final native void gtk_drag_source_set_actions(long source, int actions); |
| /** |
| * @param source cast=(GtkDragSource *) |
| * @param paintable cast=(GdkPaintable *) |
| */ |
| public static final native void gtk_drag_source_set_icon(long source, long paintable, int hot_x, int hot_y); |
| |
| /* GtkDropTarget */ |
| /** |
| * @param formats cast=(GdkContentFormats *) |
| * @param actions cast=(GdkDragAction) |
| */ |
| public static final native long gtk_drop_target_async_new(long formats, int actions); |
| /** |
| * @param target cast=(GtkDropTargetAsync *) |
| * @param formats cast=(GdkContentFormats *) |
| */ |
| public static final native void gtk_drop_target_async_set_formats(long target, long formats); |
| |
| /* GdkContentFormats */ |
| public static final native long gdk_content_formats_builder_new(); |
| /** |
| * @param builder cast=(GdkContentFormatsBuilder *) |
| * @param mime_type cast=(const char *) |
| */ |
| public static final native void gdk_content_formats_builder_add_mime_type(long builder, byte[] mime_type); |
| /** @param builder cast=(GdkContentFormatsBuilder *) */ |
| public static final native long gdk_content_formats_builder_free_to_formats(long builder); |
| |
| /* GtkFileChooser */ |
| /** @param chooser cast=(GtkFileChooser *) */ |
| public static final native long gtk_file_chooser_get_files(long chooser); |
| /** @param chooser cast=(GtkFileChooser *) */ |
| public static final native long gtk_file_chooser_get_file(long chooser); |
| /** |
| * @param chooser cast=(GtkFileChooser *) |
| * @param file cast=(GFile *) |
| * @param error cast=(GError **) |
| */ |
| public static final native boolean gtk_file_chooser_set_current_folder(long chooser, long file, long error); |
| /** |
| * @param chooser cast=(GtkFileChooser *) |
| * @param file cast=(GFile *) |
| * @param error cast=(GError **) |
| */ |
| public static final native boolean gtk_file_chooser_set_file(long chooser, long file, long error); |
| |
| /* GtkScrolledWindow */ |
| public static final native long gtk_scrolled_window_new(); |
| /** @param scrolled_window cast=(GtkScrolledWindow *) */ |
| public static final native void gtk_scrolled_window_set_has_frame(long scrolled_window, boolean has_frame); |
| /** @param scrolled_window cast=(GtkScrolledWindow *) */ |
| public static final native boolean gtk_scrolled_window_get_has_frame(long scrolled_window); |
| /** |
| * @param scrolled_window cast=(GtkScrolledWindow *) |
| * @param child cast=(GtkWidget *) |
| */ |
| public static final native void gtk_scrolled_window_set_child(long scrolled_window, long child); |
| |
| /* GtkWindow */ |
| public static final native long gtk_window_new(); |
| /** @param window cast=(GtkWindow *) */ |
| public static final native void gtk_window_minimize(long window); |
| /** @param window cast=(GtkWindow *) */ |
| public static final native void gtk_window_unminimize(long window); |
| /** |
| * @param window cast=(GtkWindow *) |
| * @param default_widget cast=(GtkWidget *) |
| */ |
| public static final native void gtk_window_set_default_widget(long window, long default_widget); |
| /** |
| * @param window cast=(GtkWindow *) |
| * @param child cast=(GtkWidget *) |
| */ |
| public static final native void gtk_window_set_child(long window, long child); |
| /** @param window cast=(GtkWindow *) */ |
| public static final native void gtk_window_destroy(long window); |
| /** @param window cast=(GtkWindow *) */ |
| public static final native long gtk_window_get_icon_name(long window); |
| /** |
| * @param window cast=(GtkWindow *) |
| * @param name cast=(const char *) |
| * */ |
| public static final native void gtk_window_set_icon_name(long window, long name); |
| |
| /* GtkShortcutController */ |
| public static final native long gtk_shortcut_controller_new(); |
| /** |
| * @param controller cast=(GtkShortcutController *) |
| * @param scope cast=(GtkShortcutScope) |
| */ |
| public static final native void gtk_shortcut_controller_set_scope(long controller, int scope); |
| /** |
| * @param controller cast=(GtkShortcutController *) |
| * @param shortcut cast=(GtkShortcut *) |
| */ |
| public static final native void gtk_shortcut_controller_add_shortcut(long controller, long shortcut); |
| /** |
| * @param controller cast=(GtkShortcutController *) |
| * @param shortcut cast=(GtkShortcut *) |
| */ |
| public static final native void gtk_shortcut_controller_remove_shortcut(long controller, long shortcut); |
| |
| /* GtkShortcut */ |
| /** |
| * @param trigger cast=(GtkShortcutTrigger *) |
| * @param action cast=(GtkShortcutAction *) |
| */ |
| public static final native long gtk_shortcut_new(long trigger, long action); |
| |
| /* GtkShortcutTrigger */ |
| /** |
| * @param keyval cast=(guint) |
| * @param modifiers cast=(GdkModifierType) |
| */ |
| public static final native long gtk_keyval_trigger_new(int keyval, int modifiers); |
| |
| /* GtkShortcutAction */ |
| /** @param name cast=(const char *) */ |
| public static final native long gtk_named_action_new(byte[] name); |
| |
| /* GtkIconPaintable */ |
| /** @param paintable cast=(GtkIconPaintable *) */ |
| public static final native long gtk_icon_paintable_get_file(long paintable); |
| |
| /* GtkText */ |
| /** @param self cast=(GtkText *) */ |
| public static final native long gtk_text_get_buffer(long self); |
| |
| /* GtkPopoverMenu */ |
| /** |
| * @param model cast=(GMenuModel *) |
| * @param flags cast=(GtkPopoverMenuFlags) |
| */ |
| public static final native long gtk_popover_menu_new_from_model_full(long model, int flags); |
| /** |
| * @param popover cast=(GtkPopoverMenu *) |
| * @param model cast=(GMenuModel *) |
| */ |
| public static final native void gtk_popover_menu_set_menu_model(long popover, long model); |
| |
| /* GtkPopover */ |
| /** @param popover cast=(GtkPopover *) */ |
| public static final native void gtk_popover_set_has_arrow(long popover, boolean has_arrow); |
| |
| /* GtkPopoverMenuBar */ |
| /** @param model cast=(GMenuModel *) */ |
| public static final native long gtk_popover_menu_bar_new_from_model(long model); |
| |
| /* GtkIconTheme */ |
| /** @param display cast=(GdkDisplay *) */ |
| public static final native long gtk_icon_theme_get_for_display(long display); |
| /** |
| * @param self cast=(GtkIconTheme *) |
| * @param icon_name cast=(const char *) |
| * @param fallbacks cast=(const char **) |
| * @param size cast=(gint) |
| * @param scale cast=(gint) |
| * @param direction cast=(GtkTextDirection) |
| * @param flags cast=(GtkIconLookupFlags) |
| */ |
| public static final native long gtk_icon_theme_lookup_icon(long self, byte[] icon_name, long fallbacks, int size, int scale, int direction, int flags); |
| |
| /* GtkNative */ |
| /** @param self cast=(GtkNative *) */ |
| public static final native long gtk_native_get_surface(long self); |
| |
| /* GtkEntry */ |
| /** |
| * @param entry cast=(GtkEntry *) |
| * @param buffer cast=(GtkEntryBuffer *) |
| */ |
| public static final native void gtk_entry_set_buffer(long entry, long buffer); |
| /** @param entry cast=(GtkEntry *) */ |
| public static final native long gtk_entry_get_buffer(long entry); |
| /** |
| * @param entry cast=(GtkEntry *) |
| * @param hint cast=(GtkInputHints) |
| */ |
| public static final native void gtk_entry_set_input_hints(long entry, int hint); |
| |
| /* GtkExpander */ |
| /** |
| * @param expander cast=(GtkExpander *) |
| * @param child cast=(GtkWidget *) |
| */ |
| public static final native void gtk_expander_set_child(long expander, long child); |
| |
| /* GtkEventController */ |
| public static final native long gtk_event_controller_focus_new(); |
| /** @param controller cast=(GtkEventController *) */ |
| public static final native long gtk_event_controller_get_current_event(long controller); |
| public static final native long gtk_event_controller_key_new(); |
| public static final native long gtk_event_controller_motion_new(); |
| /** @param flag cast=(GtkEventControllerScrollFlags) */ |
| public static final native long gtk_event_controller_scroll_new(int flag); |
| |
| /* GtkGestureClick */ |
| public static final native long gtk_gesture_click_new(); |
| |
| /* GtkFrame */ |
| /** |
| * @param frame cast=(GtkFrame *) |
| * @param child cast=(GtkWidget *) |
| */ |
| public static final native void gtk_frame_set_child(long frame, long child); |
| |
| /* GtkScrollbar */ |
| /** @param scrollbar cast=(GtkScrollbar *) */ |
| public static final native long gtk_scrollbar_get_adjustment(long scrollbar); |
| } |