Skip to content

Commit

Permalink
remove unused code (Windows related)
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@860 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
[email protected] committed Jul 8, 2013
1 parent b5d3d66 commit 10c1169
Show file tree
Hide file tree
Showing 126 changed files with 9 additions and 434 deletions.
153 changes: 0 additions & 153 deletions api/tesseractmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
*
**********************************************************************/

// #define USE_VLD //Uncomment for Visual Leak Detector.
#if (defined _MSC_VER && defined USE_VLD)
#include "mfcpch.h"
#include <vld.h>
#endif

// Include automatically generated configuration file if running autoconf
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
Expand All @@ -32,7 +26,6 @@
#include "baseapi.h"
#include "basedir.h"
#include "strngs.h"
#include "tesseractmain.h"
#include "tprintf.h"

/**********************************************************************
Expand Down Expand Up @@ -229,149 +222,3 @@ int main(int argc, char **argv) {

return 0; // Normal exit
}

#ifdef _WIN32

char szAppName[] = "Tesseract"; //app name
int initialized = 0;

/**********************************************************************
* WinMain
*
* Main function for a windows program.
**********************************************************************/

int WINAPI WinMain( //main for windows //command line
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdLine,
int nCmdShow) {
WNDCLASS wc;
HWND hwnd;
MSG msg;

char **argv;
char *argsin[2];
int argc;
int exit_code;

wc.style = CS_NOCLOSE | CS_OWNDC;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = NULL; //LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = NULL; //LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
wc.lpszMenuName = NULL;
wc.lpszClassName = szAppName;

RegisterClass(&wc);

hwnd = CreateWindow (szAppName, szAppName,
WS_OVERLAPPEDWINDOW | WS_DISABLED,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, HWND_DESKTOP, NULL, hInstance, NULL);

argsin[0] = strdup (szAppName);
argsin[1] = strdup (lpszCmdLine);
/*allocate memory for the args. There can never be more than half*/
/*the total number of characters in the arguments.*/
argv = (char **)malloc(((strlen(argsin[0]) + strlen(argsin[1])) / 2 + 1) *
sizeof(char *));

/*now construct argv as it should be for C.*/
argc = parse_args (2, argsin, argv);

// ShowWindow (hwnd, nCmdShow);
// UpdateWindow (hwnd);

if (initialized) {
exit_code = main (argc, argv);
free (argsin[0]);
free (argsin[1]);
free(argv);
return exit_code;
}
while (GetMessage (&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
if (initialized) {
exit_code = main (argc, argv);
break;
}
else
exit_code = msg.wParam;
}
free (argsin[0]);
free (argsin[1]);
free(argv);
return exit_code;
}


/**********************************************************************
* WndProc
*
* Function to respond to messages.
**********************************************************************/

LONG WINAPI WndProc( //message handler
HWND hwnd, //window with message
UINT msg, //message typ
WPARAM wParam,
LPARAM lParam) {
HDC hdc;

if (msg == WM_CREATE) {
//
// Create a rendering context.
//
hdc = GetDC (hwnd);
ReleaseDC(hwnd, hdc);
initialized = 1;
return 0;
}
return DefWindowProc (hwnd, msg, wParam, lParam);
}


/**********************************************************************
* parse_args
*
* Turn a list of args into a new list of args with each separate
* whitespace spaced string being an arg.
**********************************************************************/

int
parse_args ( /*refine arg list */
int argc, /*no of input args */
char *argv[], /*input args */
char *arglist[] /*output args */
) {
int argcount; /*converted argc */
char *testchar; /*char in option string */
int arg; /*current argument */

argcount = 0; /*no of options */
for (arg = 0; arg < argc; arg++) {
testchar = argv[arg]; /*start of arg */
do {
while (*testchar
&& (*testchar == ' ' || *testchar == '\n'
|| *testchar == '\t'))
testchar++; /*skip white space */
if (*testchar) {
/*new arg */
arglist[argcount++] = testchar;
/*skip to white space */
for (testchar++; *testchar && *testchar != ' ' && *testchar != '\n' && *testchar != '\t'; testchar++) ;
if (*testchar)
*testchar++ = '\0'; /*turn to separate args */
}
}
while (*testchar);
}
return argcount; /*new number of args */
}
#endif
2 changes: 0 additions & 2 deletions ccmain/adaptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#pragma warning(disable:4305) // int/float warnings
#endif

#include "mfcpch.h"

#ifdef __UNIX__
#include <assert.h>
#endif
Expand Down
1 change: 0 additions & 1 deletion ccmain/applybox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
** limitations under the License.
*
**********************************************************************/
#include "mfcpch.h"

#ifdef _MSC_VER
#pragma warning(disable:4244) // Conversion warnings
Expand Down
3 changes: 0 additions & 3 deletions ccmain/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*
**********************************************************************/

#include "mfcpch.h"

#include <string.h>
#include <math.h>
#ifdef __UNIX__
Expand All @@ -42,7 +40,6 @@
#include "secname.h"
#include "output.h"
#include "callcpp.h"
#include "notdll.h"
#include "globals.h"
#include "sorthelper.h"
#include "tesseractclass.h"
Expand Down
1 change: 0 additions & 1 deletion ccmain/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "ratngs.h"
#include "statistc.h"
#include "pageres.h"
#include "notdll.h"

enum ACCEPTABLE_WERD_TYPE
{
Expand Down
1 change: 0 additions & 1 deletion ccmain/docqual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#pragma warning(disable:4244) // Conversion warnings
#endif

#include "mfcpch.h"
#include <ctype.h>
#include "docqual.h"
#include "tfacep.h"
Expand Down
1 change: 0 additions & 1 deletion ccmain/docqual.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define DOCQUAL_H

#include "control.h"
#include "notdll.h"

enum GARBAGE_LEVEL
{
Expand Down
1 change: 0 additions & 1 deletion ccmain/fixspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*
**********************************************************************/

#include "mfcpch.h"
#include <ctype.h>
#include "reject.h"
#include "statistc.h"
Expand Down
1 change: 0 additions & 1 deletion ccmain/fixspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "pageres.h"
#include "params.h"
#include "notdll.h"

void initialise_search(WERD_RES_LIST &src_list, WERD_RES_LIST &new_list);
void transform_to_next_perm(WERD_RES_LIST &words);
Expand Down
1 change: 0 additions & 1 deletion ccmain/fixxht.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*
**********************************************************************/

#include "mfcpch.h"
#include <string.h>
#include <ctype.h>
#include "params.h"
Expand Down
1 change: 0 additions & 1 deletion ccmain/imgscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#pragma warning(disable:4244) // Conversion warnings
#endif

#include "mfcpch.h"
#include <stdio.h>
#include <stdlib.h>
#include "errcode.h"
Expand Down
1 change: 0 additions & 1 deletion ccmain/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#pragma warning(disable:4244) // Conversion warnings
#endif

#include "mfcpch.h"
#include <string.h>
#include <ctype.h>
#ifdef __UNIX__
Expand Down
1 change: 0 additions & 1 deletion ccmain/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "params.h"
//#include "epapconv.h"
#include "pageres.h"
#include "notdll.h"

/** test line ends */
char determine_newline_type(WERD *word, ///< word to do
Expand Down
1 change: 0 additions & 1 deletion ccmain/pagewalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*
**********************************************************************/

#include "mfcpch.h"
#include "pageres.h"
#include "tesseractclass.h"

Expand Down
1 change: 0 additions & 1 deletion ccmain/pgedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "werd.h"
#include "rect.h"
#include "params.h"
#include "notdll.h"
#include "tesseractclass.h"

class ScrollView;
Expand Down
3 changes: 0 additions & 3 deletions ccmain/reject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#pragma warning(disable:4305) // int/float warnings
#endif

#include "mfcpch.h"

#include "tessvars.h"
#ifdef __UNIX__
#include <assert.h>
Expand All @@ -45,7 +43,6 @@
/* #define SECURE_NAMES done in secnames.h when necessary */

#include "tesseractclass.h"
#include "notdll.h"

// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
Expand Down
1 change: 0 additions & 1 deletion ccmain/reject.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "params.h"
#include "pageres.h"
#include "notdll.h"

void reject_blanks(WERD_RES *word);
void reject_poor_matches(WERD_RES *word, BLOB_CHOICE_LIST_CLIST *blob_choices);
Expand Down
3 changes: 0 additions & 3 deletions ccmain/scaleimg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@
#pragma warning(disable:4244) // Conversion warnings
#endif

#include "mfcpch.h"
#include <stdlib.h>
#include <string.h>
#include "fileerr.h"
#include "tprintf.h"
//#include "grphics.h"
#include "img.h"
//#include "basefile.h"
#include "imgscale.h"
#include "scaleimg.h"

Expand Down
1 change: 0 additions & 1 deletion ccmain/tessbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#pragma warning(disable:4244) // Conversion warnings
#endif

#include "mfcpch.h"
#include "tfacep.h"
#include "tfacepp.h"
#include "tessbox.h"
Expand Down
1 change: 0 additions & 1 deletion ccmain/tessbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define TESSBOX_H

#include "ratngs.h"
#include "notdll.h"
#include "tesseractclass.h"

// TODO(ocr-team): Delete this along with other empty header files.
Expand Down
3 changes: 0 additions & 3 deletions ccmain/tessedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*
**********************************************************************/

#include "mfcpch.h"
//#include <osfcn.h>
//#include <signal.h>
//#include <time.h>
Expand Down Expand Up @@ -51,8 +50,6 @@
#include "tesseractclass.h"
#include "params.h"

#include "notdll.h" //phils nn stuff

#define VARDIR "configs/" /*variables files */
//config under api
#define API_CONFIG "configs/api_config"
Expand Down
1 change: 0 additions & 1 deletion ccmain/tessedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "blobs.h"
#include "pgedit.h"
#include "notdll.h"

//progress monitor
extern ETEXT_DESC *global_monitor;
Expand Down
1 change: 0 additions & 1 deletion ccmain/tessvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <stdio.h>

#include "mfcpch.h"
#include "tessvars.h"

FILE *debug_fp = stderr; // write debug stuff here
1 change: 0 additions & 1 deletion ccmain/tessvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <stdio.h>

#include "img.h"
#include "notdll.h"

extern FILE *debug_fp; // write debug stuff here
#endif
Loading

0 comments on commit 10c1169

Please sign in to comment.