diff options
| author | Po Lu | 2022-04-06 12:27:57 +0800 |
|---|---|---|
| committer | Po Lu | 2022-04-06 12:27:57 +0800 |
| commit | 62eb57f43871dacb6c7ac1f6e2cdaf7add1414e2 (patch) | |
| tree | 0f4257717da2612a0780240058f7fdff97f92af0 /src/pgtkterm.c | |
| parent | f0ff20be51980731364ef5ccf0505c35ea1b4e78 (diff) | |
| download | emacs-62eb57f43871dacb6c7ac1f6e2cdaf7add1414e2.tar.gz emacs-62eb57f43871dacb6c7ac1f6e2cdaf7add1414e2.zip | |
Clean up more PGTK code
* lisp/term/pgtk-win.el (featurep):
(pgtk):
(pgtk-use-im-context):
(pgtk-handle-nxopen):
(pgtk-handle-nxopentemp):
(pgtk-ignore-1-arg):
([C-drag-n-drop]):
([M-drag-n-drop]):
([C-M-drag-n-drop]):
(pgtk-alternate-modifier):
(pgtk-right-alternate-modifier):
(pgtk-right-command-modifier):
(pgtk-right-control-modifier):
(pgtk-do-hide-emacs):
(pgtk-hide-others):
(pgtk-do-hide-others):
(pgtk-emacs-info-panel):
(pgtk-do-emacs-info-panel):
(pgtk-next-frame):
(pgtk-prev-frame):
(after-make-frame-functions):
(tool-bar-mode):
(pgtk-toggle-toolbar):
(pgtk-print-buffer):
(scalable-fonts-allowed):
(pgtk-standard-fontset-spec):
(pgtk-store-cut-buffer-internal):
(pgtk-copy-including-secondary):
(pgtk-paste-secondary):
(pgtk-suspend-error):
(window-system-initialization):
(after-init-hook): Remove code mindlessly copied from ns-win.el,
delete unused custom group, write doc strings and rename
variables duplicated from X to their names on X. Also reformat
comments and code.
(pgtk-use-im-context-handler): New function.
* src/pgtkfns.c (syms_of_pgtkfns): Delete useless
AppleScript (!) code copied from NS.
* src/pgtkselect.c: Write FIXME about selection API usage.
* src/pgtkterm.c (get_keysym_name): Implement correctly instead
of sprintf'ing the numeric value of the keysym into a static
buffer.
(pgtk_set_window_size):
(xg_scroll_callback): Delete code that was #if 0'd out and
doesn't make sense on PGTK.
(pgtk_delete_terminal): Remove misleading comment.
Diffstat (limited to 'src/pgtkterm.c')
| -rw-r--r-- | src/pgtkterm.c | 80 |
1 files changed, 20 insertions, 60 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 94587381424..b2816aa04af 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c | |||
| @@ -136,12 +136,10 @@ pgtk_toolkit_position (struct frame *f, int x, int y, | |||
| 136 | } | 136 | } |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | /* | 139 | /* This is not a flip context in the same sense as gpu rendering |
| 140 | * This is not a flip context in the same sense as gpu rendering | 140 | scenes, it only occurs when a new context was required due to a |
| 141 | * scences, it only occurs when a new context was required due to a | 141 | resize or other fundamental change. This is called when that |
| 142 | * resize or other fundamental change. This is called when that | 142 | context's surface has completed drawing. */ |
| 143 | * context's surface has completed drawing | ||
| 144 | */ | ||
| 145 | 143 | ||
| 146 | static void | 144 | static void |
| 147 | flip_cr_context (struct frame *f) | 145 | flip_cr_context (struct frame *f) |
| @@ -221,14 +219,8 @@ mark_pgtkterm (void) | |||
| 221 | 219 | ||
| 222 | char * | 220 | char * |
| 223 | get_keysym_name (int keysym) | 221 | get_keysym_name (int keysym) |
| 224 | /* -------------------------------------------------------------------------- | ||
| 225 | Called by keyboard.c. Not sure if the return val is important, except | ||
| 226 | that it be unique. | ||
| 227 | -------------------------------------------------------------------------- */ | ||
| 228 | { | 222 | { |
| 229 | static char value[16]; | 223 | return gdk_keyval_name (keysym); |
| 230 | sprintf (value, "%d", keysym); | ||
| 231 | return value; | ||
| 232 | } | 224 | } |
| 233 | 225 | ||
| 234 | void | 226 | void |
| @@ -531,31 +523,8 @@ pgtk_set_window_size (struct frame *f, bool change_gravity, | |||
| 531 | gtk_widget_get_size_request (FRAME_GTK_WIDGET (f), &pixelwidth, | 523 | gtk_widget_get_size_request (FRAME_GTK_WIDGET (f), &pixelwidth, |
| 532 | &pixelheight); | 524 | &pixelheight); |
| 533 | 525 | ||
| 534 | #if 0 | ||
| 535 | if (pixelwise) | ||
| 536 | { | ||
| 537 | pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); | ||
| 538 | pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); | ||
| 539 | } | ||
| 540 | else | ||
| 541 | { | ||
| 542 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); | ||
| 543 | pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); | ||
| 544 | } | ||
| 545 | #else | ||
| 546 | pixelwidth = width; | 526 | pixelwidth = width; |
| 547 | pixelheight = height; | 527 | pixelheight = height; |
| 548 | #endif | ||
| 549 | |||
| 550 | #if 0 | ||
| 551 | frame_size_history_add | ||
| 552 | (f, Qx_set_window_size_1, width, height, | ||
| 553 | list5 (Fcons (make_fixnum (pixelwidth), make_fixnum (pixelheight)), | ||
| 554 | Fcons (make_fixnum (pixelwidth), make_fixnum (pixelheight)), | ||
| 555 | make_fixnum (f->border_width), | ||
| 556 | make_fixnum (FRAME_PGTK_TITLEBAR_HEIGHT (f)), | ||
| 557 | make_fixnum (FRAME_TOOLBAR_HEIGHT (f)))); | ||
| 558 | #endif | ||
| 559 | 528 | ||
| 560 | for (GtkWidget * w = FRAME_GTK_WIDGET (f); w != NULL; | 529 | for (GtkWidget * w = FRAME_GTK_WIDGET (f); w != NULL; |
| 561 | w = gtk_widget_get_parent (w)) | 530 | w = gtk_widget_get_parent (w)) |
| @@ -3921,28 +3890,21 @@ xg_scroll_callback (GtkRange * range, | |||
| 3921 | switch (scroll) | 3890 | switch (scroll) |
| 3922 | { | 3891 | { |
| 3923 | case GTK_SCROLL_JUMP: | 3892 | case GTK_SCROLL_JUMP: |
| 3924 | #if 0 | 3893 | if (bar->horizontal) |
| 3925 | /* Buttons 1 2 or 3 must be grabbed. */ | 3894 | { |
| 3926 | if (FRAME_DISPLAY_INFO (f)->grabbed != 0 | 3895 | part = scroll_bar_horizontal_handle; |
| 3927 | && FRAME_DISPLAY_INFO (f)->grabbed < (1 << 4)) | 3896 | whole = (int) (gtk_adjustment_get_upper (adj) - |
| 3928 | #endif | 3897 | gtk_adjustment_get_page_size (adj)); |
| 3929 | { | 3898 | portion = min ((int) value, whole); |
| 3930 | if (bar->horizontal) | 3899 | bar->dragging = portion; |
| 3931 | { | 3900 | } |
| 3932 | part = scroll_bar_horizontal_handle; | 3901 | else |
| 3933 | whole = (int) (gtk_adjustment_get_upper (adj) - | 3902 | { |
| 3934 | gtk_adjustment_get_page_size (adj)); | 3903 | part = scroll_bar_handle; |
| 3935 | portion = min ((int) value, whole); | 3904 | whole = gtk_adjustment_get_upper (adj) - |
| 3936 | bar->dragging = portion; | 3905 | gtk_adjustment_get_page_size (adj); |
| 3937 | } | 3906 | portion = min ((int) value, whole); |
| 3938 | else | 3907 | bar->dragging = portion; |
| 3939 | { | ||
| 3940 | part = scroll_bar_handle; | ||
| 3941 | whole = gtk_adjustment_get_upper (adj) - | ||
| 3942 | gtk_adjustment_get_page_size (adj); | ||
| 3943 | portion = min ((int) value, whole); | ||
| 3944 | bar->dragging = portion; | ||
| 3945 | } | ||
| 3946 | } | 3908 | } |
| 3947 | break; | 3909 | break; |
| 3948 | case GTK_SCROLL_STEP_BACKWARD: | 3910 | case GTK_SCROLL_STEP_BACKWARD: |
| @@ -4505,8 +4467,6 @@ pgtk_delete_terminal (struct terminal *terminal) | |||
| 4505 | 4467 | ||
| 4506 | xg_display_close (dpyinfo->gdpy); | 4468 | xg_display_close (dpyinfo->gdpy); |
| 4507 | 4469 | ||
| 4508 | /* Do not close the connection here because it's already closed | ||
| 4509 | by X(t)CloseDisplay (Bug#18403). */ | ||
| 4510 | dpyinfo->gdpy = NULL; | 4470 | dpyinfo->gdpy = NULL; |
| 4511 | } | 4471 | } |
| 4512 | 4472 | ||