source: trunk/classes/c/c_image/cwjpg.c

Last change on this file was 2, checked in by stevenhl, 8 years ago

Import sources from cwmm-full.zip dated 2005-03-21

File size: 4.8 KB
Line 
1/*
2 * (C) Chris Wohlgemuth 2002-2004
3 *
4 */
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20/*
21 * If you need another license for your project/product (commercial,
22 * noncommercial, whatever) contact me at
23 *
24 * http://www.os2world.com/cdwriting
25 * http://www.geocities.com/SiliconValley/Sector/5785/
26 *
27 */
28/*
29 * This file was generated by the SOM Compiler and Emitter Framework.
30 * Generated using:
31 * SOM Emitter emitctm: 2.42
32 */
33
34#ifndef SOM_Module_cwjpg_Source
35#define SOM_Module_cwjpg_Source
36#endif
37#define CWJPG_Class_Source
38#define M_CWJPG_Class_Source
39
40#include <os2.h>
41#include "helpid.h"
42#include "cwjpg.ih"
43#include "cwaudioinc.h"
44
45extern char chrHelpLibrary[CCHMAXPATH];
46
47HMODULE queryResModuleHandle(void);
48HMODULE queryModuleHandle(void);
49BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
50BOOL checkImageIOProc(char * chrExt);
51BOOL mmclsCreateTheDefaultTemplate(M_WPObject *somSelf,
52 WPObject* Folder);
53
54/*
55 * The prototype for cwjpgM_wpclsQueryInstanceType was replaced by the following prototype:
56 */
57SOM_Scope PSZ SOMLINK cwjpgM_wpclsQueryInstanceType(M_MMJPG *somSelf)
58{
59 /* M_CWJPGData *somThis = M_CWJPGGetData(somSelf); */
60 M_MMJPGMethodDebug("M_MMJPG","cwjpgM_wpclsQueryInstanceType");
61
62 return "JPG";
63}
64
65/*
66 * The prototype for cwjpgM_wpclsQueryInstanceFilter was replaced by the following prototype:
67 */
68/*
69 * wpclsCreateDefaultTemplates : override;
70 */
71
72SOM_Scope PSZ SOMLINK cwjpgM_wpclsQueryInstanceFilter(M_MMJPG *somSelf)
73{
74 /* M_CWJPGData *somThis = M_CWJPGGetData(somSelf); */
75 M_MMJPGMethodDebug("M_MMJPG","cwjpgM_wpclsQueryInstanceFilter");
76
77 return "*.JPG";
78}
79
80#if 0
81SOM_Scope BOOL SOMLINK cwjpgM_wpclsCreateDefaultTemplates(M_MMJPG *somSelf,
82 WPObject* Folder)
83{
84 /* M_MMJPGData *somThis = M_MMJPGGetData(somSelf); */
85 M_MMJPGMethodDebug("M_MMJPG","cwjpgM_wpclsCreateDefaultTemplates");
86
87 /* The FOURCC of the JPEG-IO proc is JPEG so we have to create the template
88 here. Templates for other image files are created in MMImage. */
89DosBeep(5000, 1000);
90 if(checkImageIOProc( "JPEG")) {
91DosBeep(500, 1000);
92 mmclsCreateTheDefaultTemplate(somSelf, Folder);
93 return TRUE;
94 }
95
96 return TRUE;
97}
98#endif
99/*
100 * The prototype for cwjpgM_wpclsQueryDefaultHelp was replaced by the following prototype:
101 */
102SOM_Scope BOOL SOMLINK cwjpgM_wpclsQueryDefaultHelp(M_MMJPG *somSelf,
103 PULONG pHelpPanelId,
104 PSZ pszHelpLibrary)
105{
106 /* M_CWJPGData *somThis = M_CWJPGGetData(somSelf); */
107 M_MMJPGMethodDebug("M_MMJPG","cwjpgM_wpclsQueryDefaultHelp");
108
109 if(pHelpPanelId)
110 *pHelpPanelId=JPGFILE_HELP_PANEL;
111 if(pszHelpLibrary)
112 strncpy(pszHelpLibrary, chrHelpLibrary, CCHMAXPATH);
113 return TRUE;
114}
115
116/*
117 * The prototype for cwjpgM_wpclsQueryTitle was replaced by the following prototype:
118 */
119SOM_Scope PSZ SOMLINK cwjpgM_wpclsQueryTitle(M_MMJPG *somSelf)
120{
121 static char chrTitle[20]={0};
122 /* M_CWJPGData *somThis = M_CWJPGGetData(somSelf); */
123 M_MMJPGMethodDebug("M_MMJPG","cwjpgM_wpclsQueryTitle");
124
125 if(chrTitle[0]==0)
126 if(!getMessage(chrTitle, IDSTR_JPGTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
127 strcpy(chrTitle,"JPGImage.JPG");
128
129 return chrTitle;
130}
131
132/*
133 * The prototype for cwjpgM_wpclsQueryIconData was replaced by the following prototype:
134 */
135SOM_Scope ULONG SOMLINK cwjpgM_wpclsQueryIconData(M_MMJPG *somSelf,
136 PICONINFO pIconInfo)
137{
138 HMODULE hmod;
139
140 /* M_CWJPGData *somThis = M_CWJPGGetData(somSelf); */
141 M_MMJPGMethodDebug("M_MMJPG","cwjpgM_wpclsQueryIconData");
142
143 hmod=queryModuleHandle();
144 if(!hmod)
145 return M_MMJPG_parent_M_MMImage_wpclsQueryIconData(somSelf, pIconInfo);
146
147 if (pIconInfo) {
148 pIconInfo->fFormat = ICON_RESOURCE;
149 pIconInfo->hmod = hmod;
150 pIconInfo->resid = ID_ICONJPGFILE;
151 } /* endif */
152
153 return ( sizeof(ICONINFO) );
154}
155
156
157
158
159
160
161
162
Note: See TracBrowser for help on using the repository browser.