all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Consolidation of image support in new image.c file.
  2004-03-11  1:40 Consolidation of image support in new image.c file Kim F. Storm
@ 2004-03-11  1:14 ` Luc Teirlinck
  2004-03-11 12:25   ` Kim F. Storm
  2004-03-11  5:57 ` Steven Tamm
  1 sibling, 1 reply; 8+ messages in thread
From: Luc Teirlinck @ 2004-03-11  1:14 UTC (permalink / raw)
  Cc: steventamm, rms, handa, eliz, emacs-devel, monnier, storm, jasonr,
	mituharu, miles

In my previous message I forgot to say that this was on GNU/Linux
(i686-pc-linux-gnu, X toolkit).

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Consolidation of image support in new image.c file.
@ 2004-03-11  1:40 Kim F. Storm
  2004-03-11  1:14 ` Luc Teirlinck
  2004-03-11  5:57 ` Steven Tamm
  0 siblings, 2 replies; 8+ messages in thread
From: Kim F. Storm @ 2004-03-11  1:40 UTC (permalink / raw)
  Cc: steventamm, rms, handa, eliz, teirllm, jasonr, monnier, mituharu,
	miles


[This is sent to emacs-devel with CC to selected team members as the
mailing list is still too slow to be useful].

I have just committed changes which moves/merges/consolidates the
image support code for the X, W32, and MAC platforms into a new file
image.c.

I have successfully tested this on X (with and without -nw).

I have done as much code review as I can for the W32 and MAC ports,
but I cannot do any actual compilation or testing on those platforms.
So if you can test (and fix :-) it for me, I'd appreciate it.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Consolidation of image support in new image.c file.
  2004-03-11  1:40 Consolidation of image support in new image.c file Kim F. Storm
  2004-03-11  1:14 ` Luc Teirlinck
@ 2004-03-11  5:57 ` Steven Tamm
  2004-03-11 12:25   ` Kim F. Storm
  2004-03-11 22:16   ` YAMAMOTO Mitsuharu
  1 sibling, 2 replies; 8+ messages in thread
From: Steven Tamm @ 2004-03-11  5:57 UTC (permalink / raw)
  Cc: YAMAMOTO Mitsuharu, emacs-devel

I also could not bootstrap (or make for that matter): Some code was 
left lying around macfns.c that defines Qjpeg and the like and 
sys/stat.h wasn't included in image.c for OSX.

I checked in the following changes that make it compile (don't know if 
it works yet... still bootstrapping):

*** src/macfns.c.~1.29.~        Wed Mar 10 16:27:13 2004
--- src/macfns.c        Wed Mar 10 21:15:22 2004
***************
*** 4391,4412 ****
     set_frame_fontset_func = x_set_font;
     check_window_system_func = check_mac;

-   Qjpeg = intern ("jpeg");
-   staticpro (&Qjpeg);
-
-   Qtiff = intern ("tiff");
-   staticpro (&Qtiff);
-
-   Qgif = intern ("gif");
-   staticpro (&Qgif);
-
-   Qpng = intern ("png");
-   staticpro (&Qpng);
-
-   defsubr (&Sclear_image_cache);
-   defsubr (&Simage_size);
-   defsubr (&Simage_mask_p);
-
     hourglass_atimer = NULL;
     hourglass_shown_p = 0;

*** src/image.c.~1.1.~  Wed Mar 10 16:28:24 2004
--- src/image.c Wed Mar 10 21:39:19 2004
***************
*** 92,97 ****
--- 92,98 ----
   #include <alloca.h>
   #endif
   #ifdef MAC_OSX
+ #include <sys/stat.h>
   #include <QuickTime/QuickTime.h>
   #else /* not MAC_OSX */
   #include <Windows.h>

-Steven

On Mar 10, 2004, at 5:40 PM, Kim F. Storm wrote:

>
> [This is sent to emacs-devel with CC to selected team members as the
> mailing list is still too slow to be useful].
>
> I have just committed changes which moves/merges/consolidates the
> image support code for the X, W32, and MAC platforms into a new file
> image.c.
>
> I have successfully tested this on X (with and without -nw).
>
> I have done as much code review as I can for the W32 and MAC ports,
> but I cannot do any actual compilation or testing on those platforms.
> So if you can test (and fix :-) it for me, I'd appreciate it.
>
> -- 
> Kim F. Storm <storm@cua.dk> http://www.cua.dk
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Consolidation of image support in new image.c file.
  2004-03-11  1:14 ` Luc Teirlinck
@ 2004-03-11 12:25   ` Kim F. Storm
  0 siblings, 0 replies; 8+ messages in thread
From: Kim F. Storm @ 2004-03-11 12:25 UTC (permalink / raw)
  Cc: steventamm, rms, handa, eliz, jasonr, monnier, emacs-devel,
	mituharu, miles

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> In my previous message I forgot to say that this was on GNU/Linux
> (i686-pc-linux-gnu, X toolkit).
> 

Sorry. My mistake.

There was a bug in Makefile.in which meant that the new image.o was
not included in some cases.  I have just checked in a fix.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Consolidation of image support in new image.c file.
  2004-03-11  5:57 ` Steven Tamm
@ 2004-03-11 12:25   ` Kim F. Storm
  2004-03-11 22:16   ` YAMAMOTO Mitsuharu
  1 sibling, 0 replies; 8+ messages in thread
From: Kim F. Storm @ 2004-03-11 12:25 UTC (permalink / raw)
  Cc: YAMAMOTO Mitsuharu, emacs-devel

Steven Tamm <steventamm@mac.com> writes:

> I also could not bootstrap (or make for that matter): Some code was
> left lying around macfns.c that defines Qjpeg and the like and
> sys/stat.h wasn't included in image.c for OSX.
> 
> I checked in the following changes that make it compile (don't know if
> it works yet... still bootstrapping):

Thanks!

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Consolidation of image support in new image.c file.
  2004-03-11  5:57 ` Steven Tamm
  2004-03-11 12:25   ` Kim F. Storm
@ 2004-03-11 22:16   ` YAMAMOTO Mitsuharu
  2004-03-11 23:52     ` Kim F. Storm
  1 sibling, 1 reply; 8+ messages in thread
From: YAMAMOTO Mitsuharu @ 2004-03-11 22:16 UTC (permalink / raw)
  Cc: emacs-devel, storm

>>>>> On Wed, 10 Mar 2004 21:57:37 -0800, Steven Tamm <steventamm@mac.com> said:

> I also could not bootstrap (or make for that matter): Some code was
> left lying around macfns.c that defines Qjpeg and the like and
> sys/stat.h wasn't included in image.c for OSX.

> I checked in the following changes that make it compile (don't know
> if it works yet... still bootstrapping):

With the following change, I could do make bootstrap in Mac OS X.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

Index: src/dispextern.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/dispextern.h,v
retrieving revision 1.167
diff -c -r1.167 dispextern.h
*** src/dispextern.h	11 Mar 2004 11:17:27 -0000	1.167
--- src/dispextern.h	11 Mar 2004 21:26:39 -0000
***************
*** 50,66 ****
--- 50,73 ----
  
  #ifdef HAVE_X_WINDOWS
  typedef struct x_display_info Display_Info;
+ typedef XImage * XImagePtr;
+ typedef XImagePtr XImagePtr_or_DC;
  #define NativeRectangle XRectangle
  #endif
  
  #ifdef HAVE_NTGUI
  #include "w32gui.h"
  typedef struct w32_display_info Display_Info;
+ typedef XImage *XImagePtr;
+ typedef HDC XImagePtr_or_DC;
  #endif
  
  #ifdef HAVE_CARBON
  #include "macgui.h"
  typedef struct mac_display_info Display_Info;
+ /* Mac equivalent of XImage.  */
+ typedef Pixmap XImagePtr;
+ typedef XImagePtr XImagePtr_or_DC;
  #endif
  
  #ifndef NativeRectangle
***************
*** 2623,2631 ****
  int lookup_image P_ ((struct frame *, Lisp_Object));
  
  unsigned long image_background P_ ((struct image *, struct frame *,
! 				    XImage *ximg));
  int image_background_transparent P_ ((struct image *, struct frame *,
! 				      XImage *mask));
  
  #endif
  
--- 2630,2638 ----
  int lookup_image P_ ((struct frame *, Lisp_Object));
  
  unsigned long image_background P_ ((struct image *, struct frame *,
! 				    XImagePtr_or_DC ximg));
  int image_background_transparent P_ ((struct image *, struct frame *,
! 				      XImagePtr_or_DC mask));
  
  #endif
  
Index: src/image.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/image.c,v
retrieving revision 1.3
diff -c -r1.3 image.c
*** src/image.c	11 Mar 2004 05:56:41 -0000	1.3
--- src/image.c	11 Mar 2004 21:26:50 -0000
***************
*** 49,56 ****
  #define COLOR_TABLE_SUPPORT 1
  
  typedef struct x_bitmap_record Bitmap_Record;
- typedef XImage * XImagePtr;
- typedef XImagePtr XImagePtr_or_DC;
  #define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y)
  #define NO_PIXMAP None
  #define PNG_BG_COLOR_SHIFT 0
--- 49,54 ----
***************
*** 69,76 ****
  #undef COLOR_TABLE_SUPPORT
  
  typedef struct w32_bitmap_record Bitmap_Record;
- typedef XImage *XImagePtr;
- typedef HDC XImagePtr_or_DC;
  #define GET_PIXEL(ximg, x, y) GetPixel(ximg, x, y)
  #define NO_PIXMAP 0
  #define PNG_BG_COLOR_SHIFT 0
--- 67,72 ----
***************
*** 103,114 ****
  /* MAC_TODO : Color tables on Mac.  */
  #undef COLOR_TABLE_SUPPORT
  
- /* Mac equivalent of XImage.  */
- typedef Pixmap XImagePtr;
  #define ZPixmap 0 		/* arbitrary */
  typedef struct mac_bitmap_record Bitmap_Record;
  
- typedef XImagePtr XImagePtr_or_DC;
  #define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y)
  #define NO_PIXMAP 0
  #define PNG_BG_COLOR_SHIFT 8
--- 99,107 ----
Index: src/macfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macfns.c,v
retrieving revision 1.30
diff -c -r1.30 macfns.c
*** src/macfns.c	11 Mar 2004 05:56:41 -0000	1.30
--- src/macfns.c	11 Mar 2004 21:26:59 -0000
***************
*** 172,192 ****
  
  extern int mac_initialized;
  
- /* Functions in macterm.c.  */
- extern void x_set_window_size (struct frame *, int, int, int);
- extern void x_make_frame_visible (struct frame *);
- extern struct mac_display_info *mac_term_init (Lisp_Object, char *, char *);
- extern struct font_info *x_get_font_info (FRAME_PTR, int);
- extern struct font_info *x_load_font (struct frame *, char *, int);
- extern void x_find_ccl_program (struct font_info *);
- extern struct font_info *x_query_font (struct frame *, char *);
- extern void mac_initialize ();
- extern Pixmap XCreatePixmap (Display *, WindowPtr, unsigned int, unsigned int, unsigned int);
- extern Pixmap XCreatePixmapFromBitmapData (Display *, WindowPtr, char *, unsigned int, unsigned int, unsigned long, unsigned long, unsigned int);
- extern void XFreePixmap (Display *, Pixmap);
- extern void XSetForeground (Display *, GC, unsigned long);
- extern void mac_draw_line_to_pixmap (Display *, Pixmap, GC, int, int, int, int);
- 
  
  /* compare two strings ignoring case */
  
--- 172,177 ----
Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.63
diff -c -r1.63 macterm.c
*** src/macterm.c	27 Feb 2004 23:47:13 -0000	1.63
--- src/macterm.c	11 Mar 2004 21:27:15 -0000
***************
*** 8262,8268 ****
  	            {
  		      Lisp_Object window;
  
- 	              inev.kind = MOUSE_CLICK_EVENT;
  		      XSETFRAME (inev.frame_or_window, mwp->mFP);
  		      if (er.what == mouseDown)
  			mouse_tracking_in_progress
--- 8262,8267 ----
***************
*** 8285,8290 ****
--- 8284,8291 ----
  						   );
  			  break;
  			}
+ 		      else
+ 			inev.kind = MOUSE_CLICK_EVENT;
  		    }
  
  #if USE_CARBON_EVENTS
Index: src/macterm.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.h,v
retrieving revision 1.12
diff -c -r1.12 macterm.h
*** src/macterm.h	11 Mar 2004 00:26:50 -0000	1.12
--- src/macterm.h	11 Mar 2004 21:27:17 -0000
***************
*** 240,245 ****
--- 240,251 ----
  
  extern struct mac_display_info *mac_term_init ();
  
+ extern Lisp_Object x_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
+ extern struct font_info *x_get_font_info P_ ((struct frame *f, int));
+ extern struct font_info *x_load_font P_ ((struct frame *, char *, int));
+ extern struct font_info *x_query_font P_ ((struct frame *, char *));
+ extern void x_find_ccl_program P_ ((struct font_info *));
+ \f
  /* When Emacs uses a tty window, tty_display in frame.c points to an
     x_output struct .  */
  struct x_output
***************
*** 564,569 ****
--- 570,591 ----
  
  void activate_scroll_bars (FRAME_PTR);
  void deactivate_scroll_bars (FRAME_PTR);
+ 
+ /* Defined in macterm.c.  */
+ 
+ extern void x_set_window_size P_ ((struct frame *, int, int, int));
+ extern void x_make_frame_visible P_ ((struct frame *));
+ extern void mac_initialize P_ ((void));
+ extern Pixmap XCreatePixmap P_ ((Display *, WindowPtr, unsigned int,
+ 				 unsigned int, unsigned int));
+ extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
+ 					       unsigned int, unsigned int,
+ 					       unsigned long, unsigned long,
+ 					       unsigned int));
+ extern void XFreePixmap P_ ((Display *, Pixmap));
+ extern void XSetForeground P_ ((Display *, GC, unsigned long));
+ extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int,
+ 					 int, int));
  
  #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
  #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Consolidation of image support in new image.c file.
  2004-03-11 22:16   ` YAMAMOTO Mitsuharu
@ 2004-03-11 23:52     ` Kim F. Storm
  0 siblings, 0 replies; 8+ messages in thread
From: Kim F. Storm @ 2004-03-11 23:52 UTC (permalink / raw)
  Cc: steventamm, emacs-devel

YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

> >>>>> On Wed, 10 Mar 2004 21:57:37 -0800, Steven Tamm <steventamm@mac.com> said:
> 
> > I also could not bootstrap (or make for that matter): Some code was
> > left lying around macfns.c that defines Qjpeg and the like and
> > sys/stat.h wasn't included in image.c for OSX.
> 
> > I checked in the following changes that make it compile (don't know
> > if it works yet... still bootstrapping):
> 
> With the following change, I could do make bootstrap in Mac OS X.
> 

Thank you very much.  I have committed your changes.

You also included a patch for mouse click on toolbar (I think).
I committed that as well.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Consolidation of image support in new image.c file.
@ 2004-03-12 10:46 David PONCE
  0 siblings, 0 replies; 8+ messages in thread
From: David PONCE @ 2004-03-12 10:46 UTC (permalink / raw)
  Cc: emacs-devel

Hi Kim,

Following your change to consolidate image support I had to apply this
patch to fix a link error when building Emacs "--with-gtk".

This is because in that case the function `xg_set_icon' in xfns.c
calls `x_find_image_file' which is now in image.c

Hope it helps.

Sincerely,
David

Index: src/dispextern.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/dispextern.h,v
retrieving revision 1.168
diff -c -r1.168 dispextern.h
*** src/dispextern.h	11 Mar 2004 22:42:47 -0000	1.168
--- src/dispextern.h	12 Mar 2004 10:29:46 -0000
***************
*** 2618,2624 ****
  #endif
  extern void x_destroy_all_bitmaps P_ ((Display_Info *));
  extern int x_create_bitmap_mask P_ ((struct frame * , int));
! 
  void x_kill_gs_process P_ ((Pixmap, struct frame *));
  struct image_cache *make_image_cache P_ ((void));
  void free_image_cache P_ ((struct frame *));
--- 2618,2624 ----
  #endif
  extern void x_destroy_all_bitmaps P_ ((Display_Info *));
  extern int x_create_bitmap_mask P_ ((struct frame * , int));
! extern Lisp_Object x_find_image_file P_ ((Lisp_Object));
  void x_kill_gs_process P_ ((Pixmap, struct frame *));
  struct image_cache *make_image_cache P_ ((void));
  void free_image_cache P_ ((struct frame *));
Index: src/image.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/image.c,v
retrieving revision 1.4
diff -c -r1.4 image.c
*** src/image.c	11 Mar 2004 22:43:06 -0000	1.4
--- src/image.c	12 Mar 2004 10:29:46 -0000
***************
*** 1998,2004 ****
  			      File Handling
   ***********************************************************************/
  
- static Lisp_Object x_find_image_file P_ ((Lisp_Object));
  static unsigned char *slurp_file P_ ((char *, int *));
  
  
--- 1998,2003 ----
***************
*** 2006,2012 ****
     x-bitmap-file-path.  Value is the full name of the file found, or
     nil if not found.  */
  
! static Lisp_Object
  x_find_image_file (file)
       Lisp_Object file;
  {
--- 2005,2011 ----
     x-bitmap-file-path.  Value is the full name of the file found, or
     nil if not found.  */
  
! Lisp_Object
  x_find_image_file (file)
       Lisp_Object file;
  {
Index: src/xfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfns.c,v
retrieving revision 1.607
diff -c -r1.607 xfns.c
*** src/xfns.c	11 Mar 2004 00:25:38 -0000	1.607
--- src/xfns.c	12 Mar 2004 10:29:47 -0000
***************
*** 761,768 ****
  
  #ifdef USE_GTK
  
- static Lisp_Object x_find_image_file P_ ((Lisp_Object file));
- 
  /* Set icon from FILE for frame F.  By using GTK functions the icon
     may be any format that GdkPixbuf knows about, i.e. not just bitmaps.  */
  
--- 761,766 ----

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-12 10:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-11  1:40 Consolidation of image support in new image.c file Kim F. Storm
2004-03-11  1:14 ` Luc Teirlinck
2004-03-11 12:25   ` Kim F. Storm
2004-03-11  5:57 ` Steven Tamm
2004-03-11 12:25   ` Kim F. Storm
2004-03-11 22:16   ` YAMAMOTO Mitsuharu
2004-03-11 23:52     ` Kim F. Storm
  -- strict thread matches above, loose matches on Subject: below --
2004-03-12 10:46 David PONCE

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.