OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 // Xt support functions | 77 // Xt support functions |
78 | 78 |
79 void LinuxTimer(XtPointer data, XtIntervalId* id) { | 79 void LinuxTimer(XtPointer data, XtIntervalId* id) { |
80 PluginObject *obj = static_cast<PluginObject *>(data); | 80 PluginObject *obj = static_cast<PluginObject *>(data); |
81 DCHECK(obj->xt_interval_ == *id); | 81 DCHECK(obj->xt_interval_ == *id); |
82 obj->client()->Tick(); | 82 obj->client()->Tick(); |
83 obj->draw_ = true; | 83 obj->draw_ = true; |
84 if (obj->renderer()) { | 84 if (obj->renderer()) { |
85 if (obj->client()->NeedsContinuousRender() || | 85 if (obj->client()->NeedsRender()) { |
86 obj->renderer()->need_to_render()) { | |
87 | |
88 // NOTE: this draws no matter what instead of just invalidating the | 86 // NOTE: this draws no matter what instead of just invalidating the |
89 // region, which means it will execute even if the plug-in window is | 87 // region, which means it will execute even if the plug-in window is |
90 // invisible. | 88 // invisible. |
91 DrawPlugin(obj); | 89 DrawPlugin(obj); |
92 } | 90 } |
93 } | 91 } |
94 obj->xt_interval_ = | 92 obj->xt_interval_ = |
95 XtAppAddTimeOut(obj->xt_app_context_, 8, LinuxTimer, obj); | 93 XtAppAddTimeOut(obj->xt_app_context_, 8, LinuxTimer, obj); |
96 } | 94 } |
97 | 95 |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 gpointer user_data) { | 596 gpointer user_data) { |
599 PluginObject *obj = static_cast<PluginObject *>(user_data); | 597 PluginObject *obj = static_cast<PluginObject *>(user_data); |
600 return obj->OnGtkDelete(widget, event); | 598 return obj->OnGtkDelete(widget, event); |
601 } | 599 } |
602 | 600 |
603 static gboolean GtkTimeoutCallback(gpointer user_data) { | 601 static gboolean GtkTimeoutCallback(gpointer user_data) { |
604 PluginObject *obj = static_cast<PluginObject *>(user_data); | 602 PluginObject *obj = static_cast<PluginObject *>(user_data); |
605 obj->draw_ = true; | 603 obj->draw_ = true; |
606 obj->client()->Tick(); | 604 obj->client()->Tick(); |
607 if (obj->renderer()) { | 605 if (obj->renderer()) { |
608 if (obj->client()->NeedsContinuousRender() || | 606 if (obj->client()->NeedsRender()) { |
609 obj->renderer()->need_to_render()) { | |
610 | |
611 GtkWidget *widget; | 607 GtkWidget *widget; |
612 if (obj->fullscreen()) { | 608 if (obj->fullscreen()) { |
613 widget = obj->gtk_fullscreen_container_; | 609 widget = obj->gtk_fullscreen_container_; |
614 } else { | 610 } else { |
615 widget = obj->gtk_container_; | 611 widget = obj->gtk_container_; |
616 } | 612 } |
617 gtk_widget_queue_draw(widget); | 613 gtk_widget_queue_draw(widget); |
618 } | 614 } |
619 } | 615 } |
620 return TRUE; | 616 return TRUE; |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 client()->SendResizeEvent(renderer()->width(), renderer()->height(), | 952 client()->SendResizeEvent(renderer()->width(), renderer()->height(), |
957 false); | 953 false); |
958 SetGtkEventSource(gtk_container_); | 954 SetGtkEventSource(gtk_container_); |
959 gtk_widget_destroy(gtk_fullscreen_container_); | 955 gtk_widget_destroy(gtk_fullscreen_container_); |
960 gtk_fullscreen_container_ = NULL; | 956 gtk_fullscreen_container_ = NULL; |
961 fullscreen_window_ = 0; | 957 fullscreen_window_ = 0; |
962 fullscreen_ = false; | 958 fullscreen_ = false; |
963 } | 959 } |
964 } // namespace _o3d | 960 } // namespace _o3d |
965 } // namespace glue | 961 } // namespace glue |
OLD | NEW |