/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/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/branches/seamlessrdp-branch/rdesktop/seamless.c

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

revision 1121 by astrand, Wed Mar 15 08:18:05 2006 UTC revision 1154 by ossman_, Fri Mar 17 09:56:20 2006 UTC
# Line 69  seamless_process_line(const char *line, Line 69  seamless_process_line(const char *line,
69    
70          DEBUG_SEAMLESS(("seamlessrdp got:%s\n", p));          DEBUG_SEAMLESS(("seamlessrdp got:%s\n", p));
71    
         if (!g_seamless_rdp)  
                 return True;  
   
72          tok1 = seamless_get_token(&p);          tok1 = seamless_get_token(&p);
73          tok2 = seamless_get_token(&p);          tok2 = seamless_get_token(&p);
74          tok3 = seamless_get_token(&p);          tok3 = seamless_get_token(&p);
# Line 132  seamless_process_line(const char *line, Line 129  seamless_process_line(const char *line,
129                  if (*endptr)                  if (*endptr)
130                          return False;                          return False;
131    
132                  x = strtoul(tok3, &endptr, 0);                  x = strtol(tok3, &endptr, 0);
133                  if (*endptr)                  if (*endptr)
134                          return False;                          return False;
135                  y = strtoul(tok4, &endptr, 0);                  y = strtol(tok4, &endptr, 0);
136                  if (*endptr)                  if (*endptr)
137                          return False;                          return False;
138    
139                  width = strtoul(tok5, &endptr, 0);                  width = strtol(tok5, &endptr, 0);
140                  if (*endptr)                  if (*endptr)
141                          return False;                          return False;
142                  height = strtoul(tok6, &endptr, 0);                  height = strtol(tok6, &endptr, 0);
143                  if (*endptr)                  if (*endptr)
144                          return False;                          return False;
145    
# Line 154  seamless_process_line(const char *line, Line 151  seamless_process_line(const char *line,
151          }          }
152          else if (!strcmp("ZCHANGE", tok1))          else if (!strcmp("ZCHANGE", tok1))
153          {          {
154                  unimpl("SeamlessRDP ZCHANGE1\n");                  unsigned long behind;
155    
156                    id = strtoul(tok2, &endptr, 0);
157                    if (*endptr)
158                            return False;
159    
160                    behind = strtoul(tok3, &endptr, 0);
161                    if (*endptr)
162                            return False;
163    
164                    flags = strtoul(tok4, &endptr, 0);
165                    if (*endptr)
166                            return False;
167    
168                    ui_seamless_restack_window(id, behind, flags);
169          }          }
170          else if (!strcmp("TITLE", tok1))          else if (!strcmp("TITLE", tok1))
171          {          {
# Line 196  seamless_process_line(const char *line, Line 207  seamless_process_line(const char *line,
207          {          {
208                  printf("SeamlessRDP:%s\n", line);                  printf("SeamlessRDP:%s\n", line);
209          }          }
210            else if (!strcmp("SYNCBEGIN", tok1))
211            {
212                    if (!tok2)
213                            return False;
214    
215                    flags = strtoul(tok2, &endptr, 0);
216                    if (*endptr)
217                            return False;
218    
219                    ui_seamless_syncbegin(flags);
220            }
221            else if (!strcmp("SYNCEND", tok1))
222            {
223                    if (!tok2)
224                            return False;
225    
226                    flags = strtoul(tok2, &endptr, 0);
227                    if (*endptr)
228                            return False;
229    
230                    /* do nothing, currently */
231            }
232            else if (!strcmp("HELLO", tok1))
233            {
234                    if (!tok2)
235                            return False;
236    
237                    flags = strtoul(tok2, &endptr, 0);
238                    if (*endptr)
239                            return False;
240    
241                    ui_seamless_begin();
242            }
243    
244    
245          xfree(l);          xfree(l);
246          return True;          return True;
# Line 238  seamless_process(STREAM s) Line 283  seamless_process(STREAM s)
283  BOOL  BOOL
284  seamless_init(void)  seamless_init(void)
285  {  {
286            if (!g_seamless_rdp)
287                    return False;
288    
289          seamless_channel =          seamless_channel =
290                  channel_register("seamrdp", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,                  channel_register("seamrdp", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
291                                   seamless_process);                                   seamless_process);
# Line 274  seamless_send(const char *format, ...) Line 322  seamless_send(const char *format, ...)
322  void  void
323  seamless_send_sync()  seamless_send_sync()
324  {  {
325            if (!g_seamless_rdp)
326                    return;
327    
328          seamless_send("SYNC\n");          seamless_send("SYNC\n");
329  }  }
330    
# Line 281  seamless_send_sync() Line 332  seamless_send_sync()
332  void  void
333  seamless_send_state(unsigned long id, unsigned int state, unsigned long flags)  seamless_send_state(unsigned long id, unsigned int state, unsigned long flags)
334  {  {
335            if (!g_seamless_rdp)
336                    return;
337    
338          seamless_send("STATE,0x%08lx,0x%x,0x%lx\n", id, state, flags);          seamless_send("STATE,0x%08lx,0x%x,0x%lx\n", id, state, flags);
339  }  }
340    
341    
342    void
343    seamless_send_zchange(unsigned long id, unsigned long below, unsigned long flags)
344    {
345            if (!g_seamless_rdp)
346                    return;
347    
348            seamless_send("ZCHANGE,0x%08lx,0x%08lx,0x%lx\n", id, below, flags);
349    }
350    
351    
352    void
353    seamless_send_focus(unsigned long id, unsigned long flags)
354    {
355            if (!g_seamless_rdp)
356                    return;
357    
358            seamless_send("FOCUS,0x%08lx,0x%lx\n", id, flags);
359    }

Legend:
Removed from v.1121  
changed lines
  Added in v.1154

  ViewVC Help
Powered by ViewVC 1.1.26