diff --git a/mozilla/themes/classic/communicator/sidebar/sidebar.css b/mozilla/themes/classic/communicator/sidebar/sidebar.css index 64f8ef86dcd..82886385895 100644 --- a/mozilla/themes/classic/communicator/sidebar/sidebar.css +++ b/mozilla/themes/classic/communicator/sidebar/sidebar.css @@ -45,6 +45,7 @@ #sidebar-panel-picker { color: inherit; + -moz-user-focus:normal !important; } #sidebar-panel-picker > .toolbarbutton-dropmarker { diff --git a/mozilla/themes/classic/editor/editor.css b/mozilla/themes/classic/editor/editor.css index 928e901cb79..fc7faf9af4a 100644 --- a/mozilla/themes/classic/editor/editor.css +++ b/mozilla/themes/classic/editor/editor.css @@ -49,6 +49,7 @@ #content-source, #doctype-text { font-family: -moz-fixed; + font-size: -moz-initial; } #appcontent { @@ -62,4 +63,3 @@ border-right: 1px solid ThreeDLightShadow; } - diff --git a/mozilla/themes/classic/global/mac/browser.css b/mozilla/themes/classic/global/mac/browser.css index 00b4be1cea5..a98d06343d9 100644 --- a/mozilla/themes/classic/global/mac/browser.css +++ b/mozilla/themes/classic/global/mac/browser.css @@ -38,3 +38,8 @@ tab[busy] > .tab-icon { .tabs-closebutton > .toolbarbutton-icon { margin: 0; } + +.tabs-newbutton { + margin: 0px; + list-style-image: url("chrome://global/skin/icons/tab-new.gif"); +} diff --git a/mozilla/themes/classic/global/mac/globalBindings.xml b/mozilla/themes/classic/global/mac/globalBindings.xml index 3742fef3d16..60d6f2707b7 100644 --- a/mozilla/themes/classic/global/mac/globalBindings.xml +++ b/mozilla/themes/classic/global/mac/globalBindings.xml @@ -31,16 +31,19 @@ - - + + + + - + diff --git a/mozilla/themes/classic/global/mac/menu.css b/mozilla/themes/classic/global/mac/menu.css index ec3faf3f0d5..87495c758ee 100644 --- a/mozilla/themes/classic/global/mac/menu.css +++ b/mozilla/themes/classic/global/mac/menu.css @@ -185,7 +185,7 @@ menuitem[checked="true"][type="radio"][disabled="true"] { menulist > menupopup > menuitem, .menulist-menupopup > menuitem { max-width: none; - padding: 0; + padding: 0px 20px 0px 0px; font: message-box; } diff --git a/mozilla/themes/classic/global/mac/toolbar.css b/mozilla/themes/classic/global/mac/toolbar.css index bf609895569..5af9dd3efaa 100644 --- a/mozilla/themes/classic/global/mac/toolbar.css +++ b/mozilla/themes/classic/global/mac/toolbar.css @@ -47,8 +47,13 @@ menubar { Prevents hiding of scrollbars in browser when window is made smaller.*/ } -.toolbar-holder { +.toolbar-prefix { border-left: 1px solid ThreeDHighlight; + border-top: 1px solid ThreeDHighlight; + border-bottom: 1px solid ThreeDShadow; +} + +.toolbar-holder { border-top: 1px solid ThreeDHighlight; border-right: 1px solid ThreeDShadow; border-bottom: 1px solid ThreeDShadow; diff --git a/mozilla/themes/classic/global/win/browser.css b/mozilla/themes/classic/global/win/browser.css index 9bf479bf961..62a93c174ef 100644 --- a/mozilla/themes/classic/global/win/browser.css +++ b/mozilla/themes/classic/global/win/browser.css @@ -43,3 +43,7 @@ tab[busy] > .tab-icon { margin: 0; } +.tabs-newbutton { + margin: 0px; + list-style-image: url("chrome://global/skin/icons/tab-new.gif"); +} diff --git a/mozilla/themes/classic/global/win/menu.css b/mozilla/themes/classic/global/win/menu.css index d5c87df7827..695a9b620ec 100644 --- a/mozilla/themes/classic/global/win/menu.css +++ b/mozilla/themes/classic/global/win/menu.css @@ -150,10 +150,10 @@ menulist > menupopup > menuitem, .menulist-menupopup > menu, menulist > menupopup > menu { border: 1px solid transparent; - padding: 1px 16px 1px 5px; + padding: 1px 30px 1px 5px; max-width: none; font: message-box; - color: -moz-FieldText + color: -moz-FieldText; } .menulist-menupopup > menuitem > .menu-iconic-left, diff --git a/mozilla/themes/classic/global/win/toolbar.css b/mozilla/themes/classic/global/win/toolbar.css index 5ade9b0241d..1a6dc86f6e7 100644 --- a/mozilla/themes/classic/global/win/toolbar.css +++ b/mozilla/themes/classic/global/win/toolbar.css @@ -45,8 +45,13 @@ menubar { Prevents hiding of scrollbars in browser when window is made smaller.*/ } -.toolbar-holder { +.toolbar-prefix { border-left: 1px solid ThreeDHighlight; + border-top: 1px solid ThreeDHighlight; + border-bottom: 1px solid ThreeDShadow; +} + +.toolbar-holder { border-top: 1px solid ThreeDHighlight; border-right: 1px solid ThreeDShadow; border-bottom: 1px solid ThreeDShadow; diff --git a/mozilla/themes/classic/jar.mn b/mozilla/themes/classic/jar.mn index fb6fa7af95c..7fdc4b5c294 100644 --- a/mozilla/themes/classic/jar.mn +++ b/mozilla/themes/classic/jar.mn @@ -141,6 +141,7 @@ classic.jar: skin/classic/global/console/console-error-dash.gif (global/console/console-error-dash.gif) skin/classic/global/console/console-error-caret.gif (global/console/console-error-caret.gif) skin/classic/global/icons/close-button.gif (global/icons/close-button.gif) + skin/classic/global/icons/tab-new.gif (global/icons/tab-new.gif) skin/classic/global/toolbar/tbgrip-arrow.gif (global/toolbar/tbgrip-arrow.gif) skin/classic/global/toolbar/tbgrip-arrow-clps.gif (global/toolbar/tbgrip-arrow-clps.gif) skin/classic/global/toolbar/tbgrip-texture.gif (global/toolbar/tbgrip-texture.gif) @@ -285,6 +286,7 @@ classic.jar: skin/classic/messenger/smime/msgCompSecurityInfo.css (messenger/smime/msgCompSecurityInfo.css) skin/classic/messenger/smime/msgReadSMIMEOverlay.css (messenger/smime/msgReadSMIMEOverlay.css) skin/classic/messenger/smime/msgCompSMIMEOverlay.css (messenger/smime/msgCompSMIMEOverlay.css) + skin/classic/messenger/smime/certFetchingStatus.css (messenger/smime/certFetchingStatus.css) skin/classic/messenger/smime/msgHdrViewSMIMEOverlay.css (messenger/smime/msgHdrViewSMIMEOverlay.css) skin/classic/messenger/smime/icons/smbtn1.gif (messenger/smime/icons/smbtn1.gif) skin/classic/messenger/smime/icons/sbSignOk.gif (messenger/smime/icons/sbSignOk.gif) diff --git a/mozilla/themes/classic/messenger/messageHeader.css b/mozilla/themes/classic/messenger/messageHeader.css index fbfe93cc74a..91b5c10271a 100644 --- a/mozilla/themes/classic/messenger/messageHeader.css +++ b/mozilla/themes/classic/messenger/messageHeader.css @@ -100,6 +100,11 @@ color: #FF0000; } +.emailDisplayImage { + padding-left: 2px; + -moz-box-pack: end; +} + /* ::::: email address twisty ::::: */ .addresstwisty { diff --git a/mozilla/themes/classic/messenger/smime/msgReadSMIMEOverlay.css b/mozilla/themes/classic/messenger/smime/msgReadSMIMEOverlay.css index 400b233e7d8..9628baa17f2 100644 --- a/mozilla/themes/classic/messenger/smime/msgReadSMIMEOverlay.css +++ b/mozilla/themes/classic/messenger/smime/msgReadSMIMEOverlay.css @@ -40,35 +40,28 @@ #status-bar #signed-status { list-style-image: none; - visibility: collapsed; } #status-bar[signed="ok"] #signed-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbSignOk.gif"); - visibility: visible; } #status-bar[signed="unknown"] #signed-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbSignUnknown.gif"); - visibility: visible; } #status-bar[signed="notok"] #signed-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbSignNotOk.gif"); - visibility: visible; } #status-bar #encrypted-status { list-style-image: none; - visibility: collapsed; } #status-bar[encrypted="ok"] #encrypted-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbCryptoOk.gif"); - visibility: visible; } #status-bar[encrypted="notok"] #encrypted-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbCryptoNotOk.gif"); - visibility: visible; } diff --git a/mozilla/themes/modern/communicator/sidebar/sbar-top.gif b/mozilla/themes/modern/communicator/sidebar/sbar-top.gif new file mode 100644 index 00000000000..5f2b6569aeb Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbar-top.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-act.gif index bd86a2e8587..f879fa3b3f7 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-act.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-sel.gif index 89063148d27..69b3d16a006 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-sel.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft.gif index 8acb34244a9..7e0cf5e8477 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-lft.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-act.gif index 97343cca665..ad6160424c0 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-act.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-sel.gif index 8c9bce84209..dadcdec1c89 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-sel.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid.gif index cd521db2d8b..0d0bdaa8b87 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-mid.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-act.gif index e16d2dacf31..f5a33053580 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-act.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-hov.gif index 5612dbf68b4..b293ccc0281 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-hov.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-act.gif index 10395b6099f..1c12ea53dc4 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-act.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-hov.gif index a428ea35b4b..7bdbbe0f48d 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-hov.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-sel.gif index d134781cc38..9e9db745a4f 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-sel.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top.gif index 00c638b3e6a..437617dc7be 100644 Binary files a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top.gif and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sidebar.css b/mozilla/themes/modern/communicator/sidebar/sidebar.css index 27ffb1df7b0..c1c17bf1ec1 100644 --- a/mozilla/themes/modern/communicator/sidebar/sidebar.css +++ b/mozilla/themes/modern/communicator/sidebar/sidebar.css @@ -43,20 +43,41 @@ #sidebar-box { border-left: 1px solid #8998AA; - background-color: #C1CBD5; + background-color: #B9C4D0; } /* ::::: sidebar header ::::: */ -.sidebarheader-main { - -moz-binding: url("chrome://communicator/skin/sidebar/sidebarBindings.xml#sidebarheader") !important; - -moz-box-align: center; - border-top: 1px solid #DFE5EF; +.grippy-aligner { + width: 10px; border-left: 1px solid #DFE5EF; - padding: 3px 0px 2px 6px; - background-color: #C1CBD5; + border-top: 1px solid #DFE5EF; +} + +.toolbar-button-aligner { + width: 51px; +} + +.toolbar-button-aligner[prefixhidden="true"] { + width: 0px; +} + +.sidebar-header-text { color: #000000; font-weight: bold; + -moz-box-align: center; +} + +.sidebar-header-body { + border-top: 1px solid #DFE5EF; + -moz-box-align: center; +} + +.sidebarheader-main { + -moz-binding: url("chrome://communicator/skin/sidebar/sidebarBindings.xml#sidebarheader") !important; + background-color: #B9C4D0; + background-image: url("chrome://communicator/skin/sidebar/sbar-top.gif"); + background-repeat: no-repeat; } /* ..... picker button ..... */ @@ -65,6 +86,7 @@ margin-right: 1px; margin-top: 1px; padding: 2px; + -moz-user-focus:normal !important; } #sidebar-panel-picker:hover { @@ -86,10 +108,12 @@ #sidebar-close-button { margin: 0px 1px; -moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-image"); - padding: 0px 2px 0px 4px; + padding: 4px 2px 4px 4px; list-style-image: url("chrome://global/skin/icons/closebox.gif"); } + + /* ::::: loading info ::::: */ .text-panel-loading { @@ -110,7 +134,7 @@ .iframe-panel { -moz-binding: url("chrome://global/skin/globalBindings.xml#iframe-miniscroll") !important; border-bottom: 6px solid; - -moz-border-bottom-colors: #C1CBD5 #C1CBD5 #C1CBD5 #C1CBD5 #DFE5EF #A1ADBE; + -moz-border-bottom-colors: #B9C4D0 #B9C4D0 #B9C4D0 #B9C4D0 #DAE3ED #96A7B8; } /* ::::: sidebar tabs ::::: */ @@ -120,7 +144,7 @@ .box-texttab { -moz-binding: url("chrome://communicator/skin/sidebar/sidebarBindings.xml#sidebar-tab"); color: #000000; - border-left: 1px solid #DFE5EF; + border-left: 1px solid #DAE3ED; } .sidebar-tab-left-box, @@ -130,8 +154,8 @@ .sidebar-tab-left-box { border-top: 2px solid; - border-bottom: 1px solid #C1CBD5; - -moz-border-top-colors: #97A4B2 #DFE5EF; + border-bottom: 1px solid #B9C4D0; + -moz-border-top-colors: #8A9DAF #D4E1EA; min-width: 90px; } @@ -157,14 +181,14 @@ .sidebar-tab-right-line { border-bottom: 2px solid; - -moz-border-bottom-colors: #DFE5EF #97A4B2; + -moz-border-bottom-colors: #DAE3ED #96A7B8; } /* ..... hover state ..... */ .box-texttab:hover > .sidebar-tab-left-box { border-bottom: 2px solid; - -moz-border-bottom-colors: #DFE5EF #99A8B9; + -moz-border-bottom-colors: #CCD7E2 #9CADBB; } .box-texttab:hover > .sidebar-tab-right-box > .sidebar-tab-right-top-box @@ -186,10 +210,10 @@ .box-texttab:hover:active > .sidebar-tab-left-box { border-left: 2px solid; - -moz-border-bottom-colors: #DFE5EF #ADB9C5; - -moz-border-top-colors: #97A4B2 #838D97; - -moz-border-left-colors: #97A4B2 #AAB5C1; - background-color: #ADB9C5; + -moz-border-bottom-colors: #D8E2EC #A1B1BE ; + -moz-border-top-colors: #8A9DAF #748490; + -moz-border-left-colors: #737E8A #90A0AD; + background-color: #A1B1BE; } .box-texttab:hover:active > .sidebar-tab-left-box > .sidebar-tab-left { @@ -213,16 +237,16 @@ /* ..... selected state ..... */ .box-texttab[selected] { - border-left: 1px solid #EAF0F7 !important; - border-bottom: 1px solid #97A4B2 !important; + border-left: 1px solid #E8EEF5 !important; + border-bottom: 1px solid #CBD5E0 !important; color: #000000 !important; } .box-texttab[selected] > .sidebar-tab-left-box { border-bottom: none !important; border-left: none !important; - -moz-border-top-colors: #97A4B2 #E6EAF4 !important; - background-color: #D2D8E3 !important; + -moz-border-top-colors: #8A9DAF #DFEBF2 !important; + background-color: #CBD5E0 !important; } .box-texttab[selected] > .sidebar-tab-left-box, @@ -245,7 +269,12 @@ } .box-texttab[selected] > .sidebar-tab-right-box > .sidebar-tab-right-btm { - background: #D2D8E3 !important; + background: #CBD5E0 !important; +} + +.box-texttab[selected] > .sidebar-tab-right-box > .sidebar-tab-right-top-box > .sidebar-tab-right-line +{ + -moz-border-bottom-colors: #E2EAF4 #8CA2B3 !important; } /* ::::: sidebar navigation buttons ::::: */ diff --git a/mozilla/themes/modern/communicator/sidebar/sidebarBindings.xml b/mozilla/themes/modern/communicator/sidebar/sidebarBindings.xml index 5524cac53fa..6d38c5c4234 100644 --- a/mozilla/themes/modern/communicator/sidebar/sidebarBindings.xml +++ b/mozilla/themes/modern/communicator/sidebar/sidebarBindings.xml @@ -55,10 +55,22 @@ - - - - + + + + + + + + + + + + + + + diff --git a/mozilla/themes/modern/communicator/taskbar/addressbook-16.gif b/mozilla/themes/modern/communicator/taskbar/addressbook-16.gif index 51fd8231508..f8551d4f161 100644 Binary files a/mozilla/themes/modern/communicator/taskbar/addressbook-16.gif and b/mozilla/themes/modern/communicator/taskbar/addressbook-16.gif differ diff --git a/mozilla/themes/modern/communicator/taskbar/addressbook-act.gif b/mozilla/themes/modern/communicator/taskbar/addressbook-act.gif index 6c657ddbed3..554ff6647fc 100644 Binary files a/mozilla/themes/modern/communicator/taskbar/addressbook-act.gif and b/mozilla/themes/modern/communicator/taskbar/addressbook-act.gif differ diff --git a/mozilla/themes/modern/communicator/taskbar/addressbook.gif b/mozilla/themes/modern/communicator/taskbar/addressbook.gif index 1b159633c51..ef7e183d2c5 100644 Binary files a/mozilla/themes/modern/communicator/taskbar/addressbook.gif and b/mozilla/themes/modern/communicator/taskbar/addressbook.gif differ diff --git a/mozilla/themes/modern/communicator/taskbar/composer-16.gif b/mozilla/themes/modern/communicator/taskbar/composer-16.gif index 4de6140e8d3..8ad2fc76e79 100644 Binary files a/mozilla/themes/modern/communicator/taskbar/composer-16.gif and b/mozilla/themes/modern/communicator/taskbar/composer-16.gif differ diff --git a/mozilla/themes/modern/communicator/taskbar/composer-act.gif b/mozilla/themes/modern/communicator/taskbar/composer-act.gif index a7e9a256cd3..73b52c0a4ef 100644 Binary files a/mozilla/themes/modern/communicator/taskbar/composer-act.gif and b/mozilla/themes/modern/communicator/taskbar/composer-act.gif differ diff --git a/mozilla/themes/modern/communicator/taskbar/composer.gif b/mozilla/themes/modern/communicator/taskbar/composer.gif index 4922791c408..d15a12c5319 100644 Binary files a/mozilla/themes/modern/communicator/taskbar/composer.gif and b/mozilla/themes/modern/communicator/taskbar/composer.gif differ diff --git a/mozilla/themes/modern/editor/editor.css b/mozilla/themes/modern/editor/editor.css index 90f9b416abd..0326055457d 100644 --- a/mozilla/themes/modern/editor/editor.css +++ b/mozilla/themes/modern/editor/editor.css @@ -60,5 +60,6 @@ /* Multiline textarea for HTML source editing */ #content-source, #doctype-text { font-family : -moz-fixed; + font-size: -moz-initial; } diff --git a/mozilla/themes/modern/editor/icons/btn1.gif b/mozilla/themes/modern/editor/icons/btn1.gif index daff85321ca..d911757abb5 100644 Binary files a/mozilla/themes/modern/editor/icons/btn1.gif and b/mozilla/themes/modern/editor/icons/btn1.gif differ diff --git a/mozilla/themes/modern/global/browser.css b/mozilla/themes/modern/global/browser.css index c2d96863fd3..3c2c0ecf648 100644 --- a/mozilla/themes/modern/global/browser.css +++ b/mozilla/themes/modern/global/browser.css @@ -72,7 +72,7 @@ tab[busy] { .tabs-closebutton { margin: 0px 4px; - padding: 4px 2px 4px 2px; + padding: 3px 2px; border: none; list-style-image: url("chrome://global/skin/icons/close.gif"); } @@ -83,4 +83,20 @@ tab[busy] { .tabs-closebutton:hover:active { list-style-image: url("chrome://global/skin/icons/close-act.gif"); -} \ No newline at end of file +} + +.tabs-newbutton { + margin: 0px; + padding: 2px 0px 3px 2px; + border: none; + list-style-image: url("chrome://global/skin/icons/tab-new.gif"); +} + +.tabs-newbutton:hover { + list-style-image: url("chrome://global/skin/icons/tab-new-hov.gif"); +} + +.tabs-newbutton:hover:active { + list-style-image: url("chrome://global/skin/icons/tab-new-act.gif"); +} + diff --git a/mozilla/themes/modern/global/menu.css b/mozilla/themes/modern/global/menu.css index dfa7aa93a19..59ecdd0c3ca 100644 --- a/mozilla/themes/modern/global/menu.css +++ b/mozilla/themes/modern/global/menu.css @@ -157,7 +157,7 @@ popup > menuitem[_moz-menuactive="true"] { menulist > menupopup > menuitem, .menulist-menupopup > menu, menulist > menupopup > menu { - padding-right: 12px; + padding-right: 26px; padding-top: 1px; padding-bottom: 1px; max-width: none; diff --git a/mozilla/themes/modern/global/toolbar.css b/mozilla/themes/modern/global/toolbar.css index aa112bbcbc2..d6ef747a3ea 100644 --- a/mozilla/themes/modern/global/toolbar.css +++ b/mozilla/themes/modern/global/toolbar.css @@ -41,12 +41,6 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); -/* ::::: toolbox ::::: */ - -toolbox { - border-bottom: 1px solid #494F5D; -} - /* ::::: toolbar ::::: */ toolbar { @@ -56,11 +50,15 @@ toolbar { color: #000000; } +toolbar > .toolbar-prefix { + border-top: 1px solid #EEF0F3; + border-left: 1px solid #EEF0F3; +} + toolbar > .toolbar-holder { border-top: 1px solid #EEF0F3; border-right: 1px solid #86929E; border-bottom: 1px solid #86929E; - border-left: 1px solid #EEF0F3; } /* ::::: menubar ::::: */ diff --git a/mozilla/themes/modern/global/toolbarbutton.css b/mozilla/themes/modern/global/toolbarbutton.css index 760b6f7d314..2dc0ba9e202 100644 --- a/mozilla/themes/modern/global/toolbarbutton.css +++ b/mozilla/themes/modern/global/toolbarbutton.css @@ -62,23 +62,23 @@ toolbarbutton { } toolbarbutton:hover { - border-top: 1px solid #EEF0F3; - border-right: 1px solid #86929E; - border-bottom: 1px solid #86929E; - border-left: 1px solid #EEF0F3; + border-top-color: #EEF0F3; + border-right-color: #86929E; + border-bottom-color: #86929E; + border-left-color: #EEF0F3; } toolbarbutton:hover:active, toolbarbutton[open="true"] { - border-top: 1px solid #86929E; - border-right: 1px solid #EEF0F3; - border-bottom: 1px solid #EEF0F3; - border-left: 1px solid #86929E; + border-top-color: #86929E; + border-right-color: #EEF0F3; + border-bottom-color: #EEF0F3; + border-left-color: #86929E; padding: 2px 1px 0px 3px; } toolbarbutton[disabled="true"] { - border: 1px solid transparent !important; + border-color: transparent !important; padding: 1px 2px !important; color: #9399AB !important; } @@ -86,10 +86,10 @@ toolbarbutton[disabled="true"] { /* ..... checked state ..... */ toolbarbutton[checked="true"] { - border-top: 1px solid #454C55 !important; - border-right: 1px solid #7D848D !important; - border-bottom: 1px solid #7D848D !important; - border-left: 1px solid #454C55 !important; + border-top-color: #454C55 !important; + border-right-color: #7D848D !important; + border-bottom-color: #7D848D !important; + border-left-color: #454C55 !important; background-color: #8C9AA8 !important; color: #EFF1F4; } diff --git a/mozilla/themes/modern/jar.mn b/mozilla/themes/modern/jar.mn index bb9de43b1bf..6f80f29f355 100644 --- a/mozilla/themes/modern/jar.mn +++ b/mozilla/themes/modern/jar.mn @@ -57,6 +57,7 @@ modern.jar: skin/modern/communicator/search/search.css (communicator/search/search.css) skin/modern/communicator/alerts/alert.css (communicator/alerts/alert.css) skin/modern/communicator/sidebar/sidebarBindings.xml (communicator/sidebar/sidebarBindings.xml) + skin/modern/communicator/sidebar/sbar-top.gif (communicator/sidebar/sbar-top.gif) skin/modern/communicator/sidebar/sbtab-rit-top-act.gif (communicator/sidebar/sbtab-rit-top-act.gif) skin/modern/communicator/sidebar/sbtab-rit-btm-act.gif (communicator/sidebar/sbtab-rit-btm-act.gif) skin/modern/communicator/sidebar/sbtab-rit-top.gif (communicator/sidebar/sbtab-rit-top.gif) @@ -199,6 +200,9 @@ modern.jar: skin/modern/global/icons/close-act.gif (global/icons/close-act.gif) skin/modern/global/icons/close.gif (global/icons/close.gif) skin/modern/global/icons/close-hov.gif (global/icons/close-hov.gif) + skin/modern/global/icons/tab-new.gif (global/icons/tab-new.gif) + skin/modern/global/icons/tab-new-hov.gif (global/icons/tab-new-hov.gif) + skin/modern/global/icons/tab-new-act.gif (global/icons/tab-new-act.gif) skin/modern/global/icons/closebox.gif (global/icons/closebox.gif) skin/modern/global/menu/menu-arrow-dis.gif (global/menu/menu-arrow-dis.gif) skin/modern/global/menu/menu-arrow-hov.gif (global/menu/menu-arrow-hov.gif) @@ -392,6 +396,7 @@ modern.jar: skin/modern/messenger/smime/msgCompSecurityInfo.css (messenger/smime/msgCompSecurityInfo.css) skin/modern/messenger/smime/msgReadSMIMEOverlay.css (messenger/smime/msgReadSMIMEOverlay.css) skin/modern/messenger/smime/msgCompSMIMEOverlay.css (messenger/smime/msgCompSMIMEOverlay.css) + skin/modern/messenger/smime/certFetchingStatus.css (messenger/smime/certFetchingStatus.css) skin/modern/messenger/smime/msgHdrViewSMIMEOverlay.css (messenger/smime/msgHdrViewSMIMEOverlay.css) skin/modern/messenger/smime/icons/smbtn1.gif (messenger/smime/icons/smbtn1.gif) skin/modern/messenger/smime/icons/sbSignOk.gif (messenger/smime/icons/sbSignOk.gif) diff --git a/mozilla/themes/modern/messenger/messageHeader.css b/mozilla/themes/modern/messenger/messageHeader.css index e7bf8968f82..99343600342 100644 --- a/mozilla/themes/modern/messenger/messageHeader.css +++ b/mozilla/themes/modern/messenger/messageHeader.css @@ -119,6 +119,7 @@ } .emailDisplayImage { + padding-left: 2px; -moz-box-pack: end; } diff --git a/mozilla/themes/modern/messenger/smime/msgReadSMIMEOverlay.css b/mozilla/themes/modern/messenger/smime/msgReadSMIMEOverlay.css index 9c158f67aaf..9628baa17f2 100644 --- a/mozilla/themes/modern/messenger/smime/msgReadSMIMEOverlay.css +++ b/mozilla/themes/modern/messenger/smime/msgReadSMIMEOverlay.css @@ -39,34 +39,29 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); #status-bar #signed-status { - visibility: collapsed; + list-style-image: none; } #status-bar[signed="ok"] #signed-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbSignOk.gif"); - visibility: visible; } #status-bar[signed="unknown"] #signed-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbSignUnknown.gif"); - visibility: visible; } #status-bar[signed="notok"] #signed-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbSignNotOk.gif"); - visibility: visible; } #status-bar #encrypted-status { - visibility: collapsed; + list-style-image: none; } #status-bar[encrypted="ok"] #encrypted-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbCryptoOk.gif"); - visibility: visible; } #status-bar[encrypted="notok"] #encrypted-status { list-style-image: url("chrome://messenger/skin/smime/icons/sbCryptoNotOk.gif"); - visibility: visible; } diff --git a/mozilla/themes/modern/navigator/navigator.css b/mozilla/themes/modern/navigator/navigator.css index 80f10ee2e50..d61a5aa2dab 100644 --- a/mozilla/themes/modern/navigator/navigator.css +++ b/mozilla/themes/modern/navigator/navigator.css @@ -472,10 +472,19 @@ } #PersonalToolbar > toolbargrippy, +#PersonalToolbar > .toolbar-prefix, #PersonalToolbar > .toolbar-holder { border-top: 1px solid #CED6DD; +} + +#PersonalToolbar > toolbargrippy, +#PersonalToolbar > .toolbar-holder { border-right: 1px solid #95A0AD; border-bottom: 1px solid #95A0AD; +} + +#PersonalToolbar > toolbargrippy, +#PersonalToolbar > .toolbar-prefix { border-left: 1px solid #DAE3ED; } @@ -494,6 +503,10 @@ /* ::::: content area ::::: */ +#appcontent { + border-top: 1px solid #494F5D; +} + #content { border-bottom: 1px solid #494F5D; } diff --git a/mozilla/widget/src/gtk/nsGtkEventHandler.cpp b/mozilla/widget/src/gtk/nsGtkEventHandler.cpp index b6c3370bd64..4984ad93bee 100644 --- a/mozilla/widget/src/gtk/nsGtkEventHandler.cpp +++ b/mozilla/widget/src/gtk/nsGtkEventHandler.cpp @@ -254,6 +254,12 @@ int nsPlatformToDOMKeyCode(GdkEventKey *aGEK) #if defined(SUNOS4) || defined(SOLARIS) if (keysym == GDK_F11) return NS_VK_ESCAPE; + //When F11 key is pressed in Sun keyboard, keysym is SunF36 not F11 + if (keysym == 268828432) //SunF36's value is 0x1005ff10(268828432) + return NS_VK_F11; //Change it into F11 + //When F12 key is pressed in Sun keyboard, keysym is SunF37 not F12 + if (keysym == 268828433) //SunF37's value is 0x1005ff11(268828433) + return NS_VK_F12; //Change it into F12 #endif if (keysym >= GDK_F1 && keysym <= GDK_F24) return keysym - GDK_F1 + NS_VK_F1; diff --git a/mozilla/widget/src/gtk/nsWindow.cpp b/mozilla/widget/src/gtk/nsWindow.cpp index bc429af96cd..58b209e704f 100644 --- a/mozilla/widget/src/gtk/nsWindow.cpp +++ b/mozilla/widget/src/gtk/nsWindow.cpp @@ -1893,6 +1893,15 @@ NS_METHOD nsWindow::CreateNative(GtkObject *parentWidget) // set the back pixmap to None so that we don't get a flash of // black gdk_window_set_back_pixmap(mShell->window, NULL, FALSE); + + // gdk does not automatically set the cursor for "temporary" + // windows, which are what gtk uses for popups. + + mCursor = eCursor_wait; // force SetCursor to actually set the cursor, + // even though our internal state indicates + // that we already have the standard cursor. + SetCursor(eCursor_standard); + break; case eWindowType_toplevel: diff --git a/mozilla/widget/src/gtkxtbin/gtkxtbin.c b/mozilla/widget/src/gtkxtbin/gtkxtbin.c index ff5f916eeab..23d9f05dc7e 100644 --- a/mozilla/widget/src/gtkxtbin/gtkxtbin.c +++ b/mozilla/widget/src/gtkxtbin/gtkxtbin.c @@ -213,7 +213,7 @@ gtk_xtbin_realize (GtkWidget *widget) GdkWindowAttr attributes; gint attributes_mask, n; GtkXtBin *xtbin; - Arg args[2]; + Arg args[5]; gint width, height; Widget top_widget; Window win; @@ -254,9 +254,9 @@ gtk_xtbin_realize (GtkWidget *widget) attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - attributes.event_mask = gtk_widget_get_events (widget); + attributes.visual = gdk_window_get_visual (xtbin->parent_window); + attributes.colormap = gdk_window_get_colormap (xtbin->parent_window); + attributes.event_mask = gdk_window_get_events (xtbin->parent_window); attributes.event_mask |= GDK_EXPOSURE_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; @@ -309,6 +309,9 @@ gtk_xtbin_realize (GtkWidget *widget) n = 0; XtSetArg(args[n], XtNheight, xtbin->height);n++; XtSetArg(args[n], XtNwidth, xtbin->width);n++; + XtSetArg(args[n], XtNvisual, GDK_VISUAL_XVISUAL(gdk_window_get_visual( xtbin->parent_window )) ); n++; + XtSetArg(args[n], XtNdepth, gdk_window_get_visual( xtbin->parent_window )->depth ); n++; + XtSetArg(args[n], XtNcolormap, GDK_COLORMAP_XCOLORMAP(gdk_window_get_colormap( xtbin->parent_window)) ); n++; XtSetValues(embeded, args, n); /* Ok, here is the dirty little secret on how I am */ diff --git a/mozilla/widget/src/os2/nsAppShell.cpp b/mozilla/widget/src/os2/nsAppShell.cpp index 013a7ca746d..854942f144a 100644 --- a/mozilla/widget/src/os2/nsAppShell.cpp +++ b/mozilla/widget/src/os2/nsAppShell.cpp @@ -164,12 +164,15 @@ nsresult nsAppShell::Run() if (mDispatchListener) mDispatchListener->AfterDispatch(); } else { - if( mQmsg.hwnd) { + if ((mQmsg.hwnd) && (mQmsg.mp1 || mQmsg.mp2)) { // send WM_SYSCOMMAND, SC_CLOSE to window (tasklist close) WinSendMsg( mQmsg.hwnd, WM_SYSCOMMAND, MPFROMSHORT(SC_CLOSE), 0); } else { - if( mQuitNow) // Don't want to close the app when a window - keepGoing = 0; // is closed, just when our `Exit' is called. + // Don't want to close the app when a window + // is closed, just when our `Exit' is called or + // shutdown is invoked. + if (mQuitNow || ((mQmsg.mp1 == 0) && (mQmsg.mp2 == 0))) + keepGoing = 0; } } diff --git a/mozilla/widget/src/os2/nsDragService.cpp b/mozilla/widget/src/os2/nsDragService.cpp index 6acd6a1e3ea..a6b1609e51e 100644 --- a/mozilla/widget/src/os2/nsDragService.cpp +++ b/mozilla/widget/src/os2/nsDragService.cpp @@ -69,7 +69,7 @@ MRESULT EXPENTRY nsDragWindowProc(HWND hWnd, ULONG msg, MPARAM mp1, pszURL = (PSZ)nsMemory::Alloc(ulLength+1); DrgQueryStrName(pdragtransfer->pditem->hstrSourceName, ulLength+1, pszURL); fp = fopen(chPath, "wb+"); - fwrite(pszURL, ulLength+1, 1, fp); + fwrite(pszURL, ulLength, 1, fp); fclose(fp); WriteTypeEA(chPath, "UniformResourceLocator"); nsMemory::Free(pszURL); diff --git a/mozilla/widget/src/os2/nsFrameWindow.cpp b/mozilla/widget/src/os2/nsFrameWindow.cpp index 33ea7a41266..5e2cba2afaa 100644 --- a/mozilla/widget/src/os2/nsFrameWindow.cpp +++ b/mozilla/widget/src/os2/nsFrameWindow.cpp @@ -41,9 +41,6 @@ extern nsIRollupListener * gRollupListener; extern nsIWidget * gRollupWidget; extern PRBool gRollupConsumeRollupEvent; -extern PRBool gJustGotDeactivate; -extern HWND gHwndBeingDestroyed; - BOOL nsFrameWindow::fHiddenWindowCreated = FALSE; nsFrameWindow::nsFrameWindow() : nsWindow() @@ -61,7 +58,7 @@ void nsFrameWindow::SetWindowListVisibility( PRBool bState) HSWITCH hswitch; SWCNTRL swctl; - hswitch = WinQuerySwitchHandle(GetMainWindow(), 0); + hswitch = WinQuerySwitchHandle(mFrameWnd, 0); if( hswitch) { WinQuerySwitchEntry( hswitch, &swctl); @@ -393,22 +390,6 @@ MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2) WinRemoveProperty(mFrameWnd, "hwndMinMax"); WinRemoveProperty(mFrameWnd, "ulStyle"); break; - - case WM_ACTIVATE: - if( !mp1) - { - /* we don't want to go through all of this deactivation stuff if - * the window is just going away anyhow. Causes problems to process - * the deactivation event if we've hit some destructors or done - * some destroy work. Especially w.r.t the focus controller - */ - if( (mFrameWnd != gHwndBeingDestroyed) || - (!WinIsChild( mFrameWnd, gHwndBeingDestroyed )) ) - { - gJustGotDeactivate = PR_TRUE; - } - } - break; } if( !bDone) diff --git a/mozilla/widget/src/os2/nsFrameWindow.h b/mozilla/widget/src/os2/nsFrameWindow.h index 1695079c5d4..fddce1fba31 100644 --- a/mozilla/widget/src/os2/nsFrameWindow.h +++ b/mozilla/widget/src/os2/nsFrameWindow.h @@ -43,7 +43,6 @@ class nsFrameWindow : public nsWindow HWND GetMainWindow() const { return mFrameWnd; } protected: - HWND mFrameWnd; PFNWP fnwpDefFrame; nsSize mSizeClient; nsSize mSizeBorder; diff --git a/mozilla/widget/src/os2/nsModule.cpp b/mozilla/widget/src/os2/nsModule.cpp index e1a27346000..839beda9063 100644 --- a/mozilla/widget/src/os2/nsModule.cpp +++ b/mozilla/widget/src/os2/nsModule.cpp @@ -38,6 +38,8 @@ #include "resource.h" #include #include +#include "nsIPref.h" +#include "nsIServiceManager.h" // Module-level data & utility functions: // * unicode keycode & string conversion @@ -117,6 +119,13 @@ void nsWidgetModuleData::Init( nsIAppShell *aPrimaevalAppShell) for (int i=0;i<=16;i++ ) { hptrArray[i] = ::WinLoadPointer(HWND_DESKTOP, gModuleHandle, IDC_BASE+i); } + nsresult rv; + + bIsTrackPoint = PR_FALSE; + + nsCOMPtr prefs(do_GetService(NS_PREF_CONTRACTID, &rv)); + if (NS_SUCCEEDED(rv) && prefs) + prefs->GetBoolPref("os2.trackpoint", &bIsTrackPoint); } nsWidgetModuleData::~nsWidgetModuleData() diff --git a/mozilla/widget/src/os2/nsModule.h b/mozilla/widget/src/os2/nsModule.h index 58b7bbfbfeb..730bd7e4055 100644 --- a/mozilla/widget/src/os2/nsModule.h +++ b/mozilla/widget/src/os2/nsModule.h @@ -55,6 +55,7 @@ class nsWidgetModuleData : public nsISupports BOOL bMouseSwitched; // true if MB1 is the RH mouse button LONG lHtEntryfield; // ideal height of an entryfield BOOL bIsDBCS; // true if system is dbcs + PRBool bIsTrackPoint; // true if system has a TrackPoint HPOINTER hptrArray[17]; // xptoolkit services we look after, & the primaeval appshell too. diff --git a/mozilla/widget/src/os2/nsWindow.cpp b/mozilla/widget/src/os2/nsWindow.cpp index 9f746458e51..4162b3c9e68 100644 --- a/mozilla/widget/src/os2/nsWindow.cpp +++ b/mozilla/widget/src/os2/nsWindow.cpp @@ -63,7 +63,6 @@ static int WINDOWCOUNT = 0; #endif -#define kWindowPositionSlop 20 static const char *sScreenManagerContractID = "@mozilla.org/gfx/screenmanager;1"; // HWNDs are mapped to nsWindow objects using a custom presentation parameter, @@ -105,8 +104,7 @@ PRBool gRollupConsumeRollupEvent = PR_FALSE; PRBool gJustGotActivate = PR_FALSE; PRBool gJustGotDeactivate = PR_FALSE; - -HWND gHwndBeingDestroyed = NULLHANDLE; +PRBool gIsDestroyingAny = PR_FALSE; //////////////////////////////////////////////////// // Mouse Clicks - static variable defintions @@ -117,6 +115,10 @@ static LONG gLastMsgTime = 0; static LONG gLastClickCount = 0; //////////////////////////////////////////////////// +#ifdef DEBUG_FOCUS +static int currentWindowIdentifier = 0; +#endif + //------------------------------------------------------------------------- // // nsWindow constructor @@ -126,6 +128,7 @@ nsWindow::nsWindow() : nsBaseWidget() { NS_INIT_REFCNT(); mWnd = 0; + mFrameWnd = 0; mPrevWndProc = NULL; mParent = 0; mNextID = 1; @@ -148,8 +151,7 @@ nsWindow::nsWindow() : nsBaseWidget() mBorderStyle = eBorderStyle_default; mFont = nsnull; mOS2Toolkit = nsnull; - mMenuBar = nsnull; -// mActiveMenu = nsnull; + mIsScrollBar = FALSE; mIsTopWidgetWindow = PR_FALSE; } @@ -654,6 +656,13 @@ MRESULT EXPENTRY fnwpNSWindow( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) } } + // hold on to the window for the life of this method, in case it gets + // deleted during processing. yes, it's a double hack, since someWindow + // is not really an interface. + nsCOMPtr kungFuDeathGrip; + if (!wnd->mIsDestroying) // not if we're in the destructor! + kungFuDeathGrip = do_QueryInterface((nsBaseWidget*)wnd); + MRESULT mRC = 0; if( wnd) @@ -775,6 +784,8 @@ void nsWindow::RealDoCreate( HWND hwndP, style &= ~WS_CLIPSIBLINGS; } + mIsScrollBar = (!(strcmp( WindowClass(), WC_SCROLLBAR_STRING ))); + if( hwndP != HWND_DESKTOP) { // For pop-up menus, the parent is the desktop, but use the "parent" as owner @@ -789,15 +800,23 @@ void nsWindow::RealDoCreate( HWND hwndP, // For scrollbars, the parent is the owner, for notification purposes else if(!hwndOwner ) { - BOOL bHwndIsScrollBar = - (!(strcmp( WindowClass(), WC_SCROLLBAR_STRING ))); - if( bHwndIsScrollBar ) + if( mIsScrollBar ) { hwndOwner = hwndP; } } } +#ifdef DEBUG_FOCUS + mWindowIdentifier = currentWindowIdentifier; + currentWindowIdentifier++; + if (aInitData && (aInitData->mWindowType == eWindowType_toplevel)) { + printf("[%x] Create Frame Window (%d)\n", this, mWindowIdentifier); + } else { + printf("[%x] Create Window (%d)\n", this, mWindowIdentifier); + } +#endif + // Create a window: create hidden & then size to avoid swp_noadjust problems // owner == parent except for 'borderless top-level' -- see nsCanvas.cpp mWnd = WinCreateWindow( hwndP, @@ -812,6 +831,17 @@ void nsWindow::RealDoCreate( HWND hwndP, NS_ASSERTION( mWnd, "Couldn't create window"); + // This is ugly. The Thinkpad TrackPoint driver checks to see whether or not a window + // actually has a scroll bar as a child before sending it scroll messages. Needless to + // say, no Mozilla window has real scroll bars. So if you have the "os2.trackpoint" + // preference set, we put an invisible scroll bar on every child window so we can + // scroll. Woohoo! + if (gWidgetModuleData->bIsTrackPoint && mWindowType == eWindowType_child && !mIsScrollBar) { + WinCreateWindow(mWnd, WC_SCROLLBAR, 0, SBS_VERT, + 0, 0, 0, 0, mWnd, HWND_TOP, + FID_VERTSCROLL, NULL, NULL); + } + #if DEBUG_sobotka printf("\n+++++++++++In nsWindow::RealDoCreate created 0x%lx, %d x %d\n", mWnd, aRect.width, aRect.height); @@ -961,9 +991,16 @@ NS_METHOD nsWindow::Destroy() if( mWnd) { - gHwndBeingDestroyed = (mHackDestroyWnd ? mHackDestroyWnd : mWnd); - WinDestroyWindow( gHwndBeingDestroyed); - gHwndBeingDestroyed = NULLHANDLE; + HWND hwndBeingDestroyed = mFrameWnd ? mFrameWnd : mWnd; + gIsDestroyingAny = PR_TRUE; +#ifdef DEBUG_FOCUS + printf("[%x] Destroy (%d)\n", this, mWindowIdentifier); +#endif + if (hwndBeingDestroyed == WinQueryFocus(HWND_DESKTOP)) { + WinSetFocus(HWND_DESKTOP, WinQueryWindow(hwndBeingDestroyed, QW_PARENT)); + } + WinDestroyWindow(hwndBeingDestroyed); + gIsDestroyingAny = PR_FALSE; } } return NS_OK; @@ -1211,6 +1248,8 @@ NS_METHOD nsWindow::ConstrainPosition(PRBool aAllowSlop, } } +#define kWindowPositionSlop 100 + if (doConstrain) { if (aAllowSlop) { if (*aX < screenRect.xLeft - mBounds.width + kWindowPositionSlop) @@ -1218,8 +1257,8 @@ NS_METHOD nsWindow::ConstrainPosition(PRBool aAllowSlop, else if (*aX >= screenRect.xRight - kWindowPositionSlop) *aX = screenRect.xRight - kWindowPositionSlop; - if (*aY < screenRect.yTop - mBounds.height + kWindowPositionSlop) - *aY = screenRect.yTop - mBounds.height + kWindowPositionSlop; + if (*aY < screenRect.yTop) + *aY = screenRect.yTop; else if (*aY >= screenRect.yBottom - kWindowPositionSlop) *aY = screenRect.yBottom - kWindowPositionSlop; @@ -1350,8 +1389,10 @@ NS_METHOD nsWindow::SetFocus(PRBool aRaise) mOS2Toolkit->CallMethod(&info); } else - if (mWnd && - (!gHwndBeingDestroyed || !WinIsChild(mWnd, gHwndBeingDestroyed))) { + if (mWnd) { +#ifdef DEBUG_FOCUS + printf("[%x] SetFocus (%d)\n", this, mWindowIdentifier); +#endif WinSetFocus( HWND_DESKTOP, mWnd); } return NS_OK; @@ -2093,6 +2134,7 @@ void nsWindow::ConstrainZLevel(HWND *aAfter) { PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc) { PRBool result = PR_FALSE; // call the default window procedure + PRBool isMozWindowTakingFocus = PR_TRUE; switch (msg) { #if 0 @@ -2294,48 +2336,76 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc) result = OnScroll( msg, mp1, mp2); break; - case WM_FOCUSCHANGED: - /* Make a test to see if we are in the process of closing, deleting - * or destroying this nsWindow. If we are, then we've already - * gotten rid of our nsDocShell->mScriptGlobal. To handle focus - * events when there is no mScriptGlobal is apparently a bad thing. - */ - if(!(mWindowState & nsWindowState_eClosing)) - { - PRBool isMozWindowTakingFocus = PR_TRUE; - if( SHORT1FROMMP( mp2 ) || mWnd == WinQueryFocus(HWND_DESKTOP) ) - { - result = DispatchFocus( NS_GOTFOCUS, isMozWindowTakingFocus ); - // Only sending an Activate event when we get a WM_ACTIVATE message - // isn't good enough; need to do this every time we gain focus. - if( !gJustGotActivate ) - { - gJustGotActivate = PR_TRUE; - if ( WinIsChild( mWnd, HWNDFROMMP(mp1)) && mNextID == 1) - result = DispatchFocus( NS_PLUGIN_ACTIVATE, isMozWindowTakingFocus ); - else - result = DispatchFocus( NS_ACTIVATE, isMozWindowTakingFocus ); - gJustGotActivate = PR_FALSE; - } - } - else - { - char className[19]; - ::WinQueryClassName((HWND)mp1, 19, className); - if (strcmp(className, WindowClass()) != 0 && - strcmp(className, WC_SCROLLBAR_STRING) != 0) - isMozWindowTakingFocus = PR_FALSE; - - if( gJustGotDeactivate ) - { - gJustGotDeactivate = PR_FALSE; - result = DispatchFocus( NS_DEACTIVATE, isMozWindowTakingFocus ); - } - result = DispatchFocus( NS_LOSTFOCUS, isMozWindowTakingFocus ); - } + case WM_ACTIVATE: +#ifdef DEBUG_FOCUS + printf("[%x] WM_ACTIVATE (%d)\n", this, mWindowIdentifier); +#endif + if (mp1) { + /* The window is being activated */ + gJustGotActivate = PR_TRUE; +#ifdef DEBUG_FOCUS + printf("[%x] NS_GOTFOCUS (%d)\n", this, mWindowIdentifier); +#endif + result = DispatchFocus(NS_GOTFOCUS, isMozWindowTakingFocus); + } else { + /* The window is being deactivated */ + gJustGotDeactivate = PR_TRUE; } break; - + + case WM_FOCUSCHANGED: +#ifdef DEBUG_FOCUS + printf("[%x] WM_FOCUSCHANGED (%d)\n", this, mWindowIdentifier); +#endif + if (SHORT1FROMMP(mp2)) { + /* We are receiving focus */ + if (!gIsDestroyingAny) { +#ifdef DEBUG_FOCUS + printf("[%x] NS_GOTFOCUS (%d)\n", this, mWindowIdentifier); +#endif + result = DispatchFocus(NS_GOTFOCUS, isMozWindowTakingFocus); + if (gJustGotActivate) { + gJustGotActivate = PR_FALSE; + gJustGotDeactivate = PR_FALSE; +#ifdef DEBUG_FOCUS + printf("[%x] NS_ACTIVATE (%d)\n", this, mWindowIdentifier); +#endif + result = DispatchFocus(NS_ACTIVATE, isMozWindowTakingFocus); + } + if ( WinIsChild( mWnd, HWNDFROMMP(mp1)) && mNextID == 1) { +#ifdef DEBUG_FOCUS + printf("[%x] NS_PLUGIN_ACTIVATE (%d)\n", this, mWindowIdentifier); +#endif + result = DispatchFocus(NS_PLUGIN_ACTIVATE, isMozWindowTakingFocus); + WinSetFocus(HWND_DESKTOP, mWnd); + } + } else { + nsToolkit *toolkit = NS_STATIC_CAST(nsToolkit *, mToolkit); + WinPostMsg(toolkit->GetDispatchWindow(), WM_FOCUSCHANGED, mp1, mp2); + } + + } else { + /* We are losing focus */ + char className[19]; + ::WinQueryClassName((HWND)mp1, 19, className); + if (strcmp(className, WindowClass()) != 0 && + strcmp(className, WC_SCROLLBAR_STRING) != 0) { + isMozWindowTakingFocus = PR_FALSE; + } + if (gJustGotDeactivate) { + gJustGotDeactivate = PR_FALSE; +#ifdef DEBUG_FOCUS + printf("[%x] NS_DEACTIVATE (%d)\n", this, mWindowIdentifier); +#endif + result = DispatchFocus(NS_DEACTIVATE, isMozWindowTakingFocus); + } +#ifdef DEBUG_FOCUS + printf("[%x] NS_LOSTFOCUS (%d)\n", this, mWindowIdentifier); +#endif + result = DispatchFocus(NS_LOSTFOCUS, isMozWindowTakingFocus); + } + break; + case WM_WINDOWPOSCHANGED: result = OnReposition( (PSWP) mp1); break; @@ -2494,9 +2564,6 @@ void nsWindow::OnDestroy() // kill font delete mFont; - // release menubar -// NS_IF_RELEASE(mMenuBar); - // dispatching of the event may cause the reference count to drop to 0 // and result in this object being deleted. To avoid that, add a // reference and then release it after dispatching the event. @@ -3024,8 +3091,12 @@ NS_METHOD nsWindow::SetTitle(const nsString& aTitle) } else if( mWnd) { + /* On OS/2, if you pass a titlebar > 512 characters, it doesn't display at all. */ + /* We are going to limit our titlebars to 256 just to be on the safe side */ + nsAutoString left; + aTitle.Left(left, 256); WinSetWindowText( GetMainWindow(), - gWidgetModuleData->ConvertFromUcs( aTitle)); + gWidgetModuleData->ConvertFromUcs(left)); } return NS_OK; } diff --git a/mozilla/widget/src/os2/nsWindow.h b/mozilla/widget/src/os2/nsWindow.h index 36ac1118886..18256b43864 100644 --- a/mozilla/widget/src/os2/nsWindow.h +++ b/mozilla/widget/src/os2/nsWindow.h @@ -41,7 +41,7 @@ #include "nsToolkit.h" #include "nsSwitchToUIThread.h" -class nsIMenuBar; +//#define DEBUG_FOCUS // Base widget class. // This is abstract. Controls (labels, radio buttons, listboxen) derive @@ -99,8 +99,6 @@ class nsWindow : public nsBaseWidget, virtual nsIWidget *GetParent(); NS_IMETHOD SetSizeMode(PRInt32 aMode); - NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar) { return NS_ERROR_FAILURE; } - NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; } // Physical properties NS_IMETHOD Show( PRBool bState); @@ -143,6 +141,8 @@ class nsWindow : public nsBaseWidget, NS_IMETHOD SetCursor( nsCursor aCursor); NS_IMETHOD HideWindowChrome(PRBool aShouldHide); NS_IMETHOD SetTitle( const nsString& aTitle); + NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar) { return NS_ERROR_FAILURE; } + NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; } NS_IMETHOD Invalidate( PRBool aIsSynchronous); NS_IMETHOD Invalidate( const nsRect & aRect, PRBool aIsSynchronous); NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous); @@ -229,6 +229,7 @@ protected: // PM data members HWND mWnd; // window handle + HWND mFrameWnd; // frame window handle PFNWP mPrevWndProc; // previous window procedure nsWindow *mParent; // parent widget ULONG mNextID; // next child window id @@ -243,6 +244,7 @@ protected: HWND mHackDestroyWnd; // access GetMainWindow() window from destructor QMSG mQmsg; PRBool mIsTopWidgetWindow; + BOOL mIsScrollBar; HWND GetParentHWND() const; HWND GetHWND() const { return mWnd; } @@ -294,6 +296,9 @@ protected: }; friend MRESULT EXPENTRY fnwpNSWindow( HWND, ULONG, MPARAM, MPARAM); friend MRESULT EXPENTRY fnwpFrame( HWND, ULONG, MPARAM, MPARAM); +#ifdef DEBUG_FOCUS + int mWindowIdentifier; +#endif }; #define PM2NS_PARENT NS2PM_PARENT diff --git a/mozilla/widget/src/windows/nsClipboard.cpp b/mozilla/widget/src/windows/nsClipboard.cpp index 81e294bc104..b604222bd52 100644 --- a/mozilla/widget/src/windows/nsClipboard.cpp +++ b/mozilla/widget/src/windows/nsClipboard.cpp @@ -200,7 +200,7 @@ nsresult nsClipboard::SetupNativeDataObject(nsITransferable * aTransferable, IDa #endif } else if ( strcmp(flavorStr, kPNGImageMime) == 0 || strcmp(flavorStr, kJPEGImageMime) == 0 || - strcmp(flavorStr, kGIFImageMime) == 0 ) { + strcmp(flavorStr, kGIFImageMime) == 0 || strcmp(flavorStr, kNativeImageMime) == 0 ) { // if we're an image, register the native bitmap flavor FORMATETC imageFE; SET_FORMATETC(imageFE, CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL) diff --git a/mozilla/widget/src/windows/nsDataObj.cpp b/mozilla/widget/src/windows/nsDataObj.cpp index 31d44c32b38..b48f8cb17d1 100644 --- a/mozilla/widget/src/windows/nsDataObj.cpp +++ b/mozilla/widget/src/windows/nsDataObj.cpp @@ -383,10 +383,21 @@ nsDataObj :: GetDib ( const nsACString& inFlavor, FORMATETC &, STGMEDIUM & aSTG PRNTDEBUG("nsDataObj::GetDib\n"); ULONG result = E_FAIL; + PRUint32 len = 0; nsCOMPtr genericDataWrapper; mTransferable->GetTransferData(PromiseFlatCString(inFlavor).get(), getter_AddRefs(genericDataWrapper), &len); nsCOMPtr image ( do_QueryInterface(genericDataWrapper) ); + if ( !image ) { + // In the 0.9.4 timeframe, I had some embedding clients put the nsIImage directly into the + // transferable. Newer code, however, wraps the nsIImage in a nsISupportsInterfacePointer. + // We should be backwards compatibile with code already out in the field. If we can't find + // the image directly out of the transferable, unwrap the image from its wrapper. + nsCOMPtr ptr(do_QueryInterface(genericDataWrapper)); + if ( ptr ) + ptr->GetData(getter_AddRefs(image)); + } + if ( image ) { // use a the helper class to build up a bitmap. We now own the bits, // and pass them back to the OS in |aSTG|. diff --git a/mozilla/widget/src/windows/nsDataObjCollection.cpp b/mozilla/widget/src/windows/nsDataObjCollection.cpp index c2487971832..24e76ef291d 100644 --- a/mozilla/widget/src/windows/nsDataObjCollection.cpp +++ b/mozilla/widget/src/windows/nsDataObjCollection.cpp @@ -60,7 +60,6 @@ ULONG nsDataObjCollection::g_cRef = 0; EXTERN_C GUID CDECL CLSID_nsDataObjCollection = { 0x2d851b91, 0xd4c, 0x11d3, { 0x96, 0xd4, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }; - /* * Class nsDataObjCollection */ @@ -113,11 +112,17 @@ STDMETHODIMP nsDataObjCollection::QueryInterface(REFIID riid, void** ppv) *ppv=NULL; if ( (IID_IUnknown == riid) || (IID_IDataObject == riid) ) { - *ppv = this; + *ppv = static_cast(this); AddRef(); return NOERROR; } + if ( IID_IDataObjCollection == riid ) { + *ppv = static_cast(this); + AddRef(); + return NOERROR; + } + return ResultFromScode(E_NOINTERFACE); } diff --git a/mozilla/widget/src/windows/nsDataObjCollection.h b/mozilla/widget/src/windows/nsDataObjCollection.h index 72bcd6a472f..1e1b24da513 100644 --- a/mozilla/widget/src/windows/nsDataObjCollection.h +++ b/mozilla/widget/src/windows/nsDataObjCollection.h @@ -38,6 +38,8 @@ #ifndef _NSDATAOBJCOLLECTION_H_ #define _NSDATAOBJCOLLECTION_H_ +#define INITGUID // needed for initializing the IID_IDataObjCollection GUID + #include "OLEIDL.H" #include "nsString.h" @@ -65,13 +67,24 @@ public: }; #endif +// {25589C3E-1FAC-47b9-BF43-CAEA89B79533} +DEFINE_GUID(IID_IDataObjCollection, +0x25589c3e, 0x1fac, 0x47b9, 0xbf, 0x43, 0xca, 0xea, 0x89, 0xb7, 0x95, 0x33); + +// An interface to make sure we have the right kind of object for D&D +// this way we can filter out collection objects that aren't ours +class nsIDataObjCollection : public IUnknown { +public: + +}; + /* * This ole registered class is used to facilitate drag-drop of objects which * can be adapted by an object derived from CfDragDrop. The CfDragDrop is * associated with instances via SetDragDrop(). */ -class nsDataObjCollection : public IDataObject //, public nsPIDataObjCollection +class nsDataObjCollection : public IDataObject, public nsIDataObjCollection //, public nsPIDataObjCollection { public: // construction, destruction nsDataObjCollection(); diff --git a/mozilla/widget/src/windows/nsDragService.cpp b/mozilla/widget/src/windows/nsDragService.cpp index 1723236493d..429986ff86a 100644 --- a/mozilla/widget/src/windows/nsDragService.cpp +++ b/mozilla/widget/src/windows/nsDragService.cpp @@ -163,6 +163,22 @@ NS_IMETHODIMP nsDragService::StartInvokingDragSession(IDataObject * aDataObj, PR return (DRAGDROP_S_DROP == res?NS_OK:NS_ERROR_FAILURE); } +//------------------------------------------------------------------------- +// Make Sure we have the right kind of object +nsDataObjCollection* nsDragService::GetDataObjCollection(IDataObject* aDataObj) +{ + nsDataObjCollection * dataObjCol = nsnull; + if (aDataObj) { + nsIDataObjCollection* dataObj; + if (aDataObj->QueryInterface(IID_IDataObjCollection, (void**)&dataObj) == S_OK) { + dataObjCol = NS_STATIC_CAST(nsDataObjCollection*, aDataObj); + dataObj->Release(); + } + } + + return dataObjCol; +} + //------------------------------------------------------------------------- NS_IMETHODIMP nsDragService::GetNumDropItems (PRUint32 * aNumItems) { @@ -172,7 +188,8 @@ NS_IMETHODIMP nsDragService::GetNumDropItems (PRUint32 * aNumItems) } if ( IsCollectionObject(mDataObject) ) { - nsDataObjCollection * dataObjCol = NS_STATIC_CAST(nsDataObjCollection*, mDataObject); + + nsDataObjCollection * dataObjCol = GetDataObjCollection(mDataObject); if ( dataObjCol ) *aNumItems = dataObjCol->GetNumDataObjects(); } @@ -211,7 +228,7 @@ NS_IMETHODIMP nsDragService::GetData (nsITransferable * aTransferable, PRUint32 if ( IsCollectionObject(mDataObject) ) { // multiple items, use |anItem| as an index into our collection - nsDataObjCollection * dataObjCol = NS_STATIC_CAST(nsDataObjCollection*, mDataObject); + nsDataObjCollection * dataObjCol = GetDataObjCollection(mDataObject); PRUint32 cnt = dataObjCol->GetNumDataObjects(); if (anItem >= 0 && anItem < cnt) { IDataObject * dataObj = dataObjCol->GetDataObjectAt(anItem); @@ -271,7 +288,7 @@ NS_IMETHODIMP nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PRBo SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI); // See if any one of the IDataObjects in the collection supports this data type - nsDataObjCollection* dataObjCol = NS_STATIC_CAST(nsDataObjCollection*, mDataObject); + nsDataObjCollection* dataObjCol = GetDataObjCollection(mDataObject); if ( dataObjCol ) { PRUint32 cnt = dataObjCol->GetNumDataObjects(); for (PRUint32 i=0;iInvoke(); } + + case WM_SYSCOLORCHANGE: + { + // WM_SYSCOLORCHANGE messages are only dispatched to top + // level windows but NS_SYSCOLORCHANGE messages must be dispatched + // to all windows including child windows. We dispatch these messages + // from the nsToolkit because if we are running embedded we may not + // have a top-level nsIWidget window. + + // On WIN32 all windows are automatically invalidated after the + // WM_SYSCOLORCHANGE is dispatched so the window is drawn using + // the current system colors. + nsWindow::GlobalMsgWindowProc(hWnd, msg, wParam, lParam); + } + } #ifdef MOZ_AIMM diff --git a/mozilla/widget/src/windows/nsToolkit.h b/mozilla/widget/src/windows/nsToolkit.h index bd2f96c696f..06e29acb53d 100644 --- a/mozilla/widget/src/windows/nsToolkit.h +++ b/mozilla/widget/src/windows/nsToolkit.h @@ -89,6 +89,7 @@ protected: public: static HINSTANCE mDllInstance; // OS flag + static PRBool mIsWinXP; static PRBool mUseImeApiW; static PRBool mW2KXP_CP936; diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index 9a92ad3457f..d26a0dfe1aa 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -322,23 +322,73 @@ static PRBool is_vk_down(int vk) #define NS_IMM_SETCANDIDATEWINDOW(hIMC, candForm) \ { \ if (nsToolkit::gAIMMApp) \ - (nsToolkit::gAIMMApp->SetCandidateWindow(hIMC, candForm) == S_OK); \ + nsToolkit::gAIMMApp->SetCandidateWindow(hIMC, candForm); \ else { \ nsIMM &theIMM = nsIMM::LoadModule(); \ theIMM.SetCandidateWindow(hIMC, candForm); \ } \ } +#define NS_IMM_SETCOMPOSITIONWINDOW(hIMC, compForm) \ + { \ + if (nsToolkit::gAIMMApp) \ + nsToolkit::gAIMMApp->SetCompositionWindow(hIMC, compForm); \ + else { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.SetCompositionWindow(hIMC, compForm); \ + } \ + } + #define NS_IMM_GETCOMPOSITIONWINDOW(hIMC, compForm) \ { \ if (nsToolkit::gAIMMApp) \ - (nsToolkit::gAIMMApp->GetCompositionWindow(hIMC, compForm) == S_OK); \ + nsToolkit::gAIMMApp->GetCompositionWindow(hIMC, compForm); \ else { \ nsIMM &theIMM = nsIMM::LoadModule(); \ theIMM.GetCompositionWindow(hIMC, compForm); \ } \ } +#define NS_IMM_GETCOMPOSITIONFONT(hIMC, lf) \ + { \ + if (nsToolkit::gAIMMApp) \ + nsToolkit::gAIMMApp->GetCompositionFontA(hIMC, lf); \ + else { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.GetCompositionFontA(hIMC, lf); \ + } \ + } + +#define NS_IMM_SETCOMPOSITIONFONT(hIMC, lf) \ + { \ + if (nsToolkit::gAIMMApp) \ + nsToolkit::gAIMMApp->SetCompositionFontA(hIMC, lf); \ + else { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.SetCompositionFontA(hIMC, lf); \ + } \ + } + +#define NS_IMM_GETCOMPOSITIONFONTW(hIMC, lf) \ + { \ + if (nsToolkit::gAIMMApp) \ + nsToolkit::gAIMMApp->GetCompositionFontW(hIMC, lf); \ + else { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.GetCompositionFontW(hIMC, lf); \ + } \ + } + +#define NS_IMM_SETCOMPOSITIONFONTW(hIMC, lf) \ + { \ + if (nsToolkit::gAIMMApp) \ + nsToolkit::gAIMMApp->SetCompositionFontW(hIMC, lf); \ + else { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.SetCompositionFontW(hIMC, lf); \ + } \ + } + #define NS_IMM_SETCONVERSIONSTATUS(hIMC, pfdwConversion, pfdwSentence, bRet) \ { \ bRet = TRUE; \ @@ -404,6 +454,36 @@ static PRBool is_vk_down(int vk) theIMM.SetCandidateWindow(hIMC, candForm); \ } +#define NS_IMM_SETCOMPOSITIONWINDOW(hIMC, compForm) \ + { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.SetCompositionWindow(hIMC, compForm); \ + } + +#define NS_IMM_GETCOMPOSITIONFONT(hIMC, lf) \ + { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.GetCompositionFont(hIMC, lf); \ + } + +#define NS_IMM_GETCOMPOSITIONFONTW(hIMC, lf) \ + { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.GetCompositionFontW(hIMC, lf); \ + } + +#define NS_IMM_SETCOMPOSITIONFONT(hIMC, lf) \ + { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.SetCompositionFont(hIMC, lf); \ + } + +#define NS_IMM_SETCOMPOSITIONFONTW(hIMC, lf) \ + { \ + nsIMM &theIMM = nsIMM::LoadModule(); \ + theIMM.SetCompositionFontW(hIMC, lf); \ + } + #define NS_IMM_SETCONVERSIONSTATUS(hIMC, lpfdwConversion, lpfdwSentence) \ { \ nsIMM &theIMM = nsIMM::LoadModule(); \ @@ -564,6 +644,67 @@ private: static nsAttentionTimerMonitor *gAttentionTimerMonitor = 0; +PRBool gIsDestroyingAny = PR_FALSE; + + +// Code to dispatch WM_SYSCOLORCHANGE message to all child windows. +// WM_SYSCOLORCHANGE is only sent to top-level windows, but the +// cross platform API requires that NS_SYSCOLORCHANGE message be sent to +// all child windows as well. When running in an embedded application +// we may not receive a WM_SYSCOLORCHANGE message because the top +// level window is owned by the embeddor. Note: this code can be used to +// dispatch other global messages (i.e messages that must be sent to all +// nsIWidget instances. + +// Enumerate all child windows sending aMsg to each of them + +BOOL CALLBACK nsWindow::BroadcastMsgToChildren(HWND aWnd, LPARAM aMsg) +{ + LONG proc = ::GetWindowLong(aWnd, GWL_WNDPROC); + if (proc == (LONG)&nsWindow::WindowProc) { + // its one of our windows so go ahead and send a message to it + WNDPROC winProc = (WNDPROC)GetWindowLong(aWnd, GWL_WNDPROC); + ::CallWindowProc(winProc, aWnd, aMsg, 0, 0); + } + // Send message to children of this window + ::EnumChildWindows(aWnd, nsWindow::BroadcastMsgToChildren, aMsg); + return TRUE; +} + +// Enumerate all top level windows specifying that the children of each +// top level window should be enumerated. Do *not* send the message to +// each top level window since it is assumed that the toolkit will send +// aMsg to them directly. + +BOOL CALLBACK nsWindow::BroadcastMsg(HWND aTopWindow, LPARAM aMsg) +{ + // Iterate each of aTopWindows child windows sending the aMsg + // to each of them. + EnumChildWindows(aTopWindow, nsWindow::BroadcastMsgToChildren, aMsg); + return TRUE; +} + +// This method is called from nsToolkit::WindowProc to forward global +// messages which need to be dispatched to all child windows. + +void nsWindow::GlobalMsgWindowProc(HWND hWnd, UINT msg, + WPARAM wParam, LPARAM lParam) + +{ + switch (msg) { + case WM_SYSCOLORCHANGE: + // System color changes are posted to top-level windows only. + // The NS_SYSCOLORCHANGE must be dispatched to all child + // windows as well. + ::EnumThreadWindows(GetCurrentThreadId(), nsWindow::BroadcastMsg, msg); + break; + } +} + +// End of the methods to dispatch global messages + + + //------------------------------------------------------------------------- // // nsISupport stuff @@ -638,6 +779,7 @@ nsWindow::nsWindow() : nsBaseWidget() mIMECompClauseStringSize = 0; mIMECompClauseStringLength = 0; mIMEReconvertUnicode = NULL; + mLeadByte = '\0'; static BOOL gbInitGlobalValue = FALSE; if(! gbInitGlobalValue) { @@ -1409,7 +1551,11 @@ NS_METHOD nsWindow::Destroy() mEventCallback = nsnull; if (gAttentionTimerMonitor) gAttentionTimerMonitor->KillTimer(mWnd); + + gIsDestroyingAny = PR_TRUE; VERIFY(::DestroyWindow(mWnd)); + gIsDestroyingAny = PR_FALSE; + mWnd = NULL; //our windows can be subclassed by //others and these namless, faceless others @@ -2725,7 +2871,10 @@ BOOL nsWindow::OnKeyDown( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) DispatchKeyEvent(NS_KEY_PRESS, 0, NS_VK_TAB, aKeyData); } else if (mIsControlDown && !mIsShiftDown && aVirtualKeyCode == NS_VK_SUBTRACT) { - DispatchKeyEvent(NS_KEY_PRESS, aVirtualKeyCode-64, 0, aKeyData); + DispatchKeyEvent(NS_KEY_PRESS, '-', 0, aKeyData); + } + else if (mIsControlDown && !mIsShiftDown && aVirtualKeyCode == NS_VK_ADD) { + DispatchKeyEvent(NS_KEY_PRESS, '+', 0, aKeyData); } else if ((mIsControlDown && !mIsShiftDown) && ((( NS_VK_0 <= aVirtualKeyCode) && (aVirtualKeyCode <= NS_VK_9)) || @@ -2782,19 +2931,13 @@ BOOL nsWindow::OnKeyUp( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) BOOL nsWindow::OnChar( UINT mbcsCharCode, UINT virtualKeyCode, bool isMultiByte ) { wchar_t uniChar; - char charToConvert[2]; + char charToConvert[3]; size_t length; if (mIMEIsComposing) { HandleEndComposition(); } - { - charToConvert[0] = LOBYTE(mbcsCharCode); - length=1; - } - - if(mIsControlDown && (virtualKeyCode <= 0x1A)) // Ctrl+A Ctrl+Z, see Programming Windows 3.1 page 110 for details { // need to account for shift here. bug 16486 @@ -2820,8 +2963,31 @@ BOOL nsWindow::OnChar( UINT mbcsCharCode, UINT virtualKeyCode, bool isMultiByte } else { + if (!isMultiByte) { + if (mLeadByte) { // mLeadByte is used for keeping the lead-byte of CJK char + charToConvert[0] = mLeadByte; + charToConvert[1] = LOBYTE(mbcsCharCode); + mLeadByte = '\0'; + length=2; + } + else { + charToConvert[0] = LOBYTE(mbcsCharCode); + if (::IsDBCSLeadByteEx(gCurrentKeyboardCP, charToConvert[0])) { + mLeadByte = charToConvert[0]; + return TRUE; + } + length=1; + } + } else { + // SC double-byte punctuation mark in Windows-English is 0x0000aca3 + uniChar = LOWORD(mbcsCharCode); + charToConvert[0] = LOBYTE(uniChar); + charToConvert[1] = HIBYTE(uniChar); + mLeadByte = '\0'; + length=2; + } ::MultiByteToWideChar(gCurrentKeyboardCP,MB_PRECOMPOSED,charToConvert,length, - &uniChar,sizeof(uniChar)); + &uniChar, 1); virtualKeyCode = 0; mIsShiftDown = PR_FALSE; } @@ -3338,6 +3504,15 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT case WM_DISPLAYCHANGE: DispatchStandardEvent(NS_DISPLAYCHANGED); break; + + case WM_SYSCOLORCHANGE: + // Note: This is sent for child windows as well as top-level windows. + // The Win32 toolkit normally only sends these events to top-level windows. + // But we cycle through all of the childwindows and send it to them as well + // so all presentations get notified properly. + // See nsWindow::GlobalMsgWindowProc. + DispatchStandardEvent(NS_SYSCOLORCHANGED); + break; case WM_NOTIFY: // TAB change @@ -3446,7 +3621,6 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT } unsigned char ch = (unsigned char)wParam; - UINT char_result; // and J and generate exactly the same char code // but we want to "eat" the event for because @@ -3461,15 +3635,10 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT // if ((wParam <= 0xff) && (ch==0x0d || ch==0x08)) { - result = OnChar(ch,ch==0x0d ? VK_RETURN : VK_BACK,true); + result = OnChar(wParam, ch==0x0d ? VK_RETURN : VK_BACK, false); break; } - - { - char_result = ch; - result = OnChar(char_result,ch,false); - } - + result = OnChar(wParam, ch, (wParam > 0xff)); break; } case WM_SYSKEYUP: @@ -3752,16 +3921,23 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT } case WM_SETFOCUS: - result = DispatchFocus(NS_GOTFOCUS, isMozWindowTakingFocus); - if(gJustGotActivate) { - gJustGotActivate = PR_FALSE; - result = DispatchFocus(NS_ACTIVATE, isMozWindowTakingFocus); - } -#ifdef ACCESSIBILITY - if (nsWindow::gIsAccessibilityOn && !mRootAccessible && mIsTopWidgetWindow) - CreateRootAccessible(); -#endif + if(!gIsDestroyingAny) { + result = DispatchFocus(NS_GOTFOCUS, isMozWindowTakingFocus); + if(gJustGotActivate) { + gJustGotActivate = PR_FALSE; + gJustGotDeactivate = PR_FALSE; + result = DispatchFocus(NS_ACTIVATE, isMozWindowTakingFocus); + } +#ifdef ACCESSIBILITY + if (nsWindow::gIsAccessibilityOn && !mRootAccessible && mIsTopWidgetWindow) + CreateRootAccessible(); +#endif + } else { + nsToolkit *toolkit = NS_STATIC_CAST(nsToolkit *, mToolkit); + VERIFY(::PostMessage(toolkit->GetDispatchWindow(), WM_SETFOCUS, + wParam, lParam)); + } break; case WM_KILLFOCUS: @@ -3850,7 +4026,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT because in testing it seems an accurate harbinger of an impending min/max/restore change (WM_NCCALCSIZE would also work, but it's also sent when merely resizing.)) */ - if (wp->flags & SWP_FRAMECHANGED) { + if (wp->flags & SWP_FRAMECHANGED && ::IsWindowVisible(mWnd)) { WINDOWPLACEMENT pl; pl.length = sizeof(pl); ::GetWindowPlacement(mWnd, &pl); @@ -3866,6 +4042,22 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT InitEvent(event, NS_SIZEMODE); result = DispatchWindowEvent(&event); + + if (pl.showCmd == SW_SHOWMINIMIZED) { + // Deactivate + char className[19]; + ::GetClassName((HWND)wParam, className, 19); + if(strcmp(className, WindowClass())) + isMozWindowTakingFocus = PR_FALSE; + + gJustGotDeactivate = PR_FALSE; + result = DispatchFocus(NS_DEACTIVATE, isMozWindowTakingFocus); + } else if (pl.showCmd == SW_SHOWNORMAL){ + // Make sure we're active + result = DispatchFocus(NS_GOTFOCUS, PR_TRUE); + result = DispatchFocus(NS_ACTIVATE, PR_TRUE); + } + NS_RELEASE(event.widget); } break; @@ -3928,6 +4120,8 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT break; case WM_IME_CHAR: + // We receive double byte char code. No need to worry about the + mIsShiftDown = PR_FALSE; result = OnIMEChar((BYTE)(wParam>>8), (BYTE) (wParam & 0x00FF), lParam); @@ -5145,6 +5339,10 @@ NS_METHOD nsWindow::SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight) } #define ZH_CN_INTELLEGENT_ABC_IME ((HKL)0xe0040804L) +#define ZH_CN_MS_PINYIN_IME_3_0 ((HKL)0xe00e0804L) +#define ZH_CN_NEIMA_IME ((HKL)0xe0050804L) +#define USE_OVERTHESPOT_IME(kl) ((nsToolkit::mIsWinXP) \ + && (ZH_CN_MS_PINYIN_IME_3_0 == (kl))) void nsWindow::HandleTextEvent(HIMC hIMEContext,PRBool aCheckAttr) @@ -5242,7 +5440,7 @@ nsWindow::HandleTextEvent(HIMC hIMEContext,PRBool aCheckAttr) } -void +BOOL nsWindow::HandleStartComposition(HIMC hIMEContext) { NS_ASSERTION( !mIMEIsComposing, "conflict state"); @@ -5261,6 +5459,27 @@ nsWindow::HandleStartComposition(HIMC hIMEContext) // // Post process event // + if (USE_OVERTHESPOT_IME(gKeyboardLayout)) { + LOGFONT lf; + NS_IMM_GETCOMPOSITIONFONT(hIMEContext, &lf); + lf.lfHeight = event.theReply.mCursorPosition.height; + NS_IMM_SETCOMPOSITIONFONT(hIMEContext, &lf); + + COMPOSITIONFORM cf; + memset(&cf, NULL, sizeof(COMPOSITIONFORM)); + cf.dwStyle = CFS_POINT; + cf.ptCurrentPos.x = event.theReply.mCursorPosition.x + IME_X_OFFSET; + cf.ptCurrentPos.y = event.theReply.mCursorPosition.y + IME_Y_OFFSET; + NS_IMM_SETCOMPOSITIONWINDOW(hIMEContext, &cf); + + InitEvent(event,NS_COMPOSITION_END,&point); + event.eventStructType = NS_COMPOSITION_END; + event.compositionMessage = NS_COMPOSITION_END; + (void)DispatchWindowEvent(&event); + NS_RELEASE(event.widget); + return PR_FALSE; + } + if((0 != event.theReply.mCursorPosition.width) || (0 != event.theReply.mCursorPosition.height) ) { @@ -5290,6 +5509,7 @@ nsWindow::HandleStartComposition(HIMC hIMEContext) mIMECompUnicode = new nsAutoString(); mIMEIsComposing = PR_TRUE; + return PR_TRUE; } void @@ -5459,14 +5679,58 @@ BOOL nsWindow::OnIMEChar(BYTE aByte1, BYTE aByte2, LPARAM aKeyState) #ifdef DEBUG_IME printf("OnIMEChar\n"); #endif - NS_ASSERTION(PR_TRUE, "should not got an WM_IME_CHAR"); + wchar_t uniChar; + char charToConvert[3]; + size_t length; + int err = 0; - // not implement yet - return PR_FALSE; + if (aByte1) { + charToConvert[0] = aByte1; + charToConvert[1] = aByte2; + length=2; + } + else { + charToConvert[0] = aByte2; + length=1; + } + err = ::MultiByteToWideChar(gCurrentKeyboardCP, MB_PRECOMPOSED, charToConvert, length, + &uniChar, 1); + +#ifdef DEBUG_IME + if (!err) { + DWORD lastError = ::GetLastError(); + switch (lastError) + { + case ERROR_INSUFFICIENT_BUFFER: + printf("ERROR_INSUFFICIENT_BUFFER\n"); + break; + + case ERROR_INVALID_FLAGS: + printf("ERROR_INVALID_FLAGS\n"); + break; + + case ERROR_INVALID_PARAMETER: + printf("ERROR_INVALID_PARAMETER\n"); + break; + + case ERROR_NO_UNICODE_TRANSLATION: + printf("ERROR_NO_UNICODE_TRANSLATION\n"); + break; + } + } +#endif + + // We need to return TRUE here so that Windows doesnt' + // send two WM_CHAR msgs + DispatchKeyEvent(NS_KEY_PRESS, uniChar, 0, 0); + return PR_TRUE; } //========================================================================== BOOL nsWindow::OnIMEComposition(LPARAM aGCS) { + if (USE_OVERTHESPOT_IME(gKeyboardLayout)) + return PR_FALSE; + #ifdef DEBUG_IME printf("OnIMEComposition\n"); #endif @@ -5720,6 +5984,9 @@ BOOL nsWindow::OnIMECompositionFull() //========================================================================== BOOL nsWindow::OnIMEEndComposition() { + if (USE_OVERTHESPOT_IME(gKeyboardLayout)) + return PR_FALSE; + #ifdef DEBUG_IME printf("OnIMEEndComposition\n"); #endif @@ -5954,7 +6221,9 @@ BOOL nsWindow::OnIMESetContext(BOOL aActive, LPARAM& aISC) if(! aActive) ResetInputState(); - aISC &= ~ ISC_SHOWUICOMPOSITIONWINDOW; + if (!USE_OVERTHESPOT_IME(gKeyboardLayout)) + aISC &= ~ ISC_SHOWUICOMPOSITIONWINDOW; + // We still return false here because we need to pass the // aISC w/ ISC_SHOWUICOMPOSITIONWINDOW clear to the default // window proc so it will draw the candidcate window for us... @@ -5976,9 +6245,9 @@ BOOL nsWindow::OnIMEStartComposition() if (hIMEContext==NULL) return PR_TRUE; - HandleStartComposition(hIMEContext); + PRBool rtn = HandleStartComposition(hIMEContext); NS_IMM_RELEASECONTEXT(mWnd, hIMEContext); - return PR_TRUE; + return rtn; } //========================================================================== diff --git a/mozilla/widget/src/windows/nsWindow.h b/mozilla/widget/src/windows/nsWindow.h index 01271489e59..728cfc6486b 100644 --- a/mozilla/widget/src/windows/nsWindow.h +++ b/mozilla/widget/src/windows/nsWindow.h @@ -83,6 +83,9 @@ class nsIMM typedef LONG (CALLBACK *SetCStatusPtr) (HIMC,DWORD,DWORD); typedef LONG (CALLBACK *NotifyIMEPtr) (HIMC,DWORD,DWORD,DWORD); typedef LONG (CALLBACK *SetCandWindowPtr) (HIMC,LPCANDIDATEFORM); + typedef LONG (CALLBACK *SetCompWindowPtr) (HIMC,LPCOMPOSITIONFORM); + typedef LONG (CALLBACK *GetCompFontPtr) (HIMC, PLOGFONT); + typedef LONG (CALLBACK *SetCompFontPtr) (HIMC, PLOGFONT); typedef LONG (CALLBACK *GetCompWindowPtr) (HIMC,LPCOMPOSITIONFORM); typedef LONG (CALLBACK *GetPropertyPtr) (HKL, DWORD); @@ -123,6 +126,21 @@ public: mGetCompositionWindow=(mInstance) ? (GetCompWindowPtr)GetProcAddress(mInstance,"ImmGetCompositionWindow") : 0; NS_ASSERTION(mGetCompositionWindow!=NULL,"nsIMM.ImmGetCompositionWindow failed."); + + mGetCompositionFontA=(mInstance) ? (GetCompFontPtr)GetProcAddress(mInstance,"ImmGetCompositionFontA") : 0; + NS_ASSERTION(mGetCompositionFontA!=NULL,"nsIMM.ImmGetCompositionFontA failed."); + + mGetCompositionFontW=(mInstance) ? (GetCompFontPtr)GetProcAddress(mInstance,"ImmGetCompositionFontW") : 0; + NS_ASSERTION(mGetCompositionFontW!=NULL,"nsIMM.ImmGetCompositionFontW failed."); + + mSetCompositionFontA=(mInstance) ? (SetCompFontPtr)GetProcAddress(mInstance,"ImmSetCompositionFontA") : 0; + NS_ASSERTION(mSetCompositionFontA!=NULL,"nsIMM.ImmSetCompositionFontA failed."); + + mSetCompositionFontW=(mInstance) ? (SetCompFontPtr)GetProcAddress(mInstance,"ImmSetCompositionFontW") : 0; + NS_ASSERTION(mSetCompositionFontW!=NULL,"nsIMM.ImmSetCompositionFontW failed."); + + mSetCompositionWindow=(mInstance) ? (SetCompWindowPtr)GetProcAddress(mInstance,"ImmSetCompositionWindow") : 0; + NS_ASSERTION(mSetCompositionWindow!=NULL,"nsIMM.ImmSetCompositionWindow failed."); mGetProperty=(mInstance) ? (GetPropertyPtr)GetProcAddress(mInstance,"ImmGetProperty") : 0; NS_ASSERTION(mGetProperty!=NULL,"nsIMM.ImmGetProperty failed."); @@ -141,6 +159,11 @@ public: mNotifyIME=0; mSetCandiateWindow=0; mGetCompositionWindow=0; + mSetCompositionWindow=0; + mGetCompositionFontA=0; + mGetCompositionFontA=0; + mSetCompositionFontW=0; + mSetCompositionFontW=0; mGetProperty=0; } @@ -176,6 +199,26 @@ public: return (mSetCandiateWindow) ? mSetCandiateWindow(h,l) : 0L; } + LONG SetCompositionWindow(HIMC h,LPCOMPOSITIONFORM l) { + return (mSetCompositionWindow) ? mSetCompositionWindow(h,l) : 0L; + } + + LONG GetCompositionFontA(HIMC h, PLOGFONT l) { + return (mGetCompositionFontA) ? mGetCompositionFontA(h,l) : 0L; + } + + LONG GetCompositionFontW(HIMC h, PLOGFONT l) { + return (mGetCompositionFontW) ? mGetCompositionFontW(h,l) : 0L; + } + + LONG SetCompositionFontA(HIMC h, PLOGFONT l) { + return (mSetCompositionFontA) ? mSetCompositionFontA(h,l) : 0L; + } + + LONG SetCompositionFontW(HIMC h, PLOGFONT l) { + return (mSetCompositionFontW) ? mSetCompositionFontW(h,l) : 0L; + } + LONG GetCompositionWindow(HIMC h,LPCOMPOSITIONFORM l) { return (mGetCompositionWindow) ? mGetCompositionWindow(h,l) : 0L; } @@ -195,6 +238,11 @@ private: SetCStatusPtr mSetConversionStatus; NotifyIMEPtr mNotifyIME; SetCandWindowPtr mSetCandiateWindow; + SetCompWindowPtr mSetCompositionWindow; + GetCompFontPtr mGetCompositionFontA; + GetCompFontPtr mGetCompositionFontW; + SetCompFontPtr mSetCompositionFontA; + SetCompFontPtr mSetCompositionFontW; GetCompWindowPtr mGetCompositionWindow; GetPropertyPtr mGetProperty; }; @@ -412,7 +460,7 @@ protected: void GetNonClientBounds(nsRect &aRect); void HandleTextEvent(HIMC hIMEContext, PRBool aCheckAttr=PR_TRUE); - void HandleStartComposition(HIMC hIMEContext); + BOOL HandleStartComposition(HIMC hIMEContext); void HandleEndComposition(void); void MapDBCSAtrributeArrayToUnicodeOffsets(PRUint32* textRangeListLengthResult, nsTextRangeArray* textRangeListResult); @@ -429,22 +477,29 @@ private: protected: nsSize mLastSize; static nsWindow* gCurrentWindow; - PRBool mIsTopWidgetWindow; nsPoint mLastPoint; HWND mWnd; #if 0 HPALETTE mPalette; #endif WNDPROC mPrevWndProc; - - PRBool mHas3DBorder; HBRUSH mBrush; - PRBool mIsShiftDown; - PRBool mIsControlDown; - PRBool mIsAltDown; - PRBool mIsDestroying; - PRBool mOnDestroyCalled; - PRBool mIsVisible; + + PRPackedBool mIsTopWidgetWindow; + PRPackedBool mHas3DBorder; + PRPackedBool mIsShiftDown; + PRPackedBool mIsControlDown; + PRPackedBool mIsAltDown; + PRPackedBool mIsDestroying; + PRPackedBool mOnDestroyCalled; + PRPackedBool mIsVisible; + PRPackedBool mIMEIsComposing; + PRPackedBool mIMEIsStatusChanged; + PRPackedBool mIsInMouseCapture; + PRPackedBool mIsInMouseWheelProcessing; + + char mLeadByte; + // XXX Temporary, should not be caching the font nsFont * mFont; @@ -459,8 +514,6 @@ protected: // For Input Method Support DWORD mIMEProperty; - PRBool mIMEIsComposing; - PRBool mIMEIsStatusChanged; nsCString* mIMECompString; nsString* mIMECompUnicode; PRUint8* mIMEAttributeString; @@ -476,9 +529,6 @@ protected: static UINT gCurrentKeyboardCP; static HKL gKeyboardLayout; - PRBool mIsInMouseCapture; - PRBool mIsInMouseWheelProcessing; - // Drag & Drop nsNativeDragTarget * mNativeDragTarget; @@ -513,6 +563,11 @@ protected: IAccessible* mRootAccessible; static BOOL gIsAccessibilityOn; #endif + + static BOOL CALLBACK BroadcastMsgToChildren(HWND aWnd, LPARAM aMsg); + static BOOL CALLBACK BroadcastMsg(HWND aTopWindow, LPARAM aMsg); +public: + static void GlobalMsgWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); }; // diff --git a/mozilla/widget/src/xlib/Makefile.in b/mozilla/widget/src/xlib/Makefile.in index dd2348aafb5..3a9958268d3 100644 --- a/mozilla/widget/src/xlib/Makefile.in +++ b/mozilla/widget/src/xlib/Makefile.in @@ -31,7 +31,7 @@ MODULE = widget LIBRARY_NAME = widget_xlib EXPORT_LIBRARY = 1 IS_COMPONENT = 1 -MODULE_NAME = nsWidgetXLibModule +MODULE_NAME = nsWidgetXLIBModule REQUIRES = xpcom \ string \ appshell \ diff --git a/mozilla/xpfe/browser/resources/content/browser.js b/mozilla/xpfe/browser/resources/content/browser.js index e368c2f7c88..921e893a47c 100644 --- a/mozilla/xpfe/browser/resources/content/browser.js +++ b/mozilla/xpfe/browser/resources/content/browser.js @@ -39,6 +39,8 @@ * ***** END LICENSE BLOCK ***** */ const nsIWebNavigation = Components.interfaces.nsIWebNavigation; +var gPrintSettingsAreGlobal = true; +var gSavePrintSettings = true; var gPrintSettings = null; var gChromeState = null; // chrome state before we went into print preview var gOldCloseHandler = null; // close handler before we went into print preview @@ -196,23 +198,28 @@ function BrowserExitPrintPreview() mainWin.setAttribute("onclose", gOldCloseHandler); } -function GetPrintSettings(webBrowserPrint) +function GetPrintSettings() { var prevPS = gPrintSettings; try { if (gPrintSettings == null) { - var useGlobalPrintSettings = true; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (pref) { - useGlobalPrintSettings = pref.getBoolPref("print.use_global_printsettings", false); + gPrintSettingsAreGlobal = pref.getBoolPref("print.use_global_printsettings", false); + gSavePrintSettings = pref.getBoolPref("print.save_print_settings", false); } - if (useGlobalPrintSettings) { - gPrintSettings = webBrowserPrint.globalPrintSettings; + var psService = Components.classes["@mozilla.org/gfx/printsettings-service;1"] + .getService(Components.interfaces.nsIPrintSettingsService); + if (gPrintSettingsAreGlobal) { + gPrintSettings = psService.globalPrintSettings; + if (gSavePrintSettings) { + psService.initPrintSettingsFromPrefs(gPrintSettings, false, gPrintSettings.kInitSaveNativeData); + } } else { - gPrintSettings = webBrowserPrint.newPrintSettings; + gPrintSettings = psService.newPrintSettings; } } } catch (e) { @@ -244,8 +251,8 @@ function BrowserPrintPreview() var webBrowserPrint = ifreq.getInterface( Components.interfaces.nsIWebBrowserPrint); if (webBrowserPrint) { - gPrintSettings = GetPrintSettings(webBrowserPrint); - webBrowserPrint.printPreview(gPrintSettings); + gPrintSettings = GetPrintSettings(); + webBrowserPrint.printPreview(gPrintSettings, null, null); } // show the toolbar after we go into print preview mode so @@ -269,18 +276,22 @@ function BrowserPrintSetup() var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint); if (webBrowserPrint) { - gPrintSettings = GetPrintSettings(webBrowserPrint); + gPrintSettings = GetPrintSettings(); } didOK = goPageSetup(window, gPrintSettings); // from utilityOverlay.js if (didOK) { if (webBrowserPrint) { + if (gPrintSettingsAreGlobal && gSavePrintSettings) { + var psService = Components.classes["@mozilla.org/gfx/printsettings-service;1"] + .getService(Components.interfaces.nsIPrintSettingsService); + psService.savePrintSettingsToPrefs(gPrintSettings, false, gPrintSettings.kInitSaveNativeData); + } if (webBrowserPrint.doingPrintPreview) { - webBrowserPrint.printPreview(gPrintSettings); + webBrowserPrint.printPreview(gPrintSettings, null, null); } } } - } catch (e) { dump("BrowserPrintSetup "+e); } @@ -293,7 +304,7 @@ function BrowserPrint() var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint); if (webBrowserPrint) { - gPrintSettings = GetPrintSettings(webBrowserPrint); + gPrintSettings = GetPrintSettings(); webBrowserPrint.print(gPrintSettings, null); } } catch (e) { diff --git a/mozilla/xpfe/browser/resources/content/contents-region.rdf b/mozilla/xpfe/browser/resources/content/contents-region.rdf index c1d474d2c5a..6ec02db93f4 100644 --- a/mozilla/xpfe/browser/resources/content/contents-region.rdf +++ b/mozilla/xpfe/browser/resources/content/contents-region.rdf @@ -11,7 +11,7 @@ + chrome:localeVersion="1.0.1rc1"> diff --git a/mozilla/xpfe/browser/resources/content/contents.rdf b/mozilla/xpfe/browser/resources/content/contents.rdf index a09ef74bbfd..b63b7310da0 100644 --- a/mozilla/xpfe/browser/resources/content/contents.rdf +++ b/mozilla/xpfe/browser/resources/content/contents.rdf @@ -12,7 +12,7 @@ chrome:displayName="Navigator" chrome:author="mozilla.org" chrome:name="navigator" - chrome:localeVersion="1.0.0final" + chrome:localeVersion="1.0.1rc1" chrome:skinVersion="1.0"> diff --git a/mozilla/xpfe/browser/resources/content/mac/contents-platform.rdf b/mozilla/xpfe/browser/resources/content/mac/contents-platform.rdf index 2383bfc088e..9b4757fecfd 100644 --- a/mozilla/xpfe/browser/resources/content/mac/contents-platform.rdf +++ b/mozilla/xpfe/browser/resources/content/mac/contents-platform.rdf @@ -12,6 +12,6 @@ chrome:displayName="Mac Specific Resources" chrome:author="mozilla.org" chrome:name="navigator-platform" - chrome:localeVersion="1.0.0final"> + chrome:localeVersion="1.0.1rc1"> diff --git a/mozilla/xpfe/browser/resources/content/navigator.js b/mozilla/xpfe/browser/resources/content/navigator.js index 34cf08357f7..2420c4b6448 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.js +++ b/mozilla/xpfe/browser/resources/content/navigator.js @@ -104,8 +104,10 @@ const gTabStripPrefListener = return; var stripVisibility = !pref.getBoolPref(prefName); - if (gBrowser.mTabContainer.childNodes.length == 1) + if (gBrowser.mTabContainer.childNodes.length == 1) { gBrowser.setStripVisibilityTo(stripVisibility); + pref.setBoolPref("browser.tabs.forceHide", false); + } } }; @@ -292,6 +294,23 @@ function allLeftButtonsAreHidden() return true; } +function RegisterTabOpenObserver() +{ + const observer = { + observe: function(subject, topic, data) + { + if (topic != "open-new-tab-request" || subject != window) + return; + + delayedOpenTab(data); + } + }; + + const service = Components.classes["@mozilla.org/observer-service;1"] + .getService(Components.interfaces.nsIObserverService); + service.addObserver(observer, "open-new-tab-request", false); +} + function Startup() { // init globals @@ -449,6 +468,8 @@ function Startup() remoteService = Components.classes[XREMOTESERVICE_CONTRACTID] .getService(Components.interfaces.nsIXRemoteService); remoteService.addBrowserInstance(window); + + RegisterTabOpenObserver(); } } @@ -645,16 +666,12 @@ function OpenBookmarkGroupFromResource(resource, datasource, rdf) { var tabPanels = gBrowser.mPanelContainer.childNodes; var tabCount = tabPanels.length; var index = 0; - while (containerChildren.hasMoreElements()) { + for (; containerChildren.hasMoreElements(); ++index) { var resource = containerChildren.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var target = datasource.GetTarget(resource, urlResource, true); if (target) { var uri = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; - if (index < tabCount) - tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE); - else - gBrowser.addTab(uri); - index++; + gBrowser.addTab(uri); } } @@ -663,11 +680,7 @@ function OpenBookmarkGroupFromResource(resource, datasource, rdf) { // Select the first tab in the group. var tabs = gBrowser.mTabContainer.childNodes; - gBrowser.selectedTab = tabs[0]; - - // Close any remaining open tabs that are left over. - for (var i = tabCount-1; i >= index; i--) - gBrowser.removeTab(tabs[i]); + gBrowser.selectedTab = tabs[tabCount]; } function OpenBookmarkURL(node, datasources) @@ -721,6 +734,17 @@ function addBookmarkAs() BookmarksUtils.addBookmarkForBrowser(gBrowser.webNavigation, true); } +function addGroupmarkAs() +{ + BookmarksUtils.addBookmarkForTabBrowser(gBrowser, true); +} + +function updateGroupmarkMenuitem(id) +{ + const disabled = gBrowser.browsers.length == 1; + document.getElementById(id).setAttribute("disabled", disabled); +} + function readRDFString(aDS,aRes,aProp) { var n = aDS.GetTarget(aRes, aProp, true); @@ -773,6 +797,15 @@ function getSearchUrl(attr) return searchURL; } +function QualifySearchTerm() +{ + // If the text in the URL bar is the same as the currently loaded + // page's URL then treat this as an empty search term. This way + // the user is taken to the search page where s/he can enter a term. + if (window.XULBrowserWindow.userTyped.value) + return document.getElementById("urlbar").value; + return ""; +} function OpenSearch(tabName, forceDialogFlag, searchStr, newWindowFlag) { @@ -1649,29 +1682,45 @@ function updateComponentBarBroadcaster() function updateToolbarStates(toolbarMenuElt) { - if (gHaveUpdatedToolbarState) { - updateComponentBarBroadcaster(); - return; - } - var mainWindow = document.getElementById("main-window"); - if (mainWindow.hasAttribute("chromehidden")) { - gHaveUpdatedToolbarState = true; - var i; - for (i = 0; i < toolbarMenuElt.childNodes.length; ++i) - document.getElementById(toolbarMenuElt.childNodes[i].getAttribute("observes")).removeAttribute("checked"); - var toolbars = document.getElementsByTagName("toolbar"); - for (i = 0; i < toolbars.length; ++i) { - if (toolbars[i].getAttribute("class").indexOf("chromeclass") != -1) - toolbars[i].setAttribute("hidden", "true"); + if (!gHaveUpdatedToolbarState) { + var mainWindow = document.getElementById("main-window"); + if (mainWindow.hasAttribute("chromehidden")) { + gHaveUpdatedToolbarState = true; + var i; + for (i = 0; i < toolbarMenuElt.childNodes.length; ++i) + document.getElementById(toolbarMenuElt.childNodes[i].getAttribute("observes")).removeAttribute("checked"); + var toolbars = document.getElementsByTagName("toolbar"); + for (i = 0; i < toolbars.length; ++i) { + if (toolbars[i].getAttribute("class").indexOf("chromeclass") != -1) + toolbars[i].setAttribute("hidden", "true"); + } + var statusbars = document.getElementsByTagName("statusbar"); + for (i = 0; i < statusbars.length; ++i) { + if (statusbars[i].getAttribute("class").indexOf("chromeclass") != -1) + statusbars[i].setAttribute("hidden", "true"); + } + mainWindow.removeAttribute("chromehidden"); } - var statusbars = document.getElementsByTagName("statusbar"); - for (i = 0; i < statusbars.length; ++i) { - if (statusbars[i].getAttribute("class").indexOf("chromeclass") != -1) - statusbars[i].setAttribute("hidden", "true"); - } - mainWindow.removeAttribute("chromehidden"); } updateComponentBarBroadcaster(); + + const tabbarMenuItem = document.getElementById("menuitem_showhide_tabbar"); + // Make show/hide menu item reflect current state + const visibility = gBrowser.getStripVisibility(); + tabbarMenuItem.setAttribute("checked", visibility); + + // Don't allow the tab bar to be shown/hidden when more than one tab is open + // or when we have 1 tab and the autoHide pref is set + const disabled = gBrowser.browsers.length > 1 || + pref.getBoolPref("browser.tabs.autoHide"); + tabbarMenuItem.setAttribute("disabled", disabled); +} + +function showHideTabbar() +{ + const visibility = gBrowser.getStripVisibility(); + pref.setBoolPref("browser.tabs.forceHide", visibility); + gBrowser.setStripVisibilityTo(!visibility); } // Fill in tooltips for personal toolbar diff --git a/mozilla/xpfe/browser/resources/content/navigator.xul b/mozilla/xpfe/browser/resources/content/navigator.xul index 06cefca0733..1171d1c6125 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.xul +++ b/mozilla/xpfe/browser/resources/content/navigator.xul @@ -164,6 +164,7 @@ Contributor(s): ______________________________________. --> showCommentColumn="true" inputtooltiptext="&locationBar.tooltip;" oninput="window.XULBrowserWindow.userTyped.value=true;" + ondragdrop="window.XULBrowserWindow.userTyped.value=true;alert('foo');" ontextcommand="return handleURLBarCommand(eventParam, domEvent);" ontextrevert="return handleURLBarRevert();" onfocus="URLBarFocusHandler(event);" @@ -200,7 +201,7 @@ Contributor(s): ______________________________________. -->