summaryrefslogtreecommitdiffstats
path: root/src/npplayer.c
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
commit769e63d24adf5c844137484f06a972fcce732d6a (patch)
tree5185797dcb3ff4b1b3cb71d367123bf89eb2410f /src/npplayer.c
parent0a8af92185eac74d48da1225e6053a0d66c078f5 (diff)
downloadkmplayer-769e63d24adf5c844137484f06a972fcce732d6a.tar.gz
kmplayer-769e63d24adf5c844137484f06a972fcce732d6a.zip
TQt4 port kmplayer
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1238840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/npplayer.c')
-rw-r--r--src/npplayer.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/npplayer.c b/src/npplayer.c
index e7f67bb..bb0dbd3 100644
--- a/src/npplayer.c
+++ b/src/npplayer.c
@@ -58,7 +58,7 @@ static gchar *callback_path;
static GModule *library;
static GtkWidget *xembed;
static Window socket_id;
-static Window parent_id;
+static Window tqparent_id;
static int top_w, top_h;
static int update_dimension_timer;
static int stdin_read_watch;
@@ -94,7 +94,7 @@ typedef struct _StreamInfo {
struct JsObject;
typedef struct _JsObject {
NPObject npobject;
- struct _JsObject * parent;
+ struct _JsObject * tqparent;
char * name;
} JsObject;
@@ -249,15 +249,15 @@ static StreamInfo *addStream (const char *url, const char *mime, const char *tar
static void createJsName (JsObject * obj, char **name, uint32_t * len) {
int slen = strlen (obj->name);
- if (obj->parent) {
+ if (obj->tqparent) {
*len += slen + 1;
- createJsName (obj->parent, name, len);
+ createJsName (obj->tqparent, name, len);
} else {
*name = (char *) malloc (*len + slen + 1);
*(*name + *len + slen) = 0;
*len = 0;
}
- if (obj->parent) {
+ if (obj->tqparent) {
*(*name + *len) = '.';
*len += 1;
}
@@ -379,9 +379,9 @@ static NPError nsDestroyStream (NPP instance, NPStream *stream, NPError reason)
return NPERR_NO_DATA;
}
-static void nsStatus (NPP instance, const char* message) {
+static void nstqStatus (NPP instance, const char* message) {
(void)instance;
- print ("NPN_Status %s\n", message ? message : "-");
+ print ("NPN_tqStatus %s\n", message ? message : "-");
}
static const char* nsUserAgent (NPP instance) {
@@ -687,8 +687,8 @@ static NPObject * windowClassAllocate (NPP instance, NPClass *aClass) {
static void windowClassDeallocate (NPObject *npobj) {
JsObject *jo = (JsObject *) npobj;
/*print ("windowClassDeallocate\n");*/
- if (jo->parent) {
- nsReleaseObject ((NPObject *) jo->parent);
+ if (jo->tqparent) {
+ nsReleaseObject ((NPObject *) jo->tqparent);
} else if (jo->name && !strncmp (jo->name, "this.__kmplayer__obj_", 21)) {
char *script = (char *) malloc (strlen (jo->name) + 7);
char *result;
@@ -793,7 +793,7 @@ static bool windowClassGetProperty (NPObject *npobj, NPIdentifier property,
}
jo.name = id;
- jo.parent = (JsObject *) npobj;
+ jo.tqparent = (JsObject *) npobj;
createJsName (&jo, (char **)&fullname.utf8characters, &fullname.utf8length);
res = nsEvaluate (npp, npobj, &fullname, result);
@@ -814,7 +814,7 @@ static bool windowClassSetProperty (NPObject *npobj, NPIdentifier property,
return false;
jo.name = id;
- jo.parent = (JsObject *) npobj;
+ jo.tqparent = (JsObject *) npobj;
createJsName (&jo, &var_name, &len);
var_val = nsVariant2Str (value);
@@ -966,7 +966,7 @@ static int initPlugin (const char *plugin_lib) {
ns_funcs.newstream = nsNewStream;
ns_funcs.write = nsWrite;
ns_funcs.destroystream = nsDestroyStream;
- ns_funcs.status = nsStatus;
+ ns_funcs.status = nstqStatus;
ns_funcs.uagent = nsUserAgent;
ns_funcs.memalloc = nsAlloc;
ns_funcs.memfree = nsMemFree;
@@ -1354,19 +1354,19 @@ static void windowCreatedEvent (GtkWidget *w, gpointer d) {
(void)d;
print ("windowCreatedEvent\n");
socket_id = gtk_socket_get_id (GTK_SOCKET (xembed));
- if (parent_id) {
+ if (tqparent_id) {
print ("windowCreatedEvent %p\n", GTK_PLUG (w)->socket_window);
if (!GTK_PLUG (w)->socket_window)
- gtk_plug_construct (GTK_PLUG (w), parent_id);
+ gtk_plug_construct (GTK_PLUG (w), tqparent_id);
gdk_window_reparent( w->window,
GTK_PLUG (w)->socket_window
? GTK_PLUG (w)->socket_window
- : gdk_window_foreign_new (parent_id),
+ : gdk_window_foreign_new (tqparent_id),
0, 0);
gtk_widget_show_all (w);
- /*XReparentWindow (gdk_x11_drawable_get_xdisplay (w->window),
+ /*XRetqparentWindow (gdk_x11_drawable_get_xdisplay (w->window),
gdk_x11_drawable_get_xid (w->window),
- parent_id,
+ tqparent_id,
0, 0);*/
}
if (!callback_service) {
@@ -1425,7 +1425,7 @@ static gboolean initPlayer (void * p) {
(void)p;
window = callback_service
- ? gtk_plug_new (parent_id)
+ ? gtk_plug_new (tqparent_id)
: gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), "delete_event",
G_CALLBACK (windowCloseEvent), NULL);
@@ -1446,7 +1446,7 @@ static gboolean initPlayer (void * p) {
gtk_container_add (GTK_CONTAINER (window), xembed);
- if (!parent_id) {
+ if (!tqparent_id) {
gtk_widget_set_size_request (window, 440, 330);
gtk_widget_show_all (window);
} else {
@@ -1518,7 +1518,7 @@ int main (int argc, char **argv) {
} else if (!strcmp (argv[i], "-m") && ++i < argc) {
mimetype = g_strdup (argv[i]);
} else if (!strcmp (argv [i], "-wid") && ++i < argc) {
- parent_id = strtol (argv[i], 0L, 10);
+ tqparent_id = strtol (argv[i], 0L, 10);
} else
object_url = g_strdup (argv[i]);
}