From be58900723e99145fbef6ff9bf1f634566fa259e Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 2 Sep 2015 03:52:30 +0200 Subject: [PATCH 01/14] Implement custom font settings for splash window on Windows --- direct/src/plugin/p3dWinSplashWindow.cxx | 16 +++++++++++++--- direct/src/plugin/p3dWinSplashWindow.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/direct/src/plugin/p3dWinSplashWindow.cxx b/direct/src/plugin/p3dWinSplashWindow.cxx index eb071711db..999abdb86f 100644 --- a/direct/src/plugin/p3dWinSplashWindow.cxx +++ b/direct/src/plugin/p3dWinSplashWindow.cxx @@ -34,6 +34,7 @@ P3DWinSplashWindow(P3DInstance *inst, bool make_visible) : _thread = NULL; _thread_id = 0; _hwnd = NULL; + _font = NULL; _fg_brush = NULL; _bg_brush = NULL; _bar_brush = NULL; @@ -498,6 +499,17 @@ make_window() { ShowWindow(_hwnd, SW_HIDE); } + // Load the requested font. + _font = CreateFontA(-_font_size, 0, 0, 0, _font_weight, + (_font_style != FS_normal), FALSE, FALSE, + ANSI_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, + CLEARTYPE_QUALITY, VARIABLE_PITCH, _font_family.c_str()); + + if (_font == NULL) { + nout << "CreateFont failed: " << GetLastError() << "\n"; + _font = (HFONT)GetStockObject(ANSI_VAR_FONT); + } + _fg_brush = CreateSolidBrush(RGB(_fgcolor_r, _fgcolor_g, _fgcolor_b)); _bg_brush = CreateSolidBrush(RGB(_bgcolor_r, _bgcolor_g, _bgcolor_b)); _bar_brush = CreateSolidBrush(RGB(_barcolor_r, _barcolor_g, _barcolor_b)); @@ -840,12 +852,10 @@ paint_progress_bar(HDC dc) { if (!_drawn_label.empty()) { // Now draw the install_label right above it. - const char *text = _drawn_label.c_str(); - HFONT font = (HFONT)GetStockObject(ANSI_VAR_FONT); // Measure the text, for centering. - SelectObject(dc, font); + SelectObject(dc, _font); SIZE text_size; GetTextExtentPoint32(dc, text, strlen(text), &text_size); diff --git a/direct/src/plugin/p3dWinSplashWindow.h b/direct/src/plugin/p3dWinSplashWindow.h index 9c27f4578e..33c9f9d584 100644 --- a/direct/src/plugin/p3dWinSplashWindow.h +++ b/direct/src/plugin/p3dWinSplashWindow.h @@ -109,6 +109,7 @@ private: HANDLE _thread; DWORD _thread_id; HWND _hwnd; + HFONT _font; HBRUSH _fg_brush; HBRUSH _bg_brush; HBRUSH _bar_brush; From f9f62f17f1feb808fde79af5b3a6a535f6121855 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 2 Sep 2015 22:27:03 +0200 Subject: [PATCH 02/14] Implement font customization options in MacOSX splash window Also, switch to non-deprecated CoreText API --- direct/src/plugin/p3dOsxSplashWindow.cxx | 168 +++++++++++++---------- direct/src/plugin/p3dOsxSplashWindow.h | 2 + 2 files changed, 100 insertions(+), 70 deletions(-) diff --git a/direct/src/plugin/p3dOsxSplashWindow.cxx b/direct/src/plugin/p3dOsxSplashWindow.cxx index 6b979b2a7b..53f9976d4c 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.cxx +++ b/direct/src/plugin/p3dOsxSplashWindow.cxx @@ -36,6 +36,7 @@ P3DOsxSplashWindow:: P3DOsxSplashWindow(P3DInstance *inst, bool make_visible) : P3DSplashWindow(inst, make_visible) { + _font_attribs = NULL; _install_progress = 0; _progress_known = true; _received_data = 0; @@ -59,6 +60,9 @@ P3DOsxSplashWindow:: DisposeWindow(_toplevel_window); _toplevel_window = NULL; } + if (_font_attribs != NULL) { + CFRelease(_font_attribs); + } } //////////////////////////////////////////////////////////////////// @@ -123,6 +127,41 @@ set_wparams(const P3DWindowParams &wparams) { } } } + + // Determine the attributes of the font we're going to use. + int symbolic = 0; + if (_font_style != FS_normal) { + symbolic |= kCTFontItalicTrait; + } + if (_font_weight > 500) { + symbolic |= kCTFontBoldTrait; + } + CFNumberRef symbolic_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &symbolic); + + CFStringRef traits_keys[1] = { kCTFontSymbolicTrait }; + CFTypeRef traits_values[1] = { symbolic_ref }; + CFDictionaryRef traits = CFDictionaryCreate(kCFAllocatorDefault, (const void **)&traits_keys, (const void **)&traits_values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + + CFStringRef family = CFStringCreateWithCString(NULL, _font_family.c_str(), kCFStringEncodingUTF8); + + CFStringRef attribs_keys[2] = { kCTFontFamilyNameAttribute, kCTFontTraitsAttribute }; + CFTypeRef attribs_values[2] = { family, traits }; + CFDictionaryRef attribs = CFDictionaryCreate(kCFAllocatorDefault, (const void **)&attribs_keys, (const void **)&attribs_values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + + // Create the font object. + CTFontDescriptorRef font_desc = CTFontDescriptorCreateWithAttributes(attribs); + CTFontRef font = CTFontCreateWithFontDescriptor(font_desc, _font_size, NULL); + + CFStringRef keys[1] = { kCTFontAttributeName }; + CFTypeRef values[1] = { font }; + _font_attribs = CFDictionaryCreate(kCFAllocatorDefault, (const void **)&keys, (const void **)&values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + + CFRelease(font); + CFRelease(font_desc); + CFRelease(attribs); + CFRelease(traits); + CFRelease(family); + CFRelease(symbolic_ref); } //////////////////////////////////////////////////////////////////// @@ -171,6 +210,9 @@ set_image_filename(const string &image_filename, ImagePlacement image_placement) case IP_button_click: load_image(_button_click_image, image_filename); break; + + default: + return; } refresh(); @@ -333,10 +375,8 @@ paint_window_osx_cgcontext(CGContextRef context) { CGColorRef bg = CGColorCreate(rgb_space, bg_components); CGRect region = { { 0, 0 }, { _win_width, _win_height } }; - CGContextBeginPath(context); CGContextSetFillColorWithColor(context, bg); - CGContextAddRect(context, region); - CGContextFillPath(context); + CGContextFillRect(context, region); CGColorRelease(bg); CGColorSpaceRelease(rgb_space); @@ -445,8 +485,6 @@ handle_event_osx_event_record(const P3D_event_data &event) { //////////////////////////////////////////////////////////////////// bool P3DOsxSplashWindow:: handle_event_osx_cocoa(const P3D_event_data &event) { - bool retval = false; - assert(event._event_type == P3D_ET_osx_cocoa); const P3DCocoaEvent &ce = event._event._osx_cocoa._event; @@ -455,33 +493,31 @@ handle_event_osx_cocoa(const P3D_event_data &event) { if (_visible) { CGContextRef context = ce.data.draw.context; paint_window_osx_cgcontext(context); - retval = true; + return true; + } else { + return false; } - break; case P3DCocoaEventMouseDown: set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, true); - retval = true; - break; + return true; case P3DCocoaEventMouseUp: set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, false); - retval = true; - break; + return true; case P3DCocoaEventMouseMoved: case P3DCocoaEventMouseDragged: set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, _mouse_down); - retval = true; - break; + return true; case P3DCocoaEventFocusChanged: _mouse_active = (ce.data.focus.hasFocus != 0); - retval = true; - break; - } + return true; - return retval; + default: + return false; + } } //////////////////////////////////////////////////////////////////// @@ -612,42 +648,33 @@ paint_image(CGContextRef context, const OsxImageData &image) { //////////////////////////////////////////////////////////////////// void P3DOsxSplashWindow:: paint_progress_bar(CGContextRef context) { - // Get some colors we'll need. We can't just use - // CGColorGetConstantColor(), since that requires 10.5. CGFloat fg_components[] = { _fgcolor_r / 255.0f, _fgcolor_g / 255.0f, _fgcolor_b / 255.0f, 1 }; CGFloat bg_components[] = { _bgcolor_r / 255.0f, _bgcolor_g / 255.0f, _bgcolor_b / 255.0f, 1 }; CGFloat bar_components[] = { _barcolor_r / 255.0f, _barcolor_g / 255.0f, _barcolor_b / 255.0f, 1 }; + CGFloat bar_bg_components[] = { _bar_bgcolor_r / 255.0f, _bar_bgcolor_g / 255.0f, _bar_bgcolor_b / 255.0f, 1 }; CGColorSpaceRef rgb_space = CGColorSpaceCreateDeviceRGB(); CGColorRef fg = CGColorCreate(rgb_space, fg_components); CGColorRef bg = CGColorCreate(rgb_space, bg_components); CGColorRef bar = CGColorCreate(rgb_space, bar_components); + CGColorRef bar_bg = CGColorCreate(rgb_space, bar_bg_components); + // Get the proper placement for the progress bar. int bar_x, bar_y, bar_width, bar_height; get_bar_placement(bar_x, bar_y, bar_width, bar_height); - // We offset the bar by half a pixel, so we'll be drawing the - // one-pixel line through the middle of a pixel, and it won't try to - // antialias itself into a half-black two-pixel line. - float bar_xf = bar_x + 0.5; - float bar_yf = bar_y - 0.5; - - CGRect bar_rect = { { bar_xf, bar_yf }, { bar_width, bar_height } }; + CGRect bar_rect = { { bar_x, bar_y }, { bar_width, bar_height } }; // Clear the entire progress bar to white (or the background color). - CGContextBeginPath(context); - CGContextSetFillColorWithColor(context, bg); - CGContextAddRect(context, bar_rect); - CGContextFillPath(context); + CGContextSetFillColorWithColor(context, bar_bg); + CGContextFillRect(context, bar_rect); // Draw the interior of the progress bar in blue (or the bar color). if (_progress_known) { int progress_width = (int)(bar_width * _install_progress + 0.5); if (progress_width != 0) { - CGRect prog = { { bar_xf, bar_yf }, { progress_width, bar_height } }; - CGContextBeginPath(context); + CGRect prog = { { bar_x, bar_y }, { progress_width, bar_height } }; CGContextSetFillColorWithColor(context, bar); - CGContextAddRect(context, prog); - CGContextFillPath(context); + CGContextFillRect(context, prog); } } else { // Progress is unknown. Draw a moving block, not a progress bar @@ -660,57 +687,58 @@ paint_progress_bar(CGContextRef context) { progress = block_travel * 2 - progress; } - CGRect prog = { { bar_xf + progress, bar_yf }, { block_width, bar_height } }; - CGContextBeginPath(context); + CGRect prog = { { bar_x + progress, bar_y }, { block_width, bar_height } }; CGContextSetFillColorWithColor(context, bar); - CGContextAddRect(context, prog); - CGContextFillPath(context); + CGContextFillRect(context, prog); } - + // Draw the black stroke around the progress bar. - CGContextBeginPath(context); - CGContextSetLineWidth(context, 1); - CGContextSetStrokeColorWithColor(context, fg); - CGContextAddRect(context, bar_rect); - CGContextStrokePath(context); + if (_bar_border > 0) { + // We offset the border by half a pixel, so we'll be drawing the + // one-pixel line through the middle of a pixel, and it won't try to + // antialias itself into a half-black two-pixel line. + CGRect border_rect = { { bar_x - 0.5, bar_y - 0.5 }, + { bar_width + 1, bar_height + 1 } }; + + CGContextBeginPath(context); + CGContextSetLineWidth(context, 1); + CGContextSetStrokeColorWithColor(context, fg); + + for (int i = 0; i < _bar_border; ++i) { + CGContextAddRect(context, border_rect); + border_rect.origin.x -= 1; + border_rect.origin.y -= 1; + border_rect.size.width += 2; + border_rect.size.height += 2; + } + CGContextStrokePath(context); + } if (!_install_label.empty()) { - // Now draw the install_label right above it. - // Need to invert the text so it won't be upside-down. CGAffineTransform text_xform = CGAffineTransformMakeScale(1, -1); CGContextSetTextMatrix(context, text_xform); - // Choose a suitable font. - float text_height = 15.0; - CGContextSelectFont(context, _font_family.c_str(), text_height, kCGEncodingMacRoman); + // Now draw the install_label right above it. + CFStringRef string = CFStringCreateWithCString(NULL, _install_label.c_str(), kCFStringEncodingUTF8); + CFAttributedStringRef attr_string = CFAttributedStringCreate(NULL, string, _font_attribs); + CTLineRef line = CTLineCreateWithAttributedString(attr_string); - // Measure the text, for centering. - CGContextSetTextPosition(context, 0, 0); - CGContextSetTextDrawingMode(context, kCGTextInvisible); - CGContextShowText(context, _install_label.data(), _install_label.length()); - CGPoint end_point = CGContextGetTextPosition(context); - float text_width = end_point.x; - - int text_x = (int)(_win_width - text_width) / 2; - int text_y = (int)(bar_y - text_height * 1.5); - - // Clear the rectangle behind the text to bg. - CGRect text_rect = { { text_x - 2, text_y - 2 }, { text_width + 4, text_height + 4 } }; - - CGContextBeginPath(context); - CGContextAddRect(context, text_rect); - CGContextSetFillColorWithColor(context, bg); - CGContextFillPath(context); + // Determine the placement based on the size of the text. + CGRect bounds = CTLineGetImageBounds(line, context); + float text_x = (_win_width - bounds.size.width) / 2.0f - bounds.origin.x; + float text_y = bar_y + bounds.origin.y - 4 - _bar_border; // And finally, draw the text. - CGContextSetTextDrawingMode(context, kCGTextFill); - CGContextSetFillColorWithColor(context, fg); + CGContextSetTextPosition(context, text_x, text_y); + CTLineDraw(line, context); - CGContextShowTextAtPoint(context, text_x, text_y + text_height, - _install_label.data(), _install_label.length()); + CFRelease(line); + CFRelease(attr_string); + CFRelease(string); } + CGColorRelease(bar_bg); CGColorRelease(bar); CGColorRelease(bg); CGColorRelease(fg); diff --git a/direct/src/plugin/p3dOsxSplashWindow.h b/direct/src/plugin/p3dOsxSplashWindow.h index 03149bfc98..8c4cab382b 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.h +++ b/direct/src/plugin/p3dOsxSplashWindow.h @@ -83,6 +83,8 @@ private: OsxImageData _button_rollover_image; OsxImageData _button_click_image; + CFDictionaryRef _font_attribs; + string _install_label; double _install_progress; bool _progress_known; From e1d7c737cf16cbc46f1b22f89205c146c88999bc Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Sep 2015 03:29:42 +0200 Subject: [PATCH 03/14] Fix "... is not a Multifile" error in pdeployed executables --- direct/src/plugin_standalone/panda3dBase.cxx | 10 +++++----- direct/src/plugin_standalone/panda3dBase.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/direct/src/plugin_standalone/panda3dBase.cxx b/direct/src/plugin_standalone/panda3dBase.cxx index 6b38e221f2..707eddedd2 100644 --- a/direct/src/plugin_standalone/panda3dBase.cxx +++ b/direct/src/plugin_standalone/panda3dBase.cxx @@ -342,7 +342,7 @@ make_parent_window() { //////////////////////////////////////////////////////////////////// P3D_instance *Panda3DBase:: create_instance(const string &p3d, bool start_instance, - char **args, int num_args, const int &p3d_offset) { + char **args, int num_args, int p3d_offset) { // Check to see if the p3d filename we were given is a URL, or a // local file. Filename p3d_filename = Filename::from_os_specific(p3d); @@ -356,9 +356,9 @@ create_instance(const string &p3d, bool start_instance, p3d_filename.make_absolute(); os_p3d_filename = p3d_filename.to_os_specific(); - } + } if (is_local) { - read_p3d_info(p3d_filename); + read_p3d_info(p3d_filename, p3d_offset); } // Build up the token list. @@ -454,9 +454,9 @@ delete_instance(P3D_instance *inst) { // parameters (like width and height). //////////////////////////////////////////////////////////////////// bool Panda3DBase:: -read_p3d_info(const Filename &p3d_filename) { +read_p3d_info(const Filename &p3d_filename, int p3d_offset) { PT(Multifile) mf = new Multifile; - if (!mf->open_read(p3d_filename)) { + if (!mf->open_read(p3d_filename, p3d_offset)) { return false; } int si = mf->find_subfile("p3d_info.xml"); diff --git a/direct/src/plugin_standalone/panda3dBase.h b/direct/src/plugin_standalone/panda3dBase.h index f53e59b14c..b3ace6256f 100644 --- a/direct/src/plugin_standalone/panda3dBase.h +++ b/direct/src/plugin_standalone/panda3dBase.h @@ -49,10 +49,10 @@ protected: P3D_instance * create_instance(const string &p3d, bool start_instance, - char **args, int num_args, const int &p3d_offset = 0); + char **args, int num_args, int p3d_offset = 0); void delete_instance(P3D_instance *instance); - bool read_p3d_info(const Filename &p3d_filename); + bool read_p3d_info(const Filename &p3d_filename, int p3d_offset = 0); bool parse_token(const char *arg); bool parse_int_pair(const char *arg, int &x, int &y); string lookup_token(const string &keyword) const; From c33f3b3dca1b80c467c002edf6a577430b18e983 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Sep 2015 03:49:01 +0200 Subject: [PATCH 04/14] Force httplib2 and pyglet to be platform-independent packages --- direct/src/p3d/thirdparty.pdef | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/src/p3d/thirdparty.pdef b/direct/src/p3d/thirdparty.pdef index b657aac95b..bc72b39eb7 100644 --- a/direct/src/p3d/thirdparty.pdef +++ b/direct/src/p3d/thirdparty.pdef @@ -137,7 +137,7 @@ class pyopengl(package): module('OpenGL.GLU', 'OpenGL.GLUT', 'OpenGL.GLE', 'OpenGL.GLX') class httplib2(package): - config(display_name = "httplib2") + config(display_name = "httplib2", platform_specific = False) require('panda3d') module('httplib2', required = True) @@ -149,7 +149,7 @@ class box2d(package): module('Box2D', required = True) class pyglet(package): - config(display_name = "pyglet") - require('panda3d') + config(display_name = "pyglet", platform_specific = False) + require('panda3d', 'morepy') module('pyglet', required = True) From 03a13993785af90be3d342b83be19c657c13d871 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 5 Sep 2015 13:12:48 +0200 Subject: [PATCH 05/14] Remove accidentally checked in debug message --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 1eda94595b..0a1dc16a0b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -11331,7 +11331,6 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, if (_supports_clear_buffer) { // For buffer textures we need to clear the underlying storage. string clear_data = tex->get_clear_data(); - cerr << "clearing buffer data\n"; _glClearBufferData(GL_TEXTURE_BUFFER, internal_format, external_format, component_type, (const void *)clear_data.data()); From e1c0ae7f1be9e8478778306a0d42acc89a97bfb8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 5 Sep 2015 15:28:12 +0200 Subject: [PATCH 06/14] Add F_hardware_skinning/p3d_TransformTable to GLSL on 1.9 branch, as requested Uses a hack to prevent breaking ABI compat --- panda/src/display/standardMunger.cxx | 40 ++++++--- panda/src/glstuff/glGeomMunger_src.cxx | 2 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 6 +- panda/src/glstuff/glShaderContext_src.cxx | 84 +++++++++++++++++++ panda/src/glstuff/glShaderContext_src.h | 7 ++ panda/src/pgraph/shaderAttrib.h | 1 + 6 files changed, 125 insertions(+), 15 deletions(-) diff --git a/panda/src/display/standardMunger.cxx b/panda/src/display/standardMunger.cxx index 922150a114..c33c95f7e2 100644 --- a/panda/src/display/standardMunger.cxx +++ b/panda/src/display/standardMunger.cxx @@ -37,14 +37,13 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, StateMunger(gsg), _num_components(num_components), _numeric_type(numeric_type), - _contents(contents) + _contents(contents), + _munge_color(false), + _munge_color_scale(false), + _auto_shader(false) { _render_mode = DCAST(RenderModeAttrib, state->get_attrib(RenderModeAttrib::get_class_slot())); - _munge_color = false; - _munge_color_scale = false; - _auto_shader = false; - if (!get_gsg()->get_runtime_color_scale()) { // We might need to munge the colors. const ColorAttrib *color_attrib = (const ColorAttrib *) @@ -98,6 +97,11 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, if (shader_attrib->auto_shader()) { _auto_shader = true; } + if (shader_attrib->get_flag(ShaderAttrib::F_hardware_skinning)) { + // Hijack this field, such as not to break ABI compatibility. + // This hack is not present in 1.10. + _num_components |= 0x10000; + } } //////////////////////////////////////////////////////////////////// @@ -120,17 +124,20 @@ munge_data_impl(const GeomVertexData *data) { CPT(GeomVertexData) new_data = data; if (_munge_color) { - new_data = new_data->set_color(_color, _num_components, _numeric_type, - _contents); + new_data = new_data->set_color(_color, _num_components & 0xffff, + _numeric_type, _contents); } else if (_munge_color_scale) { - new_data = new_data->scale_color(_color_scale, _num_components, + new_data = new_data->scale_color(_color_scale, _num_components & 0xffff, _numeric_type, _contents); } GeomVertexAnimationSpec animation = new_data->get_format()->get_animation(); - if (hardware_animated_vertices && - animation.get_animation_type() == AT_panda && - new_data->get_slider_table() == (SliderTable *)NULL) { + if (_num_components & 0x10000) { + animation.set_hardware(4, true); + + } else if (hardware_animated_vertices && + animation.get_animation_type() == AT_panda && + new_data->get_slider_table() == (SliderTable *)NULL) { // Maybe we can animate the vertices with hardware. const TransformBlendTable *table = new_data->get_transform_blend_table(); if (table != (TransformBlendTable *)NULL && @@ -306,7 +313,11 @@ compare_to_impl(const GeomMunger *other) const { return compare; } } - + bool shader_skinning = ((_num_components & 0x10000) != 0); + bool om_shader_skinning = ((om->_num_components & 0x10000) != 0); + if (shader_skinning != om_shader_skinning) { + return (int)shader_skinning - (int)om_shader_skinning; + } if (_auto_shader != om->_auto_shader) { return (int)_auto_shader - (int)om->_auto_shader; } @@ -345,6 +356,11 @@ geom_compare_to_impl(const GeomMunger *other) const { return compare; } } + bool shader_skinning = ((_num_components & 0x10000) != 0); + bool om_shader_skinning = ((om->_num_components & 0x10000) != 0); + if (shader_skinning != om_shader_skinning) { + return (int)shader_skinning - (int)om_shader_skinning; + } return StateMunger::geom_compare_to_impl(other); } diff --git a/panda/src/glstuff/glGeomMunger_src.cxx b/panda/src/glstuff/glGeomMunger_src.cxx index b2deb6e29f..a3b53ac464 100644 --- a/panda/src/glstuff/glGeomMunger_src.cxx +++ b/panda/src/glstuff/glGeomMunger_src.cxx @@ -118,7 +118,7 @@ munge_format_impl(const GeomVertexFormat *orig, if (animation.get_num_transforms() > 1) { PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat; new_array_format->add_column - (InternalName::get_transform_weight(), animation.get_num_transforms() - 1, + (InternalName::get_transform_weight(), animation.get_num_transforms(), NT_stdfloat, C_other); if (animation.get_indexed_transforms()) { diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index a1a2e7e7a9..2d0c82e0b9 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3249,11 +3249,11 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, } } +#ifndef OPENGLES const GeomVertexAnimationSpec &animation = _data_reader->get_format()->get_animation(); bool hardware_animation = (animation.get_animation_type() == Geom::AT_hardware); -#ifndef OPENGLES - if (hardware_animation) { + if (hardware_animation && _current_shader_context == NULL) { // Set up the transform matrices for vertex blending. nassertr(_supports_vertex_blend, false); glEnable(GL_VERTEX_BLEND_ARB); @@ -3335,6 +3335,8 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, GLPf(LoadMatrix)(_internal_transform->get_mat().get_data()); } } +#else + const bool hardware_animation = false; #endif #ifndef OPENGLES_2 diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 5df6c93871..298eda1f9e 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -197,6 +197,8 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext _glsl_program = 0; _uses_standard_vertex_arrays = false; _has_divisor = false; + _transform_table_index = -1; + _slider_table_index = -1; nassertv(s->get_language() == Shader::SL_GLSL); @@ -527,6 +529,26 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext s->_mat_spec.push_back(bind); continue; } + if (noprefix == "TransformTable") { + if (param_type != GL_FLOAT_MAT4) { + GLCAT.error() + << "p3d_TransformTable should be uniform mat4\n"; + continue; + } + _transform_table_index = p; + _transform_table_size = param_size; + continue; + } + if (noprefix == "SliderTable") { + if (param_type != GL_FLOAT) { + GLCAT.error() + << "p3d_SliderTable should be uniform float\n"; + continue; + } + _slider_table_index = p; + _slider_table_size = param_size; + continue; + } GLCAT.error() << "Unrecognized uniform name '" << param_name_cstr << "'!\n"; continue; @@ -1324,6 +1346,58 @@ issue_parameters(int altered) { _glgsg->report_my_gl_errors(); } +//////////////////////////////////////////////////////////////////// +// Function: GLShaderContext::update_transform_table +// Access: Public +// Description: Changes the active transform table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(ShaderContext):: +update_transform_table(const TransformTable *table) { + LMatrix4f *matrices = (LMatrix4f *)alloca(_transform_table_size * 64); + + int i = 0; + if (table != NULL) { + int num_transforms = min(_transform_table_size, table->get_num_transforms()); + for (; i < num_transforms; ++i) { +#ifdef STDFLOAT_DOUBLE + LMatrix4 matrix; + table->get_transform(i)->get_matrix(matrix); + matrices[i] = LCAST(float, matrix); +#else + table->get_transform(i)->get_matrix(matrices[i]); +#endif + } + } + for (; i < _transform_table_size; ++i) { + matrices[i] = LMatrix4f::ident_mat(); + } + + _glgsg->_glUniformMatrix4fv(_transform_table_index, _transform_table_size, + GL_FALSE, (float *)matrices); +} + +//////////////////////////////////////////////////////////////////// +// Function: GLShaderContext::update_slider_table +// Access: Public +// Description: Changes the active slider table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(ShaderContext):: +update_slider_table(const SliderTable *table) { + float *sliders = (float *)alloca(_slider_table_size * 4); + memset(sliders, 0, _slider_table_size * 4); + + if (table != NULL) { + int num_sliders = min(_slider_table_size, table->get_num_sliders()); + for (int i = 0; i < num_sliders; ++i) { + sliders[i] = table->get_slider(i)->get_slider(); + } + } + + _glgsg->_glUniform1fv(_slider_table_index, _slider_table_size, sliders); +} + //////////////////////////////////////////////////////////////////// // Function: GLShaderContext::disable_shader_vertex_arrays // Access: Public @@ -1441,6 +1515,16 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { } } + if (_transform_table_index >= 0) { + const TransformTable *table = _glgsg->_data_reader->get_transform_table(); + update_transform_table(table); + } + + if (_slider_table_index >= 0) { + const SliderTable *table = _glgsg->_data_reader->get_slider_table(); + update_slider_table(table); + } + _glgsg->report_my_gl_errors(); return true; diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index e2a9aadc9d..62d54ed675 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -41,6 +41,8 @@ public: void bind(bool reissue_parameters = true); void unbind(); void issue_parameters(int altered); + void update_transform_table(const TransformTable *table); + void update_slider_table(const SliderTable *table); void disable_shader_vertex_arrays(); bool update_shader_vertex_arrays(ShaderContext *prev, bool force); void disable_shader_texture_bindings(); @@ -65,6 +67,11 @@ private: //typedef pvector ParamContexts; //ParamContexts _params; + GLint _transform_table_index; + GLint _slider_table_index; + GLsizei _transform_table_size; + GLsizei _slider_table_size; + pvector _glsl_parameter_map; pmap _glsl_uniform_handles; diff --git a/panda/src/pgraph/shaderAttrib.h b/panda/src/pgraph/shaderAttrib.h index c6bb2eb583..9d677a411e 100644 --- a/panda/src/pgraph/shaderAttrib.h +++ b/panda/src/pgraph/shaderAttrib.h @@ -48,6 +48,7 @@ PUBLISHED: enum { F_disable_alpha_write = 0, // Suppress writes to color buffer alpha channel. F_subsume_alpha_test = 1, // Shader promises to subsume the alpha test using TEXKILL + F_hardware_skinning = 2, // Shader needs pre-animated vertices }; INLINE bool has_shader() const; From d3487eba6b06e6f6af408d08f8a54596eb9e87a0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 7 Sep 2015 23:28:37 +0200 Subject: [PATCH 07/14] Set visibility attributes on all exported bindings --- dtool/src/interrogate/interfaceMakerC.cxx | 19 ++++++++++++++----- .../interfaceMakerPythonNative.cxx | 4 ++++ .../interrogate/interfaceMakerPythonObj.cxx | 2 ++ .../interfaceMakerPythonSimple.cxx | 2 ++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerC.cxx b/dtool/src/interrogate/interfaceMakerC.cxx index c693bf7689..25eeb87023 100644 --- a/dtool/src/interrogate/interfaceMakerC.cxx +++ b/dtool/src/interrogate/interfaceMakerC.cxx @@ -53,6 +53,14 @@ InterfaceMakerC:: //////////////////////////////////////////////////////////////////// void InterfaceMakerC:: write_prototypes(ostream &out,ostream *out_h) { + // The 'used' attribute prevents emscripten from optimizing it out. + out << + "#if __GNUC__ >= 4\n" + "#define EXPORT_FUNC extern \"C\" __attribute__((used, visibility(\"default\")))\n" + "#else\n" + "#define EXPORT_FUNC extern \"C\"\n" + "#endif\n\n"; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { Function *func = (*fi).second; @@ -140,8 +148,13 @@ write_prototype_for(ostream &out, InterfaceMaker::Function *func) { for (ri = func->_remaps.begin(); ri != func->_remaps.end(); ++ri) { FunctionRemap *remap = (*ri); + + if (remap->_extension || (remap->_flags & FunctionRemap::F_explicit_self)) { + continue; + } + if (output_function_names) { - out << "extern \"C\" "; + out << "EXPORT_FUNC "; } write_function_header(out, func, remap, false); out << ";\n"; @@ -216,10 +229,6 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func, void InterfaceMakerC:: write_function_header(ostream &out, InterfaceMaker::Function *func, FunctionRemap *remap, bool newline) { - if (remap->_extension || (remap->_flags & FunctionRemap::F_explicit_self)) { - return; - } - if (remap->_void_return) { out << "void"; } else { diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index cd780c01a2..49e7a184ec 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1499,6 +1499,8 @@ write_module(ostream &out, ostream *out_h, InterrogateModuleDef *def) { << "\n" << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) PyObject *PyInit_" << def->module_name << "();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) PyInit_" << def->module_name << "();\n" << "#else\n" << "extern \"C\" PyObject *PyInit_" << def->module_name << "();\n" << "#endif\n" @@ -1512,6 +1514,8 @@ write_module(ostream &out, ostream *out_h, InterrogateModuleDef *def) { << "\n" << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) void init" << def->module_name << "();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) init" << def->module_name << "();\n" << "#else\n" << "extern \"C\" void init" << def->module_name << "();\n" << "#endif\n" diff --git a/dtool/src/interrogate/interfaceMakerPythonObj.cxx b/dtool/src/interrogate/interfaceMakerPythonObj.cxx index 9081c435bd..d88c62e7c7 100644 --- a/dtool/src/interrogate/interfaceMakerPythonObj.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonObj.cxx @@ -136,6 +136,8 @@ write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def) { << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) INIT_FUNC();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) INIT_FUNC();\n" << "#else\n" << "extern \"C\" INIT_FUNC();\n" << "#endif\n\n" diff --git a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx index d6e0684db7..9b04103af2 100644 --- a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx @@ -123,6 +123,8 @@ write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def) { << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) INIT_FUNC();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) INIT_FUNC();\n" << "#else\n" << "extern \"C\" INIT_FUNC();\n" << "#endif\n\n" From 20f90f35b9ce7f6ff1792d4eb1e270eaa6181c33 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 7 Sep 2015 23:30:02 +0200 Subject: [PATCH 08/14] Regenerate interrogatedb bindings to include interrogate_request --- dtool/metalibs/dtoolconfig/pydtool.cxx | 842 +++++++++++++------------ 1 file changed, 438 insertions(+), 404 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/pydtool.cxx b/dtool/metalibs/dtoolconfig/pydtool.cxx index bde03f4197..77a162c7ec 100644 --- a/dtool/metalibs/dtoolconfig/pydtool.cxx +++ b/dtool/metalibs/dtoolconfig/pydtool.cxx @@ -1,12 +1,13 @@ /* - * This file generated by: - * interrogate -D EXPCL_DTOOLCONFIG= -nodb -python -promiscuous -I~/panda3d-git/built/include -module panda3d.dtoolconfig -library dtoolconfig -string -true-names -do-module -oc pydtool.cxx ../../src/interrogatedb/interrogate_interface.h + * This file was generated by: + * interrogate -D EXPCL_DTOOLCONFIG= -nodb -python -promiscuous -I/home/rdb/panda3d-git/built/include -module panda3d.interrogatedb -library interrogatedb -string -true-names -do-module -oc pydtool.cxx ../../src/interrogatedb/interrogate_interface.h ../../src/interrogatedb/interrogate_request.h * */ #include #include "../../src/interrogatedb/interrogate_interface.h" +#include "../../src/interrogatedb/interrogate_request.h" #include "dtoolbase.h" #undef _POSIX_C_SOURCE @@ -18,137 +19,139 @@ #include "Python.h" #endif -static PyObject *_inPU7VHtbRf(PyObject *self, PyObject *args); -static PyObject *_inPU7VHda_g(PyObject *self, PyObject *args); -static PyObject *_inPU7VH4RgX(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3Gip(PyObject *self, PyObject *args); -static PyObject *_inPU7VHRKDz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHgZ9N(PyObject *self, PyObject *args); -static PyObject *_inPU7VHFnRZ(PyObject *self, PyObject *args); -static PyObject *_inPU7VHg0Qv(PyObject *self, PyObject *args); -static PyObject *_inPU7VHtrqw(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdmpW(PyObject *self, PyObject *args); -static PyObject *_inPU7VHUYgQ(PyObject *self, PyObject *args); -static PyObject *_inPU7VH0k7F(PyObject *self, PyObject *args); -static PyObject *_inPU7VHfIsr(PyObject *self, PyObject *args); -static PyObject *_inPU7VHvysR(PyObject *self, PyObject *args); -static PyObject *_inPU7VHYQ_2(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3kdv(PyObject *self, PyObject *args); -static PyObject *_inPU7VHew01(PyObject *self, PyObject *args); -static PyObject *_inPU7VHQna7(PyObject *self, PyObject *args); -static PyObject *_inPU7VHkg95(PyObject *self, PyObject *args); -static PyObject *_inPU7VHluRc(PyObject *self, PyObject *args); -static PyObject *_inPU7VHtHdM(PyObject *self, PyObject *args); -static PyObject *_inPU7VHDId0(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHuAm(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_xr0(PyObject *self, PyObject *args); -static PyObject *_inPU7VHH5qp(PyObject *self, PyObject *args); -static PyObject *_inPU7VHU2_B(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHFO2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHcfjm(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3Sjw(PyObject *self, PyObject *args); -static PyObject *_inPU7VHgJcX(PyObject *self, PyObject *args); -static PyObject *_inPU7VHYlw6(PyObject *self, PyObject *args); -static PyObject *_inPU7VHsmnz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHxQ10(PyObject *self, PyObject *args); -static PyObject *_inPU7VH6gPB(PyObject *self, PyObject *args); -static PyObject *_inPU7VHISgV(PyObject *self, PyObject *args); -static PyObject *_inPU7VHH3bx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHzeUk(PyObject *self, PyObject *args); -static PyObject *_inPU7VHUeI5(PyObject *self, PyObject *args); -static PyObject *_inPU7VHuSvx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHwpYd(PyObject *self, PyObject *args); -static PyObject *_inPU7VHOfNh(PyObject *self, PyObject *args); -static PyObject *_inPU7VHf5_U(PyObject *self, PyObject *args); -static PyObject *_inPU7VHL3ZB(PyObject *self, PyObject *args); -static PyObject *_inPU7VHXw0I(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3zru(PyObject *self, PyObject *args); -static PyObject *_inPU7VHRrg2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHEJCx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHWAZr(PyObject *self, PyObject *args); -static PyObject *_inPU7VHrD_M(PyObject *self, PyObject *args); -static PyObject *_inPU7VHjolz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHt_JD(PyObject *self, PyObject *args); -static PyObject *_inPU7VHwEts(PyObject *self, PyObject *args); -static PyObject *_inPU7VHrJWs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHpmFD(PyObject *self, PyObject *args); -static PyObject *_inPU7VHyYUX(PyObject *self, PyObject *args); -static PyObject *_inPU7VH54dn(PyObject *self, PyObject *args); -static PyObject *_inPU7VHGMpW(PyObject *self, PyObject *args); -static PyObject *_inPU7VHNuBV(PyObject *self, PyObject *args); -static PyObject *_inPU7VH9UwA(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3FDt(PyObject *self, PyObject *args); -static PyObject *_inPU7VHf513(PyObject *self, PyObject *args); -static PyObject *_inPU7VHsqGH(PyObject *self, PyObject *args); -static PyObject *_inPU7VH7shV(PyObject *self, PyObject *args); -static PyObject *_inPU7VHA1eF(PyObject *self, PyObject *args); -static PyObject *_inPU7VH9tTm(PyObject *self, PyObject *args); -static PyObject *_inPU7VH776V(PyObject *self, PyObject *args); -static PyObject *_inPU7VHfaH0(PyObject *self, PyObject *args); -static PyObject *_inPU7VHGB9D(PyObject *self, PyObject *args); -static PyObject *_inPU7VHsxxs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHMT0z(PyObject *self, PyObject *args); -static PyObject *_inPU7VHiW3v(PyObject *self, PyObject *args); -static PyObject *_inPU7VH4Px8(PyObject *self, PyObject *args); -static PyObject *_inPU7VHNHcs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHqHrb(PyObject *self, PyObject *args); -static PyObject *_inPU7VHaOqq(PyObject *self, PyObject *args); -static PyObject *_inPU7VHqWOw(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHu7x(PyObject *self, PyObject *args); -static PyObject *_inPU7VHwGnA(PyObject *self, PyObject *args); -static PyObject *_inPU7VHXGxx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHj04Z(PyObject *self, PyObject *args); -static PyObject *_inPU7VHEOv4(PyObject *self, PyObject *args); -static PyObject *_inPU7VHpCqJ(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_Pz3(PyObject *self, PyObject *args); -static PyObject *_inPU7VHt_06(PyObject *self, PyObject *args); -static PyObject *_inPU7VHmuPs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHvM8B(PyObject *self, PyObject *args); -static PyObject *_inPU7VHap97(PyObject *self, PyObject *args); -static PyObject *_inPU7VH0o8D(PyObject *self, PyObject *args); -static PyObject *_inPU7VHOoQ2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHKuFh(PyObject *self, PyObject *args); -static PyObject *_inPU7VHo5L6(PyObject *self, PyObject *args); -static PyObject *_inPU7VHzgKK(PyObject *self, PyObject *args); -static PyObject *_inPU7VH0FIF(PyObject *self, PyObject *args); -static PyObject *_inPU7VHZqvD(PyObject *self, PyObject *args); -static PyObject *_inPU7VHDyRd(PyObject *self, PyObject *args); -static PyObject *_inPU7VHMnKa(PyObject *self, PyObject *args); -static PyObject *_inPU7VHRtji(PyObject *self, PyObject *args); -static PyObject *_inPU7VHCnbQ(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdUVN(PyObject *self, PyObject *args); -static PyObject *_inPU7VHihbt(PyObject *self, PyObject *args); -static PyObject *_inPU7VHbyPY(PyObject *self, PyObject *args); -static PyObject *_inPU7VHAaT6(PyObject *self, PyObject *args); -static PyObject *_inPU7VHgL9q(PyObject *self, PyObject *args); -static PyObject *_inPU7VHWB97(PyObject *self, PyObject *args); -static PyObject *_inPU7VHDUAl(PyObject *self, PyObject *args); -static PyObject *_inPU7VH1_Kf(PyObject *self, PyObject *args); -static PyObject *_inPU7VH98lD(PyObject *self, PyObject *args); -static PyObject *_inPU7VH9SHr(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdiZP(PyObject *self, PyObject *args); -static PyObject *_inPU7VHTdER(PyObject *self, PyObject *args); -static PyObject *_inPU7VHYO56(PyObject *self, PyObject *args); -static PyObject *_inPU7VHxtCG(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_EB2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHEG1l(PyObject *self, PyObject *args); -static PyObject *_inPU7VH7tUq(PyObject *self, PyObject *args); -static PyObject *_inPU7VHyStU(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdM85(PyObject *self, PyObject *args); -static PyObject *_inPU7VHk_GN(PyObject *self, PyObject *args); -static PyObject *_inPU7VH8QjG(PyObject *self, PyObject *args); -static PyObject *_inPU7VHyMtj(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHDtN(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHFjA(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_NPR(PyObject *self, PyObject *args); -static PyObject *_inPU7VHcTOH(PyObject *self, PyObject *args); -static PyObject *_inPU7VHhdU7(PyObject *self, PyObject *args); -static PyObject *_inPU7VHQPxU(PyObject *self, PyObject *args); -static PyObject *_inPU7VHO7Pz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHvu_E(PyObject *self, PyObject *args); -static PyObject *_inPU7VHxGUt(PyObject *self, PyObject *args); -static PyObject *_inPU7VHzM1P(PyObject *self, PyObject *args); -static PyObject *_inPU7VHoY5L(PyObject *self, PyObject *args); +static PyObject *_inP07yttbRf(PyObject *self, PyObject *args); +static PyObject *_inP07ytda_g(PyObject *self, PyObject *args); +static PyObject *_inP07yt4RgX(PyObject *self, PyObject *args); +static PyObject *_inP07yt3Gip(PyObject *self, PyObject *args); +static PyObject *_inP07ytRKDz(PyObject *self, PyObject *args); +static PyObject *_inP07ytgZ9N(PyObject *self, PyObject *args); +static PyObject *_inP07ytFnRZ(PyObject *self, PyObject *args); +static PyObject *_inP07ytg0Qv(PyObject *self, PyObject *args); +static PyObject *_inP07yttrqw(PyObject *self, PyObject *args); +static PyObject *_inP07ytdmpW(PyObject *self, PyObject *args); +static PyObject *_inP07ytUYgQ(PyObject *self, PyObject *args); +static PyObject *_inP07yt0k7F(PyObject *self, PyObject *args); +static PyObject *_inP07ytfIsr(PyObject *self, PyObject *args); +static PyObject *_inP07ytvysR(PyObject *self, PyObject *args); +static PyObject *_inP07ytYQ_2(PyObject *self, PyObject *args); +static PyObject *_inP07yt3kdv(PyObject *self, PyObject *args); +static PyObject *_inP07ytew01(PyObject *self, PyObject *args); +static PyObject *_inP07ytQna7(PyObject *self, PyObject *args); +static PyObject *_inP07ytkg95(PyObject *self, PyObject *args); +static PyObject *_inP07ytluRc(PyObject *self, PyObject *args); +static PyObject *_inP07yttHdM(PyObject *self, PyObject *args); +static PyObject *_inP07ytDId0(PyObject *self, PyObject *args); +static PyObject *_inP07ytHuAm(PyObject *self, PyObject *args); +static PyObject *_inP07yt_xr0(PyObject *self, PyObject *args); +static PyObject *_inP07ytH5qp(PyObject *self, PyObject *args); +static PyObject *_inP07ytU2_B(PyObject *self, PyObject *args); +static PyObject *_inP07ytHFO2(PyObject *self, PyObject *args); +static PyObject *_inP07ytcfjm(PyObject *self, PyObject *args); +static PyObject *_inP07yt3Sjw(PyObject *self, PyObject *args); +static PyObject *_inP07ytgJcX(PyObject *self, PyObject *args); +static PyObject *_inP07ytYlw6(PyObject *self, PyObject *args); +static PyObject *_inP07ytsmnz(PyObject *self, PyObject *args); +static PyObject *_inP07ytxQ10(PyObject *self, PyObject *args); +static PyObject *_inP07yt6gPB(PyObject *self, PyObject *args); +static PyObject *_inP07ytISgV(PyObject *self, PyObject *args); +static PyObject *_inP07ytH3bx(PyObject *self, PyObject *args); +static PyObject *_inP07ytzeUk(PyObject *self, PyObject *args); +static PyObject *_inP07ytUeI5(PyObject *self, PyObject *args); +static PyObject *_inP07ytuSvx(PyObject *self, PyObject *args); +static PyObject *_inP07ytwpYd(PyObject *self, PyObject *args); +static PyObject *_inP07ytOfNh(PyObject *self, PyObject *args); +static PyObject *_inP07ytf5_U(PyObject *self, PyObject *args); +static PyObject *_inP07ytL3ZB(PyObject *self, PyObject *args); +static PyObject *_inP07ytXw0I(PyObject *self, PyObject *args); +static PyObject *_inP07yt3zru(PyObject *self, PyObject *args); +static PyObject *_inP07ytRrg2(PyObject *self, PyObject *args); +static PyObject *_inP07ytEJCx(PyObject *self, PyObject *args); +static PyObject *_inP07ytWAZr(PyObject *self, PyObject *args); +static PyObject *_inP07ytrD_M(PyObject *self, PyObject *args); +static PyObject *_inP07ytjolz(PyObject *self, PyObject *args); +static PyObject *_inP07ytt_JD(PyObject *self, PyObject *args); +static PyObject *_inP07ytwEts(PyObject *self, PyObject *args); +static PyObject *_inP07ytrJWs(PyObject *self, PyObject *args); +static PyObject *_inP07ytpmFD(PyObject *self, PyObject *args); +static PyObject *_inP07ytyYUX(PyObject *self, PyObject *args); +static PyObject *_inP07yt54dn(PyObject *self, PyObject *args); +static PyObject *_inP07ytGMpW(PyObject *self, PyObject *args); +static PyObject *_inP07ytNuBV(PyObject *self, PyObject *args); +static PyObject *_inP07yt9UwA(PyObject *self, PyObject *args); +static PyObject *_inP07yt3FDt(PyObject *self, PyObject *args); +static PyObject *_inP07ytf513(PyObject *self, PyObject *args); +static PyObject *_inP07ytsqGH(PyObject *self, PyObject *args); +static PyObject *_inP07yt7shV(PyObject *self, PyObject *args); +static PyObject *_inP07ytA1eF(PyObject *self, PyObject *args); +static PyObject *_inP07yt9tTm(PyObject *self, PyObject *args); +static PyObject *_inP07yt776V(PyObject *self, PyObject *args); +static PyObject *_inP07ytfaH0(PyObject *self, PyObject *args); +static PyObject *_inP07ytGB9D(PyObject *self, PyObject *args); +static PyObject *_inP07ytsxxs(PyObject *self, PyObject *args); +static PyObject *_inP07ytMT0z(PyObject *self, PyObject *args); +static PyObject *_inP07ytiW3v(PyObject *self, PyObject *args); +static PyObject *_inP07yt4Px8(PyObject *self, PyObject *args); +static PyObject *_inP07ytNHcs(PyObject *self, PyObject *args); +static PyObject *_inP07ytqHrb(PyObject *self, PyObject *args); +static PyObject *_inP07ytaOqq(PyObject *self, PyObject *args); +static PyObject *_inP07ytqWOw(PyObject *self, PyObject *args); +static PyObject *_inP07ytHu7x(PyObject *self, PyObject *args); +static PyObject *_inP07ytwGnA(PyObject *self, PyObject *args); +static PyObject *_inP07ytXGxx(PyObject *self, PyObject *args); +static PyObject *_inP07ytj04Z(PyObject *self, PyObject *args); +static PyObject *_inP07ytEOv4(PyObject *self, PyObject *args); +static PyObject *_inP07ytpCqJ(PyObject *self, PyObject *args); +static PyObject *_inP07yt_Pz3(PyObject *self, PyObject *args); +static PyObject *_inP07ytt_06(PyObject *self, PyObject *args); +static PyObject *_inP07ytmuPs(PyObject *self, PyObject *args); +static PyObject *_inP07ytvM8B(PyObject *self, PyObject *args); +static PyObject *_inP07ytap97(PyObject *self, PyObject *args); +static PyObject *_inP07yt0o8D(PyObject *self, PyObject *args); +static PyObject *_inP07ytOoQ2(PyObject *self, PyObject *args); +static PyObject *_inP07ytKuFh(PyObject *self, PyObject *args); +static PyObject *_inP07yto5L6(PyObject *self, PyObject *args); +static PyObject *_inP07ytzgKK(PyObject *self, PyObject *args); +static PyObject *_inP07yt0FIF(PyObject *self, PyObject *args); +static PyObject *_inP07ytZqvD(PyObject *self, PyObject *args); +static PyObject *_inP07ytDyRd(PyObject *self, PyObject *args); +static PyObject *_inP07ytMnKa(PyObject *self, PyObject *args); +static PyObject *_inP07ytRtji(PyObject *self, PyObject *args); +static PyObject *_inP07ytCnbQ(PyObject *self, PyObject *args); +static PyObject *_inP07ytdUVN(PyObject *self, PyObject *args); +static PyObject *_inP07ytihbt(PyObject *self, PyObject *args); +static PyObject *_inP07ytbyPY(PyObject *self, PyObject *args); +static PyObject *_inP07ytAaT6(PyObject *self, PyObject *args); +static PyObject *_inP07ytgL9q(PyObject *self, PyObject *args); +static PyObject *_inP07ytWB97(PyObject *self, PyObject *args); +static PyObject *_inP07ytDUAl(PyObject *self, PyObject *args); +static PyObject *_inP07yt1_Kf(PyObject *self, PyObject *args); +static PyObject *_inP07yt98lD(PyObject *self, PyObject *args); +static PyObject *_inP07yt9SHr(PyObject *self, PyObject *args); +static PyObject *_inP07ytdiZP(PyObject *self, PyObject *args); +static PyObject *_inP07ytTdER(PyObject *self, PyObject *args); +static PyObject *_inP07ytYO56(PyObject *self, PyObject *args); +static PyObject *_inP07ytxtCG(PyObject *self, PyObject *args); +static PyObject *_inP07yt_EB2(PyObject *self, PyObject *args); +static PyObject *_inP07ytEG1l(PyObject *self, PyObject *args); +static PyObject *_inP07yt7tUq(PyObject *self, PyObject *args); +static PyObject *_inP07ytyStU(PyObject *self, PyObject *args); +static PyObject *_inP07ytdM85(PyObject *self, PyObject *args); +static PyObject *_inP07ytk_GN(PyObject *self, PyObject *args); +static PyObject *_inP07yt8QjG(PyObject *self, PyObject *args); +static PyObject *_inP07ytyMtj(PyObject *self, PyObject *args); +static PyObject *_inP07ytHDtN(PyObject *self, PyObject *args); +static PyObject *_inP07ytHFjA(PyObject *self, PyObject *args); +static PyObject *_inP07yt_NPR(PyObject *self, PyObject *args); +static PyObject *_inP07ytcTOH(PyObject *self, PyObject *args); +static PyObject *_inP07ythdU7(PyObject *self, PyObject *args); +static PyObject *_inP07ytQPxU(PyObject *self, PyObject *args); +static PyObject *_inP07ytO7Pz(PyObject *self, PyObject *args); +static PyObject *_inP07ytvu_E(PyObject *self, PyObject *args); +static PyObject *_inP07ytxGUt(PyObject *self, PyObject *args); +static PyObject *_inP07ytzM1P(PyObject *self, PyObject *args); +static PyObject *_inP07ytoY5L(PyObject *self, PyObject *args); +static PyObject *_inP07yte_7S(PyObject *self, PyObject *args); +static PyObject *_inP07ytw_15(PyObject *self, PyObject *args); /* @@ -156,10 +159,10 @@ static PyObject *_inPU7VHoY5L(PyObject *self, PyObject *args); * void interrogate_add_search_directory(char const *dirname) */ static PyObject * -_inPU7VHtbRf(PyObject *, PyObject *args) { +_inP07yttbRf(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - interrogate_add_search_directory((char *)param0); + interrogate_add_search_directory((char const *)param0); return Py_BuildValue(""); } return (PyObject *)NULL; @@ -170,10 +173,10 @@ _inPU7VHtbRf(PyObject *, PyObject *args) { * void interrogate_add_search_path(char const *pathstring) */ static PyObject * -_inPU7VHda_g(PyObject *, PyObject *args) { +_inP07ytda_g(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - interrogate_add_search_path((char *)param0); + interrogate_add_search_path((char const *)param0); return Py_BuildValue(""); } return (PyObject *)NULL; @@ -184,7 +187,7 @@ _inPU7VHda_g(PyObject *, PyObject *args) { * bool interrogate_error_flag(void) */ static PyObject * -_inPU7VH4RgX(PyObject *, PyObject *args) { +_inP07yt4RgX(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { bool return_value = interrogate_error_flag(); return PyBool_FromLong(return_value); @@ -197,7 +200,7 @@ _inPU7VH4RgX(PyObject *, PyObject *args) { * int interrogate_number_of_manifests(void) */ static PyObject * -_inPU7VH3Gip(PyObject *, PyObject *args) { +_inP07yt3Gip(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_manifests(); #if PY_MAJOR_VERSION >= 3 @@ -214,7 +217,7 @@ _inPU7VH3Gip(PyObject *, PyObject *args) { * ManifestIndex interrogate_get_manifest(int n) */ static PyObject * -_inPU7VHRKDz(PyObject *, PyObject *args) { +_inP07ytRKDz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { ManifestIndex return_value = interrogate_get_manifest((int)param0); @@ -232,10 +235,10 @@ _inPU7VHRKDz(PyObject *, PyObject *args) { * ManifestIndex interrogate_get_manifest_by_name(char const *manifest_name) */ static PyObject * -_inPU7VHgZ9N(PyObject *, PyObject *args) { +_inP07ytgZ9N(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - ManifestIndex return_value = interrogate_get_manifest_by_name((char *)param0); + ManifestIndex return_value = interrogate_get_manifest_by_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -250,7 +253,7 @@ _inPU7VHgZ9N(PyObject *, PyObject *args) { * char const *interrogate_manifest_name(ManifestIndex manifest) */ static PyObject * -_inPU7VHFnRZ(PyObject *, PyObject *args) { +_inP07ytFnRZ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_manifest_name((ManifestIndex)param0); @@ -268,7 +271,7 @@ _inPU7VHFnRZ(PyObject *, PyObject *args) { * char const *interrogate_manifest_definition(ManifestIndex manifest) */ static PyObject * -_inPU7VHg0Qv(PyObject *, PyObject *args) { +_inP07ytg0Qv(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_manifest_definition((ManifestIndex)param0); @@ -286,7 +289,7 @@ _inPU7VHg0Qv(PyObject *, PyObject *args) { * bool interrogate_manifest_has_type(ManifestIndex manifest) */ static PyObject * -_inPU7VHtrqw(PyObject *, PyObject *args) { +_inP07yttrqw(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_type((ManifestIndex)param0); @@ -300,7 +303,7 @@ _inPU7VHtrqw(PyObject *, PyObject *args) { * TypeIndex interrogate_manifest_get_type(ManifestIndex manifest) */ static PyObject * -_inPU7VHdmpW(PyObject *, PyObject *args) { +_inP07ytdmpW(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_manifest_get_type((ManifestIndex)param0); @@ -318,7 +321,7 @@ _inPU7VHdmpW(PyObject *, PyObject *args) { * bool interrogate_manifest_has_getter(ManifestIndex manifest) */ static PyObject * -_inPU7VHUYgQ(PyObject *, PyObject *args) { +_inP07ytUYgQ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_getter((ManifestIndex)param0); @@ -332,7 +335,7 @@ _inPU7VHUYgQ(PyObject *, PyObject *args) { * FunctionIndex interrogate_manifest_getter(ManifestIndex manifest) */ static PyObject * -_inPU7VH0k7F(PyObject *, PyObject *args) { +_inP07yt0k7F(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_manifest_getter((ManifestIndex)param0); @@ -350,7 +353,7 @@ _inPU7VH0k7F(PyObject *, PyObject *args) { * bool interrogate_manifest_has_int_value(ManifestIndex manifest) */ static PyObject * -_inPU7VHfIsr(PyObject *, PyObject *args) { +_inP07ytfIsr(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_int_value((ManifestIndex)param0); @@ -364,7 +367,7 @@ _inPU7VHfIsr(PyObject *, PyObject *args) { * int interrogate_manifest_get_int_value(ManifestIndex manifest) */ static PyObject * -_inPU7VHvysR(PyObject *, PyObject *args) { +_inP07ytvysR(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_manifest_get_int_value((ManifestIndex)param0); @@ -382,7 +385,7 @@ _inPU7VHvysR(PyObject *, PyObject *args) { * char const *interrogate_element_name(ElementIndex element) */ static PyObject * -_inPU7VHYQ_2(PyObject *, PyObject *args) { +_inP07ytYQ_2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_name((ElementIndex)param0); @@ -400,7 +403,7 @@ _inPU7VHYQ_2(PyObject *, PyObject *args) { * char const *interrogate_element_scoped_name(ElementIndex element) */ static PyObject * -_inPU7VH3kdv(PyObject *, PyObject *args) { +_inP07yt3kdv(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_scoped_name((ElementIndex)param0); @@ -418,7 +421,7 @@ _inPU7VH3kdv(PyObject *, PyObject *args) { * bool interrogate_element_has_comment(ElementIndex element) */ static PyObject * -_inPU7VHew01(PyObject *, PyObject *args) { +_inP07ytew01(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_comment((ElementIndex)param0); @@ -432,7 +435,7 @@ _inPU7VHew01(PyObject *, PyObject *args) { * char const *interrogate_element_comment(ElementIndex element) */ static PyObject * -_inPU7VHQna7(PyObject *, PyObject *args) { +_inP07ytQna7(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_comment((ElementIndex)param0); @@ -450,10 +453,10 @@ _inPU7VHQna7(PyObject *, PyObject *args) { * ElementIndex interrogate_get_element_by_name(char const *element_name) */ static PyObject * -_inPU7VHkg95(PyObject *, PyObject *args) { +_inP07ytkg95(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - ElementIndex return_value = interrogate_get_element_by_name((char *)param0); + ElementIndex return_value = interrogate_get_element_by_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -468,10 +471,10 @@ _inPU7VHkg95(PyObject *, PyObject *args) { * ElementIndex interrogate_get_element_by_scoped_name(char const *element_name) */ static PyObject * -_inPU7VHluRc(PyObject *, PyObject *args) { +_inP07ytluRc(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - ElementIndex return_value = interrogate_get_element_by_scoped_name((char *)param0); + ElementIndex return_value = interrogate_get_element_by_scoped_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -486,7 +489,7 @@ _inPU7VHluRc(PyObject *, PyObject *args) { * TypeIndex interrogate_element_type(ElementIndex element) */ static PyObject * -_inPU7VHtHdM(PyObject *, PyObject *args) { +_inP07yttHdM(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_element_type((ElementIndex)param0); @@ -504,7 +507,7 @@ _inPU7VHtHdM(PyObject *, PyObject *args) { * bool interrogate_element_has_getter(ElementIndex element) */ static PyObject * -_inPU7VHDId0(PyObject *, PyObject *args) { +_inP07ytDId0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_getter((ElementIndex)param0); @@ -518,7 +521,7 @@ _inPU7VHDId0(PyObject *, PyObject *args) { * FunctionIndex interrogate_element_getter(ElementIndex element) */ static PyObject * -_inPU7VHHuAm(PyObject *, PyObject *args) { +_inP07ytHuAm(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_element_getter((ElementIndex)param0); @@ -536,7 +539,7 @@ _inPU7VHHuAm(PyObject *, PyObject *args) { * bool interrogate_element_has_setter(ElementIndex element) */ static PyObject * -_inPU7VH_xr0(PyObject *, PyObject *args) { +_inP07yt_xr0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_setter((ElementIndex)param0); @@ -550,7 +553,7 @@ _inPU7VH_xr0(PyObject *, PyObject *args) { * FunctionIndex interrogate_element_setter(ElementIndex element) */ static PyObject * -_inPU7VHH5qp(PyObject *, PyObject *args) { +_inP07ytH5qp(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_element_setter((ElementIndex)param0); @@ -568,7 +571,7 @@ _inPU7VHH5qp(PyObject *, PyObject *args) { * int interrogate_number_of_globals(void) */ static PyObject * -_inPU7VHU2_B(PyObject *, PyObject *args) { +_inP07ytU2_B(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_globals(); #if PY_MAJOR_VERSION >= 3 @@ -585,7 +588,7 @@ _inPU7VHU2_B(PyObject *, PyObject *args) { * ElementIndex interrogate_get_global(int n) */ static PyObject * -_inPU7VHHFO2(PyObject *, PyObject *args) { +_inP07ytHFO2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { ElementIndex return_value = interrogate_get_global((int)param0); @@ -603,7 +606,7 @@ _inPU7VHHFO2(PyObject *, PyObject *args) { * int interrogate_number_of_global_functions(void) */ static PyObject * -_inPU7VHcfjm(PyObject *, PyObject *args) { +_inP07ytcfjm(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_global_functions(); #if PY_MAJOR_VERSION >= 3 @@ -620,7 +623,7 @@ _inPU7VHcfjm(PyObject *, PyObject *args) { * FunctionIndex interrogate_get_global_function(int n) */ static PyObject * -_inPU7VH3Sjw(PyObject *, PyObject *args) { +_inP07yt3Sjw(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_get_global_function((int)param0); @@ -638,7 +641,7 @@ _inPU7VH3Sjw(PyObject *, PyObject *args) { * int interrogate_number_of_functions(void) */ static PyObject * -_inPU7VHgJcX(PyObject *, PyObject *args) { +_inP07ytgJcX(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_functions(); #if PY_MAJOR_VERSION >= 3 @@ -655,7 +658,7 @@ _inPU7VHgJcX(PyObject *, PyObject *args) { * FunctionIndex interrogate_get_function(int n) */ static PyObject * -_inPU7VHYlw6(PyObject *, PyObject *args) { +_inP07ytYlw6(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_get_function((int)param0); @@ -673,7 +676,7 @@ _inPU7VHYlw6(PyObject *, PyObject *args) { * char const *interrogate_function_name(FunctionIndex function) */ static PyObject * -_inPU7VHsmnz(PyObject *, PyObject *args) { +_inP07ytsmnz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_name((FunctionIndex)param0); @@ -691,7 +694,7 @@ _inPU7VHsmnz(PyObject *, PyObject *args) { * char const *interrogate_function_scoped_name(FunctionIndex function) */ static PyObject * -_inPU7VHxQ10(PyObject *, PyObject *args) { +_inP07ytxQ10(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_scoped_name((FunctionIndex)param0); @@ -709,7 +712,7 @@ _inPU7VHxQ10(PyObject *, PyObject *args) { * bool interrogate_function_has_comment(FunctionIndex function) */ static PyObject * -_inPU7VH6gPB(PyObject *, PyObject *args) { +_inP07yt6gPB(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_comment((FunctionIndex)param0); @@ -723,7 +726,7 @@ _inPU7VH6gPB(PyObject *, PyObject *args) { * char const *interrogate_function_comment(FunctionIndex function) */ static PyObject * -_inPU7VHISgV(PyObject *, PyObject *args) { +_inP07ytISgV(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_comment((FunctionIndex)param0); @@ -741,7 +744,7 @@ _inPU7VHISgV(PyObject *, PyObject *args) { * char const *interrogate_function_prototype(FunctionIndex function) */ static PyObject * -_inPU7VHH3bx(PyObject *, PyObject *args) { +_inP07ytH3bx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_prototype((FunctionIndex)param0); @@ -759,7 +762,7 @@ _inPU7VHH3bx(PyObject *, PyObject *args) { * bool interrogate_function_is_method(FunctionIndex function) */ static PyObject * -_inPU7VHzeUk(PyObject *, PyObject *args) { +_inP07ytzeUk(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_is_method((FunctionIndex)param0); @@ -773,7 +776,7 @@ _inPU7VHzeUk(PyObject *, PyObject *args) { * TypeIndex interrogate_function_class(FunctionIndex function) */ static PyObject * -_inPU7VHUeI5(PyObject *, PyObject *args) { +_inP07ytUeI5(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_function_class((FunctionIndex)param0); @@ -791,7 +794,7 @@ _inPU7VHUeI5(PyObject *, PyObject *args) { * bool interrogate_function_has_module_name(FunctionIndex function) */ static PyObject * -_inPU7VHuSvx(PyObject *, PyObject *args) { +_inP07ytuSvx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_module_name((FunctionIndex)param0); @@ -805,7 +808,7 @@ _inPU7VHuSvx(PyObject *, PyObject *args) { * char const *interrogate_function_module_name(FunctionIndex function) */ static PyObject * -_inPU7VHwpYd(PyObject *, PyObject *args) { +_inP07ytwpYd(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_module_name((FunctionIndex)param0); @@ -823,7 +826,7 @@ _inPU7VHwpYd(PyObject *, PyObject *args) { * bool interrogate_function_has_library_name(FunctionIndex function) */ static PyObject * -_inPU7VHOfNh(PyObject *, PyObject *args) { +_inP07ytOfNh(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_library_name((FunctionIndex)param0); @@ -837,7 +840,7 @@ _inPU7VHOfNh(PyObject *, PyObject *args) { * char const *interrogate_function_library_name(FunctionIndex function) */ static PyObject * -_inPU7VHf5_U(PyObject *, PyObject *args) { +_inP07ytf5_U(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_library_name((FunctionIndex)param0); @@ -855,7 +858,7 @@ _inPU7VHf5_U(PyObject *, PyObject *args) { * bool interrogate_function_is_virtual(FunctionIndex function) */ static PyObject * -_inPU7VHL3ZB(PyObject *, PyObject *args) { +_inP07ytL3ZB(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_is_virtual((FunctionIndex)param0); @@ -869,7 +872,7 @@ _inPU7VHL3ZB(PyObject *, PyObject *args) { * int interrogate_function_number_of_c_wrappers(FunctionIndex function) */ static PyObject * -_inPU7VHXw0I(PyObject *, PyObject *args) { +_inP07ytXw0I(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_function_number_of_c_wrappers((FunctionIndex)param0); @@ -887,7 +890,7 @@ _inPU7VHXw0I(PyObject *, PyObject *args) { * FunctionWrapperIndex interrogate_function_c_wrapper(FunctionIndex function, int n) */ static PyObject * -_inPU7VH3zru(PyObject *, PyObject *args) { +_inP07yt3zru(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -906,7 +909,7 @@ _inPU7VH3zru(PyObject *, PyObject *args) { * int interrogate_function_number_of_python_wrappers(FunctionIndex function) */ static PyObject * -_inPU7VHRrg2(PyObject *, PyObject *args) { +_inP07ytRrg2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_function_number_of_python_wrappers((FunctionIndex)param0); @@ -924,7 +927,7 @@ _inPU7VHRrg2(PyObject *, PyObject *args) { * FunctionWrapperIndex interrogate_function_python_wrapper(FunctionIndex function, int n) */ static PyObject * -_inPU7VHEJCx(PyObject *, PyObject *args) { +_inP07ytEJCx(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -943,7 +946,7 @@ _inPU7VHEJCx(PyObject *, PyObject *args) { * char const *interrogate_wrapper_name(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHWAZr(PyObject *, PyObject *args) { +_inP07ytWAZr(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_name((FunctionWrapperIndex)param0); @@ -961,7 +964,7 @@ _inPU7VHWAZr(PyObject *, PyObject *args) { * bool interrogate_wrapper_is_callable_by_name(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHrD_M(PyObject *, PyObject *args) { +_inP07ytrD_M(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_is_callable_by_name((FunctionWrapperIndex)param0); @@ -975,7 +978,7 @@ _inPU7VHrD_M(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_comment(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHjolz(PyObject *, PyObject *args) { +_inP07ytjolz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_comment((FunctionWrapperIndex)param0); @@ -989,7 +992,7 @@ _inPU7VHjolz(PyObject *, PyObject *args) { * char const *interrogate_wrapper_comment(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHt_JD(PyObject *, PyObject *args) { +_inP07ytt_JD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_comment((FunctionWrapperIndex)param0); @@ -1007,7 +1010,7 @@ _inPU7VHt_JD(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_return_value(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHwEts(PyObject *, PyObject *args) { +_inP07ytwEts(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_return_value((FunctionWrapperIndex)param0); @@ -1021,7 +1024,7 @@ _inPU7VHwEts(PyObject *, PyObject *args) { * TypeIndex interrogate_wrapper_return_type(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHrJWs(PyObject *, PyObject *args) { +_inP07ytrJWs(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_wrapper_return_type((FunctionWrapperIndex)param0); @@ -1039,7 +1042,7 @@ _inPU7VHrJWs(PyObject *, PyObject *args) { * bool interrogate_wrapper_caller_manages_return_value(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHpmFD(PyObject *, PyObject *args) { +_inP07ytpmFD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_caller_manages_return_value((FunctionWrapperIndex)param0); @@ -1053,7 +1056,7 @@ _inPU7VHpmFD(PyObject *, PyObject *args) { * FunctionIndex interrogate_wrapper_return_value_destructor(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHyYUX(PyObject *, PyObject *args) { +_inP07ytyYUX(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_wrapper_return_value_destructor((FunctionWrapperIndex)param0); @@ -1071,7 +1074,7 @@ _inPU7VHyYUX(PyObject *, PyObject *args) { * int interrogate_wrapper_number_of_parameters(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VH54dn(PyObject *, PyObject *args) { +_inP07yt54dn(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_wrapper_number_of_parameters((FunctionWrapperIndex)param0); @@ -1089,7 +1092,7 @@ _inPU7VH54dn(PyObject *, PyObject *args) { * TypeIndex interrogate_wrapper_parameter_type(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VHGMpW(PyObject *, PyObject *args) { +_inP07ytGMpW(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1108,7 +1111,7 @@ _inPU7VHGMpW(PyObject *, PyObject *args) { * bool interrogate_wrapper_parameter_has_name(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VHNuBV(PyObject *, PyObject *args) { +_inP07ytNuBV(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1123,7 +1126,7 @@ _inPU7VHNuBV(PyObject *, PyObject *args) { * char const *interrogate_wrapper_parameter_name(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VH9UwA(PyObject *, PyObject *args) { +_inP07yt9UwA(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1142,7 +1145,7 @@ _inPU7VH9UwA(PyObject *, PyObject *args) { * bool interrogate_wrapper_parameter_is_this(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VH3FDt(PyObject *, PyObject *args) { +_inP07yt3FDt(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1157,7 +1160,7 @@ _inPU7VH3FDt(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_pointer(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHf513(PyObject *, PyObject *args) { +_inP07ytf513(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_pointer((FunctionWrapperIndex)param0); @@ -1171,7 +1174,7 @@ _inPU7VHf513(PyObject *, PyObject *args) { * void *interrogate_wrapper_pointer(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHsqGH(PyObject *, PyObject *args) { +_inP07ytsqGH(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { interrogate_wrapper_pointer((FunctionWrapperIndex)param0); @@ -1185,7 +1188,7 @@ _inPU7VHsqGH(PyObject *, PyObject *args) { * char const *interrogate_wrapper_unique_name(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VH7shV(PyObject *, PyObject *args) { +_inP07yt7shV(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_unique_name((FunctionWrapperIndex)param0); @@ -1203,10 +1206,10 @@ _inPU7VH7shV(PyObject *, PyObject *args) { * FunctionWrapperIndex interrogate_get_wrapper_by_unique_name(char const *unique_name) */ static PyObject * -_inPU7VHA1eF(PyObject *, PyObject *args) { +_inP07ytA1eF(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - FunctionWrapperIndex return_value = interrogate_get_wrapper_by_unique_name((char *)param0); + FunctionWrapperIndex return_value = interrogate_get_wrapper_by_unique_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1221,7 +1224,7 @@ _inPU7VHA1eF(PyObject *, PyObject *args) { * TypeIndex interrogate_make_seq_class(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VH9tTm(PyObject *, PyObject *args) { +_inP07yt9tTm(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_make_seq_class((MakeSeqIndex)param0); @@ -1239,7 +1242,7 @@ _inPU7VH9tTm(PyObject *, PyObject *args) { * char const *interrogate_make_seq_seq_name(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VH776V(PyObject *, PyObject *args) { +_inP07yt776V(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_seq_name((MakeSeqIndex)param0); @@ -1257,7 +1260,7 @@ _inPU7VH776V(PyObject *, PyObject *args) { * char const *interrogate_make_seq_num_name(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VHfaH0(PyObject *, PyObject *args) { +_inP07ytfaH0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_num_name((MakeSeqIndex)param0); @@ -1275,7 +1278,7 @@ _inPU7VHfaH0(PyObject *, PyObject *args) { * char const *interrogate_make_seq_element_name(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VHGB9D(PyObject *, PyObject *args) { +_inP07ytGB9D(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_element_name((MakeSeqIndex)param0); @@ -1293,7 +1296,7 @@ _inPU7VHGB9D(PyObject *, PyObject *args) { * int interrogate_number_of_global_types(void) */ static PyObject * -_inPU7VHsxxs(PyObject *, PyObject *args) { +_inP07ytsxxs(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_global_types(); #if PY_MAJOR_VERSION >= 3 @@ -1310,7 +1313,7 @@ _inPU7VHsxxs(PyObject *, PyObject *args) { * TypeIndex interrogate_get_global_type(int n) */ static PyObject * -_inPU7VHMT0z(PyObject *, PyObject *args) { +_inP07ytMT0z(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_get_global_type((int)param0); @@ -1328,7 +1331,7 @@ _inPU7VHMT0z(PyObject *, PyObject *args) { * int interrogate_number_of_types(void) */ static PyObject * -_inPU7VHiW3v(PyObject *, PyObject *args) { +_inP07ytiW3v(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_types(); #if PY_MAJOR_VERSION >= 3 @@ -1345,7 +1348,7 @@ _inPU7VHiW3v(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type(int n) */ static PyObject * -_inPU7VH4Px8(PyObject *, PyObject *args) { +_inP07yt4Px8(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_get_type((int)param0); @@ -1363,10 +1366,10 @@ _inPU7VH4Px8(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type_by_name(char const *type_name) */ static PyObject * -_inPU7VHNHcs(PyObject *, PyObject *args) { +_inP07ytNHcs(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - TypeIndex return_value = interrogate_get_type_by_name((char *)param0); + TypeIndex return_value = interrogate_get_type_by_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1381,10 +1384,10 @@ _inPU7VHNHcs(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type_by_scoped_name(char const *type_name) */ static PyObject * -_inPU7VHqHrb(PyObject *, PyObject *args) { +_inP07ytqHrb(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - TypeIndex return_value = interrogate_get_type_by_scoped_name((char *)param0); + TypeIndex return_value = interrogate_get_type_by_scoped_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1399,10 +1402,10 @@ _inPU7VHqHrb(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type_by_true_name(char const *type_name) */ static PyObject * -_inPU7VHaOqq(PyObject *, PyObject *args) { +_inP07ytaOqq(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - TypeIndex return_value = interrogate_get_type_by_true_name((char *)param0); + TypeIndex return_value = interrogate_get_type_by_true_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1417,7 +1420,7 @@ _inPU7VHaOqq(PyObject *, PyObject *args) { * char const *interrogate_type_name(TypeIndex type) */ static PyObject * -_inPU7VHqWOw(PyObject *, PyObject *args) { +_inP07ytqWOw(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_name((TypeIndex)param0); @@ -1435,7 +1438,7 @@ _inPU7VHqWOw(PyObject *, PyObject *args) { * char const *interrogate_type_scoped_name(TypeIndex type) */ static PyObject * -_inPU7VHHu7x(PyObject *, PyObject *args) { +_inP07ytHu7x(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_scoped_name((TypeIndex)param0); @@ -1453,7 +1456,7 @@ _inPU7VHHu7x(PyObject *, PyObject *args) { * char const *interrogate_type_true_name(TypeIndex type) */ static PyObject * -_inPU7VHwGnA(PyObject *, PyObject *args) { +_inP07ytwGnA(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_true_name((TypeIndex)param0); @@ -1471,7 +1474,7 @@ _inPU7VHwGnA(PyObject *, PyObject *args) { * bool interrogate_type_is_nested(TypeIndex type) */ static PyObject * -_inPU7VHXGxx(PyObject *, PyObject *args) { +_inP07ytXGxx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_nested((TypeIndex)param0); @@ -1485,7 +1488,7 @@ _inPU7VHXGxx(PyObject *, PyObject *args) { * TypeIndex interrogate_type_outer_class(TypeIndex type) */ static PyObject * -_inPU7VHj04Z(PyObject *, PyObject *args) { +_inP07ytj04Z(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_type_outer_class((TypeIndex)param0); @@ -1503,7 +1506,7 @@ _inPU7VHj04Z(PyObject *, PyObject *args) { * bool interrogate_type_has_comment(TypeIndex type) */ static PyObject * -_inPU7VHEOv4(PyObject *, PyObject *args) { +_inP07ytEOv4(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_comment((TypeIndex)param0); @@ -1517,7 +1520,7 @@ _inPU7VHEOv4(PyObject *, PyObject *args) { * char const *interrogate_type_comment(TypeIndex type) */ static PyObject * -_inPU7VHpCqJ(PyObject *, PyObject *args) { +_inP07ytpCqJ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_comment((TypeIndex)param0); @@ -1535,7 +1538,7 @@ _inPU7VHpCqJ(PyObject *, PyObject *args) { * bool interrogate_type_has_module_name(TypeIndex type) */ static PyObject * -_inPU7VH_Pz3(PyObject *, PyObject *args) { +_inP07yt_Pz3(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_module_name((TypeIndex)param0); @@ -1549,7 +1552,7 @@ _inPU7VH_Pz3(PyObject *, PyObject *args) { * char const *interrogate_type_module_name(TypeIndex type) */ static PyObject * -_inPU7VHt_06(PyObject *, PyObject *args) { +_inP07ytt_06(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_module_name((TypeIndex)param0); @@ -1567,7 +1570,7 @@ _inPU7VHt_06(PyObject *, PyObject *args) { * bool interrogate_type_has_library_name(TypeIndex type) */ static PyObject * -_inPU7VHmuPs(PyObject *, PyObject *args) { +_inP07ytmuPs(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_library_name((TypeIndex)param0); @@ -1581,7 +1584,7 @@ _inPU7VHmuPs(PyObject *, PyObject *args) { * char const *interrogate_type_library_name(TypeIndex type) */ static PyObject * -_inPU7VHvM8B(PyObject *, PyObject *args) { +_inP07ytvM8B(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_library_name((TypeIndex)param0); @@ -1599,7 +1602,7 @@ _inPU7VHvM8B(PyObject *, PyObject *args) { * bool interrogate_type_is_atomic(TypeIndex type) */ static PyObject * -_inPU7VHap97(PyObject *, PyObject *args) { +_inP07ytap97(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_atomic((TypeIndex)param0); @@ -1613,7 +1616,7 @@ _inPU7VHap97(PyObject *, PyObject *args) { * AtomicToken interrogate_type_atomic_token(TypeIndex type) */ static PyObject * -_inPU7VH0o8D(PyObject *, PyObject *args) { +_inP07yt0o8D(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { AtomicToken return_value = interrogate_type_atomic_token((TypeIndex)param0); @@ -1631,7 +1634,7 @@ _inPU7VH0o8D(PyObject *, PyObject *args) { * bool interrogate_type_is_unsigned(TypeIndex type) */ static PyObject * -_inPU7VHOoQ2(PyObject *, PyObject *args) { +_inP07ytOoQ2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_unsigned((TypeIndex)param0); @@ -1645,7 +1648,7 @@ _inPU7VHOoQ2(PyObject *, PyObject *args) { * bool interrogate_type_is_signed(TypeIndex type) */ static PyObject * -_inPU7VHKuFh(PyObject *, PyObject *args) { +_inP07ytKuFh(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_signed((TypeIndex)param0); @@ -1659,7 +1662,7 @@ _inPU7VHKuFh(PyObject *, PyObject *args) { * bool interrogate_type_is_long(TypeIndex type) */ static PyObject * -_inPU7VHo5L6(PyObject *, PyObject *args) { +_inP07yto5L6(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_long((TypeIndex)param0); @@ -1673,7 +1676,7 @@ _inPU7VHo5L6(PyObject *, PyObject *args) { * bool interrogate_type_is_longlong(TypeIndex type) */ static PyObject * -_inPU7VHzgKK(PyObject *, PyObject *args) { +_inP07ytzgKK(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_longlong((TypeIndex)param0); @@ -1687,7 +1690,7 @@ _inPU7VHzgKK(PyObject *, PyObject *args) { * bool interrogate_type_is_short(TypeIndex type) */ static PyObject * -_inPU7VH0FIF(PyObject *, PyObject *args) { +_inP07yt0FIF(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_short((TypeIndex)param0); @@ -1701,7 +1704,7 @@ _inPU7VH0FIF(PyObject *, PyObject *args) { * bool interrogate_type_is_wrapped(TypeIndex type) */ static PyObject * -_inPU7VHZqvD(PyObject *, PyObject *args) { +_inP07ytZqvD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_wrapped((TypeIndex)param0); @@ -1715,7 +1718,7 @@ _inPU7VHZqvD(PyObject *, PyObject *args) { * bool interrogate_type_is_pointer(TypeIndex type) */ static PyObject * -_inPU7VHDyRd(PyObject *, PyObject *args) { +_inP07ytDyRd(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_pointer((TypeIndex)param0); @@ -1729,7 +1732,7 @@ _inPU7VHDyRd(PyObject *, PyObject *args) { * bool interrogate_type_is_const(TypeIndex type) */ static PyObject * -_inPU7VHMnKa(PyObject *, PyObject *args) { +_inP07ytMnKa(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_const((TypeIndex)param0); @@ -1743,7 +1746,7 @@ _inPU7VHMnKa(PyObject *, PyObject *args) { * bool interrogate_type_is_typedef(TypeIndex type) */ static PyObject * -_inPU7VHRtji(PyObject *, PyObject *args) { +_inP07ytRtji(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_typedef((TypeIndex)param0); @@ -1757,7 +1760,7 @@ _inPU7VHRtji(PyObject *, PyObject *args) { * TypeIndex interrogate_type_wrapped_type(TypeIndex type) */ static PyObject * -_inPU7VHCnbQ(PyObject *, PyObject *args) { +_inP07ytCnbQ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_type_wrapped_type((TypeIndex)param0); @@ -1775,7 +1778,7 @@ _inPU7VHCnbQ(PyObject *, PyObject *args) { * bool interrogate_type_is_enum(TypeIndex type) */ static PyObject * -_inPU7VHdUVN(PyObject *, PyObject *args) { +_inP07ytdUVN(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_enum((TypeIndex)param0); @@ -1789,7 +1792,7 @@ _inPU7VHdUVN(PyObject *, PyObject *args) { * int interrogate_type_number_of_enum_values(TypeIndex type) */ static PyObject * -_inPU7VHihbt(PyObject *, PyObject *args) { +_inP07ytihbt(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_enum_values((TypeIndex)param0); @@ -1807,7 +1810,7 @@ _inPU7VHihbt(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_name(TypeIndex type, int n) */ static PyObject * -_inPU7VHbyPY(PyObject *, PyObject *args) { +_inP07ytbyPY(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1826,7 +1829,7 @@ _inPU7VHbyPY(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_scoped_name(TypeIndex type, int n) */ static PyObject * -_inPU7VHAaT6(PyObject *, PyObject *args) { +_inP07ytAaT6(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1845,7 +1848,7 @@ _inPU7VHAaT6(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_comment(TypeIndex type, int n) */ static PyObject * -_inPU7VHgL9q(PyObject *, PyObject *args) { +_inP07ytgL9q(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1864,7 +1867,7 @@ _inPU7VHgL9q(PyObject *, PyObject *args) { * int interrogate_type_enum_value(TypeIndex type, int n) */ static PyObject * -_inPU7VHWB97(PyObject *, PyObject *args) { +_inP07ytWB97(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1883,7 +1886,7 @@ _inPU7VHWB97(PyObject *, PyObject *args) { * bool interrogate_type_is_struct(TypeIndex type) */ static PyObject * -_inPU7VHDUAl(PyObject *, PyObject *args) { +_inP07ytDUAl(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_struct((TypeIndex)param0); @@ -1897,7 +1900,7 @@ _inPU7VHDUAl(PyObject *, PyObject *args) { * bool interrogate_type_is_class(TypeIndex type) */ static PyObject * -_inPU7VH1_Kf(PyObject *, PyObject *args) { +_inP07yt1_Kf(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_class((TypeIndex)param0); @@ -1911,7 +1914,7 @@ _inPU7VH1_Kf(PyObject *, PyObject *args) { * bool interrogate_type_is_union(TypeIndex type) */ static PyObject * -_inPU7VH98lD(PyObject *, PyObject *args) { +_inP07yt98lD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_union((TypeIndex)param0); @@ -1925,7 +1928,7 @@ _inPU7VH98lD(PyObject *, PyObject *args) { * bool interrogate_type_is_fully_defined(TypeIndex type) */ static PyObject * -_inPU7VH9SHr(PyObject *, PyObject *args) { +_inP07yt9SHr(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_fully_defined((TypeIndex)param0); @@ -1939,7 +1942,7 @@ _inPU7VH9SHr(PyObject *, PyObject *args) { * bool interrogate_type_is_unpublished(TypeIndex type) */ static PyObject * -_inPU7VHdiZP(PyObject *, PyObject *args) { +_inP07ytdiZP(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_unpublished((TypeIndex)param0); @@ -1953,7 +1956,7 @@ _inPU7VHdiZP(PyObject *, PyObject *args) { * int interrogate_type_number_of_constructors(TypeIndex type) */ static PyObject * -_inPU7VHTdER(PyObject *, PyObject *args) { +_inP07ytTdER(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_constructors((TypeIndex)param0); @@ -1971,7 +1974,7 @@ _inPU7VHTdER(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_constructor(TypeIndex type, int n) */ static PyObject * -_inPU7VHYO56(PyObject *, PyObject *args) { +_inP07ytYO56(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1990,7 +1993,7 @@ _inPU7VHYO56(PyObject *, PyObject *args) { * bool interrogate_type_has_destructor(TypeIndex type) */ static PyObject * -_inPU7VHxtCG(PyObject *, PyObject *args) { +_inP07ytxtCG(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_destructor((TypeIndex)param0); @@ -2004,7 +2007,7 @@ _inPU7VHxtCG(PyObject *, PyObject *args) { * bool interrogate_type_destructor_is_inherited(TypeIndex type) */ static PyObject * -_inPU7VH_EB2(PyObject *, PyObject *args) { +_inP07yt_EB2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_destructor_is_inherited((TypeIndex)param0); @@ -2018,7 +2021,7 @@ _inPU7VH_EB2(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_destructor(TypeIndex type) */ static PyObject * -_inPU7VHEG1l(PyObject *, PyObject *args) { +_inP07ytEG1l(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_type_get_destructor((TypeIndex)param0); @@ -2036,7 +2039,7 @@ _inPU7VHEG1l(PyObject *, PyObject *args) { * int interrogate_type_number_of_elements(TypeIndex type) */ static PyObject * -_inPU7VH7tUq(PyObject *, PyObject *args) { +_inP07yt7tUq(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_elements((TypeIndex)param0); @@ -2054,7 +2057,7 @@ _inPU7VH7tUq(PyObject *, PyObject *args) { * ElementIndex interrogate_type_get_element(TypeIndex type, int n) */ static PyObject * -_inPU7VHyStU(PyObject *, PyObject *args) { +_inP07ytyStU(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2073,7 +2076,7 @@ _inPU7VHyStU(PyObject *, PyObject *args) { * int interrogate_type_number_of_methods(TypeIndex type) */ static PyObject * -_inPU7VHdM85(PyObject *, PyObject *args) { +_inP07ytdM85(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_methods((TypeIndex)param0); @@ -2091,7 +2094,7 @@ _inPU7VHdM85(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_method(TypeIndex type, int n) */ static PyObject * -_inPU7VHk_GN(PyObject *, PyObject *args) { +_inP07ytk_GN(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2110,7 +2113,7 @@ _inPU7VHk_GN(PyObject *, PyObject *args) { * int interrogate_type_number_of_make_seqs(TypeIndex type) */ static PyObject * -_inPU7VH8QjG(PyObject *, PyObject *args) { +_inP07yt8QjG(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_make_seqs((TypeIndex)param0); @@ -2128,7 +2131,7 @@ _inPU7VH8QjG(PyObject *, PyObject *args) { * MakeSeqIndex interrogate_type_get_make_seq(TypeIndex type, int n) */ static PyObject * -_inPU7VHyMtj(PyObject *, PyObject *args) { +_inP07ytyMtj(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2147,7 +2150,7 @@ _inPU7VHyMtj(PyObject *, PyObject *args) { * int interrogate_type_number_of_casts(TypeIndex type) */ static PyObject * -_inPU7VHHDtN(PyObject *, PyObject *args) { +_inP07ytHDtN(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_casts((TypeIndex)param0); @@ -2165,7 +2168,7 @@ _inPU7VHHDtN(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_cast(TypeIndex type, int n) */ static PyObject * -_inPU7VHHFjA(PyObject *, PyObject *args) { +_inP07ytHFjA(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2184,7 +2187,7 @@ _inPU7VHHFjA(PyObject *, PyObject *args) { * int interrogate_type_number_of_derivations(TypeIndex type) */ static PyObject * -_inPU7VH_NPR(PyObject *, PyObject *args) { +_inP07yt_NPR(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_derivations((TypeIndex)param0); @@ -2202,7 +2205,7 @@ _inPU7VH_NPR(PyObject *, PyObject *args) { * TypeIndex interrogate_type_get_derivation(TypeIndex type, int n) */ static PyObject * -_inPU7VHcTOH(PyObject *, PyObject *args) { +_inP07ytcTOH(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2221,7 +2224,7 @@ _inPU7VHcTOH(PyObject *, PyObject *args) { * bool interrogate_type_derivation_has_upcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHhdU7(PyObject *, PyObject *args) { +_inP07ythdU7(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2236,7 +2239,7 @@ _inPU7VHhdU7(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_upcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHQPxU(PyObject *, PyObject *args) { +_inP07ytQPxU(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2255,7 +2258,7 @@ _inPU7VHQPxU(PyObject *, PyObject *args) { * bool interrogate_type_derivation_downcast_is_impossible(TypeIndex type, int n) */ static PyObject * -_inPU7VHO7Pz(PyObject *, PyObject *args) { +_inP07ytO7Pz(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2270,7 +2273,7 @@ _inPU7VHO7Pz(PyObject *, PyObject *args) { * bool interrogate_type_derivation_has_downcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHvu_E(PyObject *, PyObject *args) { +_inP07ytvu_E(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2285,7 +2288,7 @@ _inPU7VHvu_E(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_downcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHxGUt(PyObject *, PyObject *args) { +_inP07ytxGUt(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2304,7 +2307,7 @@ _inPU7VHxGUt(PyObject *, PyObject *args) { * int interrogate_type_number_of_nested_types(TypeIndex type) */ static PyObject * -_inPU7VHzM1P(PyObject *, PyObject *args) { +_inP07ytzM1P(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_nested_types((TypeIndex)param0); @@ -2322,7 +2325,7 @@ _inPU7VHzM1P(PyObject *, PyObject *args) { * TypeIndex interrogate_type_get_nested_type(TypeIndex type, int n) */ static PyObject * -_inPU7VHoY5L(PyObject *, PyObject *args) { +_inP07ytoY5L(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2336,139 +2339,169 @@ _inPU7VHoY5L(PyObject *, PyObject *args) { return (PyObject *)NULL; } +/* + * Python simple wrapper for + * void interrogate_request_database(char const *database_filename) + */ +static PyObject * +_inP07yte_7S(PyObject *, PyObject *args) { + char *param0; + if (PyArg_ParseTuple(args, "s", ¶m0)) { + interrogate_request_database((char const *)param0); + return Py_BuildValue(""); + } + return (PyObject *)NULL; +} + +/* + * Python simple wrapper for + * void interrogate_request_module(InterrogateModuleDef *def) + */ +static PyObject * +_inP07ytw_15(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + interrogate_request_module((InterrogateModuleDef *)param0); + return Py_BuildValue(""); + } + return (PyObject *)NULL; +} + static PyMethodDef python_simple_funcs[] = { - { "interrogate_add_search_directory", &_inPU7VHtbRf, METH_VARARGS }, - { "interrogate_add_search_path", &_inPU7VHda_g, METH_VARARGS }, - { "interrogate_error_flag", &_inPU7VH4RgX, METH_VARARGS }, - { "interrogate_number_of_manifests", &_inPU7VH3Gip, METH_VARARGS }, - { "interrogate_get_manifest", &_inPU7VHRKDz, METH_VARARGS }, - { "interrogate_get_manifest_by_name", &_inPU7VHgZ9N, METH_VARARGS }, - { "interrogate_manifest_name", &_inPU7VHFnRZ, METH_VARARGS }, - { "interrogate_manifest_definition", &_inPU7VHg0Qv, METH_VARARGS }, - { "interrogate_manifest_has_type", &_inPU7VHtrqw, METH_VARARGS }, - { "interrogate_manifest_get_type", &_inPU7VHdmpW, METH_VARARGS }, - { "interrogate_manifest_has_getter", &_inPU7VHUYgQ, METH_VARARGS }, - { "interrogate_manifest_getter", &_inPU7VH0k7F, METH_VARARGS }, - { "interrogate_manifest_has_int_value", &_inPU7VHfIsr, METH_VARARGS }, - { "interrogate_manifest_get_int_value", &_inPU7VHvysR, METH_VARARGS }, - { "interrogate_element_name", &_inPU7VHYQ_2, METH_VARARGS }, - { "interrogate_element_scoped_name", &_inPU7VH3kdv, METH_VARARGS }, - { "interrogate_element_has_comment", &_inPU7VHew01, METH_VARARGS }, - { "interrogate_element_comment", &_inPU7VHQna7, METH_VARARGS }, - { "interrogate_get_element_by_name", &_inPU7VHkg95, METH_VARARGS }, - { "interrogate_get_element_by_scoped_name", &_inPU7VHluRc, METH_VARARGS }, - { "interrogate_element_type", &_inPU7VHtHdM, METH_VARARGS }, - { "interrogate_element_has_getter", &_inPU7VHDId0, METH_VARARGS }, - { "interrogate_element_getter", &_inPU7VHHuAm, METH_VARARGS }, - { "interrogate_element_has_setter", &_inPU7VH_xr0, METH_VARARGS }, - { "interrogate_element_setter", &_inPU7VHH5qp, METH_VARARGS }, - { "interrogate_number_of_globals", &_inPU7VHU2_B, METH_VARARGS }, - { "interrogate_get_global", &_inPU7VHHFO2, METH_VARARGS }, - { "interrogate_number_of_global_functions", &_inPU7VHcfjm, METH_VARARGS }, - { "interrogate_get_global_function", &_inPU7VH3Sjw, METH_VARARGS }, - { "interrogate_number_of_functions", &_inPU7VHgJcX, METH_VARARGS }, - { "interrogate_get_function", &_inPU7VHYlw6, METH_VARARGS }, - { "interrogate_function_name", &_inPU7VHsmnz, METH_VARARGS }, - { "interrogate_function_scoped_name", &_inPU7VHxQ10, METH_VARARGS }, - { "interrogate_function_has_comment", &_inPU7VH6gPB, METH_VARARGS }, - { "interrogate_function_comment", &_inPU7VHISgV, METH_VARARGS }, - { "interrogate_function_prototype", &_inPU7VHH3bx, METH_VARARGS }, - { "interrogate_function_is_method", &_inPU7VHzeUk, METH_VARARGS }, - { "interrogate_function_class", &_inPU7VHUeI5, METH_VARARGS }, - { "interrogate_function_has_module_name", &_inPU7VHuSvx, METH_VARARGS }, - { "interrogate_function_module_name", &_inPU7VHwpYd, METH_VARARGS }, - { "interrogate_function_has_library_name", &_inPU7VHOfNh, METH_VARARGS }, - { "interrogate_function_library_name", &_inPU7VHf5_U, METH_VARARGS }, - { "interrogate_function_is_virtual", &_inPU7VHL3ZB, METH_VARARGS }, - { "interrogate_function_number_of_c_wrappers", &_inPU7VHXw0I, METH_VARARGS }, - { "interrogate_function_c_wrapper", &_inPU7VH3zru, METH_VARARGS }, - { "interrogate_function_number_of_python_wrappers", &_inPU7VHRrg2, METH_VARARGS }, - { "interrogate_function_python_wrapper", &_inPU7VHEJCx, METH_VARARGS }, - { "interrogate_wrapper_name", &_inPU7VHWAZr, METH_VARARGS }, - { "interrogate_wrapper_is_callable_by_name", &_inPU7VHrD_M, METH_VARARGS }, - { "interrogate_wrapper_has_comment", &_inPU7VHjolz, METH_VARARGS }, - { "interrogate_wrapper_comment", &_inPU7VHt_JD, METH_VARARGS }, - { "interrogate_wrapper_has_return_value", &_inPU7VHwEts, METH_VARARGS }, - { "interrogate_wrapper_return_type", &_inPU7VHrJWs, METH_VARARGS }, - { "interrogate_wrapper_caller_manages_return_value", &_inPU7VHpmFD, METH_VARARGS }, - { "interrogate_wrapper_return_value_destructor", &_inPU7VHyYUX, METH_VARARGS }, - { "interrogate_wrapper_number_of_parameters", &_inPU7VH54dn, METH_VARARGS }, - { "interrogate_wrapper_parameter_type", &_inPU7VHGMpW, METH_VARARGS }, - { "interrogate_wrapper_parameter_has_name", &_inPU7VHNuBV, METH_VARARGS }, - { "interrogate_wrapper_parameter_name", &_inPU7VH9UwA, METH_VARARGS }, - { "interrogate_wrapper_parameter_is_this", &_inPU7VH3FDt, METH_VARARGS }, - { "interrogate_wrapper_has_pointer", &_inPU7VHf513, METH_VARARGS }, - { "interrogate_wrapper_pointer", &_inPU7VHsqGH, METH_VARARGS }, - { "interrogate_wrapper_unique_name", &_inPU7VH7shV, METH_VARARGS }, - { "interrogate_get_wrapper_by_unique_name", &_inPU7VHA1eF, METH_VARARGS }, - { "interrogate_make_seq_class", &_inPU7VH9tTm, METH_VARARGS }, - { "interrogate_make_seq_seq_name", &_inPU7VH776V, METH_VARARGS }, - { "interrogate_make_seq_num_name", &_inPU7VHfaH0, METH_VARARGS }, - { "interrogate_make_seq_element_name", &_inPU7VHGB9D, METH_VARARGS }, - { "interrogate_number_of_global_types", &_inPU7VHsxxs, METH_VARARGS }, - { "interrogate_get_global_type", &_inPU7VHMT0z, METH_VARARGS }, - { "interrogate_number_of_types", &_inPU7VHiW3v, METH_VARARGS }, - { "interrogate_get_type", &_inPU7VH4Px8, METH_VARARGS }, - { "interrogate_get_type_by_name", &_inPU7VHNHcs, METH_VARARGS }, - { "interrogate_get_type_by_scoped_name", &_inPU7VHqHrb, METH_VARARGS }, - { "interrogate_get_type_by_true_name", &_inPU7VHaOqq, METH_VARARGS }, - { "interrogate_type_name", &_inPU7VHqWOw, METH_VARARGS }, - { "interrogate_type_scoped_name", &_inPU7VHHu7x, METH_VARARGS }, - { "interrogate_type_true_name", &_inPU7VHwGnA, METH_VARARGS }, - { "interrogate_type_is_nested", &_inPU7VHXGxx, METH_VARARGS }, - { "interrogate_type_outer_class", &_inPU7VHj04Z, METH_VARARGS }, - { "interrogate_type_has_comment", &_inPU7VHEOv4, METH_VARARGS }, - { "interrogate_type_comment", &_inPU7VHpCqJ, METH_VARARGS }, - { "interrogate_type_has_module_name", &_inPU7VH_Pz3, METH_VARARGS }, - { "interrogate_type_module_name", &_inPU7VHt_06, METH_VARARGS }, - { "interrogate_type_has_library_name", &_inPU7VHmuPs, METH_VARARGS }, - { "interrogate_type_library_name", &_inPU7VHvM8B, METH_VARARGS }, - { "interrogate_type_is_atomic", &_inPU7VHap97, METH_VARARGS }, - { "interrogate_type_atomic_token", &_inPU7VH0o8D, METH_VARARGS }, - { "interrogate_type_is_unsigned", &_inPU7VHOoQ2, METH_VARARGS }, - { "interrogate_type_is_signed", &_inPU7VHKuFh, METH_VARARGS }, - { "interrogate_type_is_long", &_inPU7VHo5L6, METH_VARARGS }, - { "interrogate_type_is_longlong", &_inPU7VHzgKK, METH_VARARGS }, - { "interrogate_type_is_short", &_inPU7VH0FIF, METH_VARARGS }, - { "interrogate_type_is_wrapped", &_inPU7VHZqvD, METH_VARARGS }, - { "interrogate_type_is_pointer", &_inPU7VHDyRd, METH_VARARGS }, - { "interrogate_type_is_const", &_inPU7VHMnKa, METH_VARARGS }, - { "interrogate_type_is_typedef", &_inPU7VHRtji, METH_VARARGS }, - { "interrogate_type_wrapped_type", &_inPU7VHCnbQ, METH_VARARGS }, - { "interrogate_type_is_enum", &_inPU7VHdUVN, METH_VARARGS }, - { "interrogate_type_number_of_enum_values", &_inPU7VHihbt, METH_VARARGS }, - { "interrogate_type_enum_value_name", &_inPU7VHbyPY, METH_VARARGS }, - { "interrogate_type_enum_value_scoped_name", &_inPU7VHAaT6, METH_VARARGS }, - { "interrogate_type_enum_value_comment", &_inPU7VHgL9q, METH_VARARGS }, - { "interrogate_type_enum_value", &_inPU7VHWB97, METH_VARARGS }, - { "interrogate_type_is_struct", &_inPU7VHDUAl, METH_VARARGS }, - { "interrogate_type_is_class", &_inPU7VH1_Kf, METH_VARARGS }, - { "interrogate_type_is_union", &_inPU7VH98lD, METH_VARARGS }, - { "interrogate_type_is_fully_defined", &_inPU7VH9SHr, METH_VARARGS }, - { "interrogate_type_is_unpublished", &_inPU7VHdiZP, METH_VARARGS }, - { "interrogate_type_number_of_constructors", &_inPU7VHTdER, METH_VARARGS }, - { "interrogate_type_get_constructor", &_inPU7VHYO56, METH_VARARGS }, - { "interrogate_type_has_destructor", &_inPU7VHxtCG, METH_VARARGS }, - { "interrogate_type_destructor_is_inherited", &_inPU7VH_EB2, METH_VARARGS }, - { "interrogate_type_get_destructor", &_inPU7VHEG1l, METH_VARARGS }, - { "interrogate_type_number_of_elements", &_inPU7VH7tUq, METH_VARARGS }, - { "interrogate_type_get_element", &_inPU7VHyStU, METH_VARARGS }, - { "interrogate_type_number_of_methods", &_inPU7VHdM85, METH_VARARGS }, - { "interrogate_type_get_method", &_inPU7VHk_GN, METH_VARARGS }, - { "interrogate_type_number_of_make_seqs", &_inPU7VH8QjG, METH_VARARGS }, - { "interrogate_type_get_make_seq", &_inPU7VHyMtj, METH_VARARGS }, - { "interrogate_type_number_of_casts", &_inPU7VHHDtN, METH_VARARGS }, - { "interrogate_type_get_cast", &_inPU7VHHFjA, METH_VARARGS }, - { "interrogate_type_number_of_derivations", &_inPU7VH_NPR, METH_VARARGS }, - { "interrogate_type_get_derivation", &_inPU7VHcTOH, METH_VARARGS }, - { "interrogate_type_derivation_has_upcast", &_inPU7VHhdU7, METH_VARARGS }, - { "interrogate_type_get_upcast", &_inPU7VHQPxU, METH_VARARGS }, - { "interrogate_type_derivation_downcast_is_impossible", &_inPU7VHO7Pz, METH_VARARGS }, - { "interrogate_type_derivation_has_downcast", &_inPU7VHvu_E, METH_VARARGS }, - { "interrogate_type_get_downcast", &_inPU7VHxGUt, METH_VARARGS }, - { "interrogate_type_number_of_nested_types", &_inPU7VHzM1P, METH_VARARGS }, - { "interrogate_type_get_nested_type", &_inPU7VHoY5L, METH_VARARGS }, + { "interrogate_add_search_directory", &_inP07yttbRf, METH_VARARGS }, + { "interrogate_add_search_path", &_inP07ytda_g, METH_VARARGS }, + { "interrogate_error_flag", &_inP07yt4RgX, METH_VARARGS }, + { "interrogate_number_of_manifests", &_inP07yt3Gip, METH_VARARGS }, + { "interrogate_get_manifest", &_inP07ytRKDz, METH_VARARGS }, + { "interrogate_get_manifest_by_name", &_inP07ytgZ9N, METH_VARARGS }, + { "interrogate_manifest_name", &_inP07ytFnRZ, METH_VARARGS }, + { "interrogate_manifest_definition", &_inP07ytg0Qv, METH_VARARGS }, + { "interrogate_manifest_has_type", &_inP07yttrqw, METH_VARARGS }, + { "interrogate_manifest_get_type", &_inP07ytdmpW, METH_VARARGS }, + { "interrogate_manifest_has_getter", &_inP07ytUYgQ, METH_VARARGS }, + { "interrogate_manifest_getter", &_inP07yt0k7F, METH_VARARGS }, + { "interrogate_manifest_has_int_value", &_inP07ytfIsr, METH_VARARGS }, + { "interrogate_manifest_get_int_value", &_inP07ytvysR, METH_VARARGS }, + { "interrogate_element_name", &_inP07ytYQ_2, METH_VARARGS }, + { "interrogate_element_scoped_name", &_inP07yt3kdv, METH_VARARGS }, + { "interrogate_element_has_comment", &_inP07ytew01, METH_VARARGS }, + { "interrogate_element_comment", &_inP07ytQna7, METH_VARARGS }, + { "interrogate_get_element_by_name", &_inP07ytkg95, METH_VARARGS }, + { "interrogate_get_element_by_scoped_name", &_inP07ytluRc, METH_VARARGS }, + { "interrogate_element_type", &_inP07yttHdM, METH_VARARGS }, + { "interrogate_element_has_getter", &_inP07ytDId0, METH_VARARGS }, + { "interrogate_element_getter", &_inP07ytHuAm, METH_VARARGS }, + { "interrogate_element_has_setter", &_inP07yt_xr0, METH_VARARGS }, + { "interrogate_element_setter", &_inP07ytH5qp, METH_VARARGS }, + { "interrogate_number_of_globals", &_inP07ytU2_B, METH_VARARGS }, + { "interrogate_get_global", &_inP07ytHFO2, METH_VARARGS }, + { "interrogate_number_of_global_functions", &_inP07ytcfjm, METH_VARARGS }, + { "interrogate_get_global_function", &_inP07yt3Sjw, METH_VARARGS }, + { "interrogate_number_of_functions", &_inP07ytgJcX, METH_VARARGS }, + { "interrogate_get_function", &_inP07ytYlw6, METH_VARARGS }, + { "interrogate_function_name", &_inP07ytsmnz, METH_VARARGS }, + { "interrogate_function_scoped_name", &_inP07ytxQ10, METH_VARARGS }, + { "interrogate_function_has_comment", &_inP07yt6gPB, METH_VARARGS }, + { "interrogate_function_comment", &_inP07ytISgV, METH_VARARGS }, + { "interrogate_function_prototype", &_inP07ytH3bx, METH_VARARGS }, + { "interrogate_function_is_method", &_inP07ytzeUk, METH_VARARGS }, + { "interrogate_function_class", &_inP07ytUeI5, METH_VARARGS }, + { "interrogate_function_has_module_name", &_inP07ytuSvx, METH_VARARGS }, + { "interrogate_function_module_name", &_inP07ytwpYd, METH_VARARGS }, + { "interrogate_function_has_library_name", &_inP07ytOfNh, METH_VARARGS }, + { "interrogate_function_library_name", &_inP07ytf5_U, METH_VARARGS }, + { "interrogate_function_is_virtual", &_inP07ytL3ZB, METH_VARARGS }, + { "interrogate_function_number_of_c_wrappers", &_inP07ytXw0I, METH_VARARGS }, + { "interrogate_function_c_wrapper", &_inP07yt3zru, METH_VARARGS }, + { "interrogate_function_number_of_python_wrappers", &_inP07ytRrg2, METH_VARARGS }, + { "interrogate_function_python_wrapper", &_inP07ytEJCx, METH_VARARGS }, + { "interrogate_wrapper_name", &_inP07ytWAZr, METH_VARARGS }, + { "interrogate_wrapper_is_callable_by_name", &_inP07ytrD_M, METH_VARARGS }, + { "interrogate_wrapper_has_comment", &_inP07ytjolz, METH_VARARGS }, + { "interrogate_wrapper_comment", &_inP07ytt_JD, METH_VARARGS }, + { "interrogate_wrapper_has_return_value", &_inP07ytwEts, METH_VARARGS }, + { "interrogate_wrapper_return_type", &_inP07ytrJWs, METH_VARARGS }, + { "interrogate_wrapper_caller_manages_return_value", &_inP07ytpmFD, METH_VARARGS }, + { "interrogate_wrapper_return_value_destructor", &_inP07ytyYUX, METH_VARARGS }, + { "interrogate_wrapper_number_of_parameters", &_inP07yt54dn, METH_VARARGS }, + { "interrogate_wrapper_parameter_type", &_inP07ytGMpW, METH_VARARGS }, + { "interrogate_wrapper_parameter_has_name", &_inP07ytNuBV, METH_VARARGS }, + { "interrogate_wrapper_parameter_name", &_inP07yt9UwA, METH_VARARGS }, + { "interrogate_wrapper_parameter_is_this", &_inP07yt3FDt, METH_VARARGS }, + { "interrogate_wrapper_has_pointer", &_inP07ytf513, METH_VARARGS }, + { "interrogate_wrapper_pointer", &_inP07ytsqGH, METH_VARARGS }, + { "interrogate_wrapper_unique_name", &_inP07yt7shV, METH_VARARGS }, + { "interrogate_get_wrapper_by_unique_name", &_inP07ytA1eF, METH_VARARGS }, + { "interrogate_make_seq_class", &_inP07yt9tTm, METH_VARARGS }, + { "interrogate_make_seq_seq_name", &_inP07yt776V, METH_VARARGS }, + { "interrogate_make_seq_num_name", &_inP07ytfaH0, METH_VARARGS }, + { "interrogate_make_seq_element_name", &_inP07ytGB9D, METH_VARARGS }, + { "interrogate_number_of_global_types", &_inP07ytsxxs, METH_VARARGS }, + { "interrogate_get_global_type", &_inP07ytMT0z, METH_VARARGS }, + { "interrogate_number_of_types", &_inP07ytiW3v, METH_VARARGS }, + { "interrogate_get_type", &_inP07yt4Px8, METH_VARARGS }, + { "interrogate_get_type_by_name", &_inP07ytNHcs, METH_VARARGS }, + { "interrogate_get_type_by_scoped_name", &_inP07ytqHrb, METH_VARARGS }, + { "interrogate_get_type_by_true_name", &_inP07ytaOqq, METH_VARARGS }, + { "interrogate_type_name", &_inP07ytqWOw, METH_VARARGS }, + { "interrogate_type_scoped_name", &_inP07ytHu7x, METH_VARARGS }, + { "interrogate_type_true_name", &_inP07ytwGnA, METH_VARARGS }, + { "interrogate_type_is_nested", &_inP07ytXGxx, METH_VARARGS }, + { "interrogate_type_outer_class", &_inP07ytj04Z, METH_VARARGS }, + { "interrogate_type_has_comment", &_inP07ytEOv4, METH_VARARGS }, + { "interrogate_type_comment", &_inP07ytpCqJ, METH_VARARGS }, + { "interrogate_type_has_module_name", &_inP07yt_Pz3, METH_VARARGS }, + { "interrogate_type_module_name", &_inP07ytt_06, METH_VARARGS }, + { "interrogate_type_has_library_name", &_inP07ytmuPs, METH_VARARGS }, + { "interrogate_type_library_name", &_inP07ytvM8B, METH_VARARGS }, + { "interrogate_type_is_atomic", &_inP07ytap97, METH_VARARGS }, + { "interrogate_type_atomic_token", &_inP07yt0o8D, METH_VARARGS }, + { "interrogate_type_is_unsigned", &_inP07ytOoQ2, METH_VARARGS }, + { "interrogate_type_is_signed", &_inP07ytKuFh, METH_VARARGS }, + { "interrogate_type_is_long", &_inP07yto5L6, METH_VARARGS }, + { "interrogate_type_is_longlong", &_inP07ytzgKK, METH_VARARGS }, + { "interrogate_type_is_short", &_inP07yt0FIF, METH_VARARGS }, + { "interrogate_type_is_wrapped", &_inP07ytZqvD, METH_VARARGS }, + { "interrogate_type_is_pointer", &_inP07ytDyRd, METH_VARARGS }, + { "interrogate_type_is_const", &_inP07ytMnKa, METH_VARARGS }, + { "interrogate_type_is_typedef", &_inP07ytRtji, METH_VARARGS }, + { "interrogate_type_wrapped_type", &_inP07ytCnbQ, METH_VARARGS }, + { "interrogate_type_is_enum", &_inP07ytdUVN, METH_VARARGS }, + { "interrogate_type_number_of_enum_values", &_inP07ytihbt, METH_VARARGS }, + { "interrogate_type_enum_value_name", &_inP07ytbyPY, METH_VARARGS }, + { "interrogate_type_enum_value_scoped_name", &_inP07ytAaT6, METH_VARARGS }, + { "interrogate_type_enum_value_comment", &_inP07ytgL9q, METH_VARARGS }, + { "interrogate_type_enum_value", &_inP07ytWB97, METH_VARARGS }, + { "interrogate_type_is_struct", &_inP07ytDUAl, METH_VARARGS }, + { "interrogate_type_is_class", &_inP07yt1_Kf, METH_VARARGS }, + { "interrogate_type_is_union", &_inP07yt98lD, METH_VARARGS }, + { "interrogate_type_is_fully_defined", &_inP07yt9SHr, METH_VARARGS }, + { "interrogate_type_is_unpublished", &_inP07ytdiZP, METH_VARARGS }, + { "interrogate_type_number_of_constructors", &_inP07ytTdER, METH_VARARGS }, + { "interrogate_type_get_constructor", &_inP07ytYO56, METH_VARARGS }, + { "interrogate_type_has_destructor", &_inP07ytxtCG, METH_VARARGS }, + { "interrogate_type_destructor_is_inherited", &_inP07yt_EB2, METH_VARARGS }, + { "interrogate_type_get_destructor", &_inP07ytEG1l, METH_VARARGS }, + { "interrogate_type_number_of_elements", &_inP07yt7tUq, METH_VARARGS }, + { "interrogate_type_get_element", &_inP07ytyStU, METH_VARARGS }, + { "interrogate_type_number_of_methods", &_inP07ytdM85, METH_VARARGS }, + { "interrogate_type_get_method", &_inP07ytk_GN, METH_VARARGS }, + { "interrogate_type_number_of_make_seqs", &_inP07yt8QjG, METH_VARARGS }, + { "interrogate_type_get_make_seq", &_inP07ytyMtj, METH_VARARGS }, + { "interrogate_type_number_of_casts", &_inP07ytHDtN, METH_VARARGS }, + { "interrogate_type_get_cast", &_inP07ytHFjA, METH_VARARGS }, + { "interrogate_type_number_of_derivations", &_inP07yt_NPR, METH_VARARGS }, + { "interrogate_type_get_derivation", &_inP07ytcTOH, METH_VARARGS }, + { "interrogate_type_derivation_has_upcast", &_inP07ythdU7, METH_VARARGS }, + { "interrogate_type_get_upcast", &_inP07ytQPxU, METH_VARARGS }, + { "interrogate_type_derivation_downcast_is_impossible", &_inP07ytO7Pz, METH_VARARGS }, + { "interrogate_type_derivation_has_downcast", &_inP07ytvu_E, METH_VARARGS }, + { "interrogate_type_get_downcast", &_inP07ytxGUt, METH_VARARGS }, + { "interrogate_type_number_of_nested_types", &_inP07ytzM1P, METH_VARARGS }, + { "interrogate_type_get_nested_type", &_inP07ytoY5L, METH_VARARGS }, + { "interrogate_request_database", &_inP07yte_7S, METH_VARARGS }, + { "interrogate_request_module", &_inP07ytw_15, METH_VARARGS }, { NULL, NULL } }; @@ -2502,3 +2535,4 @@ INIT_FUNC() { Py_InitModule("interrogatedb", python_simple_funcs); #endif } + From 57e5c8fb2544b3f7fa5efda4eea3bbbfdd939d69 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 10 Sep 2015 15:29:31 +0200 Subject: [PATCH 09/14] Wrap TypeHandle and ButtonHandle as ints in C wrappers --- dtool/src/dtoolbase/typeHandle.I | 15 ++++ dtool/src/dtoolbase/typeHandle.h | 5 +- dtool/src/interrogate/functionRemap.cxx | 48 ++++++++---- dtool/src/interrogate/interfaceMakerC.cxx | 27 +++++++ dtool/src/interrogate/interfaceMakerC.h | 2 + .../interrogate/interrogate_composite2.cxx | 1 + .../interrogate/parameterRemapHandleToInt.cxx | 65 ++++++++++++++++ .../interrogate/parameterRemapHandleToInt.h | 40 ++++++++++ dtool/src/interrogate/parameterRemapThis.cxx | 4 +- dtool/src/interrogate/typeManager.cxx | 27 ++++++- dtool/src/interrogate/typeManager.h | 1 + panda/src/express/config_express.N | 2 +- panda/src/linmath/luse.N | 74 +++++++++---------- panda/src/putil/buttonHandle.h | 2 +- panda/src/putil/config_util.N | 2 +- 15 files changed, 257 insertions(+), 58 deletions(-) create mode 100644 dtool/src/interrogate/parameterRemapHandleToInt.cxx create mode 100644 dtool/src/interrogate/parameterRemapHandleToInt.h diff --git a/dtool/src/dtoolbase/typeHandle.I b/dtool/src/dtoolbase/typeHandle.I index 867bdb4cea..ceb46a8e41 100644 --- a/dtool/src/dtoolbase/typeHandle.I +++ b/dtool/src/dtoolbase/typeHandle.I @@ -263,3 +263,18 @@ INLINE TypeHandle:: operator bool () const { return (_index != 0); } + +//////////////////////////////////////////////////////////////////// +// Function: TypeHandle::from_index +// Access: Public, Static +// Description: Creates a TypeHandle from a type index without +// error checking, for use by internal functions. +// +// See TypeRegistry::find_type_by_id(). +//////////////////////////////////////////////////////////////////// +INLINE TypeHandle TypeHandle:: +from_index(int index) { + TypeHandle handle; + handle._index = index; + return handle; +} diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index f94e983447..c05e25dd46 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -82,7 +82,7 @@ class TypedObject; // ancestry of a particular type may be queried, and the // type name may be retrieved for run-time display. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOL TypeHandle { +class EXPCL_DTOOL TypeHandle FINAL { PUBLISHED: enum MemoryClass { MC_singleton, @@ -140,6 +140,9 @@ PUBLISHED: INLINE static TypeHandle none(); INLINE operator bool () const; +public: + INLINE static TypeHandle from_index(int index); + private: int _index; static TypeHandle _none; diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 5e602a7553..2bf2fb06da 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -17,6 +17,7 @@ #include "interrogate.h" #include "parameterRemap.h" #include "parameterRemapThis.h" +#include "parameterRemapHandleToInt.h" #include "parameterRemapUnchanged.h" #include "interfaceMaker.h" #include "interrogateBuilder.h" @@ -146,8 +147,13 @@ call_function(ostream &out, int indent_level, bool convert_result, } else if (_type == T_typecast_method) { // A typecast method can be invoked implicitly. string cast_expr = - "(" + _return_type->get_orig_type()->get_local_name(&parser) + - ")(*" + container + ")"; + "(" + _return_type->get_orig_type()->get_local_name(&parser) + ")"; + + if (TypeManager::is_handle(_cpptype)) { + cast_expr += "(" + container + ")"; + } else { + cast_expr += "(*" + container + ")"; + } if (!convert_result) { return_expr = cast_expr; @@ -177,10 +183,7 @@ call_function(ostream &out, int indent_level, bool convert_result, } else if (_type == T_constructor) { // A special case for constructors. - string defconstruct = builder.in_defconstruct(_cpptype->get_local_name(&parser)); - if (pexprs.empty() && !defconstruct.empty()) { - return_expr = defconstruct; - } else if (_extension) { + if (_extension) { // Extension constructors are a special case. We assume there is a // default constructor for the class, and the actual construction is // done by an __init__ method. @@ -192,8 +195,22 @@ call_function(ostream &out, int indent_level, bool convert_result, << get_call_str("result", pexprs) << ";\n"; return_expr = "result"; + } else { - return_expr = "new " + get_call_str(container, pexprs); + string defconstruct = builder.in_defconstruct(_cpptype->get_local_name(&parser)); + string call_expr; + + if (pexprs.empty() && !defconstruct.empty()) { + call_expr = defconstruct; + } else { + call_expr = get_call_str(container, pexprs); + } + + if (!_return_type->return_value_needs_management()) { + return_expr = _return_type->get_return_expr(call_expr); + } else { + return_expr = "new " + call_expr; + } } if (_void_return) { nout << "Error, constructor for " << *_cpptype << " returning void.\n"; @@ -448,12 +465,9 @@ get_call_str(const string &container, const vector_string &pexprs) const { } else if (_has_this && !container.empty()) { // If we have a "this" parameter, the calling convention is also // a bit different. - if (container == "local_this") { - // This isn't important, it just looks a bit prettier. - call << container << "->" << _cppfunc->get_local_name(); - } else { - call << "(" << container << ")->" << _cppfunc->get_local_name(); - } + call << "("; + _parameters[0]._remap->pass_parameter(call, container); + call << ")." << _cppfunc->get_local_name(); } else { call << _cppfunc->get_local_name(&parser); @@ -569,7 +583,13 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak Parameter param; param._name = "this"; param._has_name = true; - param._remap = new ParameterRemapThis(_cpptype, _const_method); + if (_const_method) { + CPPType *const_type = CPPType::new_type(new CPPConstType(_cpptype)); + param._remap = interface_maker->remap_parameter(_cpptype, const_type); + } else { + param._remap = interface_maker->remap_parameter(_cpptype, _cpptype); + } + // param._remap = new ParameterRemapThis(_cpptype, _const_method); _parameters.push_back(param); _first_true_parameter = 1; } diff --git a/dtool/src/interrogate/interfaceMakerC.cxx b/dtool/src/interrogate/interfaceMakerC.cxx index 25eeb87023..9bd21a9922 100644 --- a/dtool/src/interrogate/interfaceMakerC.cxx +++ b/dtool/src/interrogate/interfaceMakerC.cxx @@ -16,6 +16,7 @@ #include "interrogateBuilder.h" #include "interrogate.h" #include "functionRemap.h" +#include "parameterRemapHandleToInt.h" #include "parameterRemapUnchanged.h" #include "typeManager.h" @@ -89,6 +90,32 @@ write_functions(ostream &out) { InterfaceMaker::write_functions(out); } +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMakerC::remap_parameter +// Access: Public, Virtual +// Description: Allocates a new ParameterRemap object suitable to the +// indicated parameter type. If struct_type is +// non-NULL, it is the type of the enclosing class for +// the function (method) in question. +// +// The return value is a newly-allocated ParameterRemap +// object, if the parameter type is acceptable, or NULL +// if the parameter type cannot be handled. +//////////////////////////////////////////////////////////////////// +ParameterRemap *InterfaceMakerC:: +remap_parameter(CPPType *struct_type, CPPType *param_type) { + // Wrap TypeHandle and ButtonHandle, which are practically just + // ints, as an integer instead of a pointer. It makes things easier + // on the scripting language, especially if there has to be a + // dynamic downcasting system on the scripting language side. + if (TypeManager::is_handle(param_type)) { + return new ParameterRemapHandleToInt(param_type); + + } else { + return InterfaceMaker::remap_parameter(struct_type, param_type); + } +} + //////////////////////////////////////////////////////////////////// // Function: InterfaceMakerC::synthesize_this_parameter // Access: Public, Virtual diff --git a/dtool/src/interrogate/interfaceMakerC.h b/dtool/src/interrogate/interfaceMakerC.h index 3faea7bae8..ee715424ac 100644 --- a/dtool/src/interrogate/interfaceMakerC.h +++ b/dtool/src/interrogate/interfaceMakerC.h @@ -36,6 +36,8 @@ public: virtual void write_prototypes(ostream &out,ostream *out_h); virtual void write_functions(ostream &out); + virtual ParameterRemap *remap_parameter(CPPType *struct_type, CPPType *param_type); + virtual bool synthesize_this_parameter(); protected: diff --git a/dtool/src/interrogate/interrogate_composite2.cxx b/dtool/src/interrogate/interrogate_composite2.cxx index 39000d2778..a427cf2674 100644 --- a/dtool/src/interrogate/interrogate_composite2.cxx +++ b/dtool/src/interrogate/interrogate_composite2.cxx @@ -14,5 +14,6 @@ #include "parameterRemapReferenceToPointer.cxx" #include "parameterRemapThis.cxx" #include "parameterRemapToString.cxx" +#include "parameterRemapHandleToInt.cxx" #include "parameterRemapUnchanged.cxx" diff --git a/dtool/src/interrogate/parameterRemapHandleToInt.cxx b/dtool/src/interrogate/parameterRemapHandleToInt.cxx new file mode 100644 index 0000000000..82220c1b75 --- /dev/null +++ b/dtool/src/interrogate/parameterRemapHandleToInt.cxx @@ -0,0 +1,65 @@ +// Filename: parameterRemapHandleToInt.cxx +// Created by: rdb (08Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "parameterRemapHandleToInt.h" +#include "interrogate.h" +#include "interrogateBuilder.h" +#include "typeManager.h" + +#include "cppType.h" +#include "cppDeclaration.h" +#include "cppConstType.h" +#include "cppPointerType.h" + +//////////////////////////////////////////////////////////////////// +// Function: ParameterRemapHandleToInt::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +ParameterRemapHandleToInt:: +ParameterRemapHandleToInt(CPPType *orig_type) : + ParameterRemap(orig_type) +{ + _new_type = TypeManager::get_int_type(); +} + +//////////////////////////////////////////////////////////////////// +// Function: ParameterRemapHandleToInt::pass_parameter +// Access: Public, Virtual +// Description: Outputs an expression that converts the indicated +// variable from the new type to the original type, for +// passing into the actual C++ function. +//////////////////////////////////////////////////////////////////// +void ParameterRemapHandleToInt:: +pass_parameter(ostream &out, const string &variable_name) { + CPPType *unwrapped = TypeManager::unwrap_const(_orig_type); + + if (unwrapped->get_local_name(&parser) == "TypeHandle") { + out << "TypeHandle::from_index(" << variable_name << ")"; + } else { + out << unwrapped->get_local_name(&parser) << "(" << variable_name << ")"; + } +} + +//////////////////////////////////////////////////////////////////// +// Function: ParameterRemapHandleToInt::get_return_expr +// Access: Public, Virtual +// Description: Returns an expression that evalutes to the +// appropriate value type for returning from the +// function, given an expression of the original type. +//////////////////////////////////////////////////////////////////// +string ParameterRemapHandleToInt:: +get_return_expr(const string &expression) { + return "(" + expression + ").get_index()"; +} diff --git a/dtool/src/interrogate/parameterRemapHandleToInt.h b/dtool/src/interrogate/parameterRemapHandleToInt.h new file mode 100644 index 0000000000..4a2915d279 --- /dev/null +++ b/dtool/src/interrogate/parameterRemapHandleToInt.h @@ -0,0 +1,40 @@ +// Filename: parameterRemapHandleToInt.h +// Created by: rdb (08Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef PARAMETERREMAPHANDLETOINT_H +#define PARAMETERREMAPHANDLETOINT_H + +#include "dtoolbase.h" + +#include "parameterRemap.h" + +//////////////////////////////////////////////////////////////////// +// Class : ParameterRemapHandleToInt +// Description : A ParameterRemap class that handles remapping a +// Handle parameter to an integer. This makes it +// easier to set up a dynamic typing system on the +// scripting language side. +// +// It also applies to ButtonHandle or any other class +// with the same semantics, because why not. +//////////////////////////////////////////////////////////////////// +class ParameterRemapHandleToInt : public ParameterRemap { +public: + ParameterRemapHandleToInt(CPPType *orig_type); + + virtual void pass_parameter(ostream &out, const string &variable_name); + virtual string get_return_expr(const string &expression); +}; + +#endif diff --git a/dtool/src/interrogate/parameterRemapThis.cxx b/dtool/src/interrogate/parameterRemapThis.cxx index db6e1d6d30..220f01ab44 100644 --- a/dtool/src/interrogate/parameterRemapThis.cxx +++ b/dtool/src/interrogate/parameterRemapThis.cxx @@ -45,8 +45,8 @@ ParameterRemapThis(CPPType *type, bool is_const) : // passing into the actual C++ function. //////////////////////////////////////////////////////////////////// void ParameterRemapThis:: -pass_parameter(ostream &out, const string &) { - out << "**invalid**"; +pass_parameter(ostream &out, const string &variable_name) { + out << "(*" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index c8e6dce9c7..1fd968d09f 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -1820,6 +1820,31 @@ is_Py_buffer(CPPType *type) { } } +//////////////////////////////////////////////////////////////////// +// Function: TypeManager::is_handle +// Access: Public, Static +// Description: Returns true if the indicated type is TypeHandle +// or a class with identical semantics like ButtonHandle. +//////////////////////////////////////////////////////////////////// +bool TypeManager:: +is_handle(CPPType *type) { + switch (type->get_subtype()) { + case CPPDeclaration::ST_const: + return is_handle(type->as_const_type()->_wrapped_around); + + case CPPDeclaration::ST_extension: + case CPPDeclaration::ST_struct: + return (type->get_local_name(&parser) == "TypeHandle" || + type->get_local_name(&parser) == "ButtonHandle"); + + case CPPDeclaration::ST_typedef: + return is_handle(type->as_typedef_type()->_type); + + default: + return false; + } +} + //////////////////////////////////////////////////////////////////// // Function: TypeManager::is_ostream // Access: Public, Static @@ -2631,7 +2656,7 @@ is_trivial(CPPType *source_type) { return is_trivial(source_type->as_typedef_type()->_type); default: - if (source_type->is_trivial()) { + if (source_type->is_trivial() || is_handle(source_type)) { return true; } else { // This is a bit of a hack. is_trivial() returns false for types that diff --git a/dtool/src/interrogate/typeManager.h b/dtool/src/interrogate/typeManager.h index 29b29eb2c7..5df95c63b9 100644 --- a/dtool/src/interrogate/typeManager.h +++ b/dtool/src/interrogate/typeManager.h @@ -112,6 +112,7 @@ public: static bool is_PyUnicodeObject(CPPType *type); static bool is_pointer_to_Py_buffer(CPPType *type); static bool is_Py_buffer(CPPType *type); + static bool is_handle(CPPType *type); static bool involves_unpublished(CPPType *type); static bool involves_protected(CPPType *type); diff --git a/panda/src/express/config_express.N b/panda/src/express/config_express.N index ad6e244b4e..454c630ed2 100644 --- a/panda/src/express/config_express.N +++ b/panda/src/express/config_express.N @@ -1,4 +1,4 @@ -defconstruct TypeHandle new TypeHandle(TypeHandle::none()) +defconstruct TypeHandle TypeHandle(TypeHandle::none()) forcetype PandaSystem forcetype DSearchPath diff --git a/panda/src/linmath/luse.N b/panda/src/linmath/luse.N index 20da19f1c8..ce89055b3d 100644 --- a/panda/src/linmath/luse.N +++ b/panda/src/linmath/luse.N @@ -1,46 +1,46 @@ -defconstruct LPoint2f new LPoint2f(0.0f) -defconstruct LPoint3f new LPoint3f(0.0f) -defconstruct LPoint4f new LPoint4f(0.0f) -defconstruct LPoint2d new LPoint2d(0.0) -defconstruct LPoint3d new LPoint3d(0.0) -defconstruct LPoint4d new LPoint4d(0.0) -defconstruct LPoint2i new LPoint2i(0) -defconstruct LPoint3i new LPoint3i(0) -defconstruct LPoint4i new LPoint4i(0) +defconstruct LPoint2f LPoint2f(0.0f) +defconstruct LPoint3f LPoint3f(0.0f) +defconstruct LPoint4f LPoint4f(0.0f) +defconstruct LPoint2d LPoint2d(0.0) +defconstruct LPoint3d LPoint3d(0.0) +defconstruct LPoint4d LPoint4d(0.0) +defconstruct LPoint2i LPoint2i(0) +defconstruct LPoint3i LPoint3i(0) +defconstruct LPoint4i LPoint4i(0) -defconstruct LVecBase2f new LVecBase2f(0.0f) -defconstruct LVecBase3f new LVecBase3f(0.0f) -defconstruct LVecBase4f new LVecBase4f(0.0f) -defconstruct LVecBase2d new LVecBase2d(0.0) -defconstruct LVecBase3d new LVecBase3d(0.0) -defconstruct LVecBase4d new LVecBase4d(0.0) -defconstruct LVecBase2i new LVecBase2i(0) -defconstruct LVecBase3i new LVecBase3i(0) -defconstruct LVecBase4i new LVecBase4i(0) +defconstruct LVecBase2f LVecBase2f(0.0f) +defconstruct LVecBase3f LVecBase3f(0.0f) +defconstruct LVecBase4f LVecBase4f(0.0f) +defconstruct LVecBase2d LVecBase2d(0.0) +defconstruct LVecBase3d LVecBase3d(0.0) +defconstruct LVecBase4d LVecBase4d(0.0) +defconstruct LVecBase2i LVecBase2i(0) +defconstruct LVecBase3i LVecBase3i(0) +defconstruct LVecBase4i LVecBase4i(0) -defconstruct LVector2f new LVector2f(0.0f) -defconstruct LVector3f new LVector3f(0.0f) -defconstruct LVector4f new LVector4f(0.0f) -defconstruct LVector2d new LVector2d(0.0) -defconstruct LVector3d new LVector3d(0.0) -defconstruct LVector4d new LVector4d(0.0) -defconstruct LVector2i new LVector2i(0) -defconstruct LVector3i new LVector3i(0) -defconstruct LVector4i new LVector4i(0) +defconstruct LVector2f LVector2f(0.0f) +defconstruct LVector3f LVector3f(0.0f) +defconstruct LVector4f LVector4f(0.0f) +defconstruct LVector2d LVector2d(0.0) +defconstruct LVector3d LVector3d(0.0) +defconstruct LVector4d LVector4d(0.0) +defconstruct LVector2i LVector2i(0) +defconstruct LVector3i LVector3i(0) +defconstruct LVector4i LVector4i(0) -defconstruct LMatrix3f new LMatrix3f(LMatrix3f::ident_mat()) -defconstruct LMatrix4f new LMatrix4f(LMatrix4f::ident_mat()) -defconstruct LMatrix3d new LMatrix3d(LMatrix3d::ident_mat()) -defconstruct LMatrix4d new LMatrix4d(LMatrix4d::ident_mat()) +defconstruct LMatrix3f LMatrix3f(LMatrix3f::ident_mat()) +defconstruct LMatrix4f LMatrix4f(LMatrix4f::ident_mat()) +defconstruct LMatrix3d LMatrix3d(LMatrix3d::ident_mat()) +defconstruct LMatrix4d LMatrix4d(LMatrix4d::ident_mat()) -defconstruct LQuaternionf new LQuaternionf(LQuaternionf::ident_quat()) -defconstruct LRotationf new LRotationf(LQuaternionf::ident_quat()) -defconstruct LOrientationf new LOrientationf(LQuaternionf::ident_quat()) +defconstruct LQuaternionf LQuaternionf(LQuaternionf::ident_quat()) +defconstruct LRotationf LRotationf(LQuaternionf::ident_quat()) +defconstruct LOrientationf LOrientationf(LQuaternionf::ident_quat()) -defconstruct LQuaterniond new LQuaterniond(LQuaterniond::ident_quat()) -defconstruct LRotationd new LRotationd(LQuaterniond::ident_quat()) -defconstruct LOrientationd new LOrientationd(LQuaterniond::ident_quat()) +defconstruct LQuaterniond LQuaterniond(LQuaterniond::ident_quat()) +defconstruct LRotationd LRotationd(LQuaterniond::ident_quat()) +defconstruct LOrientationd LOrientationd(LQuaterniond::ident_quat()) # We don't want to accidentally include any of the _src files in the # generated output, since these files aren't intended to be included by diff --git a/panda/src/putil/buttonHandle.h b/panda/src/putil/buttonHandle.h index c53f9a6ac9..dcb0e82db3 100644 --- a/panda/src/putil/buttonHandle.h +++ b/panda/src/putil/buttonHandle.h @@ -25,7 +25,7 @@ // device, including keyboard buttons and mouse buttons // (but see KeyboardButton and MouseButton). //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA_PUTIL ButtonHandle { +class EXPCL_PANDA_PUTIL ButtonHandle FINAL { PUBLISHED: INLINE ButtonHandle(); INLINE ButtonHandle(int index); diff --git a/panda/src/putil/config_util.N b/panda/src/putil/config_util.N index 4bcc299b1e..3e7f11238a 100644 --- a/panda/src/putil/config_util.N +++ b/panda/src/putil/config_util.N @@ -1,4 +1,4 @@ -defconstruct ButtonHandle new ButtonHandle(0) +defconstruct ButtonHandle ButtonHandle(0) ignoremember _factory ignoremember get_factory From c9434c5b8506c64014eee6544c847ce51402e0c2 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 10 Sep 2015 15:30:24 +0200 Subject: [PATCH 10/14] Fix shadowed light copy constructor, fix point light lens orientations --- panda/src/pgraphnodes/lightLensNode.cxx | 13 +++++------ panda/src/pgraphnodes/pointLight.cxx | 29 +++++-------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/panda/src/pgraphnodes/lightLensNode.cxx b/panda/src/pgraphnodes/lightLensNode.cxx index bead7ecf01..c26f0cd9c4 100644 --- a/panda/src/pgraphnodes/lightLensNode.cxx +++ b/panda/src/pgraphnodes/lightLensNode.cxx @@ -62,15 +62,12 @@ LightLensNode:: LightLensNode:: LightLensNode(const LightLensNode ©) : Light(copy), - Camera(copy) + Camera(copy), + _shadow_caster(copy._shadow_caster), + _sb_xsize(copy._sb_xsize), + _sb_ysize(copy._sb_ysize), + _sb_sort(-10) { - _shadow_caster = false; - _sb_xsize = 512; - _sb_ysize = 512; - _sb_sort = -10; - // Backface culling helps eliminating artifacts. - set_initial_state(RenderState::make(CullFaceAttrib::make_reverse(), - ColorWriteAttrib::make(ColorWriteAttrib::C_off))); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraphnodes/pointLight.cxx b/panda/src/pgraphnodes/pointLight.cxx index 5ac0c8885c..20fb1dbd1e 100644 --- a/panda/src/pgraphnodes/pointLight.cxx +++ b/panda/src/pgraphnodes/pointLight.cxx @@ -69,22 +69,22 @@ PointLight(const string &name) : { PT(Lens) lens; lens = new PerspectiveLens(90, 90); - lens->set_view_vector(1, 0, 0, 0, 0, 1); + lens->set_view_vector(1, 0, 0, 0, -1, 0); set_lens(0, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(-1, 0, 0, 0, 0, 1); + lens->set_view_vector(-1, 0, 0, 0, -1, 0); set_lens(1, lens); lens = new PerspectiveLens(90, 90); lens->set_view_vector(0, 1, 0, 0, 0, 1); set_lens(2, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, -1, 0, 0, 0, 1); + lens->set_view_vector(0, -1, 0, 0, 0, -1); set_lens(3, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, 1, 0, 0, 1); + lens->set_view_vector(0, 0, 1, 0, -1, 0); set_lens(4, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, -1, 0, 0, 1); + lens->set_view_vector(0, 0, -1, 0, -1, 0); set_lens(5, lens); } @@ -100,25 +100,6 @@ PointLight(const PointLight ©) : LightLensNode(copy), _cycler(copy._cycler) { - PT(Lens) lens; - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(1, 0, 0, 0, 0, 1); - set_lens(0, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(-1, 0, 0, 0, 0, 1); - set_lens(1, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 1, 0, 0, 0, 1); - set_lens(2, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, -1, 0, 0, 0, 1); - set_lens(3, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, 1, 0, 0, 1); - set_lens(4, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, -1, 0, 0, 1); - set_lens(5, lens); } //////////////////////////////////////////////////////////////////// From d63110a49e9d7a3243204974f99761065e39652d Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 30 Apr 2015 19:56:24 +0200 Subject: [PATCH 11/14] Add localized text strings to p3dcert --- direct/src/plugin/p3dAuthSession.cxx | 5 +- direct/src/plugin/p3dCert.cxx | 133 +++--- direct/src/plugin/p3dCert.h | 6 +- direct/src/plugin/p3dCert_strings.cxx | 570 ++++++++++++++++++++++++++ direct/src/plugin/p3dCert_strings.h | 45 ++ direct/src/plugin/p3dSession.cxx | 4 +- makepanda/makepanda.py | 2 + 7 files changed, 695 insertions(+), 70 deletions(-) create mode 100644 direct/src/plugin/p3dCert_strings.cxx create mode 100644 direct/src/plugin/p3dCert_strings.h diff --git a/direct/src/plugin/p3dAuthSession.cxx b/direct/src/plugin/p3dAuthSession.cxx index 103c372f0a..177ffc7c0a 100644 --- a/direct/src/plugin/p3dAuthSession.cxx +++ b/direct/src/plugin/p3dAuthSession.cxx @@ -183,7 +183,7 @@ start_p3dcert() { // These are the enviroment variables we forward from the current // environment, if they are set. const wchar_t *keep[] = { - L"TMP", L"TEMP", L"HOME", L"USER", + L"TMP", L"TEMP", L"HOME", L"USER", L"SYSTEMROOT", L"USERPROFILE", L"COMSPEC", NULL }; @@ -209,7 +209,8 @@ start_p3dcert() { // These are the enviroment variables we forward from the current // environment, if they are set. const char *keep[] = { - "TMP", "TEMP", "HOME", "USER", + "TMP", "TEMP", "HOME", "USER", + "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG", #ifdef HAVE_X11 "DISPLAY", "XAUTHORITY", #endif diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index b920550092..8d78ff7485 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "p3dCert.h" +#include "p3dCert_strings.h" #include "wstring_encode.h" #include "mkdir_complete.h" @@ -26,8 +27,9 @@ #include #include #include +#include -#define BUTTON_WIDTH 120 +#define BUTTON_WIDTH 180 // fit the Russian text #define BUTTON_SPACE 10 #include "ca_bundle_data_src.c" @@ -40,59 +42,58 @@ #define snprintf sprintf_s #endif -static const char -self_signed_cert_text[] = - "This Panda3D application uses a self-signed certificate. " - "This means the author's name can't be verified, and you have " - "no way of knowing for sure who wrote it.\n\n" +static LanguageIndex li = LI_default; - "We recommend you click Cancel to avoid running this application."; +static LanguageIndex detect_language() { + // First consult the LANGUAGE variable, which is a GNU extension that can + // contain multiple languages in order of preference. + const char *lang = getenv("LANGUAGE"); + while (lang != NULL && lang[0] != 0) { + size_t len; + const char *next = strchr(lang, ':'); + if (next == NULL) { + len = strlen(lang); + } else { + len = (next - lang); + ++next; + } -static const char -unknown_auth_cert_text[] = - "This Panda3D application has been signed, but we don't recognize " - "the authority that verifies the signature. This means the author's " - "name can't be trusted, and you have no way of knowing " - "for sure who wrote it.\n\n" + if (len >= 2 && !isalnum(lang[2])) { + // It may be a two-letter language code; match it in our list. + for (int i = 0; i < LI_COUNT; ++i) { + const char *lang_code = language_codes[i]; + if (lang_code != NULL && strncasecmp(lang, lang_code, 2) == 0) { + return (LanguageIndex)i; + } + } + } - "We recommend you click Cancel to avoid running this application."; + lang = next; + } -static const char -verified_cert_text[] = - "This Panda3D application has been signed by %s. " - "If you trust %s, then click the Run button below " - "to run this application on your computer. This will also " - "automatically approve this and any other applications signed by " - "%s in the future.\n\n" + // Fall back to the C locale functions. + setlocale(LC_ALL, ""); + lang = setlocale(LC_MESSAGES, NULL); - "If you are unsure about this application, " - "you should click Cancel instead."; + if (lang == NULL || lang[0] == 0 || strcmp(lang, "C") == 0) { + // Try the LANG variable. + lang = getenv("LANG"); + } -static const char -expired_cert_text[] = - "This Panda3D application has been signed by %s, " - "but the certificate has expired.\n\n" - - "You should check the current date set on your computer's clock " - "to make sure it is correct.\n\n" - - "If your computer's date is correct, we recommend " - "you click Cancel to avoid running this application."; - -static const char -generic_error_cert_text[] = - "This Panda3D application has been signed, but there is a problem " - "with the certificate (OpenSSL error code %d).\n\n" - - "We recommend you click Cancel to avoid running this application."; - -static const char -no_cert_text[] = - "This Panda3D application has not been signed. This means you have " - "no way of knowing for sure who wrote it.\n\n" - - "Click Cancel to avoid running this application."; + if (lang == NULL || strlen(lang) < 2 || isalnum(lang[2])) { + // Couldn't extract a meaningful two-letter code. + return LI_default; + } + // It may be a two-letter language code; match it in our list. + for (int i = 0; i < LI_COUNT; ++i) { + const char *lang_code = language_codes[i]; + if (lang_code != NULL && strncasecmp(lang, lang_code, 2) == 0) { + return (LanguageIndex)i; + } + } + return LI_default; +} #ifdef _WIN32 int WINAPI @@ -107,6 +108,8 @@ wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdS return 1; } + li = detect_language(); + wstring cert_filename (argv[0]); wstring cert_dir (argv[1]); LocalFree(argv); @@ -126,6 +129,8 @@ int main(int argc, char **argv) { return 1; } + li = detect_language(); + string cert_filename (argv[1]); string cert_dir (argv[2]); @@ -510,19 +515,19 @@ layout() { short bx = (w() - nbuttons * BUTTON_WIDTH - (nbuttons - 1) * BUTTON_SPACE) / 2; if (_verify_result == 0 && _cert != NULL) { - Fl_Return_Button *run_button = new Fl_Return_Button(bx, next_y, BUTTON_WIDTH, 25, "Run"); + Fl_Return_Button *run_button = new Fl_Return_Button(bx, next_y, BUTTON_WIDTH, 25, run_title[li]); run_button->callback(this->run_clicked, this); bx += BUTTON_WIDTH + BUTTON_SPACE; } if (_cert != NULL) { - Fl_Button *view_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, "View Certificate"); + Fl_Button *view_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, show_cert_title[li]); view_button->callback(this->view_cert_clicked, this); bx += BUTTON_WIDTH + BUTTON_SPACE; } Fl_Button *cancel_button; - cancel_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, "Cancel"); + cancel_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, cancel_title[li]); cancel_button->callback(this->cancel_clicked, this); next_y += 42; @@ -542,12 +547,12 @@ void AuthDialog:: get_text(char *header, size_t hlen, char *text, size_t tlen) { switch (_verify_result) { case -1: - strncpy(header, "No signature!", hlen); - strncpy(text, no_cert_text, tlen); + strncpy(header, no_cert_title[li], hlen); + strncpy(text, no_cert_text[li], tlen); break; case 0: - snprintf(text, tlen, verified_cert_text, _friendly_name.c_str(), + snprintf(text, tlen, verified_cert_text[li], _friendly_name.c_str(), _friendly_name.c_str(), _friendly_name.c_str()); break; @@ -555,24 +560,24 @@ get_text(char *header, size_t hlen, char *text, size_t tlen) { case X509_V_ERR_CERT_HAS_EXPIRED: case X509_V_ERR_CRL_NOT_YET_VALID: case X509_V_ERR_CRL_HAS_EXPIRED: - strncpy(header, "Expired signature!", hlen); - snprintf(text, tlen, expired_cert_text, _friendly_name.c_str()); + strncpy(header, expired_cert_title[li], hlen); + snprintf(text, tlen, expired_cert_text[li], _friendly_name.c_str()); break; case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: - strncpy(header, "Unverified signature!", hlen); - snprintf(text, tlen, unknown_auth_cert_text); + strncpy(header, unverified_cert_title[li], hlen); + strncpy(text, unknown_auth_cert_text[li], tlen); break; case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: - strncpy(header, "Unverified signature!", hlen); - strncpy(text, self_signed_cert_text, tlen); + strncpy(header, unverified_cert_title[li], hlen); + strncpy(text, self_signed_cert_text[li], tlen); break; default: - strncpy(header, "Unverified signature!", hlen); - snprintf(text, tlen, generic_error_cert_text, _verify_result); + strncpy(header, unverified_cert_title[li], hlen); + snprintf(text, tlen, generic_error_cert_text[li], _verify_result); } } @@ -583,7 +588,7 @@ get_text(char *header, size_t hlen, char *text, size_t tlen) { //////////////////////////////////////////////////////////////////// ViewCertDialog:: ViewCertDialog(AuthDialog *auth_dialog, X509 *cert) : - Fl_Window(600, 400, "View Certificate"), + Fl_Window(600, 400, show_cert_title[li]), _auth_dialog(auth_dialog), _cert(cert) { @@ -660,12 +665,12 @@ layout() { short bx = (w() - BUTTON_WIDTH * 2 - BUTTON_SPACE) / 2; - Fl_Return_Button *run_button = new Fl_Return_Button(bx, 360, BUTTON_WIDTH, 25, "Run"); + Fl_Return_Button *run_button = new Fl_Return_Button(bx, 360, BUTTON_WIDTH, 25, run_title[li]); run_button->callback(this->run_clicked, this); bx += BUTTON_WIDTH + BUTTON_SPACE; - Fl_Button *cancel_button = new Fl_Button(bx, 360, BUTTON_WIDTH, 25, "Cancel"); + Fl_Button *cancel_button = new Fl_Button(bx, 360, BUTTON_WIDTH, 25, cancel_title[li]); cancel_button->callback(this->cancel_clicked, this); end(); diff --git a/direct/src/plugin/p3dCert.h b/direct/src/plugin/p3dCert.h index dd434409b6..abc5deed4e 100644 --- a/direct/src/plugin/p3dCert.h +++ b/direct/src/plugin/p3dCert.h @@ -92,9 +92,9 @@ private: X509 *_cert; STACK_OF(X509) *_stack; - char _header[32]; - char _text[512]; - char _text_clean[1024]; + char _header[64]; + char _text[1024]; + char _text_clean[2048]; string _friendly_name; int _verify_result; diff --git a/direct/src/plugin/p3dCert_strings.cxx b/direct/src/plugin/p3dCert_strings.cxx new file mode 100644 index 0000000000..e33f2adba9 --- /dev/null +++ b/direct/src/plugin/p3dCert_strings.cxx @@ -0,0 +1,570 @@ +// Filename: p3dCert_strings.h +// Created by: rdb (25Mar15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "p3dCert_strings.h" + +// Translations kindly provided by: +// eng: drwr +// nld: rdb +// deu: Sebastian Hoffmann +// spa: Imanol Celaya +// ita: Flavio Clava +// rus: montreal + +const char *language_codes[LI_COUNT] = + {"en", "nl", "de", "es", "it", "eo", "ru"}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693%28v=vs.85%29.aspx +const unsigned char language_ids[LI_COUNT] = + {0x09, 0x13, 0x07, 0x0A, 0x10, 0, 0x19}; + +const char * +run_title[LI_COUNT] = { + "Run", + "Uitvoeren", + "Starten", + "Ejecutar", + "Lancia", + "Lan\304\211i", + "\320\227\320\260\320\277\321\203\321\201\321\202\320\270\321\202\321\214", +}; + +const char * +cancel_title[LI_COUNT] = { + "Cancel", + "Annuleren", + "Abbrechen", + "Cancelar", + "Cancella", + "Nuligi", + "\320\236\321\202\320\274\320\265\320\275\320\260", +}; + +const char * +show_cert_title[LI_COUNT] = { + "Show Certificate", + "Toon Certificaat", + "Zertifikat anzeigen", + "Mostrar certificado", + "Mostra certificato", + "Montri Ateston", + "\320\237\320\276\320\272\320\260\320\267\320\260\321\202\321\214 \321\201" + "\320\265\321\200\321\202\320\270\321\204\320\270\320\272\320\260\321\202", +}; + +const char * +new_application_title[LI_COUNT] = { + "New Panda3D Application", + "Nieuwe Panda3D Applicatie", + "Neue Panda3D-Anwendung", + "Nueva aplicaci\303\263n de Panda3D", + "Nuova applicazione Panda3D", + "Nova aplika\304\265o de Panda3D", + "\320\235\320\276\320\262\320\276\320\265 Panda3D-\320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\320\265", +}; + +const char * +no_cert_title[LI_COUNT] = { + "No signature!", + "Geen handtekening!", + "Keine Signatur!", + "Sin firma!", + "Nessuna firma!", + "Ne subskribo!", + "\320\235\320\265\321\202 \320\277\320\276\320\264\320\277\320\270\321\201" + "\320\270!", +}; + +const char * +unverified_cert_title[LI_COUNT] = { + "Unverified signature!", + "Ongeverifieerde handtekening!", + "Unbest\303\244tigte Signatur!", + "Firma sin verificar!", + "Firma non verificata!", + "Nekontrolita subskribo!", + "\320\235\320\265\320\277\321\200\320\276\320\262\320\265\321\200\320\265" + "\320\275\320\275\320\260\321\217 \320\277\320\276\320\264\320\277\320\270" + "\321\201\321\214!", +}; + +const char * +expired_cert_title[LI_COUNT] = { + "Expired signature!", + "Verlopen handtekening!", + "Abgelaufene Signatur!", + "Firma caducada!", + "Firma scaduta!", + "Eksvalidi\304\235inta subskribo!", + "\320\241\321\200\320\276\320\272 \320\264\320\265\320\271\321\201\321\202" + "\320\262\320\270\321\217 \320\277\320\276\320\264\320\277\320\270\321\201" + "\320\270 \320\270\321\201\321\202\321\221\320\272!", +}; + + +const char * +self_signed_cert_text[LI_COUNT] = { + // eng + "This Panda3D application uses a self-signed certificate. " + "This means the author's name can't be verified, and you have " + "no way of knowing for sure who wrote it.\n" + "\n" + "We recommend you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie gebruikt een zelf-getekend certificaat. " + "Dit betekent dat de auteursnaam niet kan worden geverifieerd, en het " + "niet zeker is of de applicatie te vertrouwen is.\n" + "\n" + "Het is aanbevolen om op Annuleren te klikken om de applicatie af te " + "sluiten.", + + // deu + "Diese Panda3D-Anwendung benutzt ein selbst-signiertes Zertifikat. Dies " + "bedeutet, dass weder der Name des Autors \303\274berpr\303\274ft werden " + "kann, noch dass garantiert werden kann, dass tats\303\244chlich die " + "angegebene Person diese Anwendung geschrieben hat.\n" + "\n" + "Wir empfehlen, dass Sie Abbrechen dr\303\274cken um diese Anwendung nicht " + "auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D usa un certificado autofirmado. " + "Esto significa que el nombre del autor no puede ser verificado y no se " + "puede conocer seguro quien la ha escrito.\n" + "\n" + "Se recomienda cancelar para evitar ejecutar esta aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D usa un certificato autofirmato. Ci\303\262 " + "significa che il nome dell'autore non pu\303\262 essere verificato, e " + "che non hai modo di assicurarti circa chi la abbia scritta.\n" + "\n" + "Raccomandiamo di cliccare su Cancella per evitare di lanciare questa " + "applicazione.", + + // epo + "\304\210i tiu aplika\304\265o de Panda3D uzas memsubskribitan ateston. " + "Tio signifas ke la nomo de la verkanto ne povas esti kontrolita, kaj vi " + "ne havas certan scimanieron pri la vera verkanto de la aplika\304\265o.\n" + "\n" + "Ni rekomendas ke vi premas la butonon 'Nuligi' por eviti lan\304\211on de " + "\304\211i tiu aplika\304\265o.", + + // rus + "\320\255\321\202\320\276 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\265 \320\270\321\201\320\277\320\276\320\273" + "\321\214\320\267\321\203\320\265\321\202 \321\201\320\260\320\274\320\276" + "\320\267\320\260\320\262\320\265\321\200\320\265\320\275\320\275\321\213" + "\320\271 \321\201\320\265\321\200\321\202\320\270\321\204\320\270\320\272" + "\320\260\321\202. \320\255\321\202\320\276 \320\276\320\267\320\275" + "\320\260\321\207\320\260\320\265\321\202, \321\207\321\202\320\276 " + "\320\270\320\274\321\217 \320\260\320\262\321\202\320\276\321\200\320\260 " + "\320\275\320\265 \320\274\320\276\320\266\320\265\321\202 \320\261\321\213" + "\321\202\321\214 \320\277\320\276\320\264\321\202\320\262\320\265\320\266" + "\320\264\320\265\320\275\320\276, \320\270 \320\262\321\213 \320\275" + "\320\265 \320\274\320\276\320\266\320\265\321\202\320\265 \320\267\320\275" + "\320\260\321\202\321\214, \320\272\321\202\320\276 \320\275\320\260" + "\320\277\320\270\321\201\320\260\320\273 \321\215\321\202\320\276 \320\277" + "\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270\320\265.\n" + "\n" + "\320\234\321\213 \321\200\320\265\320\272\320\276\320\274\320\265\320\275" + "\320\264\321\203\320\265\320\274 \320\262\320\260\320\274 \320\275\320\260" + "\320\266\320\260\321\202\321\214 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +unknown_auth_cert_text[LI_COUNT] = { + "This Panda3D application has been signed, but we don't recognize " + "the authority that verifies the signature. This means the author's " + "name can't be verified, and you have no way of knowing " + "for sure who wrote it.\n" + "\n" + "We recommend you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is ondertekend, maar de certificaatautoriteit " + "die het certificaat heeft uitgegeven wordt niet herkend. Dit betekent " + "dat de auteursnaam niet te vertrouwen is, en het niet zeker is wie de " + "applicatie gemaakt heeft.\n" + "\n" + "Het is aanbevolen om op Annuleren te klikken om de applicatie af te " + "sluiten.", + + // deu + "Diese Panda3D-Anwendung wurde signiert, aber die " + "\303\234berpr\303\274fungsstelle wurde nicht anerkannt. Dies bedeutet, " + "dass weder der Name des Autors \303\274berpr\303\274ft werden kann, noch " + "dass garantiert werden kann, dass tats\303\244chlich die angegebene " + "Person diese Anwendung geschrieben hat.\n" + "\n" + "Wir empfehlen, dass Sie Abbrechen dr\303\274cken um diese Anwendung nicht " + "auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D esta firmada, pero no reconocemos la " + "autoridad que la verifica. Esto significa que el nombre del autor no " + "puede ser verificado y no se puede conocer seguro quien la ha escrito.\n" + "\n" + "Se recomienda cancelar para evitar ejecutar esta aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D \303\250 stata firmata, ma non riconosciamo " + "l'autorit\303\240 che verifica la firma. Ci\303\262 significa che il " + "nome dell'autore non pu\303\262 essere verificato, e che non hai modo " + "di assicurarti circa chi la abbia scritta.\n" + "\n" + "Raccomandiamo di cliccare su Cancella per evitare di lanciare questa " + "applicazione.", + + // epo + "\304\210i tiu aplika\304\265o estas subskribita, sed ni ne rekonas " + "la a\305\255toritaton, kiu kontrolas la subskribon. Tio signifas ke la " + "nomo de la verkanto ne povas esti konfidata, kaj vi ne havas certan " + "scimanieron pri la vera verkanto de la aplika\304\265o.\n" + "\n" + "Ni rekomendas ke vi premas la butonon 'Nuligi' por eviti lan\304\211on " + "de \304\211i tiu aplika\304\265o.", + + // rus + "\320\243 \321\215\321\202\320\276\320\263\320\276 \320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\321\217 \320\265\321\201" + "\321\202\321\214 \320\277\320\276\320\264\320\277\320\270\321\201\321\214," + " \320\277\320\276 \320\272\320\276\321\202\320\276\321\200\320\276\320\271" + " \320\274\321\213 \320\275\320\265 \320\274\320\276\320\266\320\265" + "\320\274 \321\200\320\260\321\201\320\277\320\276\320\267\320\275\320\260" + "\321\202\321\214 \320\262\320\273\320\260\320\264\320\265\320\273\321\214" + "\321\206\320\260. \320\255\321\202\320\276 \320\276\320\267\320\275" + "\320\260\321\207\320\260\320\265\321\202, \321\207\321\202\320\276 " + "\320\270\320\274\321\217 \320\260\320\262\321\202\320\276\321\200\320\260 " + "\320\275\320\265 \320\274\320\276\320\266\320\265\321\202 \320\261\321\213" + "\321\202\321\214 \320\276\320\277\321\200\320\265\320\264\320\265\320\273" + "\320\265\320\275\320\276, \320\270 \320\275\320\265\320\262\320\276" + "\320\267\320\274\320\276\320\266\320\275\320\276 \321\202\320\276\321\207" + "\320\275\320\276 \321\203\320\267\320\275\320\260\321\202\321\214, " + "\320\272\321\202\320\276 \320\275\320\260\320\277\320\270\321\201\320\260" + "\320\273 \321\215\321\202\320\276 \320\277\321\200\320\270\320\273\320\276" + "\320\266\320\265\320\275\320\270\320\265.\n" + "\n" + "\320\234\321\213 \321\200\320\265\320\272\320\276\320\274\320\265\320\275" + "\320\264\321\203\320\265\320\274 \320\262\320\260\320\274 \320\275\320\260" + "\320\266\320\260\321\202\321\214 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +verified_cert_text[LI_COUNT] = { + // eng + "This Panda3D application has been signed by %s. " + "If you trust %s, then click the Run button below " + "to run this application on your computer. This will also " + "automatically approve this and any other applications signed by " + "%s in the future.\n" + "\n" + "If you are unsure about this application, " + "you should click Cancel instead.", + + // nld + "Deze Panda3D applicatie is ondertekend door %s. " + "Als u %s vertrouwt, klik dan de onderstaande knop Uitvoeren om de applicatie " + "op uw computer uit te voeren. Dit zal ook deze en andere door %s getekende " + "applicaties in het vervolg toestaan.\n" + "\n" + "Als u niet zeker bent over deze applicatie is het aanbevolen om op " + "Annuleren te klikken.", + + // deu + "Diese Panda3D-Anwendung wurde von %s signiert. Falls Sie %s vertrauen, " + "dr\303\274cken Sie den Starten-Knopf, um diese Anwendung auszuf\303\274hren. " + "Zudem werden in der Zukunft diese und alle anderen von %s signierten " + "Anwendungen automatisch als vertrauensw\303\274rdig anerkannt.\n" + "\n" + "Falls Sie sich unsicher \303\274ber diese Anwendung sind, sollten Sie " + "Abbrechen dr\303\274cken.", + + // spa + "Esta aplicaci\303\263n de Panda3D ha sido firmada por %s. Si se considera %s" + "de confianza el bot\303\263n inferior ejecutar\303\241 la aplicaci\303\263n." + "Esto validara esta y cualquier otra applizacion firmada por %s en el futuro.\n" + "\n" + "Si se duda de la aplicaci\303\263nse recomienda cancelar." + + // ita + "Questa applicazione Panda3D \303\250 stata firmata da %s. Se %s \303\250 " + "un'entit\303\240 fidata, allora clicca il bottone Lancia sottostante per " + "lanciare questa applicazione sul tuo computer. Inoltre, ci\303\262 " + "approver\303\240 automaticamente questa e ogni altra applicazione " + "firmata da %s in futuro.\n" + "\n" + "Se non sei sicuro circa questa applicazione, dovresti invece cliccare " + "su Cancella.", + + // epo + "\304\210i tiu aplika\304\265o estas subskribita de %s. " + "Se %s estas fidinda la\305\255 vi, premu la butonon 'Lan\304\211i' sube por " + "lan\304\211i \304\211i tiun aplika\304\265on per via komputilo. Anka\305\255 tio a\305\255tomate estonece " + "aprobos \304\211i tiun kaj alian ajn aplika\304\265on, kiu estas subskribita de %s.\n" + "\n" + "Se vi ne estas certa pri \304\211i tiu aplika\304\265o, " + "vi anstata\305\255e povus premi la butonon 'Nuligi'.", + + // rus + "\320\255\321\202\320\276 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\265 \320\277\320\276\320\264\320\277\320\270" + "\321\201\320\260\320\275\320\276 %s. " + "\320\225\321\201\320\273\320\270 \320\262\321\213 \320\264\320\276\320\262" + "\320\265\321\200\321\217\320\265\321\202\320\265 %s, \320\275\320\260" + "\320\266\320\274\320\270\321\202\320\265 \320\272\320\275\320\276\320\277" + "\320\272\321\203 \"\320\227\320\260\320\277\321\203\321\201\321\202" + "\320\270\321\202\321\214\" \320\262\320\275\320\270\320\267\321\203, " + "\321\207\321\202\320\276\320\261\321\213 \320\267\320\260\320\277\321\203" + "\321\201\321\202\320\270\321\202\321\214 \321\215\321\202\320\276 \320\277" + "\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270\320\265 " + "\320\275\320\260 \320\262\320\260\321\210\320\265\320\274 \320\272\320\276" + "\320\274\320\277\321\214\321\216\321\202\320\265\321\200\320\265. \320\255" + "\321\202\320\276 \321\202\320\260\320\272\320\266\320\265 \320\260\320\262" + "\321\202\320\276\320\274\320\260\321\202\320\270\321\207\320\265\321\201" + "\320\272\320\270 \320\277\320\276\320\264\321\202\320\262\320\265\321\200" + "\320\264\320\270\321\202 \321\215\321\202\320\276 \320\270 \320\264" + "\321\200\321\203\320\263\320\270\320\265 \320\277\321\200\320\270\320\273" + "\320\276\320\266\320\265\320\275\320\270\321\217, \320\275\320\260\320\277" + "\320\270\321\201\320\260\320\275\320\275\321\213\320\265 %s \320\262 " + "\320\261\321\203\320\264\321\203\321\211\320\265\320\274.\n" + "\n" + "\320\225\321\201\320\273\320\270 \320\262\321\213 \320\275\320\265 " + "\321\203\320\262\320\265\321\200\320\265\320\275\321\213 \320\262 \321\215" + "\321\202\320\276\320\274 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\270, \320\275\320\260\320\266\320\274\320\270" + "\321\202\320\265 \320\272\320\275\320\276\320\277\320\272\321\203 \"" + "\320\236\321\202\320\274\320\265\320\275\320\260\".", +}; + + +const char * +expired_cert_text[LI_COUNT] = { + // eng + "This Panda3D application has been signed by %s, " + "but the certificate has expired.\n" + "\n" + "You should check the current date set on your computer's clock " + "to make sure it is correct.\n" + "\n" + "If your computer's date is correct, we recommend " + "you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is ondertekend door %s, maar de geldigheidsdatum " + "van het certificaat is verstreken.\n" + "\n" + "Controleer de datum op uw computerklok om te zorgen dat deze juist is " + "ingesteld.\n" + "\n" + "Als de datum op uw computer juist is, is het aanbevolen om op Annuleren te " + "klikken om de applicatie af te sluiten.", + + // deu + "Diese Anwendung wurde von %s signiert, aber das Zertifikat ist abgelaufen.\n" + "\n" + "Sie sollten die aktuelle Uhrzeit auf Ihrem Computer " + "\303\274berpr\303\274fen, um sicherzugehen, dass sie korrekt ist.\n" + "\n" + "Falls die Uhrzeit auf Ihrem Computer korrekt ist, empfehlen wir Ihnen " + "Abbrechen zu dr\303\274cken.", + + // spa + "Esta aplicaci\303\263n Panda3D ha sido firmada por %s pero el certificado ha" + "caducado.\n" + "\n" + "Se recomienda comprobar la fecha del reloj.\n" + "\n" + "Si la fecha del reloj es correcta se recomienda cancelar.", + + // ita + "Questa applicazione Panda3D \303\250 stata firmata da %s, ma il " + "certificato \303\250 scaduto.\n" + "\n" + "Dovresti controllare la data attuale impostata nell'orologio del tuo " + "computer per assicurarti che sia corretta.\n" + "\n" + "Se la data del tuo computer \303\250 corretta, raccomandiamo di cliccare " + "Cancella per evitare di lanciare questa applicazione." + + // epo + "\304\210i tiu aplika\304\265o de Panda3D estas subskribita de %s, " + "sed la atesto eksvalidi\304\235is.\n" + "\n" + "Vi povus kontroli la aktualan daton, kiu estas agordata sur la horlo\304\235o de " + "via komputilo por certigi ke \304\235i estas korekta.\n" + "\n" + "Se la dato de via komputilo estas korekta, ni rekomendas ke vi premas la " + "butonon 'Nuligi' por eviti lan\304\211on de \304\211i tiu aplika\304\265o.", + + // rus + "\320\255\321\202\320\276 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\265 \320\277\320\276\320\264\320\277\320\270" + "\321\201\320\260\320\275\320\276 %s, \320\276\320\264\320\275\320\260" + "\320\272\320\276 \321\201\321\200\320\276\320\272 \320\264\320\265\320\271" + "\321\201\321\202\320\262\320\270\321\217 \321\201\320\265\321\200\321\202" + "\320\270\321\204\320\270\320\272\320\260\321\202\320\260 \320\270\321\201" + "\321\202\321\221\320\272.\n" + "\n" + "\320\237\321\200\320\276\320\262\320\265\321\200\321\214\321\202\320\265, " + "\320\277\320\276\320\266\320\260\320\273\321\203\320\271\321\201\321\202" + "\320\260, \320\264\320\260\321\202\321\203 \320\275\320\260 \320\262" + "\320\260\321\210\320\265\320\274 \320\272\320\276\320\274\320\277\321\214" + "\321\216\321\202\320\265\321\200\320\265.\n" + "\n" + "\320\225\321\201\320\273\320\270 \320\275\320\260 \320\262\320\260\321\210" + "\320\265\320\274 \320\272\320\276\320\274\320\277\321\214\321\216\321\202" + "\320\265\321\200\320\265 \321\203\321\201\321\202\320\260\320\275\320\276" + "\320\262\320\273\320\265\320\275\320\276 \320\277\321\200\320\260\320\262" + "\320\270\320\273\321\214\320\275\320\276\320\265 \320\262\321\200\320\265" + "\320\274\321\217, \320\274\321\213 \321\200\320\265\320\272\320\276" + "\320\274\320\265\320\275\320\264\321\203\320\265\320\274 \320\262\320\260" + "\320\274 \320\275\320\260\320\266\320\260\321\202\321\214 \320\272\320\275" + "\320\276\320\277\320\272\321\203 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +generic_error_cert_text[LI_COUNT] = { + // eng + "This Panda3D application has been signed, but there is a problem " + "with the certificate (OpenSSL error code %d).\n" + "\n" + "We recommend you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is ondertekend, maar er is een probleem " + "met het certificaat opgetreden (OpenSSL foutcode %d).\n" + "\n" + "Het is aanbevolen om op Annuleren te klikken om de applicatie af te " + "sluiten.", + + // deu + "Diese Panda3D-Anwendung wurde signiert, aber es gibt ein Problem mit " + "dem Zertifikat (OpenSSL Fehlercode %d).\n" + "\n" + "Wir empfehlen, dass Sie Abbrechen dr\303\274cken um diese Anwendung nicht " + "auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D esta firmada pero hay un problema con el " + "certificado (Error de OpenSSL %d).\n" + "\n" + "Se recomienda cancelar para evitar ejecutar esta aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D \303\250 stata firmata, ma c'\303\250 un " + "problema col certificato (codice di errore OpenSSL %s).\n" + "\n" + "Raccomandiamo di cliccare su Cancella per evitare di lanciare questa " + "applicazione.", + + // epo + "\304\210i tiu aplika\304\265o de Panda3D estas subskribita, sed la " + "atesto havas problemon (OpenSSL erarkodo %d).\n" + "\n" + "Ni rekomendas ke vi premas la butonon 'Nuligi' por eviti lan\304\211on " + "de \304\211i tiu aplika\304\265o.", + + // rus + "\320\243 \321\215\321\202\320\276\320\263\320\276 \320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\321\217 \320\265\321\201" + "\321\202\321\214 \320\277\320\276\320\264\320\277\320\270\321\201\321\214," + " \320\275\320\276 \320\262\320\276\320\267\320\275\320\270\320\272\320\273" + "\320\260 \320\277\321\200\320\276\320\261\320\273\320\265\320\274\320\260 " + "\321\201 \321\201\320\265\321\200\321\202\320\270\321\204\320\270\320\272" + "\320\260\321\202\320\276\320\274 (\320\232\320\276\320\264 \320\276" + "\321\210\320\270\320\261\320\272\320\270 OpenSSL %d).\n" + "\n" + "\320\234\321\213 \321\200\320\265\320\272\320\276\320\274\320\265\320\275" + "\320\264\321\203\320\265\320\274 \320\262\320\260\320\274 \320\275\320\260" + "\320\266\320\260\321\202\321\214 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +no_cert_text[LI_COUNT] = { + "This Panda3D application has not been signed. This means you have " + "no way of knowing for sure who wrote it.\n" + "\n" + "Click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is niet ondertekend. Dit betekent dat het niet " + "mogelijk is om de auteur te verifi\303\253ren.\n" + "\n" + "Klik op Annuleren om de applicatie af te sluiten.", + + // deu + "Diese Panda3D-Anwendung wurde nicht signiert. Es gibt keine " + "M\303\266glichkeit festzustellen, wer diese entwickelt hat.\n" + "\n" + "Dr\303\274cken Sie Abbrechen, um diese Anwendung nicht auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D no esta firmada, no hay forma de conocer " + "quien la ha escrito.\n" + "\n" + "Cancelar para evitar ejecutar la aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D non \303\250 stata firmata. Ci\303\262 " + "significa che non hai modo di assicurarti circa chi la abbia scritta.\n" + "\n" + "Clicca Cancella per evitare di lanciare questa applicazione.", + + // epo + "\304\210i tiu aplika\304\265o de Panda3D ne estas subskribita. Tio " + "signifas ke vi ne havas certan scimanieron pri la vera verkanto de " + "la aplika\304\265o.\n" + "\n" + "Premu la butonon 'Nuligi' por eviti lan\304\211on de \304\211i tiu " + "aplika\304\265o.", + + // rus + "\320\243 \321\215\321\202\320\276\320\263\320\276 \320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\321\217 \320\275\320\265" + "\321\202 \320\277\320\276\320\264\320\277\320\270\321\201\320\270. " + "\320\255\321\202\320\276 \320\276\320\267\320\275\320\260\321\207\320\260" + "\320\265\321\202, \321\207\321\202\320\276 \320\262\321\213 \320\275" + "\320\265 \320\274\320\276\320\266\320\265\321\202\320\265 \320\267\320\275" + "\320\260\321\202\321\214, \320\272\321\202\320\276 \320\265\320\263" + "\320\276 \320\275\320\260\320\277\320\270\321\201\320\260\320\273.\n" + "\n" + "\320\235\320\260\320\266\320\274\320\270\321\202\320\265 \"\320\236" + "\321\202\320\274\320\265\320\275\320\260\", \321\207\321\202\320\276" + "\320\261\321\213 \320\275\320\265 \320\267\320\260\320\277\321\203\321\201" + "\320\272\320\260\321\202\321\214 \320\277\321\200\320\270\320\273\320\276" + "\320\266\320\265\320\275\320\270\320\265.", +}; diff --git a/direct/src/plugin/p3dCert_strings.h b/direct/src/plugin/p3dCert_strings.h new file mode 100644 index 0000000000..064a04360e --- /dev/null +++ b/direct/src/plugin/p3dCert_strings.h @@ -0,0 +1,45 @@ +// Filename: p3dCert_strings.h +// Created by: rdb (25Mar15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +enum LanguageIndex { + LI_en, // English + LI_nl, // Dutch + LI_de, // German + LI_es, // Spanish + LI_it, // Italian + LI_eo, // Esperanto + LI_ru, // Russian + LI_COUNT, + + LI_default = LI_en +}; + +extern const char *language_codes[LI_COUNT]; +extern const unsigned char language_ids[LI_COUNT]; + +extern const char *run_title[LI_COUNT]; +extern const char *cancel_title[LI_COUNT]; +extern const char *show_cert_title[LI_COUNT]; + +extern const char *new_application_title[LI_COUNT]; +extern const char *no_cert_title[LI_COUNT]; +extern const char *unverified_cert_title[LI_COUNT]; +extern const char *expired_cert_title[LI_COUNT]; + +extern const char *self_signed_cert_text[LI_COUNT]; +extern const char *unknown_auth_cert_text[LI_COUNT]; +extern const char *verified_cert_text[LI_COUNT]; +extern const char *expired_cert_text[LI_COUNT]; +extern const char *generic_error_cert_text[LI_COUNT]; +extern const char *no_cert_text[LI_COUNT]; diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index 27361a8d85..0c2f13e4a8 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -891,11 +891,13 @@ start_p3dpython(P3DInstance *inst) { // These are the enviroment variables we forward from the current // environment, if they are set. const char *keep[] = { - "HOME", "USER", + "HOME", "USER", #ifdef _WIN32 "SYSTEMROOT", "USERPROFILE", "COMSPEC", "SYSTEMDRIVE", "ALLUSERSPROFILE", "APPDATA", "COMMONPROGRAMFILES", "PROGRAMFILES", "WINDIR", "PROGRAMDATA", "USERDOMAIN", +#else + "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG", #endif #ifdef HAVE_X11 "DISPLAY", "XAUTHORITY", diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 64c624100d..6e3f367be3 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -4915,9 +4915,11 @@ if (RTDIST or RUNTIME): if (PkgSkip("FLTK")==0): OPTS.append("FLTK") TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx') + TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx') TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj') TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj') + TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj') OPTS=['OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS'] if GetTarget() == 'darwin': OPTS += ['OPT:2'] From 58963a167c04cf62e394963e739ce9e02aeaec62 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 11 Sep 2015 15:43:22 +0200 Subject: [PATCH 12/14] Implement user preferred language detection on Mac --- direct/src/plugin/p3dCert.cxx | 46 ++++++++++++++++++++++++++- direct/src/plugin/p3dCert_strings.cxx | 7 ++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index 8d78ff7485..6fa6c7d3e6 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -42,8 +42,51 @@ #define snprintf sprintf_s #endif +#ifdef __APPLE__ +#include +#endif + static LanguageIndex li = LI_default; +#ifdef __APPLE__ +static LanguageIndex detect_language() { + // Get and iterate through the list of preferred languages. + CFArrayRef langs = CFLocaleCopyPreferredLanguages(); + CFIndex num_langs = CFArrayGetCount(langs); + + for (long i = 0; i < num_langs; ++i) { + CFStringRef lang = (CFStringRef)CFArrayGetValueAtIndex(langs, i); + + CFIndex length = CFStringGetLength(lang); + if (length < 2) { + continue; + } + + CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1; + char *buffer = (char *)alloca(max_size); + if (!CFStringGetCString(lang, buffer, max_size, kCFStringEncodingUTF8)) { + continue; + } + + if (isalnum(buffer[2])) { + // It's not a two-letter code. + continue; + } + + // See if we support this language. + for (int j = 0; j < LI_COUNT; ++j) { + const char *lang_code = language_codes[j]; + if (lang_code != NULL && strncasecmp(buffer, lang_code, 2) == 0) { + CFRelease(langs); + return (LanguageIndex)j; + } + } + } + + CFRelease(langs); + return LI_default; +} +#else static LanguageIndex detect_language() { // First consult the LANGUAGE variable, which is a GNU extension that can // contain multiple languages in order of preference. @@ -94,6 +137,7 @@ static LanguageIndex detect_language() { } return LI_default; } +#endif #ifdef _WIN32 int WINAPI @@ -153,7 +197,7 @@ AuthDialog(const wstring &cert_filename, const wstring &cert_dir) : AuthDialog:: AuthDialog(const string &cert_filename, const string &cert_dir) : #endif - Fl_Window(435, 242, "New Panda3D Application"), + Fl_Window(435, 242, new_application_title[li]), _cert_dir(cert_dir) { _view_cert_dialog = NULL; diff --git a/direct/src/plugin/p3dCert_strings.cxx b/direct/src/plugin/p3dCert_strings.cxx index e33f2adba9..1f111cd645 100644 --- a/direct/src/plugin/p3dCert_strings.cxx +++ b/direct/src/plugin/p3dCert_strings.cxx @@ -323,8 +323,9 @@ verified_cert_text[LI_COUNT] = { // epo "\304\210i tiu aplika\304\265o estas subskribita de %s. " "Se %s estas fidinda la\305\255 vi, premu la butonon 'Lan\304\211i' sube por " - "lan\304\211i \304\211i tiun aplika\304\265on per via komputilo. Anka\305\255 tio a\305\255tomate estonece " - "aprobos \304\211i tiun kaj alian ajn aplika\304\265on, kiu estas subskribita de %s.\n" + "lan\304\211i \304\211i tiun aplika\304\265on per via komputilo. Anka\305\255 " + "tio a\305\255tomate estonece aprobos \304\211i tiun kaj alian ajn " + "aplika\304\265on, kiu estas subskribita de %s.\n" "\n" "Se vi ne estas certa pri \304\211i tiu aplika\304\265o, " "vi anstata\305\255e povus premi la butonon 'Nuligi'.", @@ -546,7 +547,7 @@ no_cert_text[LI_COUNT] = { // epo "\304\210i tiu aplika\304\265o de Panda3D ne estas subskribita. Tio " - "signifas ke vi ne havas certan scimanieron pri la vera verkanto de " + "signifas ke vi ne havas certan scimanieron pri la vera verkanto de " "la aplika\304\265o.\n" "\n" "Premu la butonon 'Nuligi' por eviti lan\304\211on de \304\211i tiu " From c9a45f288c4ae4f760e420780e86d31469b21ea3 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 11 Sep 2015 17:32:49 +0200 Subject: [PATCH 13/14] Proper display language detection on Windows --- direct/src/plugin/p3dCert.cxx | 56 ++++++++++++++++++++++++++- direct/src/plugin/p3dCert_strings.cxx | 2 +- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index 6fa6c7d3e6..0d84e1058e 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -38,6 +38,7 @@ #define WIN32_LEAN_AND_MEAN #include #include +#include #define snprintf sprintf_s #endif @@ -48,7 +49,51 @@ static LanguageIndex li = LI_default; -#ifdef __APPLE__ +#if defined(_WIN32) +static LanguageIndex detect_language() { + // This function was introduced in Windows Vista; it may not be available + // on older systems. + typedef BOOL (*GUPL)(DWORD, PULONG, PZZWSTR, PULONG); + GUPL pGetUserPreferredUILanguages = (GUPL)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), + TEXT("GetUserPreferredUILanguages")); + if (pGetUserPreferredUILanguages != NULL) { + ULONG num_langs = 0; + ULONG buffer_size = 0; + pGetUserPreferredUILanguages(8, &num_langs, NULL, &buffer_size); + PZZWSTR buffer = (PZZWSTR)_alloca(buffer_size); + if (pGetUserPreferredUILanguages(8, &num_langs, buffer, &buffer_size)) { + for (ULONG i = 0; i < num_langs; ++i) { + size_t len = wcslen(buffer); + if (len >= 2 && (buffer[2] == 0 || buffer[2] == L'-')) { + // It may be a two-letter code; match it in our list. + for (int j = 0; j < LI_COUNT; ++j) { + const char *lang_code = language_codes[j]; + if (lang_code != NULL && lang_code[0] == buffer[0] && + lang_code[1] == buffer[1]) { + return (LanguageIndex)j; + } + } + } + buffer += len + 1; + } + } + } + + // Fall back to the old Windows XP function. + LANGID lang = GetUserDefaultUILanguage() & 0x3ff; + if (lang == 0) { + return LI_default; + } + + for (int i = 0; i < LI_COUNT; ++i) { + if (language_ids[i] != 0 && language_ids[i] == lang) { + return (LanguageIndex)i; + } + } + return LI_default; +} + +#elif defined(__APPLE__) static LanguageIndex detect_language() { // Get and iterate through the list of preferred languages. CFArrayRef langs = CFLocaleCopyPreferredLanguages(); @@ -86,6 +131,7 @@ static LanguageIndex detect_language() { CFRelease(langs); return LI_default; } + #else static LanguageIndex detect_language() { // First consult the LANGUAGE variable, which is a GNU extension that can @@ -364,12 +410,20 @@ read_cert_file(const string &cert_filename) { #endif // _WIN32 if (fp == NULL) { +#ifdef _WIN32 + wcerr << L"Couldn't read " << cert_filename.c_str() << L"\n"; +#else cerr << "Couldn't read " << cert_filename.c_str() << "\n"; +#endif return; } _cert = PEM_read_X509(fp, NULL, NULL, (void *)""); if (_cert == NULL) { +#ifdef _WIN32 + wcerr << L"Could not read certificate in " << cert_filename.c_str() << L".\n"; +#else cerr << "Could not read certificate in " << cert_filename.c_str() << ".\n"; +#endif fclose(fp); return; } diff --git a/direct/src/plugin/p3dCert_strings.cxx b/direct/src/plugin/p3dCert_strings.cxx index 1f111cd645..bd191768e0 100644 --- a/direct/src/plugin/p3dCert_strings.cxx +++ b/direct/src/plugin/p3dCert_strings.cxx @@ -27,7 +27,7 @@ const char *language_codes[LI_COUNT] = // https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693%28v=vs.85%29.aspx const unsigned char language_ids[LI_COUNT] = - {0x09, 0x13, 0x07, 0x0A, 0x10, 0, 0x19}; + {0x09, 0x13, 0x07, 0x0A, 0x10, 0x8F, 0x19}; const char * run_title[LI_COUNT] = { From bed4fdd5af90fb50a39d6918cca656024e39bbca Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 11 Sep 2015 19:13:30 +0200 Subject: [PATCH 14/14] Fix issue that caused pdeploy to spit out broken win32 installer alongside win_i386 installer --- direct/src/p3d/DeploymentTools.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 78b2378eda..e55edc1d76 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -99,6 +99,9 @@ class Standalone: if len(platforms) == 0: Standalone.notify.warning("No platforms found to build for!") + if 'win32' in platforms and 'win_i386' in platforms: + platforms.remove('win32') + outputDir = Filename(outputDir + "/") outputDir.makeDir() for platform in platforms: @@ -669,6 +672,9 @@ class Installer: if len(platforms) == 0: Installer.notify.warning("No platforms found to build for!") + if 'win32' in platforms and 'win_i386' in platforms: + platforms.remove('win32') + outputDir = Filename(outputDir + "/") outputDir.makeDir() for platform in platforms: