/[rdesktop]/sourceforge.net/trunk/rdesktop/seamless.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/seamless.c

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

revision 1231 by ossman_, Thu Apr 20 13:01:45 2006 UTC revision 1413 by ossman_, Mon Jun 18 12:00:34 2007 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Seamless Windows support     Seamless Windows support
4     Copyright (C) Peter Astrand <astrand@cendio.se> 2005-2006     Copyright 2005-2007 Peter Astrand <astrand@cendio.se> for Cendio AB
5         Copyright 2007 Pierre Ossman <ossman@cendio.se> for Cendio AB
6    
7     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.     (at your option) any later version.
11      
12     This program is distributed in the hope that it will be useful,     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.     GNU General Public License for more details.
16      
17     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software     along with this program; if not, write to the Free Software
19     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Line 22  Line 23 
23  #include <stdarg.h>  #include <stdarg.h>
24  #include <assert.h>  #include <assert.h>
25    
 /* #define WITH_DEBUG_SEAMLESS */  
   
26  #ifdef WITH_DEBUG_SEAMLESS  #ifdef WITH_DEBUG_SEAMLESS
27  #define DEBUG_SEAMLESS(args) printf args;  #define DEBUG_SEAMLESS(args) printf args;
28  #else  #else
29  #define DEBUG_SEAMLESS(args)  #define DEBUG_SEAMLESS(args)
30  #endif  #endif
31    
32  extern BOOL g_seamless_rdp;  extern RD_BOOL g_seamless_rdp;
33  static VCHANNEL *seamless_channel;  static VCHANNEL *seamless_channel;
34  static unsigned int seamless_serial;  static unsigned int seamless_serial;
35    static char icon_buf[1024];
36    
37  static char *  static char *
38  seamless_get_token(char **s)  seamless_get_token(char **s)
# Line 58  seamless_get_token(char **s) Line 58  seamless_get_token(char **s)
58  }  }
59    
60    
61  static BOOL  static RD_BOOL
62  seamless_process_line(const char *line, void *data)  seamless_process_line(const char *line, void *data)
63  {  {
64          char *p, *l;          char *p, *l;
# Line 120  seamless_process_line(const char *line, Line 120  seamless_process_line(const char *line,
120                  ui_seamless_destroy_window(id, flags);                  ui_seamless_destroy_window(id, flags);
121    
122          }          }
123            else if (!strcmp("DESTROYGRP", tok1))
124            {
125                    if (!tok4)
126                            return False;
127    
128                    id = strtoul(tok3, &endptr, 0);
129                    if (*endptr)
130                            return False;
131    
132                    flags = strtoul(tok4, &endptr, 0);
133                    if (*endptr)
134                            return False;
135    
136                    ui_seamless_destroy_group(id, flags);
137            }
138          else if (!strcmp("SETICON", tok1))          else if (!strcmp("SETICON", tok1))
139          {          {
140                  unimpl("SeamlessRDP SETICON1\n");                  int chunk, width, height, len;
141                    char byte[3];
142    
143                    if (!tok8)
144                            return False;
145    
146                    id = strtoul(tok3, &endptr, 0);
147                    if (*endptr)
148                            return False;
149    
150                    chunk = strtoul(tok4, &endptr, 0);
151                    if (*endptr)
152                            return False;
153    
154                    width = strtoul(tok6, &endptr, 0);
155                    if (*endptr)
156                            return False;
157    
158                    height = strtoul(tok7, &endptr, 0);
159                    if (*endptr)
160                            return False;
161    
162                    byte[2] = '\0';
163                    len = 0;
164                    while (*tok8 != '\0')
165                    {
166                            byte[0] = *tok8;
167                            tok8++;
168                            if (*tok8 == '\0')
169                                    return False;
170                            byte[1] = *tok8;
171                            tok8++;
172    
173                            icon_buf[len] = strtol(byte, NULL, 16);
174                            len++;
175                    }
176    
177                    ui_seamless_seticon(id, tok5, width, height, chunk, icon_buf, len);
178            }
179            else if (!strcmp("DELICON", tok1))
180            {
181                    int width, height;
182    
183                    if (!tok6)
184                            return False;
185    
186                    id = strtoul(tok3, &endptr, 0);
187                    if (*endptr)
188                            return False;
189    
190                    width = strtoul(tok5, &endptr, 0);
191                    if (*endptr)
192                            return False;
193    
194                    height = strtoul(tok6, &endptr, 0);
195                    if (*endptr)
196                            return False;
197    
198                    ui_seamless_delicon(id, tok4, width, height);
199          }          }
200          else if (!strcmp("POSITION", tok1))          else if (!strcmp("POSITION", tok1))
201          {          {
# Line 285  seamless_process_line(const char *line, Line 358  seamless_process_line(const char *line,
358  }  }
359    
360    
361  static BOOL  static RD_BOOL
362  seamless_line_handler(const char *line, void *data)  seamless_line_handler(const char *line, void *data)
363  {  {
364          if (!seamless_process_line(line, data))          if (!seamless_process_line(line, data))
# Line 318  seamless_process(STREAM s) Line 391  seamless_process(STREAM s)
391  }  }
392    
393    
394  BOOL  RD_BOOL
395  seamless_init(void)  seamless_init(void)
396  {  {
397          if (!g_seamless_rdp)          if (!g_seamless_rdp)

Legend:
Removed from v.1231  
changed lines
  Added in v.1413

  ViewVC Help
Powered by ViewVC 1.1.26