Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Upstream rebase #23

Closed
wants to merge 100 commits into from
Closed

Conversation

fejfighter
Copy link

This is my WIP to rebase and combine/reword commits to make upstream integration a simpler merge.

It should make it a fast-forward merge to upstream, but will not merge into masm11/pgtk

I think I have all changes now, and it seems to compile

@masm11
Copy link
Owner

masm11 commented Apr 29, 2020

Thank you.

Notice: #21 was reverted by #24.

@fejfighter fejfighter force-pushed the upstream-rebase branch 2 times, most recently from f8f90dd to 76e4f1e Compare April 29, 2020 07:23
@masm11
Copy link
Owner

masm11 commented Apr 29, 2020

My compiler says:

image.c: In function 'imagemagick_load_image':
image.c:9399:1: error: invalid storage class for function 'imagemagick_load'
 9399 | imagemagick_load (struct frame *f, struct image *img)
      | ^~~~~~~~~~~~~~~~
image.c:9485:13: error: invalid storage class for function 'svg_load_image'
 9485 | static bool svg_load_image (struct frame *, struct image *,
      |             ^~~~~~~~~~~~~~
image.c:9527:1: error: invalid storage class for function 'svg_image_p'
 9527 | svg_image_p (Lisp_Object object)
      | ^~~~~~~~~~~
image.c:9713:1: error: invalid storage class for function 'svg_load'
 9713 | svg_load (struct frame *f, struct image *img)
      | ^~~~~~~~

... and many errors.

@fejfighter
Copy link
Author

Sorry, I pushed on folding in more fixup commits, it might be a little out of order now..
I have taken #21 into account

@fejfighter
Copy link
Author

Ok Should be good now

I only I get gcc 10 warnings from code neither of us have touched

@fejfighter fejfighter force-pushed the upstream-rebase branch 7 times, most recently from cee04a7 to 8283bf1 Compare April 29, 2020 13:03
@masm11
Copy link
Owner

masm11 commented Apr 29, 2020

What did you do? What should I do? What is this branch?
I don't understand.
Could you explain?

@Emantor
Copy link

Emantor commented Apr 29, 2020

This branch extracts your commits on the master branch into a linear history which can be applied on top off current emacs master. This way the commits can be carried forward using a rebase, instead of periodically merging in the emacs master branch.

@masm11
Copy link
Owner

masm11 commented Apr 29, 2020

@Emantor
Thank you for the explanation about his work.

@fejfighter
I understand rebase. I should have used it. Thank you very much for your hard work!
But this branch is not tested, and shouldn't be pushed to fsf's repository.
How are you going to do from here?

@masm11
Copy link
Owner

masm11 commented Apr 29, 2020

I'll test this branch again tomorrow night.

@fejfighter
Copy link
Author

@masm11
All good, I have worked with a few developers over the years that didn't understand it.
just wanted to make sure there was no language barrier and what needed to be done.

As far as testing and pushing to FSF, I agree it's not yet ready

The best I can manage for testing is to compare diffs between your pgtk branch, upstream gnu and this one.

Most of the commits that I am squashing down are smaller fixups (removal of trace statements, change of functions or args) or in the cases where upstream made structural changes (XColor -> Emacs_Color) I'm trying to make the original code have that from the start

Once it's down to a manageable number of commits that implement/fix related unit of work then changing to gnu commit messages should be easier. for now I have put notes in for myself, but kep the original japanese commits in the body of the commit.

@masm11
Copy link
Owner

masm11 commented Apr 30, 2020

@fejfighter
Great!
Maybe, I can help you only by testing your branch.

I tested 8283bf1. My compiler says:

image.c:6491:2: error: #endif without #if
 6491 | #endif /* HAVE_PNG */
      |  ^~~~~
image.c: In function 'imagemagick_load_image':
image.c:9398:1: error: invalid storage class for function 'imagemagick_load'
 9398 | imagemagick_load (struct frame *f, struct image *img)
      | ^~~~~~~~~~~~~~~~
image.c:9484:13: error: invalid storage class for function 'svg_load_image'
 9484 | static bool svg_load_image (struct frame *, struct image *,
      |             ^~~~~~~~~~~~~~
image.c:9526:1: error: invalid storage class for function 'svg_image_p'
 9526 | svg_image_p (Lisp_Object object)
      | ^~~~~~~~~~~
image.c:9712:1: error: invalid storage class for function 'svg_load'
 9712 | svg_load (struct frame *f, struct image *img)
      | ^~~~~~~~
image.c: In function 'svg_load':
image.c:9738:19: warning: implicit declaration of function 'svg_load_image'; did you mean 'xpm_load_image'? [-Wimplicit-function-declaration]
 9738 |       success_p = svg_load_image (f, img, contents, size,
      |                   ^~~~~~~~~~~~~~
      |                   xpm_load_image
image.c:9738:19: warning: nested extern declaration of 'svg_load_image' [-Wnested-externs]
image.c: In function 'imagemagick_load_image':
image.c:9771:1: error: invalid storage class for function 'svg_load_image'
 9771 | svg_load_image (struct frame *f, struct image *img, char *contents,
      | ^~~~~~~~~~~~~~
image.c:10286:1: error: invalid storage class for function 'initialize_image_type'
10286 | initialize_image_type (struct image_type const *type)
      | ^~~~~~~~~~~~~~~~~~~~~
image.c:10321:54: error: initializer element is not constant
10321 |  { SYMBOL_INDEX (Qimagemagick), imagemagick_image_p, imagemagick_load,
      |                                                      ^~~~~~~~~~~~~~~~
image.c:10321:54: note: (near initialization for 'image_types[0].load')
image.c:10325:25: error: initializer element is not constant
10325 |  { SYMBOL_INDEX (Qsvg), svg_image_p, svg_load, image_clear_image,
      |                         ^~~~~~~~~~~
image.c:10325:25: note: (near initialization for 'image_types[1].valid_p')
image.c:10325:38: error: initializer element is not constant
10325 |  { SYMBOL_INDEX (Qsvg), svg_image_p, svg_load, image_clear_image,
      |                                      ^~~~~~~~
image.c:10325:38: note: (near initialization for 'image_types[1].load')
image.c:10362:1: error: invalid storage class for function 'lookup_image_type'
10362 | lookup_image_type (Lisp_Object type)
      | ^~~~~~~~~~~~~~~~~
image.c:10587:1: error: expected declaration or statement at end of input
10587 | }
      | ^
image.c:10587:1: error: expected declaration or statement at end of input
image.c: At top level:
image.c:877:33: warning: 'lookup_image_type' used but never defined
  877 | static struct image_type const *lookup_image_type (Lisp_Object);
      |                                 ^~~~~~~~~~~~~~~~~
image.c:10380:1: warning: 'syms_of_image' defined but not used [-Wunused-function]
10380 | syms_of_image (void)
      | ^~~~~~~~~~~~~
image.c:10362:1: warning: 'lookup_image_type' defined but not used [-Wunused-function]
10362 | lookup_image_type (Lisp_Object type)
      | ^~~~~~~~~~~~~~~~~
In file included from image.c:37:
image.c:10273:30: warning: 'Finit_image_library' defined but not used [-Wunused-function]
10273 | DEFUN ("init-image-library", Finit_image_library, Sinit_image_library, 1, 1, 0,
      |                              ^~~~~~~~~~~~~~~~~~~
lisp.h:3070:16: note: in definition of macro 'DEFUN'
 3070 |    Lisp_Object fnname
      |                ^~~~~~
image.c:10239:30: warning: 'Fimage_transforms_p' defined but not used [-Wunused-function]
10239 | DEFUN ("image-transforms-p", Fimage_transforms_p, Simage_transforms_p, 0, 1, 0,
      |                              ^~~~~~~~~~~~~~~~~~~
lisp.h:3070:16: note: in definition of macro 'DEFUN'
 3070 |    Lisp_Object fnname
      |                ^~~~~~
image.c:9771:1: warning: 'svg_load_image' defined but not used [-Wunused-function]
 9771 | svg_load_image (struct frame *f, struct image *img, char *contents,
      | ^~~~~~~~~~~~~~
In file included from image.c:37:
image.c:9438:29: warning: 'Fimagemagick_types' defined but not used [-Wunused-function]
 9438 | DEFUN ("imagemagick-types", Fimagemagick_types, Simagemagick_types, 0, 0, 0,
      |                             ^~~~~~~~~~~~~~~~~~
lisp.h:3070:16: note: in definition of macro 'DEFUN'
 3070 |    Lisp_Object fnname
      |                ^~~~~~

@masm11
Copy link
Owner

masm11 commented Apr 30, 2020

@fejfighter
For now, I'll debug many issues pointed out in emacs-devel.

@fejfighter
Copy link
Author

fejfighter commented May 1, 2020

@masm11, what configure string are you using?
and are the version numbers in your README.md still up to date?

I'm not using arch but I could set up a VM to compare against it, because I am sure I had those issues fixed

EDIT:
never mind, Now I am getting some of the same errors

thought I do have a slightly older ImageMagick on fedora31

@fejfighter
Copy link
Author

I never got the defun issues but,

I found that I missed a couple of closing braces in a for loop that should fix that

later today I will try to fold in more commits,
I think the Readme and pkgbuild commits can be placed in one for easy removal closer to an upstream push

@fejfighter fejfighter force-pushed the upstream-rebase branch 5 times, most recently from 0cc4b81 to e283fa7 Compare May 1, 2020 10:59
Yuuki Harano and others added 23 commits November 24, 2020 12:24
* configure.ac: Set HAVE_PGTK when configuring for PGTK, and
add PGTK for iteration.
* src/gtkutil.c (xg_create_frame_widgets): Use popup for tooltip.
* src/pgtkfns.c (unwind_create_tip_frame): Port X code.
(x_create_tip_frame): Re-port X code.
(x_hide_tip): Re-port X code.
(Fx_show_tip): Re-port X code.
(frame_geometry): Get left_pos and top_pos here.
(syms_of_pgtkfns): Add variables for tooltip.
* src/pgtkterm.c (pgtk_set_event_handler): Set event handler for tooltip.
* src/emacs.c (main): Remove duplicated syms_of_xwidget() call.
* lisp/term/pgtk-win.el: Call pgtk-use-im-context after init.

* src/pgtkim.c (pgtk_im_use_context): New function.
(pgtk_im_init): Call pgtk_im_use_context.
(Fpgtk_use_im_context): Call pgtk_im_use_context.
(syms_of_pgtkim): New variable Vpgtk_use_im_context_on_new_connection.
* src/pgtkfns.c (Fx_export_frames):
(syms_of_pgtkfns): port from X11 version
* src/pgtkterm.c (pgtk_cr_accumulate_data):
(pgtk_cr_destroy):
(pgtk_cr_export_frames): port from X11
* src/pgtkterm.h: add defs
* src/emacsgtkfixed.c (G_DEFINE_TYPE): Make emacs_fixed_get_type public.
* src/emacsgtkfixed.h (EMACS_TYPE_FIXED): Make emacs_fixed_get_type public.
* src/gtkutil.c (xg_frame_set_char_size): Call appropriate functions
by whether the frame is a child frame or not.
(xg_create_frame_widgets): Use GTK_WINDOW_TOPLEVEL when creating child frame.
(xg_create_frame_outer_widgets): New function.
(xg_set_skip_taskbar): Call only when top-level frame.
(xg_set_no_accept_focus): See appropriate widget.
* src/gtkutil.h: New declaration.
* src/pgtkfns.c (pgtk_set_name_internal): Do only when top-level frame.
(Fx_create_frame): Reparent the frame.
(frame_geometry): Call appropriate functions
(syms_of_pgtkfns): Port from X code.
* src/pgtkterm.c (x_free_frame_resources): Destroy appropriate widget.
(x_calc_absolute_position): Port from X code.
(x_set_offset): Re-port from X code.
(pgtk_set_window_size): Use appropriate widget.
(pgtk_make_frame_visible): Use appropriate widget.
(pgtk_make_frame_invisible): Use appropriate widget.
(x_set_parent_frame): Reparent the frame.
(x_set_z_group): Process only when top-level frame.
(pgtk_text_icon): Process only when top-level frame.
(set_fullscreen_state): Process only when top-level frame.
(frame_highlight): Hold ref.
(frame_unhighlight): Hold ref.
(pgtk_window_is_of_frame_recursive): Prune child frames.
(pgtk_window_is_of_frame): Prune child frames.
(print_widget_tree_recursive): Don't call this when not debugging.
(pgtk_handle_draw): Don't call this when not debugging.
(pgtk_set_event_handler): expect map-event for edit_widget not outer widget.
* src/pgtkterm.h (FRAME_WIDGET): New macro.
* src/pgtkterm.c (IsModifierKey): New macro.
(key_press_event): Exclude Xlib's modifier keys.
* src/gtkutil.c (update_frame_tool_bar): Do nothing when child frame.
* src/pgtkfns.c (frame_geometry): Returns nil when no widget.
* src/pgtkterm.c: New variable to indicate whether any event occurs.
(configure_event): Clear help string on a event.
(leave_notify_event): Clear help string on a event.
(motion_notify_event): Use gen_help_event.
(pgtk_set_event_handler): Hook configure-event for outer widgets.
(pgtk_term_init): Clear the flag.
* src/xwidget.c (xwidget_osr_event_forward): Propagate motion notify.
* src/pgtkterm.c (pgtk_select): Move dispatch before
g_main_context_query.
(drag_drop): Remove drag_drop.
(drag_data_received): Rename arg.
(pgtk_set_event_handler): Remove drag-drop callback.
* src/gtkutil.c (xg_frame_set_char_size): Call appropriate function
(xg_set_undecorated): Do nothing if child frame.
(xg_set_no_focus_on_map): Do nothing if child frame.
(xg_set_no_accept_focus): Do nothing if child frame.
(xg_set_frame_icon): Do nothing if child frame.
(xg_get_file_name): Do nothing if child frame.
(xg_get_font):
* src/pgtkterm.c (pgtk_focus_frame): Do nothing if child frames.
(x_set_frame_alpha): Select correct widget.
(x_new_focus_frame): Focus only when non-child frames.
(pgtk_set_event_handler): Don't set for child frames.
* src/pgtkfns.c (xg_set_icon): Do nothing if child frames.
(xg_set_icon_from_xpm_data): Do nothing if child frames.
(pgtk_set_sticky): Do nothing if child frames.
(Fx_show_tip): Do nothing if child frames.
(Fpgtk_set_mouse_absolute_pixel_position): Select correct widget.
(Fpgtk_mouse_absolute_pixel_position): Select correct widget.
* src/pgtkmenu.c (pgtk_menu_show):
(pgtk_dialog_show):
* lisp/term/pgtk-win.el (window-system-initialization): copy invocation-name.
* src/xwidget.c (xwidget_osr_draw_cb): Call it to avoid alloc_needes.
* src/xwidget.c (Fmake_xwidget): Use gtk_container_check_resize instead.
(Fxwidget_resize): Use gtk_container_check_resize instead.

; Gtk+3 document says:
; > Applications should not use any API specific to GtkWindow
; > to operate on this object. It should be treated as a GtkBin
; > that has no parent widget.
* src/frame.c (syms_of_frame): Defaults frame_resize_pixelwise to true.
* src/pgtkterm.c (pgtk_bitmap_icon): Re-port X-code.
(pgtk_term_init): Add member initialization.
* src/pgtkterm.h (struct pgtk_display_info): Add member.
(struct pgtk_output): Add member.
* src/pgtkfns.c:
* src/pgtkgui.h:
* src/pgtkim.c:
* src/pgtkmenu.c:
* src/pgtkselect.c:
* src/pgtkselect.h:
* src/pgtkterm.c:
* src/pgtkterm.h: Update copyright dates - No Funtional Changes
* src/pgtkterm.c (x_find_modifier_meanings): Convert virtual super
to non-virtual one.
(pgtk_gtk_to_emacs_modifiers): Use non-virtual one.
(pgtk_emacs_to_gtk_modifiers): Use non-virtual one.
(key_press_event): Don't call pgtk_im_context_filter_keypress while
super is pressed.
* src/pgtkterm.h (struct pgtk_display_info): New member.
* etc/org.gnu.emacs.defaults.gschema.xml: Add copyright line.
* src/pgtkfns.c (parse_resource_key): Check return value.
@fejfighter
Copy link
Author

@fejfighter
The change was introduced in bd57e31.
When I merged upstream master, it conflicted with f2bb574 and I resolved in the merge commit 591b0de.

I had been looking at the wrong function trying to figure out what was different.

this should line up now

@masm11
Copy link
Owner

masm11 commented Nov 24, 2020

@fejfighter confirmed. thanks!

@masm11
Copy link
Owner

masm11 commented Nov 24, 2020

I pushed to savannah as feature/pgtk! Thank you everyone!!

https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01141.html

@Thaodan
Copy link

Thaodan commented Dec 22, 2020

Close this one then?

@fejfighter
Copy link
Author

Yeah, this is upstream now and I haven't been updating it

@fejfighter fejfighter closed this Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants