@@ -61,10 +61,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
6161#include TERM_HEADER
6262#endif /* HAVE_WINDOW_SYSTEM */
6363
64- #ifdef HAVE_PGTK
65- #include <pgtkimage.h>
66- #endif
67-
6864/* Work around GCC bug 54561. */
6965#if GNUC_PREREQ (4 , 3 , 0 )
7066# pragma GCC diagnostic ignored "-Wclobbered"
@@ -134,19 +130,10 @@ typedef struct ns_bitmap_record Bitmap_Record;
134130
135131#ifdef HAVE_PGTK
136132typedef 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)
146133#endif /* HAVE_PGTK */
147134
148135#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 ))
150137/* W32_TODO : Color tables on W32. */
151138# define COLOR_TABLE_SUPPORT 1
152139#endif
@@ -302,22 +289,6 @@ XPutPixel (Emacs_Pix_Container image, int x, int y, unsigned long pixel)
302289}
303290#endif /* HAVE_NS */
304291
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-
321292/* Code to deal with bitmaps. Bitmaps are referenced by their bitmap
322293 id, which is just an int that this section returns. Bitmaps are
323294 reference counted so they can be shared among frames.
@@ -461,9 +432,11 @@ image_create_bitmap_from_data (struct frame *f, char *bits,
461432#endif
462433
463434#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 );
467440#endif
468441
469442 id = image_allocate_bitmap_record (f );
@@ -606,8 +579,8 @@ free_bitmap_record (Display_Info *dpyinfo, Bitmap_Record *bm)
606579 ns_release_object (bm -> img );
607580#endif
608581
609- #ifdef HAVE_NS
610- pgtk_image_destroy (bm -> img );
582+ #ifdef HAVE_PGTK
583+ // pgtk_image_destroy (bm->img);
611584#endif
612585
613586 if (bm -> file )
@@ -2755,18 +2728,6 @@ image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int d
27552728 * pimg = * pixmap ;
27562729 return 1 ;
27572730#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
27702731}
27712732
27722733
@@ -2792,7 +2753,7 @@ image_destroy_x_image (Emacs_Pix_Container pimg)
27922753 ns_release_object (pimg );
27932754#endif /* HAVE_NS */
27942755#ifdef HAVE_PGTK
2795- pgtk_image_destroy (pimg );
2756+ // pgtk_image_destroy (pimg);
27962757#endif /* HAVE_PGTK */
27972758 }
27982759#endif
@@ -2831,10 +2792,6 @@ gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg,
28312792 eassert (pimg == pixmap );
28322793 ns_retain_object (pimg );
28332794#endif
2834-
2835- #ifdef HAVE_PGTK
2836- eassert (pimg == pixmap );
2837- #endif
28382795}
28392796
28402797/* 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)
29532910
29542911 ns_retain_object (pixmap );
29552912 return pixmap ;
2956- #elif defined (HAVE_PGTK )
2957- XImagePtr pixmap = !mask_p ? img -> pixmap : img -> mask ;
2958- return pixmap ;
29592913#endif
29602914}
29612915
@@ -3664,14 +3618,12 @@ xbm_load_image (struct frame *f, struct image *img, char *contents, char *end)
36643618 img -> pixmap = NO_PIXMAP ;
36653619 xfree (data );
36663620
3667- #ifndef HAVE_PGTK
36683621 if (img -> pixmap == NO_PIXMAP )
36693622 {
36703623 image_clear_image (f , img );
36713624 image_error ("Unable to create X pixmap for `%s'" , img -> spec );
36723625 }
36733626 else
3674- #endif
36753627 success_p = 1 ;
36763628 }
36773629 else
@@ -4736,7 +4688,7 @@ xpm_load_image (struct frame *f,
47364688 Lisp_Object (* get_color_table ) (Lisp_Object , const char * , int );
47374689 Lisp_Object frame , color_symbols , color_table ;
47384690 int best_key ;
4739- #if !defined(HAVE_NS ) && !defined( HAVE_PGTK )
4691+ #if !defined(HAVE_NS )
47404692 bool have_mask = false;
47414693#endif
47424694 Emacs_Pix_Container ximg = NULL , mask_img = NULL ;
@@ -4790,7 +4742,7 @@ xpm_load_image (struct frame *f,
47904742 }
47914743
47924744 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 )
47944746 || !image_create_x_image_and_pixmap (f , img , width , height , 1 ,
47954747 & mask_img , 1 )
47964748#endif
@@ -4918,13 +4870,10 @@ xpm_load_image (struct frame *f,
49184870
49194871 PUT_PIXEL (ximg , x , y ,
49204872 FIXNUMP (color_val ) ? XFIXNUM (color_val ) : frame_fg );
4921- #if !defined(HAVE_NS ) && !defined( HAVE_PGTK )
4873+ #if !defined(HAVE_NS )
49224874 PUT_PIXEL (mask_img , x , y ,
49234875 (!EQ (color_val , Qt ) ? PIX_MASK_DRAW
49244876 : (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 );
49284877#else
49294878 if (EQ (color_val , Qt ))
49304879 ns_set_alpha (ximg , x , y , 0 );
@@ -4942,7 +4891,7 @@ xpm_load_image (struct frame *f,
49424891 IMAGE_BACKGROUND (img , f , ximg );
49434892
49444893 image_put_x_image (f , img , ximg , 0 );
4945- #if !defined(HAVE_NS ) && !defined( HAVE_PGTK )
4894+ #if !defined(HAVE_NS )
49464895 if (have_mask )
49474896 {
49484897 /* Fill in the background_transparent field while we have the
@@ -5673,7 +5622,7 @@ image_disable_image (struct frame *f, struct image *img)
56735622 if (n_planes < 2 || cross_disabled_images )
56745623 {
56755624#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 */
56775626
56785627#ifndef USE_CAIRO
56795628#define CrossForeground (f ) BLACK_PIX_DEFAULT (f)
@@ -5740,7 +5689,7 @@ image_build_heuristic_mask (struct frame *f, struct image *img,
57405689 HGDIOBJ prev ;
57415690 char * mask_img ;
57425691 int row_width ;
5743- #elif !defined HAVE_NS && !defined HAVE_PGTK
5692+ #elif !defined HAVE_NS
57445693 Emacs_Pix_Container mask_img ;
57455694#endif
57465695 int x , y ;
@@ -5751,7 +5700,7 @@ image_build_heuristic_mask (struct frame *f, struct image *img,
57515700 image_clear_image_1 (f , img , CLEAR_IMAGE_MASK );
57525701
57535702#ifndef HAVE_NTGUI
5754- #if !defined HAVE_NS && !defined HAVE_PGTK
5703+ #if !defined HAVE_NS
57555704 /* Create an image and pixmap serving as mask. */
57565705 if (! image_create_x_image_and_pixmap (f , img , img -> width , img -> height , 1 ,
57575706 & mask_img , 1 ))
@@ -5806,17 +5755,14 @@ image_build_heuristic_mask (struct frame *f, struct image *img,
58065755#ifndef HAVE_NTGUI
58075756 for (y = 0 ; y < img -> height ; ++ y )
58085757 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
58135759 PUT_PIXEL (mask_img , x , y , (GET_PIXEL (ximg , x , y ) != bg
58145760 ? PIX_MASK_DRAW : PIX_MASK_RETAIN ));
58155761#else
58165762 if (XGetPixel (ximg , x , y ) == bg )
58175763 ns_set_alpha (ximg , x , y , 0 );
58185764#endif /* HAVE_NS */
5819- #if !defined HAVE_NS && !defined HAVE_PGTK
5765+ #if !defined HAVE_NS
58205766 /* Fill in the background_transparent field while we have the mask handy. */
58215767 image_background_transparent (img , f , mask_img );
58225768
@@ -9080,7 +9026,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
90809026
90819027 init_color_table ();
90829028
9083- #if defined (HAVE_MAGICKEXPORTIMAGEPIXELS ) && ! defined (HAVE_NS ) && !defined ( HAVE_PGTK )
9029+ #if defined (HAVE_MAGICKEXPORTIMAGEPIXELS ) && ! defined (HAVE_NS )
90849030 if (imagemagick_render_type != 0 )
90859031 {
90869032 /* Magicexportimage is normally faster than pixelpushing. This
0 commit comments