Skip to content

Commit b6bb5aa

Browse files
fix(gtk4): wrap remaining Xt translations and context functions in GTK4_EXT macro
1 parent 8976c26 commit b6bb5aa

10 files changed

Lines changed: 40 additions & 1 deletion

File tree

src/libphigs/cp/cpm_tlkt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ SOFTWARE.
5050
#include <stdio.h>
5151
#ifndef GTK4_EXT
5252
#include <X11/StringDefs.h>
53+
#ifndef GTK4_EXT
5354
#include <X11/Shell.h>
5455
#endif
56+
#endif
5557
#include "phg.h"
5658
#include "ws.h"
5759
#include "sin.h"

src/libphigs/input/sin_cho.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,21 @@ SOFTWARE.
5959
#include "sin.h"
6060
#include "private/sinP.h"
6161

62+
#ifndef GTK4_EXT
6263
#include <X11/StringDefs.h>
6364
#include <X11/Shell.h>
65+
#endif
6466
#ifdef MOTIF
6567
#include <stdbool.h>
6668
#include <Xm/Frame.h>
6769
#include <Xm/ToggleB.h>
6870
#include <Xm/RowColumn.h>
6971
#else
72+
#ifndef GTK4_EXT
7073
#include <X11/Xaw/Viewport.h>
7174
#include <X11/Xaw/List.h>
7275
#endif
76+
#endif
7377
/*******************************************************************************
7478
* choice_notify
7579
*

src/libphigs/input/sin_str.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ SOFTWARE.
5959
#include "sin.h"
6060
#include "private/sinP.h"
6161

62+
#ifndef GTK4_EXT
6263
#include <X11/StringDefs.h>
6364
#include <X11/Shell.h>
65+
#endif
6466
#ifdef MOTIF
6567
#include <Xm/Frame.h>
6668
#include <Xm/Text.h>
6769
#else
70+
#ifndef GTK4_EXT
6871
#include <X11/Xaw/Viewport.h>
6972
#include <X11/Xaw/AsciiText.h>
7073
#endif
74+
#endif
7175

7276
/*******************************************************************************
7377
* reset_string_measure
@@ -228,10 +232,12 @@ XtActionProc phg_sin_xt_string_event(
228232
}
229233
#endif
230234

235+
#ifndef GTK4_EXT
231236
static XtTranslations compiled_translations;
232237
static String translations = "\
233238
<Key>Return: newline() StringEvent() RequestSatisfied() \n\
234239
";
240+
#endif
235241

236242
/*******************************************************************************
237243
* create_string
@@ -306,10 +312,12 @@ static void create_string(
306312
NULL );
307313
#endif
308314

315+
#ifndef GTK4_EXT
309316
if ( !compiled_translations ) {
310317
compiled_translations = XtParseTranslationTable( translations );
311318
}
312319
XtOverrideTranslations( widgets->textw, compiled_translations );
320+
#endif
313321
#ifdef DEBUGINP
314322
printf("Done with create string.\n");
315323
#endif
@@ -343,9 +351,11 @@ static void enable_string(
343351
#ifdef DEBUGINP
344352
printf("Setting flags\n");
345353
#endif
354+
#ifndef GTK4_EXT
346355
XSaveContext( XtDisplay(device->item_handle.string.textw),
347356
XtWindow(device->item_handle.string.textw),
348357
phg_sin_device_context_id, (caddr_t)device );
358+
#endif
349359
device->flags.been_up_yet = 1;
350360
}
351361
#ifdef DEBUGINP
@@ -409,8 +419,13 @@ static void destroy_string(
409419
#ifdef DEBUGINP
410420
printf("Destroy string.\n");
411421
#endif
412-
if ( device->item_handle.string.shell )
422+
if ( device->item_handle.string.shell ) {
423+
#ifdef GTK4_EXT
424+
gtk_window_destroy(GTK_WINDOW(device->item_handle.string.shell));
425+
#else
413426
XtDestroyWidget( device->item_handle.string.shell );
427+
#endif
428+
}
414429
}
415430

416431
/*******************************************************************************

src/libphigs/input/sin_val.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,24 @@ SOFTWARE.
5959
#include "sin.h"
6060
#include "private/sinP.h"
6161

62+
#ifndef GTK4_EXT
6263
#include <X11/StringDefs.h>
6364
#include <X11/Shell.h>
65+
#endif
6466
#ifdef MOTIF
6567
#include <Xm/Frame.h>
6668
#include <Xm/Scale.h>
6769
#include <Xm/RowColumn.h>
6870
#include <Xm/PanedW.h>
6971
#include <Xm/Label.h>
7072
#else
73+
#ifndef GTK4_EXT
7174
#include <X11/Xaw/Paned.h>
7275
#include <X11/Xaw/Scrollbar.h>
7376
#include <X11/Xaw/Label.h>
7477
#include <X11/Xaw/Box.h>
7578
#endif
79+
#endif
7680
/*******************************************************************************
7781
* init_valuator
7882
*

src/libphigs/ws/ws_inp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ SOFTWARE.
5050
#include <stdio.h>
5151
#include <stdlib.h>
5252
#include <string.h>
53+
#ifndef GTK4_EXT
5354
#include <X11/Intrinsic.h>
5455
#include <X11/StringDefs.h>
56+
#endif
5557

5658
#include "phg.h"
5759
#include "ws.h"

src/libphigs/ws/ws_pm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,23 @@ SOFTWARE.
5757
#include "cp.h"
5858
#include "ws.h"
5959
#include "private/wsxP.h"
60+
#ifndef GTK4_EXT
6061
#include <X11/IntrinsicI.h>
6162
#include <X11/StringDefs.h>
6263
#include <X11/Shell.h>
64+
#endif
6365
#ifdef MOTIF
6466
#include <Xm/Frame.h>
6567
#include <Xm/Label.h>
6668
#include <Xm/PanedW.h>
6769
#include <Xm/PushB.h>
6870
#else
71+
#ifndef GTK4_EXT
6972
#include <X11/Xaw/Box.h>
7073
#include <X11/Xaw/Label.h>
7174
#include <X11/Xaw/Command.h>
7275
#endif
76+
#endif
7377

7478
int done_pressed = 0;
7579

src/libphigs/ws/wsb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ SOFTWARE.
5555
#include <string.h>
5656
#include <assert.h>
5757
#include <stdio.h>
58+
#ifndef GTK4_EXT
5859
#include <X11/StringDefs.h>
5960
#include <X11/Shell.h>
61+
#endif
6062

6163
#include "phg.h"
6264
#include "private/phgP.h"

src/libphigs/ws/wsx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
#include <stdio.h>
2424
#include <stdlib.h>
2525
#include <string.h>
26+
#ifndef GTK4_EXT
2627
#include <X11/StringDefs.h>
2728
#include <X11/Shell.h>
29+
#endif
2830
#include <X11/Xlib.h>
2931

3032
#ifdef GLEW

src/libphigs/ws/wsx_inp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
#include "private/evtP.h"
2929
#include "private/wsxP.h"
3030

31+
#ifndef GTK4_EXT
3132
#include <X11/Shell.h>
3233
#include <X11/StringDefs.h>
34+
#endif
3335

3436
/*******************************************************************************
3537
* phg_wsx_input_dispatch_next

src/libphigs/wsgl/wsgl_shaders.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
#include <stdio.h>
2121
#include <stdlib.h>
2222
#include <string.h>
23+
#ifndef GTK4_EXT
2324
#include <X11/StringDefs.h>
2425
#include <X11/Shell.h>
26+
#endif
2527
#include <X11/Xlib.h>
2628
#ifdef GLEW
2729
#include <GL/glew.h>

0 commit comments

Comments
 (0)