@@ -61,10 +61,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
61
61
#include TERM_HEADER
62
62
#endif /* HAVE_WINDOW_SYSTEM */
63
63
64
- #ifdef HAVE_PGTK
65
- #include <pgtkimage.h>
66
- #endif
67
-
68
64
/* Work around GCC bug 54561. */
69
65
#if GNUC_PREREQ (4 , 3 , 0 )
70
66
# pragma GCC diagnostic ignored "-Wclobbered"
@@ -134,19 +130,10 @@ typedef struct ns_bitmap_record Bitmap_Record;
134
130
135
131
#ifdef HAVE_PGTK
136
132
typedef struct pgtk_bitmap_record Bitmap_Record ;
137
-
138
- #define GET_PIXEL (ximg , x , y ) XGetPixel (ximg, x, y)
139
- #define NO_PIXMAP 0
140
-
141
- #define PIX_MASK_RETAIN 0
142
- #define PIX_MASK_DRAW 1
143
-
144
- #define x_defined_color (f , name , color_def , alloc ) \
145
- pgtk_defined_color (f, name, color_def, alloc, 0)
146
133
#endif /* HAVE_PGTK */
147
134
148
135
#if (defined HAVE_X_WINDOWS \
149
- && ! (defined HAVE_NTGUI || defined USE_CAIRO || defined HAVE_NS || defined HAVE_PGTK ))
136
+ && ! (defined HAVE_NTGUI || defined USE_CAIRO || defined HAVE_NS ))
150
137
/* W32_TODO : Color tables on W32. */
151
138
# define COLOR_TABLE_SUPPORT 1
152
139
#endif
@@ -302,22 +289,6 @@ XPutPixel (Emacs_Pix_Container image, int x, int y, unsigned long pixel)
302
289
}
303
290
#endif /* HAVE_NS */
304
291
305
- #ifdef HAVE_PGTK
306
- /* Use with pgtk_image. */
307
- static unsigned long
308
- XGetPixel (XImagePtr ximage , int x , int y )
309
- {
310
- return pgtk_image_get_pixel (ximage , x , y );
311
- }
312
-
313
- /* Use with pgtk_image. */
314
- static void
315
- XPutPixel (XImagePtr ximage , int x , int y , unsigned long pixel )
316
- {
317
- pgtk_image_put_pixel (ximage , x , y , pixel );
318
- }
319
- #endif /* HAVE_PGTK */
320
-
321
292
/* Code to deal with bitmaps. Bitmaps are referenced by their bitmap
322
293
id, which is just an int that this section returns. Bitmaps are
323
294
reference counted so they can be shared among frames.
@@ -461,9 +432,11 @@ image_create_bitmap_from_data (struct frame *f, char *bits,
461
432
#endif
462
433
463
434
#ifdef HAVE_PGTK
464
- void * bitmap = pgtk_image_create_from_xbm (bits , width , height , 0xffffffff , 0xff000000 );
465
- if (!bitmap )
466
- return -1 ;
435
+ Emacs_Pixmap bitmap = image_pix_container_create_from_bitmap_data (f , bits ,
436
+ width ,
437
+ height ,
438
+ 0xffffffff ,
439
+ 0xff000000 );
467
440
#endif
468
441
469
442
id = image_allocate_bitmap_record (f );
@@ -606,8 +579,8 @@ free_bitmap_record (Display_Info *dpyinfo, Bitmap_Record *bm)
606
579
ns_release_object (bm -> img );
607
580
#endif
608
581
609
- #ifdef HAVE_NS
610
- pgtk_image_destroy (bm -> img );
582
+ #ifdef HAVE_PGTK
583
+ // pgtk_image_destroy (bm->img);
611
584
#endif
612
585
613
586
if (bm -> file )
@@ -2755,18 +2728,6 @@ image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int d
2755
2728
* pimg = * pixmap ;
2756
2729
return 1 ;
2757
2730
#endif
2758
-
2759
- #ifdef HAVE_PGTK
2760
- * pixmap = pgtk_image_create (width , height , depth );
2761
- if (* pixmap == 0 )
2762
- {
2763
- * pimg = NULL ;
2764
- image_error ("Unable to allocate pgtk_image for XPM pixmap" );
2765
- return 0 ;
2766
- }
2767
- * pimg = * pixmap ;
2768
- return 1 ;
2769
- #endif
2770
2731
}
2771
2732
2772
2733
@@ -2792,7 +2753,7 @@ image_destroy_x_image (Emacs_Pix_Container pimg)
2792
2753
ns_release_object (pimg );
2793
2754
#endif /* HAVE_NS */
2794
2755
#ifdef HAVE_PGTK
2795
- pgtk_image_destroy (pimg );
2756
+ // pgtk_image_destroy (pimg);
2796
2757
#endif /* HAVE_PGTK */
2797
2758
}
2798
2759
#endif
@@ -2831,10 +2792,6 @@ gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg,
2831
2792
eassert (pimg == pixmap );
2832
2793
ns_retain_object (pimg );
2833
2794
#endif
2834
-
2835
- #ifdef HAVE_PGTK
2836
- eassert (pimg == pixmap );
2837
- #endif
2838
2795
}
2839
2796
2840
2797
/* Thin wrapper for image_create_x_image_and_pixmap_1, so that it matches
@@ -2953,9 +2910,6 @@ image_get_x_image (struct frame *f, struct image *img, bool mask_p)
2953
2910
2954
2911
ns_retain_object (pixmap );
2955
2912
return pixmap ;
2956
- #elif defined (HAVE_PGTK )
2957
- XImagePtr pixmap = !mask_p ? img -> pixmap : img -> mask ;
2958
- return pixmap ;
2959
2913
#endif
2960
2914
}
2961
2915
@@ -3664,14 +3618,12 @@ xbm_load_image (struct frame *f, struct image *img, char *contents, char *end)
3664
3618
img -> pixmap = NO_PIXMAP ;
3665
3619
xfree (data );
3666
3620
3667
- #ifndef HAVE_PGTK
3668
3621
if (img -> pixmap == NO_PIXMAP )
3669
3622
{
3670
3623
image_clear_image (f , img );
3671
3624
image_error ("Unable to create X pixmap for `%s'" , img -> spec );
3672
3625
}
3673
3626
else
3674
- #endif
3675
3627
success_p = 1 ;
3676
3628
}
3677
3629
else
@@ -4736,7 +4688,7 @@ xpm_load_image (struct frame *f,
4736
4688
Lisp_Object (* get_color_table ) (Lisp_Object , const char * , int );
4737
4689
Lisp_Object frame , color_symbols , color_table ;
4738
4690
int best_key ;
4739
- #if !defined(HAVE_NS ) && !defined( HAVE_PGTK )
4691
+ #if !defined(HAVE_NS )
4740
4692
bool have_mask = false;
4741
4693
#endif
4742
4694
Emacs_Pix_Container ximg = NULL , mask_img = NULL ;
@@ -4790,7 +4742,7 @@ xpm_load_image (struct frame *f,
4790
4742
}
4791
4743
4792
4744
if (!image_create_x_image_and_pixmap (f , img , width , height , 0 , & ximg , 0 )
4793
- #if !defined (HAVE_NS ) && ! defined ( HAVE_PGTK )
4745
+ #if !defined (HAVE_NS )
4794
4746
|| !image_create_x_image_and_pixmap (f , img , width , height , 1 ,
4795
4747
& mask_img , 1 )
4796
4748
#endif
@@ -4918,13 +4870,10 @@ xpm_load_image (struct frame *f,
4918
4870
4919
4871
PUT_PIXEL (ximg , x , y ,
4920
4872
FIXNUMP (color_val ) ? XFIXNUM (color_val ) : frame_fg );
4921
- #if !defined(HAVE_NS ) && !defined( HAVE_PGTK )
4873
+ #if !defined(HAVE_NS )
4922
4874
PUT_PIXEL (mask_img , x , y ,
4923
4875
(!EQ (color_val , Qt ) ? PIX_MASK_DRAW
4924
4876
: (have_mask = true, PIX_MASK_RETAIN )));
4925
- #elif defined(HAVE_PGTK )
4926
- if (EQ (color_val , Qt ))
4927
- pgtk_image_set_alpha (ximg , x , y , 0 );
4928
4877
#else
4929
4878
if (EQ (color_val , Qt ))
4930
4879
ns_set_alpha (ximg , x , y , 0 );
@@ -4942,7 +4891,7 @@ xpm_load_image (struct frame *f,
4942
4891
IMAGE_BACKGROUND (img , f , ximg );
4943
4892
4944
4893
image_put_x_image (f , img , ximg , 0 );
4945
- #if !defined(HAVE_NS ) && !defined( HAVE_PGTK )
4894
+ #if !defined(HAVE_NS )
4946
4895
if (have_mask )
4947
4896
{
4948
4897
/* Fill in the background_transparent field while we have the
@@ -5673,7 +5622,7 @@ image_disable_image (struct frame *f, struct image *img)
5673
5622
if (n_planes < 2 || cross_disabled_images )
5674
5623
{
5675
5624
#ifndef HAVE_NTGUI
5676
- #if !defined(HAVE_NS ) && !defined( HAVE_PGTK ) /* TODO: NS support, however this not needed for toolbars */
5625
+ #if !defined(HAVE_NS ) /* TODO: NS support, however this not needed for toolbars */
5677
5626
5678
5627
#ifndef USE_CAIRO
5679
5628
#define CrossForeground (f ) BLACK_PIX_DEFAULT (f)
@@ -5740,7 +5689,7 @@ image_build_heuristic_mask (struct frame *f, struct image *img,
5740
5689
HGDIOBJ prev ;
5741
5690
char * mask_img ;
5742
5691
int row_width ;
5743
- #elif !defined HAVE_NS && !defined HAVE_PGTK
5692
+ #elif !defined HAVE_NS
5744
5693
Emacs_Pix_Container mask_img ;
5745
5694
#endif
5746
5695
int x , y ;
@@ -5751,7 +5700,7 @@ image_build_heuristic_mask (struct frame *f, struct image *img,
5751
5700
image_clear_image_1 (f , img , CLEAR_IMAGE_MASK );
5752
5701
5753
5702
#ifndef HAVE_NTGUI
5754
- #if !defined HAVE_NS && !defined HAVE_PGTK
5703
+ #if !defined HAVE_NS
5755
5704
/* Create an image and pixmap serving as mask. */
5756
5705
if (! image_create_x_image_and_pixmap (f , img , img -> width , img -> height , 1 ,
5757
5706
& mask_img , 1 ))
@@ -5806,17 +5755,14 @@ image_build_heuristic_mask (struct frame *f, struct image *img,
5806
5755
#ifndef HAVE_NTGUI
5807
5756
for (y = 0 ; y < img -> height ; ++ y )
5808
5757
for (x = 0 ; x < img -> width ; ++ x )
5809
- #ifdef HAVE_PGTK
5810
- if (XGetPixel (ximg , x , y ) == bg )
5811
- pgtk_image_set_alpha (ximg , x , y , 0 );
5812
- #elif !defined HAVE_NS
5758
+ #ifndef HAVE_NS
5813
5759
PUT_PIXEL (mask_img , x , y , (GET_PIXEL (ximg , x , y ) != bg
5814
5760
? PIX_MASK_DRAW : PIX_MASK_RETAIN ));
5815
5761
#else
5816
5762
if (XGetPixel (ximg , x , y ) == bg )
5817
5763
ns_set_alpha (ximg , x , y , 0 );
5818
5764
#endif /* HAVE_NS */
5819
- #if !defined HAVE_NS && !defined HAVE_PGTK
5765
+ #if !defined HAVE_NS
5820
5766
/* Fill in the background_transparent field while we have the mask handy. */
5821
5767
image_background_transparent (img , f , mask_img );
5822
5768
@@ -9080,7 +9026,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
9080
9026
9081
9027
init_color_table ();
9082
9028
9083
- #if defined (HAVE_MAGICKEXPORTIMAGEPIXELS ) && ! defined (HAVE_NS ) && !defined ( HAVE_PGTK )
9029
+ #if defined (HAVE_MAGICKEXPORTIMAGEPIXELS ) && ! defined (HAVE_NS )
9084
9030
if (imagemagick_render_type != 0 )
9085
9031
{
9086
9032
/* Magicexportimage is normally faster than pixelpushing. This
0 commit comments