/[emacs]/emacs/src/w32fns.c
ViewVC logotype

Diff of /emacs/src/w32fns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.154 by jasonr, Sat Feb 9 01:31:07 2002 UTC revision 1.155 by jasonr, Sun Feb 17 23:44:09 2002 UTC
# Line 270  Lisp_Object Qw32_charset_mac; Line 270  Lisp_Object Qw32_charset_mac;
270  Lisp_Object Qw32_charset_unicode;  Lisp_Object Qw32_charset_unicode;
271  #endif  #endif
272    
273    Lisp_Object Qfullscreen;
274    Lisp_Object Qfullwidth;
275    Lisp_Object Qfullheight;
276    Lisp_Object Qfullboth;
277    
278  extern Lisp_Object Qtop;  extern Lisp_Object Qtop;
279  extern Lisp_Object Qdisplay;  extern Lisp_Object Qdisplay;
280  extern Lisp_Object Qtool_bar_lines;  extern Lisp_Object Qtool_bar_lines;
# Line 681  static void x_change_window_heights P_ ( Line 686  static void x_change_window_heights P_ (
686  /* TODO: Native Input Method support; see x_create_im.  */  /* TODO: Native Input Method support; see x_create_im.  */
687  void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));  void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
688  static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));  static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
689    static void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object));
690  void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));  void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
691  void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));  void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
692  void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));  void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
# Line 734  static struct x_frame_parm_table x_frame Line 740  static struct x_frame_parm_table x_frame
740    {"screen-gamma", x_set_screen_gamma},    {"screen-gamma", x_set_screen_gamma},
741    {"line-spacing", x_set_line_spacing},    {"line-spacing", x_set_line_spacing},
742    {"left-fringe", x_set_fringe_width},    {"left-fringe", x_set_fringe_width},
743    {"right-fringe", x_set_fringe_width}    {"right-fringe", x_set_fringe_width},
744      {"fullscreen", x_set_fullscreen},
745  };  };
746    
747  /* Attach the `x-frame-parameter' properties to  /* Attach the `x-frame-parameter' properties to
# Line 750  init_x_parm_symbols () Line 757  init_x_parm_symbols ()
757            make_number (i));            make_number (i));
758  }  }
759    
760    /* Really try to move where we want to be in case of fullscreen.  Some WMs
761       moves the window where we tell them.  Some (mwm, twm) moves the outer
762       window manager window there instead.
763       Try to compensate for those WM here. */
764    static void
765    x_fullscreen_move (f, new_top, new_left)
766         struct frame *f;
767         int new_top;
768         int new_left;
769    {
770      if (new_top != f->output_data.w32->top_pos
771          || new_left != f->output_data.w32->left_pos)
772        {
773          int move_x = new_left;
774          int move_y = new_top;
775    
776          f->output_data.w32->want_fullscreen |= FULLSCREEN_MOVE_WAIT;
777          x_set_offset (f, move_x, move_y, 1);
778        }
779    }
780    
781  /* Change the parameters of frame F as specified by ALIST.  /* Change the parameters of frame F as specified by ALIST.
782     If a parameter is not specially recognized, do nothing;     If a parameter is not specially recognized, do nothing;
783     otherwise call the `x_set_...' function for that parameter.  */     otherwise call the `x_set_...' function for that parameter.  */
# Line 778  x_set_frame_parameters (f, alist) Line 806  x_set_frame_parameters (f, alist)
806    int i, p;    int i, p;
807    int left_no_change = 0, top_no_change = 0;    int left_no_change = 0, top_no_change = 0;
808    int icon_left_no_change = 0, icon_top_no_change = 0;    int icon_left_no_change = 0, icon_top_no_change = 0;
809      int fullscreen_is_being_set = 0;
810    
811    struct gcpro gcpro1, gcpro2;    struct gcpro gcpro1, gcpro2;
812    
# Line 835  x_set_frame_parameters (f, alist) Line 864  x_set_frame_parameters (f, alist)
864        val = values[p];        val = values[p];
865        if (EQ (prop, Qforeground_color)        if (EQ (prop, Qforeground_color)
866            || EQ (prop, Qbackground_color)            || EQ (prop, Qbackground_color)
867            || EQ (prop, Qfont))            || EQ (prop, Qfont)
868              || EQ (prop, Qfullscreen))
869          {          {
870            register Lisp_Object param_index, old_value;            register Lisp_Object param_index, old_value;
871    
872            old_value = get_frame_param (f, prop);            old_value = get_frame_param (f, prop);
873              fullscreen_is_being_set |= EQ (prop, Qfullscreen);
874    
875            if (NILP (Fequal (val, old_value)))            if (NILP (Fequal (val, old_value)))
876              {              {
# Line 876  x_set_frame_parameters (f, alist) Line 907  x_set_frame_parameters (f, alist)
907          icon_left = val;          icon_left = val;
908        else if (EQ (prop, Qforeground_color)        else if (EQ (prop, Qforeground_color)
909                 || EQ (prop, Qbackground_color)                 || EQ (prop, Qbackground_color)
910                 || EQ (prop, Qfont))                 || EQ (prop, Qfont)
911                   || EQ (prop, Qfullscreen))
912          /* Processed above.  */          /* Processed above.  */
913          continue;          continue;
914        else        else
# Line 929  x_set_frame_parameters (f, alist) Line 961  x_set_frame_parameters (f, alist)
961          XSETINT (icon_top, 0);          XSETINT (icon_top, 0);
962      }      }
963    
964      if (FRAME_VISIBLE_P (f) && fullscreen_is_being_set)
965        {
966                /* If the frame is visible already and the fullscreen parameter is
967             being set, it is too late to set WM manager hints to specify
968             size and position.
969             Here we first get the width, height and position that applies to
970             fullscreen.  We then move the frame to the appropriate
971             position.  Resize of the frame is taken care of in the code after
972             this if-statement. */
973          int new_left, new_top;
974          
975          x_fullscreen_adjust (f, &width, &height, &new_top, &new_left);
976          x_fullscreen_move (f, new_top, new_left);
977        }
978    
979    /* Don't set these parameters unless they've been explicitly    /* Don't set these parameters unless they've been explicitly
980       specified.  The window might be mapped or resized while we're in       specified.  The window might be mapped or resized while we're in
981       this function, and we don't want to override that unless the lisp       this function, and we don't want to override that unless the lisp
# Line 1032  x_real_positions (f, xptr, yptr) Line 1079  x_real_positions (f, xptr, yptr)
1079       int *xptr, *yptr;       int *xptr, *yptr;
1080  {  {
1081    POINT pt;    POINT pt;
1082      RECT rect;
1083    
1084    {    GetClientRect(FRAME_W32_WINDOW(f), &rect);
1085        RECT rect;    AdjustWindowRect(&rect, f->output_data.w32->dwStyle, FRAME_EXTERNAL_MENU_BAR(f));
1086          
1087        GetClientRect(FRAME_W32_WINDOW(f), &rect);    pt.x = rect.left;
1088        AdjustWindowRect(&rect, f->output_data.w32->dwStyle, FRAME_EXTERNAL_MENU_BAR(f));    pt.y = rect.top;
         
       pt.x = rect.left;  
       pt.y = rect.top;  
   }  
1089    
1090    ClientToScreen (FRAME_W32_WINDOW(f), &pt);    ClientToScreen (FRAME_W32_WINDOW(f), &pt);
1091    
1092      /* Remember x_pixels_diff and y_pixels_diff.  */
1093      f->output_data.w32->x_pixels_diff = pt.x - rect.left;
1094      f->output_data.w32->y_pixels_diff = pt.y - rect.top;
1095    
1096    *xptr = pt.x;    *xptr = pt.x;
1097    *yptr = pt.y;    *yptr = pt.y;
1098  }  }
# Line 1967  x_set_line_spacing (f, new_value, old_va Line 2015  x_set_line_spacing (f, new_value, old_va
2015  }  }
2016    
2017    
2018    /* Change the `fullscreen' frame parameter of frame F.  OLD_VALUE is
2019       the previous value of that parameter, NEW_VALUE is the new value. */
2020    
2021    static void
2022    x_set_fullscreen (f, new_value, old_value)
2023         struct frame *f;
2024         Lisp_Object new_value, old_value;
2025    {
2026      if (NILP (new_value))
2027        f->output_data.w32->want_fullscreen = FULLSCREEN_NONE;
2028      else if (EQ (new_value, Qfullboth))
2029        f->output_data.w32->want_fullscreen = FULLSCREEN_BOTH;
2030      else if (EQ (new_value, Qfullwidth))
2031        f->output_data.w32->want_fullscreen = FULLSCREEN_WIDTH;
2032      else if (EQ (new_value, Qfullheight))
2033        f->output_data.w32->want_fullscreen = FULLSCREEN_HEIGHT;
2034    }
2035    
2036    
2037  /* Change the `screen-gamma' frame parameter of frame F.  OLD_VALUE is  /* Change the `screen-gamma' frame parameter of frame F.  OLD_VALUE is
2038     the previous value of that parameter, NEW_VALUE is the new value.  */     the previous value of that parameter, NEW_VALUE is the new value.  */
2039    
# Line 3285  x_figure_window_size (f, parms) Line 3352  x_figure_window_size (f, parms)
3352         : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0         : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
3353         ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)         ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
3354         : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));         : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));
3355    
3356    x_compute_fringe_widths (f, 0);    x_compute_fringe_widths (f, 0);
3357    
3358    f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);    f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
3359    f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);    f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
3360    
# Line 3356  x_figure_window_size (f, parms) Line 3425  x_figure_window_size (f, parms)
3425          window_prompting |= PPosition;          window_prompting |= PPosition;
3426      }      }
3427    
3428      if (f->output_data.w32->want_fullscreen != FULLSCREEN_NONE)
3429        {
3430          int left, top;
3431          int width, height;
3432    
3433          /* It takes both for some WM:s to place it where we want */
3434          window_prompting = USPosition | PPosition;
3435          x_fullscreen_adjust (f, &width, &height, &top, &left);
3436          f->width = width;
3437          f->height = height;
3438          f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
3439          f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
3440          f->output_data.w32->left_pos = left;
3441          f->output_data.w32->top_pos = top;
3442        }
3443    
3444    return window_prompting;    return window_prompting;
3445  }  }
3446    
# Line 5564  This function is an internal primitive-- Line 5649  This function is an internal primitive--
5649                         "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);                         "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
5650    x_default_parameter (f, parms, Qtitle, Qnil,    x_default_parameter (f, parms, Qtitle, Qnil,
5651                         "title", "Title", RES_TYPE_STRING);                         "title", "Title", RES_TYPE_STRING);
5652      x_default_parameter (f, parms, Qfullscreen, Qnil,
5653                           "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
5654    
5655    f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;    f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
5656    f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;    f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
# Line 5959  w32_load_system_font (f,fontname,size) Line 6046  w32_load_system_font (f,fontname,size)
6046    
6047      /* Set global flag fonts_changed_p to non-zero if the font loaded      /* Set global flag fonts_changed_p to non-zero if the font loaded
6048         has a character with a smaller width than any other character         has a character with a smaller width than any other character
6049         before, or if the font loaded has a smalle>r height than any         before, or if the font loaded has a smaller height than any
6050         other font loaded before.  If this happens, it will make a         other font loaded before.  If this happens, it will make a
6051         glyph matrix reallocation necessary.  */         glyph matrix reallocation necessary.  */
6052      fonts_changed_p = x_compute_min_glyph_bounds (f);      fonts_changed_p |= x_compute_min_glyph_bounds (f);
6053      UNBLOCK_INPUT;      UNBLOCK_INPUT;
6054      return fontp;      return fontp;
6055    }    }
# Line 14487  syms_of_w32fns () Line 14574  syms_of_w32fns ()
14574    
14575    w32_visible_system_caret_hwnd = NULL;    w32_visible_system_caret_hwnd = NULL;
14576    
   /* The section below is built by the lisp expression at the top of the file,  
      just above where these variables are declared.  */  
   /*&&& init symbols here &&&*/  
14577    Qauto_raise = intern ("auto-raise");    Qauto_raise = intern ("auto-raise");
14578    staticpro (&Qauto_raise);    staticpro (&Qauto_raise);
14579    Qauto_lower = intern ("auto-lower");    Qauto_lower = intern ("auto-lower");
# Line 14556  syms_of_w32fns () Line 14640  syms_of_w32fns ()
14640    staticpro (&Qcenter);    staticpro (&Qcenter);
14641    Qcancel_timer = intern ("cancel-timer");    Qcancel_timer = intern ("cancel-timer");
14642    staticpro (&Qcancel_timer);    staticpro (&Qcancel_timer);
14643    /* This is the end of symbol initialization.  */    Qfullscreen = intern ("fullscreen");
14644      staticpro (&Qfullscreen);
14645      Qfullwidth = intern ("fullwidth");
14646      staticpro (&Qfullwidth);
14647      Qfullheight = intern ("fullheight");
14648      staticpro (&Qfullheight);
14649      Qfullboth = intern ("fullboth");
14650      staticpro (&Qfullboth);
14651    
14652    Qhyper = intern ("hyper");    Qhyper = intern ("hyper");
14653    staticpro (&Qhyper);    staticpro (&Qhyper);
# Line 14572  syms_of_w32fns () Line 14663  syms_of_w32fns ()
14663    staticpro (&Qcontrol);    staticpro (&Qcontrol);
14664    Qshift = intern ("shift");    Qshift = intern ("shift");
14665    staticpro (&Qshift);    staticpro (&Qshift);
14666      /* This is the end of symbol initialization.  */
14667    
14668    /* Text property `display' should be nonsticky by default.  */    /* Text property `display' should be nonsticky by default.  */
14669    Vtext_property_default_nonsticky    Vtext_property_default_nonsticky

Legend:
Removed from v.1.154  
changed lines
  Added in v.1.155

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26