From e12be2f7fb5f55553795b7c4168007173511d581 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 29 Dec 1999 14:21:38 +0000 Subject: [PATCH] Tidied some doc references; added Stefan's Blit optimisation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/function.tex | 40 ++++++++++++++++++++------------- docs/latex/wx/htlnkinf.tex | 12 +--------- docs/latex/wx/list.tex | 27 +++++++++++----------- docs/latex/wx/menu.tex | 34 ++++++++-------------------- docs/latex/wx/toolbar.tex | 5 +---- docs/latex/wx/tthreads.tex | 2 +- src/msw/dc.cpp | 46 +++++++++++++++++++++++++------------- 7 files changed, 81 insertions(+), 85 deletions(-) diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index f4196b4223..d4003c3291 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -90,7 +90,9 @@ configuration, can be handlers for BMP (loading) (always installed), GIF (loading), PCX (loading), PNM (loading and saving as raw rgb), PNG (loading and saving), JPEG (loading and saving), file formats. -See also: \helpref{wxImage}{wximage} \helpref{wxImageHandler}{wximagehandler} +\wxheading{See also} + +\helpref{wxImage}{wximage}, \helpref{wxImageHandler}{wximagehandler} \membersection{::wxIsAbsolutePath} @@ -258,7 +260,9 @@ Use of this function requires the file wx\_doc.h to be included. Returns the FQDN (fully qualified domain host name) or an empty string on error. -See also: \helpref{wxGetHostName}{wxgethostname} +\wxheading{See also} + +\helpref{wxGetHostName}{wxgethostname} \wxheading{Include files} @@ -296,7 +300,9 @@ The first variant of this function returns the hostname if successful or an empty string otherwise. The second (deprecated) function returns TRUE if successful, FALSE otherwise. -See also: \helpref{wxGetFullHostName}{wxgetfullhostname} +\wxheading{See also} + +\helpref{wxGetFullHostName}{wxgetfullhostname} \wxheading{Include files} @@ -321,7 +327,9 @@ The first variant of this function returns the login name if successful or an empty string otherwise. The second (deprecated) function returns TRUE if successful, FALSE otherwise. -See also: \helpref{wxGetUserName}{wxgetusername} +\wxheading{See also} + +\helpref{wxGetUserName}{wxgetusername} \wxheading{Include files} @@ -344,7 +352,9 @@ The first variant of this function returns the user name if successful or an empty string otherwise. The second (deprecated) function returns TRUE if successful, FALSE otherwise. -See also: \helpref{wxGetUserId}{wxgetuserid} +\wxheading{See also} + +\helpref{wxGetUserId}{wxgetuserid} \wxheading{Include files} @@ -427,20 +437,20 @@ buffer is never overflowed. Returns the number of characters copied to the buffer or -1 if there is not enough space. -\wxheading{See also:} -\helpref{wxVsnprintf}{wxvsnprintf}, -\helpref{wxString::Printf}{wxstringprintf} +\wxheading{See also} + +\helpref{wxVsnprintf}{wxvsnprintf}, \helpref{wxString::Printf}{wxstringprintf} -\membersection{::wxVsnprintf}\label{wxsnprintf} +\membersection{::wxVsnprintf}\label{wxvsnprintf} \func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argptr}} The same as \helpref{wxSnprintf}{wxsnprintf} but takes a {\tt va\_list} argument instead of arbitrary number of parameters. -\wxheading{See also:} -\helpref{wxSnprintf}{wxsnprintf}, -\helpref{wxString::PrintfV}{wxstringprintfv} +\wxheading{See also} + +\helpref{wxSnprintf}{wxsnprintf}, \helpref{wxString::PrintfV}{wxstringprintfv} \section{Dialog functions}\label{dialogfunctions} @@ -462,7 +472,7 @@ used with \helpref{wxShowTip}{wxshowtip}. \docparam{currentTip}{The index of the first tip to show - normally this index is remembered between the 2 program runs.} -\wxheading{See also:} +\wxheading{See also} \helpref{Tips overview}{tipsoverview} @@ -691,7 +701,7 @@ It may be created with the \helpref{wxCreateFileTipProvider}{wxcreatefiletipprov otherwise. This is used as the initial value for "Show tips at startup" checkbox which is shown in the tips dialog.} -\wxheading{See also:} +\wxheading{See also} \helpref{Tips overview}{tipsoverview} @@ -1293,7 +1303,7 @@ Under X only, returns the current display name. See also \helpref{wxSetDisplayNa Return the (current) user's home directory. -\wxheading{See also:} +\wxheading{See also} \helpref{wxGetUserHome}{wxgetuserhome} diff --git a/docs/latex/wx/htlnkinf.tex b/docs/latex/wx/htlnkinf.tex index a6aca8d507..5c5d8e08c4 100644 --- a/docs/latex/wx/htlnkinf.tex +++ b/docs/latex/wx/htlnkinf.tex @@ -1,9 +1,3 @@ -% -% automatically generated by HelpGen from -% x.h at 23/Dec/99 21:30:20 -% - - \section{\class{wxHtmlLinkInfo}}\label{wxhtmllinkinfo} This class stores all neccessary information about hypertext @@ -15,24 +9,19 @@ current implementation it stores URL and target frame name. \helpref{wxObject}{wxobject} - \latexignore{\rtfignore{\wxheading{Members}}} - \membersection{wxHtmlLinkInfo::wxHtmlLinkInfo}\label{wxhtmllinkinfowxhtmllinkinfo} \func{}{wxHtmlLinkInfo}{\void} Default ctor. -\membersection{wxHtmlLinkInfo::wxHtmlLinkInfo}\label{wxhtmllinkinfowxhtmllinkinfo} - \func{}{wxHtmlLinkInfo}{\param{const wxString\& }{href}, \param{const wxString\& }{target = wxEmptyString}} Construct hypertext link from HREF (aka URL) and TARGET (name of target frame). - \membersection{wxHtmlLinkInfo::GetHref}\label{wxhtmllinkinfogethref} \func{wxString}{GetHref}{\void} @@ -46,3 +35,4 @@ Returns {\it HREF} value of the {\tt } tag. Returns {\it TARGET} value of the {\tt } tag (this value is used to specify in which frame should be the page pointed by {\helpref{Href}{wxhtmllinkinfogethref} opened). + diff --git a/docs/latex/wx/list.tex b/docs/latex/wx/list.tex index f3fd9c8e1b..5e49493589 100644 --- a/docs/latex/wx/list.tex +++ b/docs/latex/wx/list.tex @@ -157,7 +157,7 @@ terminating NULL. Destroys the list. Also destroys any remaining nodes, but does not destroy client data held in the nodes. -\membersection{wxList::Append} +\membersection{wxList::Append}\label{wxlistappend} \func{wxNode *}{Append}{\param{wxObject *}{object}} @@ -171,7 +171,7 @@ later retrieval using the key. The new node is returned in each case. The key string is copied and stored by the list implementation. -\membersection{wxList::Clear} +\membersection{wxList::Clear}\label{wxlistclear} \func{void}{Clear}{\void} @@ -184,20 +184,20 @@ Clears the list (but does not delete the client data stored with each node). If {\it destroy} is TRUE, instructs the list to call {\it delete} on the client contents of a node whenever the node is destroyed. The default is FALSE. -\membersection{wxList::DeleteNode} +\membersection{wxList::DeleteNode}\label{wxlistdeletenode} \func{bool}{DeleteNode}{\param{wxNode *}{node}} Deletes the given node from the list, returning TRUE if successful. -\membersection{wxList::DeleteObject} +\membersection{wxList::DeleteObject}\label{wxlistdeleteobject} \func{bool}{DeleteObject}{\param{wxObject *}{object}} Finds the given client {\it object} and deletes the appropriate node from the list, returning TRUE if successful. The application must delete the actual object separately. -\membersection{wxList::Find} +\membersection{wxList::Find}\label{wxlistfind} \func{wxNode *}{Find}{\param{long}{ key}} @@ -211,26 +211,26 @@ Returns the node whose stored key matches {\it key}. Use on a keyed list only. Returns the number of elements in the list. -\membersection{wxList::GetFirst} +\membersection{wxList::GetFirst}\label{wxlistgetfirst} \func{wxNode *}{GetFirst}{\void} Returns the first node in the list (NULL if the list is empty). -\membersection{wxList::GetLast} +\membersection{wxList::GetLast}\label{wxlistgetlast} \func{wxNode *}{GetLast}{\void} Returns the last node in the list (NULL if the list is empty). -\membersection{wxList::IndexOf} +\membersection{wxList::IndexOf}\label{wxlistindexof} \func{int}{IndexOf}{\param{wxObject*}{ obj }} Returns the index of {\it obj} within the list or NOT\_FOUND if {\it obj} is not found in the list. -\membersection{wxList::Insert} +\membersection{wxList::Insert}\label{wxlistinsert} \func{wxNode *}{Insert}{\param{wxObject *}{object}} @@ -253,7 +253,7 @@ Inserts the object before the given {\it node}. Returns the node at given position in the list. -\membersection{wxList::Member} +\membersection{wxList::Member}\label{wxlistmember} \func{wxNode *}{Member}{\param{wxObject *}{object}} @@ -261,7 +261,7 @@ Returns the node at given position in the list. Returns the node associated with {\it object} if it is in the list, NULL otherwise. -\membersection{wxList::Nth} +\membersection{wxList::Nth}\label{wxlistnth} \func{wxNode *}{Nth}{\param{int}{ n}} @@ -270,7 +270,7 @@ Returns the node associated with {\it object} if it is in the list, NULL otherwi Returns the {\it nth} node in the list, indexing from zero (NULL if the list is empty or the nth node could not be found). -\membersection{wxList::Number} +\membersection{wxList::Number}\label{wxlistnumber} \func{int}{Number}{\void} @@ -278,7 +278,7 @@ or the nth node could not be found). Returns the number of elements in the list. -\membersection{wxList::Sort} +\membersection{wxList::Sort}\label{wxlistsort} \func{void}{Sort}{\param{wxSortCompareFunction}{ compfunc}} @@ -312,4 +312,3 @@ Example: } \end{verbatim} - diff --git a/docs/latex/wx/menu.tex b/docs/latex/wx/menu.tex index 2d64a26785..85add9a582 100644 --- a/docs/latex/wx/menu.tex +++ b/docs/latex/wx/menu.tex @@ -229,25 +229,6 @@ Enables or disables (greys out) a menu item. Finds the menu item id for a menu item string. -\wxheading{Parameters} - -\docparam{itemString}{Menu item string to find.} - -\wxheading{Return value} - -Menu item identifier, or wxNOT\_FOUND if none is found. - -\wxheading{Remarks} - -Any special menu codes are stripped out of source and target strings -before matching. - -\wxheading{See also} - -\helpref{wxMenu::FindItem}{wxmenufinditem} - -\membersection{wxMenu::FindItem}\label{wxmenufinditem} - \constfunc{wxMenuItem *}{FindItem}{\param{int}{ id}, \param{wxMenu **}{menu = NULL}} Finds the menu item object associated with the given menu item identifier and, @@ -255,6 +236,8 @@ optionally, the (sub)menu it belongs to. \wxheading{Parameters} +\docparam{itemString}{Menu item string to find.} + \docparam{id}{Menu item identifier.} \docparam{menu}{If the pointer is not NULL, it will be filled with the items @@ -262,11 +245,14 @@ parent menu (if the item was found)} \wxheading{Return value} -Returns the menu item object, or NULL if it is not found. +First form: menu item identifier, or wxNOT\_FOUND if none is found. -\wxheading{See also} +Second form: returns the menu item object, or NULL if it is not found. -\helpref{wxMenu::FindItem}{wxmenufinditem} +\wxheading{Remarks} + +Any special menu codes are stripped out of source and target strings +before matching. \pythonnote{The name of this method in wxPython is {\tt FindItemById} and it does not support the second parameter.} @@ -704,7 +690,7 @@ Returns the menu at {\it menuIndex} (zero-based). Returns the number of menus in this menubar. -\membersection{wxMenuBar::Insert}{wxmenubarinsert} +\membersection{wxMenuBar::Insert}\label{wxmenubarinsert} \func{bool}{Insert}{\param{size\_t }{pos}, \param{wxMenu *}{menu}, \param{const wxString\& }{title}} @@ -800,8 +786,6 @@ responsible for deleting it. \helpref{wxMenuBar::Insert}{wxmenubarinsert},\rtfsp \helpref{wxMenuBar::Remove}{wxmenubarremove} -\membersection{wxMenuBar::IsChecked}\label{wxmenubarischecked} - \membersection{wxMenuBar::SetHelpString}\label{wxmenubarsethelpstring} \func{void}{SetHelpString}{\param{int}{ id}, \param{const wxString\& }{helpString}} diff --git a/docs/latex/wx/toolbar.tex b/docs/latex/wx/toolbar.tex index d30db16080..84f98efaf1 100644 --- a/docs/latex/wx/toolbar.tex +++ b/docs/latex/wx/toolbar.tex @@ -544,10 +544,7 @@ A typical use of this member might be to pop up a menu. \func{bool}{Realize}{\void} -This function should be called after you have added tools. It -calls, according to the implementation, -either \helpref{wxToolBar::CreateTools}{wxtoolbarcreatetools} or - \helpref{wxToolBar::Layout}{wxtoolbarlayout}. +This function should be called after you have added tools. If you are using absolute positions for your tools when using a wxToolBarSimple object, do not call this function. You must call it at all other times. diff --git a/docs/latex/wx/tthreads.tex b/docs/latex/wx/tthreads.tex index 2e1d6cb80d..b9ba1b517b 100644 --- a/docs/latex/wx/tthreads.tex +++ b/docs/latex/wx/tthreads.tex @@ -38,7 +38,7 @@ Win32 a thread can only access GDI objects such as pens, brushes, \&c created by itself and not by the other threads). For communication between threads, use -\helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingprocessevent} +\helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent} or its short version \helpref{wxPostEvent}{wxpostevent}. These functions have thread safe implementation so that they can be used as they are for sending event from one thread to another. diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index c111cfa543..45c51e9417 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1230,17 +1230,6 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, else #endif { - // Old code -#if 0 - HDC dc_mask = CreateCompatibleDC((HDC) source->m_hDC); - ::SelectObject(dc_mask, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap()); - success = (BitBlt(GetHdc(), xdest1, ydest1, (int)width, (int)height, - dc_mask, xsrc1, ysrc1, 0x00220326 /* NOTSRCAND */) != 0); - success = (BitBlt(GetHdc(), xdest1, ydest1, (int)width, (int)height, - (HDC) source->m_hDC, xsrc1, ysrc1, SRCPAINT) != 0); - ::SelectObject(dc_mask, 0); - ::DeleteDC(dc_mask); -#endif // New code from Chris Breeze, 15/7/98 // Blit bitmap with mask @@ -1318,11 +1307,37 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, } else { + // If we are printing, source colours are screen colours + // not printer colours and so we need copy the bitmap + // pixel by pixel. if (IsKindOf(CLASSINFO(wxPrinterDC))) { - // If we are printing, source colours are screen colours - // not printer colours and so we need copy the bitmap - // pixel by pixel. + HDC dc_src = (HDC) source->m_hDC; + RECT rect; + for (int y = 0; y < height; y++) + { + // This is Stefan Csomor's optimisation, where + // identical adjacent pixels are drawn together. + // We still need a faster way of drawing bitmaps, + // perhaps converting to a DIB first and using SetDIBitsToDevice. + for (int x = 0; x < width; x++) + { + COLORREF col = ::GetPixel(dc_src, x, y) ; + HBRUSH brush = ::CreateSolidBrush( col ); + + rect.left = xdest1 + x; + rect.top = ydest1 + y; + while( (x + 1 < width) && (::GetPixel(dc_src, x + 1, y) == col ) ) + { + ++x ; + } + rect.right = xdest1 + x + 1; + rect.bottom = rect.top + 1; + ::FillRect((HDC) m_hDC, &rect, brush); + ::DeleteObject(brush); + } + } +/* HDC dc_src = (HDC) source->m_hDC; RECT rect; for (int x = 0; x < width; x++) @@ -1336,7 +1351,8 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, ::DeleteObject(brush); } } - } +*/ + } else { success = (BitBlt(GetHdc(), xdest1, ydest1, (int)width, (int)height, (HDC) source->m_hDC, -- 2.45.2